summaryrefslogtreecommitdiff
path: root/mac80211.c
AgeCommit message (Collapse)AuthorFilesLines
2016-08-05trafgen: Allow to compile without libnlVadim Kochan1-1/+0
trafgen uses libnl only to inject mac80211 frames but it might be not needed in some embedded or switch environments. Let's make it possible to disable this feature. In case the `--rfraw' option is used, the user will get a panic message. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-07-01netsniff-ng: dev: Rename device_ifindex_get to __device_ifindexTobias Klauser1-1/+1
Make the function name more in line with the scheme we use for other similar functions: the function prefixed with __ returns a negative error code, the function without prefix panic()'s on error. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-04-23all: Fix libnl3 include pathTobias Klauser1-5/+5
The libnl3 examples [1] use <netlink/netlink.h> etc. and since pkg-config returns the paths including the libnl3 path component, we should specify our include paths relative to these ones, not /usr/include. [1] http://www.infradead.org/~tgr/libnl/doc/core.html#_linking_to_this_library Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-04-20mac80211: Check existence of generated monX deviceVadim Kochan1-0/+4
Fix then case when netsniff-ng fails if there is already an existing monX device while generating one. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-04-10mac80211: Print libnl error message along with error numberVadim Kochan1-1/+2
Add printing libnl error message like: nl80211 returned with error (-23): Object type does not match cache instead of: nl80211 returned with error -23 Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-09mac80211.c: Remove or mark unused function parametersTobias Klauser1-9/+9
Compiling with "-W -Wall -Wextra" reveals the following warnings in mac80211.c: mac80211.c: In function ‘nl80211_init’: mac80211.c:78:67: warning: unused parameter ‘device’ [-Wunused-parameter] mac80211.c: In function ‘nl80211_wait_handler’: mac80211.c:106:48: warning: unused parameter ‘msg’ [-Wunused-parameter] mac80211.c: In function ‘nl80211_error_handler’: mac80211.c:115:54: warning: unused parameter ‘nla’ [-Wunused-parameter] mac80211.c:117:12: warning: unused parameter ‘arg’ [-Wunused-parameter] mac80211.c: In function ‘nl80211_del_mon_if’: mac80211.c:181:72: warning: unused parameter ‘device’ [-Wunused-parameter] Fix them by either marking them as unused (where we need to conform to library APIs or remove them alltogether (for our own APIs). For the function leave_rfmon_mac80211() the according users (netsniff-ng and trafgen) are also changed. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-02built_in: Add min_t() and max_t() macros and use themTobias Klauser1-1/+1
Introduce non-typechecking versions of min_t() and max_t() and use them where a cast would be needed. The macros were taken from the Linux Kernel, release under GPL v2. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-04xutils: eliminate xutils, move rest to epoll2Daniel Borkmann1-1/+2
Finally eliminate xutils.{c,h} and move the rest to epoll2. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xutils: move device management functions out of xutilsDaniel Borkmann1-0/+1
Move those functions out so that they can be more easily maintained in its separate file. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04xutils: break out string handling and lockingDaniel Borkmann1-0/+1
Break out all string handling functions and lockme stuff in order to further eliminate the big code blob in xutils, so that it can be easier maintained. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-21mac802.11: only wait for nl ack if unfinishedDaniel Borkmann1-7/+37
Jon reported that the setup via netlink of a raw 802.11 mon device fails with: root~/gencfg# trafgen --in beacon.cfg --rfraw --out wlan0 Waiting for netlink ack failed! Let us only wait for it, if really needed. Reported-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-03-15all: import netsniff-ng 0.5.8-rc0 sourceDaniel Borkmann1-0/+223
We decided to get rid of the old Git history and start a new one for several reasons: *) Allow / enforce only high-quality commits (which was not the case for many commits in the history), have a policy that is more close to the one from the Linux kernel. With high quality commits, we mean code that is logically split into commits and commit messages that are signed-off and have a proper subject and message body. We do not allow automatic Github merges anymore, since they are total bullshit. However, we will either cherry-pick your patches or pull them manually. *) The old archive was about ~27MB for no particular good reason. This basically derived from the bad decision that also some PDF files where stored there. From this moment onwards, no binary objects are allowed to be stored in this repository anymore. The old archive is not wiped away from the Internet. You will still be able to find it, e.g. on git.cryptoism.org etc. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>