Commit Graph

20 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
3454c77635 PKTAP,PPI: Fix printing NULL string pointers
Printing NULL string pointers with printf format %s is an undefined
behaviour.
pcap_datalink_val_to_name() may return NULL on unknown DLT_ value.

tcpdump terminated with Segmentation Fault on such case on Solaris 10
SPARC with Solaris Studio 12.3 compiler.
2016-10-13 22:18:21 +02:00
Francois-Xavier Le Bail
b38f324af9 Add a summary comment in all other printers
Moreover:
Remove some redundant comments
Update some summary comments
Update the specification URL for ATA over Ethernet (AoE) protocol
2016-08-15 22:42:38 +02:00
Guy Harris
63d0029e27 Pass an adjusted struct pcap_pkthdr to the sub-printer.
The caplen and len of the packet it's printing must be reduced by the
length of the PPI header.
2016-02-12 18:48:22 -08:00
Francois-Xavier Le Bail
99c91c3aec Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Get the full log via: git log --follow netdissect-stdinc.h
2015-09-10 08:50:40 +02:00
Francois-Xavier Le Bail
c1c3c77463 Printers must include 'netdissect.h', not 'interface.h' 2015-09-05 23:35:58 +02:00
Guy Harris
69cb46af91 Fix a bunch of de-constifications. 2015-04-26 17:24:42 -07:00
Guy Harris
9106400d03 Include the metadata *and* link-layer header in the header length.
Also, don't use the length of the fixed-length portion of the PPI header
as the metadata length, use the *entire* length.

Otherwise, "-x" doesn't start printing at the link-layer payload.
2015-04-14 14:36:23 -07:00
Denis Ovsienko
38700c7f24 dismiss NETDISSECT_REWORKED macro
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.
2015-03-22 10:06:15 +00:00
Guy Harris
4405f13804 Get rid of support for non-NDOified printers.
Remove the TTEST{2}/TCHECK{2} macros.  Rename all "ndo_printer" routines,
structures, and structure members to just "printer", and get rid of the
old routines/structures/structure members with those names.
2015-03-10 13:25:52 -07:00
Guy Harris
f457560d1e Fix PPI header and payload printing.
Header printing (-e) had a stray ", " before the header; remove it.

Payload printing was skipping only the fixed portion of the PPI header,
not the entire header.
2014-09-23 16:08:42 -07:00
Guy Harris
12d2b3e739 Fields in PPI headers are little-endian, not big-endian.
Fixes GitHub issue #382.
2014-04-26 15:39:06 -07:00
Guy Harris
ed85e20e4d u_intN_t is dead, long live uintN_t.
And, as we require at least autoconf 2.61, and as autoconf 2.61 and
later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to
define the uintN_t and intN_t macros if the system doesn't define them
for us.

This lets us get rid of bitypes.h as well.
2014-04-23 00:20:40 -07:00
Guy Harris
1cde6435df Netdissectify the to-name resolution routines.
Have them take a netdissect_options * argument, and get the "no name
resolution" flag from it.

Move the declaration of dnaddr_string to addrtoname.h, along with the
other XXX-to-string routines.
2014-04-04 00:43:46 -07:00
Denis Ovsienko
979fc38d03 make use of ND_DEFAULTPRINT() 2014-03-26 18:52:40 +04:00
Denis Ovsienko
1fe6e66ece make use of NETDISSECT_REWORKED
Update the already converted decoders to define the macro and to include
interface.h instead of netdissect.h. Fix incurred compile errors.
2014-03-15 14:19:49 +04:00
Denis Ovsienko
83bec9d56c refine some past NDO conversions
Don't include unneeded headers and replace a few remaining printf's.
2014-03-12 18:11:23 +04:00
Denis Ovsienko
88e479b75e don't include pcap.h needlessly
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
2014-02-28 18:11:09 +04:00
Guy Harris
27d428c0a1 Pull a bunch of headers into the only source file that includes them.
For headers included in only one source file, put the header contents in
the source file in question, and get rid of a bunch of stuff from the
header not used in the source file.
2013-12-30 22:52:15 -08:00
Guy Harris
961e28032f Declare all local variables before any executable statements.
Some C compilers let you get away with that C++-ism; not all do.
2011-08-14 15:29:49 -07:00
Michael Richardson
5b0329a9e7 From: Darren Reed <darren.reed@oracle.com>
To: tcpdump-workers@lists.tcpdump.org
Date: Sat, 09 Apr 2011 12:51:14 +1000
Subject: [tcpdump-workers] Printing PPI packets

Printing PPI packets with tcpdump does not turn out
to be that hard.

My simple tests have produced the output as below.

It would be worthwhile having some changes made into
the tcpdump code base that were similar to the attached
that print them out.
2011-05-03 18:58:32 -04:00