Commit Graph

27 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
94a3708f00 Include <config.h> unconditionally
Builds using Autotools or CMake generate config.h, thus remove the
'#ifdef HAVE_CONFIG_H'/'#endif'.

Remove also the 'add_definitions(-DHAVE_CONFIG_H)' in CMakeLists.txt.
2024-03-28 05:34:34 +00:00
Francois-Xavier Le Bail
ff4af2069a Put "{" at end of line with "switch" to keep a consistent style
[skip ci]
2023-04-19 22:03:17 +02:00
Francois-Xavier Le Bail
e041680a78 USB: Use ND_TCHECK_LEN() for bounds checks
Moreover:
Define ND_LONGJMP_FROM_TCHECK.
Use _U_ for unused parameters.
2020-11-13 12:49:07 +01:00
Francois-Xavier Le Bail
6288c273b6 Remove useless 'return' at end of void functions (style) 2020-09-28 17:04:08 +02:00
Francois-Xavier Le Bail
96c60029b3 Rename a field of the netdissect_options structure 2020-07-14 17:35:57 +02:00
Francois-Xavier Le Bail
65577c9619 USB: Update the link-layer dissector to a void function
Moreover:
Remove trailing "_if" from protocol names.
2020-02-07 20:36:20 +01:00
Francois-Xavier Le Bail
49257e55e1 USB: Print the protocol name
Moreover:
With '-q' option, just print the protocol name.
2019-08-15 15:55:30 +02:00
Francois-Xavier Le Bail
ee68aa3646 Use the new GET_ macros instead of the EXTRACT_ ones
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.
2019-03-26 21:06:24 +01:00
Francois-Xavier Le Bail
ba8936b39b Print truncations with nd_print_trunc() instead of tstr[] strings
Remove the tstr[] strings.
Update the output of some tests accordingly.

Moreover:
Add or update some ndo_protocol fields.
2018-05-04 13:47:49 +02:00
Francois-Xavier Le Bail
546558eabd Add the ndo_protocol field in the netdissect_options structure
Update this field in printer entry functions.
It will be used for some printings.
2018-03-16 19:44:47 +01:00
Guy Harris
fb2479d733 Always include <config.h> rather than "config.h".
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.
2018-01-21 12:27:28 -08:00
Francois-Xavier Le Bail
513f782ae1 Use quoted include netdissect-stdinc.h instead of angle-bracketed one 2018-01-21 10:28:15 +01:00
Guy Harris
fe225c5518 Use nd_ types, add host-endian extract routines, clean up signed vs. unsigned.
We now define the structures for Linux USB headers in print-usb.c, so it
doesn't need to include <pcap/usb.h>; don't check for it.
2018-01-11 11:10:21 -08:00
Francois-Xavier Le Bail
e2982e7f6f Update ND_PRINT() as a variadic macro 2018-01-07 13:36:41 +01:00
Francois-Xavier Le Bail
5cea270318 Remove all storage class specifier 'register'
Let the compiler do the optimizations (or not) based on build options.

Avoid 'value has been optimized out' messages in gdb using '-O0'.
2017-12-13 19:17:47 +01:00
Francois-Xavier Le Bail
51d034f45b Rename some link-layer dissector entry functions
Most of them are already named *_if_print.
Update the others to have the same prefix.

This change allow easier identification.
2017-11-16 07:22:41 +01:00
Francois-Xavier Le Bail
11d3a01319 Move the printer summaries from INSTALL.txt to each printer
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
2016-08-14 17:03:43 +02: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
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
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
ce1fc8263d NDOize more small decoders
This change converts decoders for: DLT_RAW, IPv6 routing header, USB,
Symantec firewall and cHDLC.
2014-03-12 20:02:32 +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
Denis Ovsienko
d8acd8f5d0 make consistent use of the "tstr" idiom
For each decoder that has more than one instance of truncation signaling
and prints the same string in each instance make sure that the string is
declared as "static const char tstr[]" right after the initial includes
block. Where necessary, replace fputs(s, stdout) with equivalent
printf("%s", s).
2013-12-26 18:19:50 +04:00
Guy Harris
071cdba2b3 Handle the 48-byte and 64-byte Linux USB headers differently; for now,
the difference isn't major, but it might be more important later.
2010-01-25 15:25:33 -08:00
Guy Harris
72553e343d Check to make sure we have all of the USB header before trying to print
it.
2009-05-21 10:26:44 -07:00
Guy Harris
2c28d8f466 From Bert Vermeulen: add a USB printer, and fix the error message
printed when trying to print packets for a DLT_ for which we don't have
a printer to indicate that you can still save to a capture file in that
case.  (Slightly changed not to require DLT_USB_LINUX_MMAPPED to be
defined, for older libpcaps that only define DLT_USB_LINUX.)
2009-04-04 12:30:27 -07:00