summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-08-09dev: Integrate `promisc' module into `dev' moduleTobias Klauser8-44/+30
Since entering/leaving promiscuous mode also is a device specific function and all users of the `promisc' module also use `dev', integrate it there. Also rename the functions to have a `device_' prefix like the other functions in the module. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-09promisc: Constify `ifname' parameters to {enter,leave}_promiscuous_mode()Tobias Klauser2-4/+4
The parameter `ifname' to {enter,leave}_promiscuous_mode() is never modified inside the functions, thus mark it as const. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-09dissector: ip_auth_hdr: Fix compiler warningTobias Klauser1-3/+2
Fix the following compiler warning that occurs when building with "-W -Wall -Wextra": ip_authentication_hdr.c: In function ‘auth_hdr’: proto_ip_authentication_hdr.c:57:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Also remove an unnecessary check for header length smaller than 0, since it always results from an unsigned type and is now a size_t anyway. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-09netsniff-ng: Fix compiler warningTobias Klauser1-1/+1
Fix the following compiler warning that occurs when building with "-W -Wall -Wextra" by introducing a cast: netsniff-ng.c: In function ‘walk_t3_block’: netsniff-ng.c:841:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-09mac80211.c: Remove or mark unused function parametersTobias Klauser4-13/+13
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-08astraceroute: Fix compiler warnings with "-W -Wall -Wextra"Tobias Klauser1-13/+17
Fix the following compiler warnings that occur when building with "-W -Wall -Wextra": astraceroute.c: In function ‘__assemble_data’: astraceroute.c:255:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c:262:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c: In function ‘check_ipv4’: astraceroute.c:425:56: warning: unused parameter ‘ttl’ [-Wunused-parameter] astraceroute.c: In function ‘handle_ipv4’: astraceroute.c:451:49: warning: unused parameter ‘len’ [-Wunused-parameter] astraceroute.c: In function ‘check_ipv6’: astraceroute.c:511:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c:491:56: warning: unused parameter ‘ttl’ [-Wunused-parameter] astraceroute.c: In function ‘handle_ipv6’: astraceroute.c:517:49: warning: unused parameter ‘len’ [-Wunused-parameter] astraceroute.c: In function ‘__process_node’: astraceroute.c:690:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c: In function ‘__process_time’: astraceroute.c:738:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c:755:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c:765:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c: In function ‘__process_ttl’: astraceroute.c:846:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] astraceroute.c: In function ‘main’: astraceroute.c:1060:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-08dev: Make device_mtu() return size_tTobias Klauser2-3/+4
We don't return negative values and the MTU is supposed to be the (maximum) length of a packet, thus make it of type size_t. Most of the users in the code store it in size_t already anyway. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-08astraceroute: Use size_t for struct members storing packet lengthsTobias Klauser1-5/+6
Packet lengths are strictly positive and the functions dealing with them (sendto(), recvfrom() etc.) take size_t, thus use size_t. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-05mausezahn: libcli: add sys/time.h for older libcli versionsDaniel Borkmann2-0/+2
Older versions of libcli lack an include in libcli.h. [1] fixed the configure script to not fail in in the test [2], and an include into cli.h was added as well for the main mausezahn build. [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/netsniff-ng/files/netsniff-ng-0.5.8-libcli-test.patch?revision=1.1&view=markup [2] http://b-4.xmw.de/var/log/portage/build/net-analyzer/netsniff-ng-0.5.8_rc2:20130805-055918.log Reported-by: Michael Weber <michael@xmw.de> Suggested-by: Michael Weber <michael@xmw.de> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-08-05build: prevent redefinition of _FORTIFY_SOURCE in gentooDaniel Borkmann1-1/+1
Add a -U_FORTIFY_SOURCE in HARDENING=1 [1] to prevent [2], e.g. as in: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -std=gnu99 -pipe -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-all -Wstack-protector --param=ssp-buffer-size=4 -ftrapv -D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -fno-strict-aliasing -fasynchronous-unwind-tables -fno-delete-null-pointer-checks -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DVERSION_STRING=\""0.5.8-rc2"""\" -DVERSION_LONG=\""0.5.8-rc2"" (Ziggomatic)"\" -DPREFIX_STRING=\"\" -Wall -I. -I/usr/include/libnl3 -I/usr/include/libnl3 -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER -I/usr/include/libnl3 -I/usr/include/libnl3 -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER -o netsniff-ng/proto_igmp.o -c proto_igmp.c :0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default] proto_igmp.c:1:0: note: this is the location of the previous definition [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/netsniff-ng/files/netsniff-ng-0.5.8-fortify_source.patch?revision=1.1&view=markup [2] http://b-4.xmw.de/var/log/portage/build/net-analyzer/netsniff-ng-0.5.8_rc2:20130805-070734.log Reported-by: Michael Weber <michael@xmw.de> Suggested-by: Michael Weber <michael@xmw.de> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-08-02built_in: Add min_t() and max_t() macros and use themTobias Klauser4-6/+24
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-08-02trafgen: Remove unused local variable in apply_*() functions.Tobias Klauser1-25/+22
The variable `i' in apply_counter(), apply_randomizer() and apply_csum16() is only set once, so use the original parameter `counter_id' instead. Rename `counter_id' to `id' in order to keep it short. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-02build: split CFLAGS_DEF and always add CFLAGS_MINDaniel Borkmann1-8/+9
Currently, when doing a custom "make CFLAGS=...", we run into a compile error as several necessary defines are not set. Therefore, use override to always set those. Reported-by: Marco Belmonte <mbelmonte@globalmedia.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-31netsniff-ng 0.5.8-rc2v0.5.8-rc2Daniel Borkmann1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-31ioops: Constify `name' parameter to tun_open_or_die()Tobias Klauser2-2/+2
The parameter `name' to tun_open_or_die() is never modified inside the function, thus mark it as const. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-31dev: Constify `ifname' parameter to device_up_and_running()Tobias Klauser2-2/+2
The parameter `ifname' to device_up_and_running() is never modified inside the function, thus mark it as const. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-30build: Use -n option to head commandTobias Klauser1-2/+2
Make the call to `head' equivalent to the one to `tail'. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-30build: reduce Extra contents to bare minimumDaniel Borkmann11-19/+34
Improve the build system, so that configuration files are installed per tool basis. Also, introduce post_install targets, so that config files can be altered in some way, e.g. done by trafgen. Moreover, move custom targets from Extra to tool-specific Makefiles. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-30build: Don't uninstall configuration filesTobias Klauser2-13/+0
Several of the tools install/uninstall files from $NCONF_FILES, however if we call the uninstall target for a specific tool (e.g. `make astraceroute_uninstall') but other tools depending on one or more of the config files are still installed, the file is still removed unconditionally. As it would require quite some logic in the Makefile in order to detect installed tools and their dependencies, we just don't uninstall the configuration files anymore. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-29build: fix up announce message in announce targetDaniel Borkmann1-7/+8
Bring the announce message in line with the latest released announce message from rc1. So that in future this can be generated automatically. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-29build: fix up GIT_PEOPLE and GIT_LOG macrosDaniel Borkmann2-2/+8
Fix them up so that a proper changelog can be generated automatically. Also while at it, add two "hidden" targets that can be used to test their output. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-29build: tag: add 'v' prefix for tag nameDaniel Borkmann1-1/+1
We need to add a 'v' prefix to the actual version for the tag name. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-29build: use VERSION_SHORT instead of VERSION_STRINGDaniel Borkmann3-12/+13
We have recently changed VERSION_STRING to append CONFIG_RC at the end of the string. Thus, for the build system, change it to VERSION_SHORT where needed, e.g. in release targets where the "+" appendix is not wished. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-29man: Align synopsis with other sectionsTobias Klauser8-8/+8
In all the tools' man pages the synopsis line is indented by one space with respect to the text in the sections above and below. Remove the space to have consistent alignment. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-29flowtop: Fix compiler warningsTobias Klauser1-2/+3
Fix the following compiler warnings that occur when building with "-W -Wall -Wextra": flowtop.c: In function ‘walk_process’: flowtop.c:417:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] flowtop.c: In function ‘presenter_screen_update’: flowtop.c:937:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] flowtop.c:938:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-29build: Use NACL_{INC,LIB}_DIR set by configureTobias Klauser2-2/+2
The environment variables $NACL_INC_DIR/$NACL_LIB_DIR might not always be set, but the configure script will attempt to detect an existing NaCl installation if they aren't. Thus use the $CONFIG_NACL_INC_DIR/$CONFIG_NACL_LIB_DIR variables as emitted by the configure script for the build. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-26mausezahn: man: note use of short hand commandsJon Schipp1-1/+5
Minor addition that notes the use of short hand commands. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-25man: mausezahn: change cisco-like short commands to long formJon Schipp1-20/+20
Change Cisco-like short form commands to long form ones for easier readability. Signed-off-by: Jon Schipp <jonschipp@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-24build: minor: align 'bold' cmd to the same column as 'normal'Daniel Borkmann1-1/+1
Just a minor whitespace alignment, nothing else. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-24build: add "+" version appendix automatically during buildDaniel Borkmann2-3/+19
For each build that has no tag name (thus for all commits except releases), we add a "+" version appendix to indicate that it is further than the rc tag itself, like in the kernel. Do this during configure automatically. This is useful in case someone wants to package a relase, so that the full version name indicates that. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-24build: split build system into smaller manageable piecesDaniel Borkmann5-225/+205
Split the build system into smaller manageable pieces, grouped by context. In that sense, we can keep the most important information within the Makefile itself, and group out misc bits and pieces that we just include into it. E.g. 'Cmds' contains all defined commands that we call from other locations, 'Template' contains the generic build template for all tools, 'Extra' has pieces that need special treatment for the tools to build and 'Misc' contains help and release code. This makes it more manageable on the long run. While at it, I also simplified some code and removed all Wflags expect "-Wall" as we want to convert into "-Wall -Wextra -W" anyway. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-23build: move trafgen_stddef.h to stddef.hDaniel Borkmann1-1/+1
Lets just move it instead of symlink as there is no concrete need for it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-23pcap_io: tun: support captures from wireshark/tcpdump via tun devicesDaniel Borkmann1-0/+2
101-103 do not have official link types and seem to be non-portable. Just add them so that we can replay pcap's of such types as well. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-23built_in: fix build if ARPHRD_IEEE802154_MONITOR is undefinedDaniel Borkmann1-0/+4
Some 3.x kernel versions seem not to ship yet the definition of ARPHRD_IEEE802154_MONITOR. Add it into built_in.h to let the tools build. Reported-by: Pablo Henrique <phenrique@gmail.com> Reported-by: Tobias Kalbitz <tobias.kalbitz@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-15configure: silent complaint if not built on git repositoryDaniel Borkmann2-2/+9
This silences a complaint if the toolkit is not built within a Git repository: ... [*] Checking libnet ... [YES] fatal: Not a git repository (or any of the parent directories): .git [*] Generating config.h ... [*] Looks good! All tools will be built! This is not problematic as the build can be done without any problems. It will just have an empty Git id in --version output. So simply silence this complaint and move on. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-15netsniff-ng 0.5.8-rc1v0.5.8-rc1Daniel Borkmann1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-14pcap_sg: Fix various compiler warningsTobias Klauser1-10/+10
Fix the following compiler warnings that occur when building with "-W -Wall": pcap_sg.c: In function ‘__pcap_sg_inter_iov_hdr_read’: pcap_sg.c:46:89: warning: unused parameter ‘type’ [-Wunused-parameter] pcap_sg.c:47:19: warning: unused parameter ‘packet’ [-Wunused-parameter] pcap_sg.c:47:34: warning: unused parameter ‘len’ [-Wunused-parameter] pcap_sg.c: In function ‘__pcap_sg_inter_iov_data_read’: pcap_sg.c:77:78: warning: unused parameter ‘len’ [-Wunused-parameter] pcap_sg.c: In function ‘pcap_sg_prepare_access’: pcap_sg.c:163:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pcap_sg.c: In function ‘pcap_sg_prepare_close’: pcap_sg.c:184:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] pcap_sg.c:180:39: warning: unused parameter ‘fd’ [-Wunused-parameter] pcap_sg.c:180:58: warning: unused parameter ‘mode’ [-Wunused-parameter] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-14flowtop: Mark unused parameters with __maybe_unusedTobias Klauser1-2/+2
In order to avoid compiler warnings when compiling with -W/-Wunused-parameter, mark unused function parameters with __maybe_unused. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-14geoip: Fix sign compare warningsTobias Klauser1-6/+7
array_size() returns size_t, thus make iterator variables comparing against it size_t too to avoid a warning regarding comparison of signed/unsigned. Also cast some ssize_t variables passed to min() for the same reason. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-14astraceroute.zsh: Fix typo of ``numeric''Tobias Klauser1-1/+1
This should be ``numeric'' instead of ``nemeric''. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13trafgen: update options for zsh completionDaniel Borkmann1-0/+1
Add -C option to zsh support. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-13ifpps: update options for zsh completionDaniel Borkmann1-0/+2
Add -m and -W options to zsh support. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-13pcap_io: Remove unused parameter sll from pcap_pkthdr_to_tpacket_hdr()Tobias Klauser2-5/+3
The sll parameter is not used anywhere in the function, so remove it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13pcap_io: Use iterator variable of correct typeTobias Klauser1-1/+1
array_size() returns size_t, thus make i size_t too to avoid a warning regarding comparison of signed/unsigned. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13make: put newline after Git peopleDaniel Borkmann1-1/+1
Place a newline after GIT_PEOPLE in the mail announcement target. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-13build: use git describe --alwaysDaniel Borkmann1-1/+1
Use git describe --always in the Makefile instead of git describe as it can fail otherwise. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-13pcap_mm: Mark unused parameters with __maybe_unusedTobias Klauser1-3/+3
In order to avoid compiler warnings when compiling with -W/-Wunused-parameter, mark unused function parameters with __maybe_unused. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13tprintf: Fix compiler warningsTobias Klauser1-5/+5
Fix the following warning when compiling with -W/-Wsign-compare/-Wunused-parameter: tprintf.c: In function ‘__tprintf_flush_skip’: tprintf.c:54:65: warning: unused parameter ‘max’ [-Wunused-parameter] tprintf.c: In function ‘__tprintf_flush’: tprintf.c:70:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tprintf.c:76:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tprintf.c:80:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tprintf.c: In function ‘tprintf’: tprintf.c:131:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13oui-update.py: oui: minor config updatesDaniel Borkmann1-0/+7
There have been minor updates after letting the script run. Some are spelling fixes, some modified entries. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-13trafgen: switch for skipping cpu time statistics on exitDaniel Borkmann2-3/+11
For systems with >8 CPUs it might be i) annoying or ii) uninteresting to print CPU time statistics. So introduce a switch that can skip this at exit. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>