My main reference is http://lxr.free-electrons.com/source/include/uapi/linux/nl80211.h
Let's say I want to call NL80211_CMD_TRIGGER_SCAN documentation says trigger a new scan with the given parameters NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the probe requests at CCK rate or not.
I am looking at some source I found online, but it does not work and I would
So how do I know what to put into message?
I am using libnl to comunicate with kernel
I found some answers online that put a little light on this, but it's still a dark alley to me. Here are some:
Using nl80211.h to scan access points
how to use the libnl library to trigger nl80211 commands?
I ran into the same issues working from a Python perspective. From personal experience, the iw source code sucks. You'd be better off doing
strace -e trace=network -f -x -s 4096 iw ...
I built a simple parser and copying and pasting the output, I was able to figure out what nl80211 command and attributes along with values were being sent and then see what the response was.
Related
I'd like to get the raw multitouch data from my touchpad in order to.
I've tried using libevdev but my success was limited and I couldn't do what I wanted. I found out about libinput which might be more abstracted, and found out how to use it to automatically get the gestures (for example using libinput-debug-events) but I find them limited and would like to get the raw input (with each finger's movement).
Is there any way to do this with libinput, or not?
I couldn't find any helpful documentation: I found this one but couldn't find any example or route to follow. Actually, I think that I could make myself a way through my problems if I understood how to use these functions, but it's far from clear, and I'm getting in a lot of trouble installing libinput itself (for example, commands like libinput debug-gui aren't recognized by my system).
Any help is appreciated.
Don't know if this helps or not, but on my distro (Ubuntu) I installed libinput-tools.
sudo libinput debug-gui
Also gives me an error:
debug-gui is not a libinput command or not installed.
However,
sudo libinput debug-events
will print out events in the terminal just fine.
I am new to qemu development. I am trying to modify qemu to emulate some features of SGX processor on x86 machines using QEMU emulator. Here is what I want to do.
I want to add the following to qemu. I want to start a qemu process with a new argument EECREATE. This when given to qemu-i386 binary should create an encrypted space in memory with few new data structures inside. Like for example,
qemu-system-i386 -hda ubuntu.img -eecreate -m 2G
This command should boot an ubuntu.img and create a encrypted space (need not be big) of memory for the image (In this case create an encrypted space within 2G that is assigned to the ubuntu-img. Basically, the encrypted space should be within a address space of the image.)
Can anyone please let me know the process involved as what needs to be followed to get it working? What files I need to modify? A brief explaination of how the flow of code will be?
I am not able to get any documentation on web and am stuck as where and how to begin.Any help is greatly appreciated.
Thanks
The short answer is "modify vl.c and qemu-options.hx". The latter is there as all the options processing is integrated into the help provision and so forth - i.e. the code is built dynamically. My normal approach is to pick a similar option and see how it's done.
The longer answer is that if you want the code upstreamed, you should probably discuss your proposal on the qemu-devel mailing list.
The #qemu IRC channel on on irc.oftc.net is also helpful. You will no doubt get some feedback. However, I'd suggest you might consider implementing this as a machine parameter rather than a command line option, unless you are going to make it work for all virtual machine types.
I have to use the Curl library to send a string to a morse code translator.(http://mattfedder.com/cgi-bin/morse.pl)
Then I have to take back the result and extract the translated code.
My prof didn't explain curl very well at all and I cannot find any clear examples.
I am not by any means asking for people to code it I just need sources to examples that may help. I apologize if these are blatantly easy to find I have put time into a search just none seemed relevant.
Curl works with webpages/webservices etc.
Its library you can use to interact with web apps without writing all the code.
read this page.
http://curl.haxx.se/libcurl/c/libcurl-tutorial.html
(could not comment as i dont have 50 rep sorry)
I cross-compiled NET-SNMP 5.7.1 from sources to a PowerPC using ELDK-3.1.
When I try to load the snmpd daemon in my embedded board, I see the message:
# snmpd -f -Lo
pcilib: Cannot open /proc/bus/pci
pcilib: Cannot find any working access method.
Of course my PPC board has no PCI, and I wonder why is netsnmp looking for it.
In more than one place I see this same message (sourceforge, mail-archive, google-groups), but ir has no answer at all. Another variant, with a little but unhelpful responses at (archlinuxarm).
Can anybody please help me?
I'm assuming you're on a Linux target.
Net-SNMP's changelog lists "[PATCH 3057093]: allow linux to use libpci for creating useful ifDescr strings".
The configure script will search for an available libpci, and, having found one, will define
HAVE_PCI_LOOKUP_NAME and HAVE_PCI_PCI_H. To disable this code: after configuring, you can change those defines in include/net-snmp/net-snmp-config.h, then rebuild. The affected code is in agent/mibgroup/if-mib/data_access/interface_linux.c.
There's also a patch in this bug report: http://sourceforge.net/p/net-snmp/bugs/2449/
I resolved the issue using the stock snmpd that comes with the Raspbian.
In /etc/snmp/snmpd.conf file I isolated the issue to the following line
agentAddress udp:161,udp6:[::1]:161
Instead of listening on all interfaces, if I specify the the ip address of the eth0 interface i.e.:
agentAddress udp:10.0.1.5:161,udp6:[::1]:161
Then snmpd starts fine.
My speculation is that the stock snmpd tries to enumerate all possible interfaces including the pci ones.
I am currently using libproxy to get the proxy information (if any) on RedHat and Debian Linux. It doesn't work all that well, but it's the only way I know I can use to get the proxy information from my code.
I need to stop using the lib since in most cases it doesn't recognize the proxy.
Is there any way to acquire the proxy information? What i mean is, is there a file (or group of files) i can read, or an env variable or an API or system call that i can use to get the information?
Gnome based code is OK, KDE might help as well but i am looking for something more generic.
The code is C.
Now, before anyone asks, I don't want to use libproxy anymore. Period. I don't want to start investigating why it doesn't work. I don't really want to know whether there is a new version of that lib. I know it might work, I just don't want to use it. i can't use it (just because). So please don't point me that way.
Code is appreciated.
thanks.
In linux, the "global proxy setting" is typically just environment variables that are usually set in /etc/profile. You can examine those variables to see what proxy is set.
The variables are:
http_proxy - the proxy for HTTP connections
ftp_proxy - the proxy for FTP connections
Using the Network Proxy Preferences tool under Gnome saves information in the GConf database. The path to the keys are /system/http_proxy and /system/proxy. You can read about the detail in those trees at this page.
You can access the GConf database using the library API. Note that GConf is based on GObject. To examine the contents of this tree using the command line, try the following:
gconftool-2 -R /system/http_proxy
This will provide a "name = value" listing of the tree, which may be usable in your application. Note that this requires a system() call, so it's not recommended for a deployed application, but it might help you get started.
GNOME has its own place to store the Proxy settings, and I am sure KDE or any other DE has its own place too. May be you can look for any mention of where Proxy settings should be store in the Linux Standard Base. That could hint you a standard of doing it irrespective of Distro or DE.
DE -> Desktop Environment
char* proxy = getenv("all_proxy");
This statement puts the value of the environment variable called all_proxy, which is used by the system as a global proxy, in your C variable.
To print it in bash, try env | grep 'all_proxy' | cut -d= -f 2.