summaryrefslogtreecommitdiff
path: root/netdissect.h
Commit message (Collapse)AuthorAgeFilesLines
* C compilers can, and some do, optimize away pointer underflow checks.Guy Harris2015-03-021-2/+14
| | | | | Cast the pointers to uintptr_t; use AC_TYPE_UINTPTR_T to get uintptr_t defined on older platforms that don't define it themselves.
* Fix plurals in packet count messages.Guy Harris2011-03-081-0/+3
| | | | | | | | Based on a patch from cr4ckn@sourceforge.net, but with a macro PLURAL_SUFFIX() defined to return either "s" or "" (rather than possibly printing a NUL character with %c), and with that macro used in a couple of cases where the equivalent had been done by hand, and with one case the patch missed fixed as well.
* Add support for setting the time stamp type for a capture.Guy Harris2010-08-221-0/+1
| | | | | | Based on a patch from Scott Mcmillan <scott.a.mcmillan@intel.com>. While we're at it, make some error messages a bit less geeky.
* Add a -h flag, and only attempt to recognize 802.11s mesh headers if it's set.Guy Harris2010-05-271-0/+1
| | | | | | | | | | | | | | | | | I give up. I have no access to the 802.11s drafts, I can't find anything that suggests whether a heuristic check for an 802.11s header should check for To DS and From DS both being set or either being set or unset, or whether it should check for a QoS frame type (the examples in all the documentation I can find have To DS and From DS set, and have a QoS field, in the 802.11 header, but that might just be an example 802.11 header showing all the fields), so I'm just adding a -h command-line flag; you need to specify it to get tcpdump to try to guess whether a frame has a mesh header or not. I'll leave it up to somebody else to figure out what the best heuristic for detecting the presence of mesh headers is (note that tcpdump and Wireshark have different heuristics, both of which can probably get false positives, especially with encrypted frames where the first payload byte just *happens* not to have any of the reserved bits in the mesh header flags set).
* Process VLAN frames and Alteon jumbo frames in the Ethernet printer.Guy Harris2010-02-211-2/+2
| | | | | | | | | | | | | | | | | Instead of having the Ethernet-type handler process the VLAN and Alteon jumbo frame Ethernet type values, process them in the Ethernet (and Linux cooked-mode) dissectors. This makes it easier for the right MAC addresses to be printed for those packets. As part of that, rename ether_encap_print() to ethertype_print() - it doesn't print encapsulated Ethernet frames, it prints payloads whose packet type is indicated by an Ethernet type field value - and remove the no-longer-needed "extracted Ethernet type" argument. That also lets us eliminate it from the SNAP print routine. Make ether_print() take a function, and an argument to pass to that function, as parameters, so that, for example, the ATM LANE printer can use it and put the LEC ID into the link-layer headeer printout.
* Get rid of BIG_ENDIAN and LITTLE_ENDIAN definitions.Guy Harris2010-01-101-5/+0
| | | | | | The configure script doesn't define BYTE_ORDER, so they can't validly be compared against BYTE_ORDER; don't leave them around for people to think they can.
* This commit makes ipnet_if_print the first NDO aware top-levelMichael Richardson2010-01-101-3/+2
|\ | | | | | | | | | | | | | | printer. Merge commit 'origin/master' Conflicts: netdissect.h
| * Include "netdissect.h" in print-ip6.c, and move icmp6_print'sGuy Harris2009-11-261-2/+2
| | | | | | | | | | declaration out from inside #if 0/#endif, to get it declared in print-ip6.c.
| * XXX_if_print() routines are not passed a "struct netdissect_options *",Guy Harris2009-11-261-3/+0
| | | | | | | | | | | | so ipnet_if_print() can't expect one. ipnet_print() isn't called from outside print-ipnet.c, so make it static.
| * ether_encap_print() is a utility for use by printers for protocols thatGuy Harris2009-11-251-1/+0
| | | | | | | | | | | | use Ethernet types, to call the appropriate printer routine for the encapsulated type. IPNET is the only protocol using IPNET types, so ipnet_encap_print() isn't needed.
* | ether_encap_print() is a utility for use by printers for protocols thatGuy Harris2010-01-101-1/+0
|/ | | | | | use Ethernet types, to call the appropriate printer routine for the encapsulated type. IPNET is the only protocol using IPNET types, so ipnet_encap_print() isn't needed.
* netdissect.h did not actually declare ipnet_if_print, make it visibleMichael Richardson2009-11-241-0/+2
|
* updated print-ipnet.c to use netdissect options structureMichael Richardson2009-11-241-0/+4
|
* netdisect converted icmp6_print()Michael Richardson2009-11-141-0/+2
|
* modularize ip6 nextlayer checksum generation andHannes Gredler2009-10-121-1/+2
| | | | change tcp6 and pim6 to use it.
* Get rid of some autoconf macros not used, or no longer used, withGuy Harris2009-07-081-3/+12
| | | | | | | | | | | tcpdump. Check whether __attribute__((format)) can be applied to function pointers and, if not, don't apply it to function pointers; some older versions of GCC appear to support applying it to functions, but not pointers to functions. As we've gotten rid of missing/getaddrinfo.c, don't use it.
* Add __attribute__((format)) to the declarations of the ndo_printf,Guy Harris2009-05-241-3/+6
| | | | | | | | | | | | | | | | ndo_error, and ndo_warning function pointers in a netdissect_options structure. Fix some errors adding that caught. Have the RRCP dissector extract fields itself, with the EXTRACT_ macros and a u_char pointer, rather than printing numbers from a structure which doesn't put structure members on natural boundaries (__attribute__((packed)) doesn't help, as not all compilers support it) - note also that not all processors support dereferencing unaligned pointers, e.g. SPARC - and assuming some fields are in the "right" byte order. Also have it check whether data is available in the packet before referring to it.
* Make the default snapshot length the maximum; add a #define for theGuy Harris2009-03-051-9/+13
| | | | | | | | maximum. Get rid of redundant definition of DEFAULT_SNAPLEN in interface.h. Update the documentation.
* from Anantharamu Suryanarayana: add 4-byte AS support to the BGP printerHannes Gredler2009-01-201-0/+1
|
* add infrastructure for verifiying the HMAC-MD5 digest in routing protocols.hannes2008-08-161-2/+2
| | | | | | | The shared secret is passed using the already existing -M option which is used for TCP-MD5 checking. add initial supoort for RSVP Integrity object verification.
* Use the new libpcap API's if available; that means we can support "-B"guy2008-04-041-1/+3
| | | | | on all platforms in that case. Also, add a "-I" flag to turn on monitor mode.
* From Andrew Silent: Realtek Remote Control Protocol support (seeguy2008-02-061-2/+3
| | | | OpenRRCP.org.ru for details).
* added "make check"mcr2007-11-241-1/+8
| | | | | | | when optimization is not on, glibc6 doesn't define ntohs(), and our attempt to optimize it for x86 doesn't work --- the functions need to be static, not extern. added decryption of IKE v2 payloads, when keys are provided by -E.
* change the TCP printer to print new-style order:hannes2007-01-291-1/+2
| | | | | | | | | - seperate fields by comma - use [] for flags and options sets - print a trailing length field make use of tok2str() and bitttok2str() move port definitions into tcp.h
* From Ben Byer <bushing@sourceforge.net>: add a "-K" flag to suppress theguy2006-05-051-1/+2
| | | | | | checking of TCP checksums. Sort the argument processing code alphabetically.
* add a maxlen boundary check to safeputs, print unprintable chars as hex in ↵hannes2006-02-081-2/+2
| | | | safeputchar
* from Will Drewry <will AT alum.bu.edu>hannes2005-10-201-1/+4
| | | | auto-rotate files after some times given with the G flag;
* depreciate llcsap_string() as LLC SAP name resolution is now done via a ↵hannes2005-09-291-2/+1
| | | | single tokentable in the LLC printer
* Add a flag to suppress the "default_print()" call made in variousguy2005-07-071-2/+3
| | | | | | | | link-layer print routines if no other print routine claimed the packet. Test whether that flag is set rather than testing whether neither of -x or -q were specified, and have -x, -q, *and* -X set that flag, so that -X suppresses it just as -x does. That way you don't get those pckets dumped twice if -X was specified.
* Have "ascii_print()" do the "-A" output, and nothing but the "-A"guy2005-07-061-7/+8
| | | | | | | | | | | | | | output. Have "hex_and_ascii_print_with_offset()" and "hex_and_ascii_print()" to the "-X"-style offset, leaving "hex_print_with_offset()" and "hex_print()" doing the "-x"-style output. Don't have any of them check "xflag", "Xflag", or "Aflag" - they print what they're intended to print, and the caller should check the flags in question. Don't have "-A" set "xflag" or "Xflag". This cleans up some problems with "-A" printing hex informatioin - it's not supposed to.
* use new ip_print_demux() routine in ISAKMP UDP-ESP encapmcr2005-04-071-1/+5
| | | | printer.
* added ESP-in-UDP printer from RFC3948.mcr2005-04-061-4/+6
|
* Check the "status value is an NT status" flag and, if it is, treat theguy2004-12-301-1/+2
| | | | | | status value as such. Constify some tables.
* There isn't a "default_print_unaligned" routine, so there's no need forguy2004-12-231-5/+1
| | | | | | | | | | an "ndo_default_print_unaligned" member of the "netdissect_options" structure. There is, however, a need for an "ndo_default_print" routine, which takes a "netdissect_options *" as its first argument, to initialize the "ndo_default_print" member of that structure, as "ND_DEFAULTPRINT()" uses it.
* If libpcap is configured with --enable-optimizer-dbg, it expects dflagguy2004-11-071-2/+1
| | | | | | to be a global supplied by the application using it. In tcpdump, "-d" is a specialized flag, and doesn't apply to packet dissection, so it doesn't belong in the netdissect structure - make it a global again.
* <sys/time.h> isn't available with all Windows platforms, and isguy2004-11-041-2/+1
| | | | | automatically included on UN*X by virtue of including "tcpdump-stdinc.h" - don't include it here.
* The first argument to "ascii_print_with_offset()", "ascii_print()",guy2004-07-211-7/+19
| | | | | | | | | | | | "hex_print_with_offset()", and "hex_print()" is a string used as a tag; make it a "const char *", not a "const u_char *". Copy the declaration of "strsep()" from "interface.h" to "netdissect.h", and get rid of the include of "interface.h" from "print-esp.c", as it includes "netdissect.h". Update the "ND_TTEST2()" macro to do the same overflow checks that "TTEST2()" now does.
* print the packet length for ESP packetshannes2004-07-161-2/+2
|
* NDO-ized print-arp.cmcr2004-04-301-2/+3
|
* new tok2strbuf() API.mcr2004-04-291-1/+6
|
* do not use gcc-ism for macro, instead abuse C-syntaxmcr2004-04-231-2/+2
|
* removed erroneous \ at end of file.mcr2004-04-051-2/+1
|
* print-esp has been "NDO"-ized.mcr2004-04-051-9/+11
| | | | | replace error() and warning() with ndo-ized version. moved snaplen/snapend to ndo structure.
* Add "ndo_Uflag", as we #define Uflag to be gndo->ndo_Uflag inguy2004-04-021-2/+3
| | | | | | | interface.h. Make "ndo_dltname" a const pointer, as we assign a const pointer value to it.
* beginnings of library version of netdissect.mcr2004-03-251-0/+414