summaryrefslogtreecommitdiff
path: root/print-null.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename the BSD_AFNUM_ values to BSD_AF_.Guy Harris2023-02-201-7/+7
| | | | | | They correspond to OS socket API AF_ values, which are distinct from address family numbers in the IANA registry at https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml
* Include <string.h> only if required.Denis Ovsienko2020-10-171-2/+0
|
* NULL/LOOP: Use ND_TCHECK_LEN() for a bounds checkFrancois-Xavier Le Bail2020-10-171-5/+2
| | | | | Moreover: Define ND_LONGJMP_FROM_TCHECK.
* Remove useless 'return' at end of void functions (style)Francois-Xavier Le Bail2020-09-281-2/+0
|
* Rename a field of the netdissect_options structureFrancois-Xavier Le Bail2020-07-141-2/+2
|
* NULL/LOOP: Update the link-layer dissector to a void functionFrancois-Xavier Le Bail2020-02-071-10/+10
| | | | | | | | Moreover: Remove trailing "_if" from protocol name. Remove a useless ND_TCHECK_4 test (GET_HE_U_4 used). Remove a no longer used 'trunc' label. Use uint32_t type for family in null_hdr_print().
* NULL/LOOP: Use GET_HE_U_4() callFrancois-Xavier Le Bail2019-04-281-1/+1
|
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-2/+1
| | | | | | | | Remove the tstr[] strings. Update the output of some tests accordingly. Moreover: Add or update some ndo_protocol fields.
* Remove useless commentsFrancois-Xavier Le Bail2018-03-191-7/+0
|
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+1
| | | | | Update this field in printer entry functions. It will be used for some printings.
* NULL/LOOP: Add a bounds checkFrancois-Xavier Le Bail2018-02-121-5/+10
| | | | | | Moreover: Use uint32_t type for family (32-bit integer). Add and use tstr[].
* Remove function specifier 'inline' in printersFrancois-Xavier Le Bail2018-01-261-1/+1
| | | | | | | | It was mostly used with large functions. Moreover: Put some function definition names at the beginning of line. Fix a space.
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-6/+6
|
* CVE-2017-12897/ISO CLNS: Use ND_TTEST() for the bounds checks in ↵Guy Harris2017-09-131-1/+1
| | | | | | | | | | | isoclns_print(). This fixes a buffer over-read discovered by Kamil Frankowicz. Don't pass the remaining caplen - that's too hard to get right, and we were getting it wrong in at least one case; just use ND_TTEST(). Add a test using the capture file supplied by the reporter(s).
* Move the printer summaries from INSTALL.txt to each printerFrancois-Xavier Le Bail2016-08-141-0/+2
| | | | | | | | with the tag '\summary:' for greping. Remark: Currently some printers have no summary line. Moreover: Summarize all printers with a single line in INSTALL.txt
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* Fix a bunch of de-constifications.Guy Harris2015-04-261-1/+1
|
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | The purpose of this macro was to enable the file-by-file switch to NDO, after which only tcpdump.c had a use of it and the definitions guarded by it. Update tcpdump.c not to require them any more and dismiss the unused definitions.
* Leave it up to ip6_print() to handle non-IPv6-capable systems.Guy Harris2014-10-011-2/+0
| | | | | | | | | | | | Always define and declare ip6_print(), always compile print-ip6.c, and always call it if we recognize a payload as IPv6. If INET6 isn't defined, ip6_print() will just print the length and note that printing isn't supported. That way, we don't do weird dissection of IPv6 packets on systems without IPv6 support, due to, for example, ethertype_print() returning 0 ("not dissected") for IPv6 packets on those systems (IPv6-over-Frame Relay was dissected weirdly due to this).
* NDOize AppleTalk, CDP and Kerberos decodersDenis Ovsienko2014-03-281-1/+1
|
* NDOize ISO CLNS decoderDenis Ovsienko2014-03-281-1/+1
|
* make use of ND_DEFAULTPRINT()Denis Ovsienko2014-03-261-1/+1
|
* make use of NETDISSECT_REWORKEDDenis Ovsienko2014-03-151-0/+1
| | | | | Update the already converted decoders to define the macro and to include interface.h instead of netdissect.h. Fix incurred compile errors.
* NDOize 8 more small decodersDenis Ovsienko2014-03-131-1/+1
| | | | | This change converts ZeroMQ, IPX, MPLS, IPv6 options, PPPoE, RIPng, PFLOG and Sun RPC decoders.
* NDOize IP mobile, MSDP and NULL decodersDenis Ovsienko2014-03-061-23/+17
|
* don't include pcap.h needlesslyDenis Ovsienko2014-02-281-1/+0
| | | | | | | | | | Both interface.h and netdissect.h include <pcap.h>, thus most files should not include it regardless if these need it or not. The only exceptions so far remain: * addrtoname.c * missing/datalinks.c * missing/dlnames.c * tcpdump.c
* don't include addrtoname.h needlesslyDenis Ovsienko2014-02-251-1/+0
|
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-5/+0
| | | | | | Remove lots of $Header's and a few $Id's that all belong to the former CVS repository of tcpdump itself. These keywords have been frozen since the migration to git in late 2008.
* Convert the IPv6 printer to use netdissect.Guy Harris2010-11-071-1/+1
|
* move the BSD AF defs into af.h and make the null and rip printer make use of ithannes2006-03-231-37/+9
|
* Add a flag to suppress the "default_print()" call made in variousguy2005-07-071-2/+2
| | | | | | | | 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.
* Print the link-layer header for packets with an unknown AF value, as itguy2005-05-191-5/+21
| | | | | | | used to do. When printing the link-layer header, interpret the "-q" flag, and print the packet length, similarly to the way the Ethernet print routine does.
* remove null_print() and make use of tok2str() instead; proto names taken ↵hannes2005-05-181-46/+13
| | | | from ethertype_values
* refactored ip_print() so that chained header parser (ESP/AH) canmcr2005-04-061-2/+8
| | | | more easily call the inner parts.
* Fix up a bunch of comments - the on-the-wire length field in aguy2004-03-171-2/+2
| | | | pcap_pkthdr is "len", not "length".
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | appropriately, and that GNUmakefile and the MSVC++ project file define it apppriately, as we do with libpcap, rather than defining it in "interface.h". Undo the rcsid-shuffling and addition of extra #includes, as we no longer need to arrange that "interface.h" be included before using _U_ in an RCS ID or copyright.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | use "_U_" in the definitions of "rcsid[]", to eliminate complaints about those variables being unused; move the definitions after the include of "interface.h", or add an include of "interface.h", so that "_U_" is defined. Include "config.h" before including "tcpdump-stdinc.h" in "missing/datalinks.c".
* don't pass on src & dst MAC adresses to the isoclns decoder as MAC adresseshannes2003-05-221-2/+2
| | | | should be really printed in ether_print() using the eflag
* Check the AF_ value rather than the IP header on packets; the packetsguy2003-02-051-19/+76
| | | | | | | | | | aren't necessarily IP packets. Support several different versions of AF_INET6 from various BSDs. Handle OSI, AppleTalk, and IPX. Handle unknown AF_ values the way unknown protocol types are handled in other print routines - print the raw packet payload.
* Hoist a bunch of stuff that should be done by all if_print routines intoguy2002-12-191-20/+4
| | | | | | tcpdump.c. Have if_print routines return the length of the link-layer header, so that the common code knows how to skip the link-layer header when printing the packet in hex/ASCII.
* Add a new routine "default_print_packet()", which takes a pointer to theguy2002-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | beginning of the raw packet data, the captured length of the raw packet data, and the length of the link-layer header, and: if "-e" was specified, prints all the raw packet data; if "-e" was not specified, prints all the raw packet data past the link-layer header, if there is any. Use that routine in all the "xxx_if_print()" routines if "-x" was specified. Make "arcnet_encap_print()" static - it's not used outside "print-arcnet.c". Add missing info printing code to "atm_if_print()". Print the packet data in "lane_if_print()", not in "lane_print()", as "lane_print()" can be called from other "xxx_if_print()" routines, and those routines will also print the packet data if "-x" was specified - no need to print it twice.
* We no longer use "packetp" for anything, so eliminate it. (If anyguy2002-12-181-5/+4
| | | | | | | | | | | | | dissector really needs source and destination MAC addresses, we should make global pointers to them - which would be null for packets lacking MAC addresses, so dissectors that need them will need to do something sensible if those pointers are null.) Don't fake up an Ethernet header if there aren't any MAC addresses to use when faking it up. "bp_chaddr" in "print-bootp.c" is an array, so "bp->bp_chaddr" cannot be null, and there's no need to test for it not being null.
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-2/+2
| | | | | | | | | | | | | | | unused-parameter problems reported by GCC. Add an _U_ tag to label parameters as unused if the function is called through a pointer (so that you can't change its signature by removing parameters) or if there are unused parameters only because the function isn't complete. Add some additional bounds checks the necessity for which was revealed while cleaning up unused-parameter problems. Make some routines static. "lcp_print()", defined in "print-lcp.c", isn't called anywhere - "print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+2
|
* Get rid of unneeded incomplete definitions of "struct mbuf" and "structguy2002-06-011-6/+1
| | | | | rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and <sys/ioctl.h>.
* Put the infodelay wrapping into the remaining "XXX_if_print()" routines.guy2001-07-051-1/+5
| | | | | | | | | | | | | | Split the Cisco HDLC printer into "chdlc_if_print()", which does the stuff expected of a low-level print routine (printing the time stamp, printing the final newline, doing the infodelay stuff) and "chdlc_print()", which doesn't do that stuff. This lets us clean up "ppp_hdlc_if_print()" a bit - it can just print the time stamp at the beginning, and do the infodelay stuff at the end, without having to treat Cisco HDLC specially by skipping the time stamp printing. (This also ensures that the time stamp is always printed, which wasn't the case before.) Print the missing final newline in "pppoe_if_print()".
* Handle DLT_NULL correctly - the AF_ value is in host byte order, whichguy2000-12-161-11/+35
| | | | | | | | | | | | | | | | | | | | | may not be *our* byte order if we're reading a capture file from another machine; we currently handle that by checking whether it looks like an integer < 65536 or not and, if it's not, byte-swap it. This also lets us handle OpenBSD DLT_LOOP as well - it's like DLT_NULL except that the AF_ value is in *network* byte order. (Old-style Linux loopback captures were also DLT_NULL, but the header had an Ethernet type in it; there have also been captures where the header was a PPP header. For now, we just continue to assume that all DLT_NULL packets are IP, and check the IP version field to decide whether it's IPv4, IPv6, or something else. We may want to consider adopting Ethereal's heuristics, which would at least mean we wouldn't be reporting bogus packet types for old-style Linux loopback captures and those weird PPP - ISDN4BSD? - captures, although the version of libpcap that goes with this version of tcpdump doesn't produce bogus DLT_NULL captures for Linux loopback devices.)