summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-07-10ifpps: Calculate and show average values across all CPUsTobias Klauser2-10/+65
Calculate the average for CPU usage, IRQs/t and absolute IRQs across all CPUs (also the ones which are not displayed) and show them below the respective per-CPU values. Mention this fact the man page accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-10dissector: print hex_ascii combination in unkown linktypesDaniel Borkmann1-5/+4
Commit f5c10ae4e3 ("dissector: do not panic on unknown hatype") let netsniff-ng not panic anymore on unkown ha types, but without explicitly starting netsniff-ng in hex or ascii printing mode, no dissection will happen. This patch fixes this situation so that at least ascii_hex() will be called in case the link type is not known to us. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-10README: Adjust mention of sponsorsTobias Klauser1-2/+3
The sponsors have been moved to AUTHORS from Sponsors in commit 9d310488 ("docs: move sponsor names into authors "), thus adjust the pointer to them in README accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-10configure: check for flex and bisonDaniel Borkmann1-0/+30
flex and bison are needed for bpfc and trafgen, so check for their existance. If they are not present, lets remove those two from the build in case users do not want it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-09configure: fix multiple issues in build configurationDaniel Borkmann8-21/+86
This patch is a bundle of multiple fixes. 1) Fix compilation of astraceroute when HAVE_LIBPCAP=1: astraceroute doesn't need libpcap, so add an additional guard/define to bpf.h and bpf_comp.c and netsniff-ng.c. Also since we generate a config.h file, we do not need to have this additional compile flag anymore. 2) Fix tstamping.{h,c} to use the configure script instead of the Makefile. For doing this, also fix the object inclusion in netsniff-ng/Makefile. Last but not least, rename __WITH_... into HAVE_... as this is more clean. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-09all: show git id in --version informationDaniel Borkmann8-20/+34
In order to be able to better track regressions or to give support, let us track the Git id as well in version information. This makes the ``--version'' switch actually useful. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-09configure: let configure script generate config.h fileDaniel Borkmann4-10/+22
While we're at it, also let configure script generate the config.h file. The generation of it is currently quite static, but that could change in future. While at it, we also generate a GITVERSION define, that we will use for ``--version'' output of the individual tools for being able to provide better support since we can see what concrete commit people are using when building from Git repo. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: when we have all deps rather tell "all tools will be built"Daniel Borkmann1-2/+7
In case we have all dependencies, tell the user that all tools will be built instead of listing the tools. Only list them when we do not have all deps. This should facilitate usability a bit. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: netsniff-ng: libpcap is not a hard dependencyDaniel Borkmann3-4/+17
netsniff-ng uses libpcap only for high-level filter compiling. Thus, let netsniff-ng not "hard-depend" on libpcap, but rather disable filter compiling in case the user does not want to install libpcap. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: make: misc: update header commentDaniel Borkmann2-0/+5
Add a header comment to the configure script with Tobias as the primary author, and also mention Tobias as an author in the Makefile itself for his changes. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: test also tpacket flags e.g. used in TX_RINGDaniel Borkmann1-6/+12
Also try compile-testing TPACKET_V2/3 flags that are used in some particular versions, especially in TX_RING. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: two fixes on dependenciesDaniel Borkmann1-6/+35
1) netsniff-ng is also dependant on libnl (e.g. for raw 802.11 devices) 2) Only netsniff-ng depends on tpacket_v3, trafgen on tpacket_v2. Thus, add checks for both. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure, Makefile: Conditionally build toolsTobias Klauser2-11/+102
Instead of halting out the entire build build if one dependency is not available, only exclude the tools that link against it from building. The configure script will now print a list of all tools that will be built -- and in case some libaries are not available -- that will not be built. Also add checks for libcli and libnet which mausezahn depends on. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-08configure: Add check for libpcapTobias Klauser1-0/+24
libpcap is used to compile tcpdump-like filters in netsniff-ng, so check for it in configure. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-08configure: Call a function from libgeoip in check_libgeoip()Tobias Klauser1-1/+3
In order to cause the linker to get called and thus the check for the presence of the library (not just the headers) to be performed, call GeoIP_new(). Also pass the proper linker flag to $CC. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-08configure: Call a function from zlib in check_zlib()Tobias Klauser1-1/+3
In order to cause the linker to get called and thus the check for the presence of the library (not just the headers) to be performed, call gzopen(). Also pass the proper linker flags to $CC. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-08configure: Fix check for libnetfilter-conntrackTobias Klauser1-2/+4
Correct the type to struct nf_conntrack and call a function to prevent the variable from getting optimized away by the compiler and cause a linker call. Also add the proper linker flag. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-08config: check for liburcuDaniel Borkmann1-0/+24
Add a configure script extension that checks for liburcu as it is currently needed by flowtop. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08config: check for libzDaniel Borkmann1-2/+23
Add a configure extension to check for libz that is needed for the geoip updater. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08config: execute check_libnf_ct function to check for conntrackDaniel Borkmann1-0/+1
The check_libnf_ct function is implemented in configure, but it was not executed currently. So from now on invoke it and check for netfilter's conntrack library. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08config: check for available databasesDaniel Borkmann1-0/+8
We need to have: GEOIP_CITY_EDITION_REV1, GEOIP_CITY_EDITION_REV1_V6, GEOIP_COUNTRY_EDITION, GEOIP_COUNTRY_EDITION_V6, GEOIP_ASNUM_EDITION, GEOIP_ASNUM_EDITION_V6. Not all might be available on older versions. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08conntrack: consolidate all conntrack header includes into conntrack.hDaniel Borkmann2-4/+10
Consolidate all conntrack header includes into conntrack.h as this is more clean. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-05configure: Don't redirect output of pkg-configTobias Klauser1-8/+8
This will of course also lead to the flags getting redirected. Silly me. While at it also remove the pointless warning flags to cc. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-05Makefile, INSTALL: Simplify clean/uninstall Makefile targetsTobias Klauser2-27/+38
Streamline the Makfile targets by separating the clean targets (which only affect the build tree) from the uninstall targets (affecting files installed in the system). Do this by renaming the 'distclean' target to 'uninstall' and removing unnecessary aliases. The 'distclean' target serves now as a way to remove build files and Config. The 'mrproper' will bring the source into a pristine state as checked out from git. Summary of the new/changed targets: clean: remove all build related files (but not Config) distclean: 'make clean' + remove Config mrproper: remove all files not in git repository uninstall: remove all files installed by us from the system, but not affecting the build environment. %_uninstall: tool specific uninstall The following targets were removed: mostlyclean, realclean and clobber. Also the target names in the INSTALL file are adjusted. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-05INSTALL: minor: Fix typo 'mainling list'Tobias Klauser1-1/+1
This should be 'mailing list' instead of 'mainling list'. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-05configure, Makefile: Fail in Makefile if Config is not completeTobias Klauser2-1/+6
Define CONFIG_OK in the Config file generated in the configure script and check for it being defined in the Makefile before attempting anything else. This way we can better inform the user that she needs to run ./configure first. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-05configure: Silence pkg-config callsTobias Klauser1-5/+9
Redirect the output of pkg-config to /dev/null so it doesn't clutter the output of the configure script. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-03dev: linktype: use ARPHRD_ETHER for "any" deviceDaniel Borkmann1-1/+3
Use ARPHRD_ETHER for the "any" device, so that when typing "netsniff-ng" without any arguments, ethernet is assumed. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03netsniff-ng: ctx: init and destruct methods for ctxDaniel Borkmann1-18/+33
Refactor ctx initialization and destruction into separate handlers. That is more clean. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03pcap: invoke dev->type to pcap linktype mapperDaniel Borkmann2-4/+5
Invoke dev->type to pcap linktype mapper in order to write a correct pcap file header for various link types. Also fix two bugs in pcap file header parsing and print a warning with the magic link number in case of an unknown link type. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03pcap: fix build errorDaniel Borkmann2-4/+12
Various fixes for last commit. Sorry for that. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03dissector: do not panic on unknown hatypeDaniel Borkmann1-2/+5
Do not panic on linktypes that are unknown to us. Just skip the usual dissector entry point and based on user input, print in hex, ascii, or hex + ascii. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03pcap: support for various linktypesDaniel Borkmann3-13/+129
Add a device_type() method to get the assigned dev->type from the kernel, and add support for automatic selection of the correct pcap file header's linktype. This needs to be integrated into the core code though. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03pcap_io: add LINKTYPE_NETLINK for netlink pcapsDaniel Borkmann1-0/+3
This adds basic linktype support for netlink "nlmon" devices. Todo: we sill need to set the correct pcap type on capturing. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-03man: netsniff-ng: elaborate on capturing netlink trafficDaniel Borkmann1-3/+15
As nlmon's device setup has now been changed to use rtnl link setup, give a full example on how to setup and teardown nlmon devices. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-29man: bpfc: add netlink arp headerDaniel Borkmann1-0/+1
As per [1] we now also have an official hw device identifier for Netlink. Add it to bpfc man page as we can capture from an nlmon device. [1] http://patchwork.ozlabs.org/patch/253293/ Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-28Merge branch 'config'Tobias Klauser4-2/+254
Pull in the configure script. From now on, before calling 'make' the './configure' script will need to get called. This is no autotools generated script, but manually written to check for netsniff-ng's dependencies.
2013-06-28configure: Improve check for libnl/libnl-genlTobias Klauser1-2/+16
Actually call some functions in the check program so they will need to get linked. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-28configure: Check for presence of pkg-config and ccache binariesTobias Klauser2-1/+35
Check whether pkg-config and ccache are in the PATH. A missing pkg-config will cause the configure script to abort with an error. The presence of ccache is written to Config and used by the Makefile to conditionally make use of it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-28configure: Add linker flags for ncursestest to correct positionTobias Klauser1-1/+1
Newer versions of GCC expect the linker flags after the object code, so move the ouput of 'pkg-config --libs ncurses' there to not make the test fail even if ncurses is present on the system. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-25netsniff-ng: tpacketv3: 'fix' packet accounting outputDaniel Borkmann3-5/+6
In netsniff-ng, we use tpacketv3 for capturing-only mode. The issue observed lately is that when using f.e. -n10 or capturing a pcap and then quitting, the pcap or actually seen number of packets are less than what the statistics tell us from getsockopt(2). This is due to the fact that tpacketv3 divides its ring buffer into blocks of frames. Meaning, while we are traversing block n, the kernel already fills up block n+1 and following if new packets arrive. While doing so, it increments packet counters. Thus, when we ^C, we haven't seen those blocks, so the stats tell us mostly a slightly higher result. Fix this by adjusting socket stats printing to this fact. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-25man: netsniff-ng: add section about netlink traffic debuggingDaniel Borkmann1-0/+4
Recently, the nlmon device driver got accepted [1], so that it's now possible to debug netlink traffic as well. [1] http://thread.gmane.org/gmane.linux.network/273952 Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-24ifpps, flowtop: Move ncurses init and end to common moduleTobias Klauser6-42/+40
ncurses (de-)initialization is duplicated across flowtop and ifpps, so move it to an own module and use it from both tools. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-24configure: Check for tpacket, ncurses, libgeoipTobias Klauser1-1/+100
Check for some more libraries we make use of in the configure step. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-24gitignore: Ignore generated ConfigTobias Klauser1-0/+3
Ignore the build config generated by the configure script. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-24README, INSTALL: minor: Remove trailing whitespacesTobias Klauser2-4/+4
Remove some trailing whitespaces from documentation. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-24configure: Add configure script used to detect NaClTobias Klauser3-1/+103
In order to use an installation of NaCl provided by the distro or by previous manual installation, provide a configure script which checks for nacl's presence. Also check of libnl-genl headers. More checks of the other libraries depended on by netsniff-ng as well as checks for necessary kernel headers should be added here too. The configure script is preliminary and has not yet extensively been tested on multiple systems. The concept was inspired by the configure script of trinity and iproute2. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-20dev: mark paths likely/unlikelyDaniel Borkmann1-4/+4
Mark them as what is to be most expected. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-17ioexact: make mayexit a boolDaniel Borkmann2-4/+9
It's used as such, so therefore make it a bool instead of int. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-17man: add colophon to the end of each document.Daniel Borkmann8-0/+32
Add a colophon to the end of each man page. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>