summaryrefslogtreecommitdiff
path: root/print-ppi.c
Commit message (Collapse)AuthorAgeFilesLines
* Apply the last step of the new way to update the link-layer header lengthFrancois-Xavier Le Bail2020-08-061-8/+5
| | | | | | | | | | | All the link-layer dissectors are now void functions. All the functions were moved to the void_printers[] array. Rename this array to printers[]. Remove the uint_printers[] array, now empty. Remove the 'ndo_void_printer' flag field, now useless, from netdissect_options. Remove other transitional code.
* Rename a field of the netdissect_options structureFrancois-Xavier Le Bail2020-07-141-5/+5
|
* PPI: Update the link-layer dissector to a void functionFrancois-Xavier Le Bail2020-03-281-25/+17
| | | | | | | Moreover: Merge ppi_if_print() and ppi_print() in one function. Remove two useless ND_TCHECK_ tests (GET_ used). Remove a no longer used 'trunc' label.
* PPI: Add a length checkFrancois-Xavier Le Bail2020-03-271-4/+7
|
* PPI: Add specification, update summary, add some commentsFrancois-Xavier Le Bail2020-03-221-5/+12
| | | | [skip ci]
* Apply the first step of the new way to update the link-layer header lengthFrancois-Xavier Le Bail2020-02-021-3/+8
| | | | | | | | | | | | | | | | | | | | | | Currently the return value of link-layer dissectors is supposed to be the length of the link-layer header, so that it can be skipped for -x and -X. If a link-layer dissector or a called function throws an exception, it returns no value, so that length isn't available. The goal is to change all the link-layer dissectors to be void functions and dissectors should update a new field of the netdissect_options structure "link-layer header length" rather than returning it as a value. In this transition process, the link-layer dissectors will be moved, when updated, from the uint_printers[] array (named before printers[]) to the void_printers[] array. In this transition process, a new field of the netdissect_options structure, ndo_void_printer (TRUE/FALSE), set in the updated function lookup_printer(), will permit to choose between the old and new way to update the link-layer header length.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-5/+5
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-4/+3
| | | | | | | | 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-8/+0
|
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+2
| | | | | Update this field in printer entry functions. It will be used for some printings.
* 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
|
* PPI: Use nd_ types, add EXTRACT_ call, tstr[] and bounds checksFrancois-Xavier Le Bail2018-01-131-14/+20
| | | | | Moreover: Remove unneeded '&' when getting a pointer to an nd_uintN_t type
* Clean up signed vs. unsigned.Guy Harris2018-01-111-1/+1
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-7/+7
|
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-4/+4
| | | | | | | | | | | | | | | | Now all the macros have a name meaning a count in bytes. With _S_: signed, _U_: unsigned e.g.: EXTRACT_BE_32BITS -> EXTRACT_BE_U_4 EXTRACT_LE_32BITS -> EXTRACT_LE_U_4 ... EXTRACT_BE_INT32 -> EXTRACT_BE_S_4 and have: EXTRACT_8BITS -> EXTRACT_U_1 EXTRACT_INT8 -> EXTRACT_S_1
* PKTAP,PPI: Fix printing NULL string pointersFrancois-Xavier Le Bail2016-10-131-2/+4
| | | | | | | | | 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.
* Add a summary comment in all other printersFrancois-Xavier Le Bail2016-08-151-0/+2
| | | | | | | Moreover: Remove some redundant comments Update some summary comments Update the specification URL for ATA over Ethernet (AoE) protocol
* Pass an adjusted struct pcap_pkthdr to the sub-printer.Guy Harris2016-02-121-1/+5
| | | | | The caplen and len of the packet it's printing must be reduced by the length of the PPI header.
* 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-3/+3
|
* Include the metadata *and* link-layer header in the header length.Guy Harris2015-04-141-10/+15
| | | | | | | 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.
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+1
| | | | | | | 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.
* Get rid of support for non-NDOified printers.Guy Harris2015-03-101-5/+2
| | | | | | 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.
* Fix PPI header and payload printing.Guy Harris2014-09-231-8/+18
| | | | | | | 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.
* Fields in PPI headers are little-endian, not big-endian.Guy Harris2014-04-261-3/+3
| | | | Fixes GitHub issue #382.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-3/+3
| | | | | | | | | 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.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-3/+3
| | | | | | | | 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.
* make use of ND_DEFAULTPRINT()Denis Ovsienko2014-03-261-1/+1
|
* make use of NETDISSECT_REWORKEDDenis Ovsienko2014-03-151-1/+1
| | | | | Update the already converted decoders to define the macro and to include interface.h instead of netdissect.h. Fix incurred compile errors.
* refine some past NDO conversionsDenis Ovsienko2014-03-121-2/+0
| | | | Don't include unneeded headers and replace a few remaining printf's.
* 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
* Pull a bunch of headers into the only source file that includes them.Guy Harris2013-12-301-1/+9
| | | | | | 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.
* Declare all local variables before any executable statements.Guy Harris2011-08-141-1/+2
| | | | Some C compilers let you get away with that C++-ism; not all do.
* From: Darren Reed <darren.reed@oracle.com>Michael Richardson2011-05-031-0/+103
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.