1

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?

Community
  • 1
  • 1
xstmpx
  • 636
  • 4
  • 21
  • I think this link can help you http://stackoverflow.com/questions/21456235/how-nl80211-library-cfg80211-work : apparently, to use nl80211 you should prefer to use lib like libnl or libnl-tiny – Garf365 Apr 29 '16 at 07:40
  • I'd have a look at [`iw` source code](http://git.kernel.org/cgit/linux/kernel/git/jberg/iw.git/), specifically [`scan.c`](http://git.kernel.org/cgit/linux/kernel/git/jberg/iw.git/tree/scan.c) – jbm May 02 '16 at 06:01

1 Answers1

3

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.

WraithWireless
  • 634
  • 9
  • 21