summaryrefslogtreecommitdiff
path: root/print-nflog.c
Commit message (Collapse)AuthorAgeFilesLines
* NFLOG: Use correct AF code points on all OSes.Denis Ovsienko2023-02-111-4/+14
| | | | | | | | | | | | On Haiku R1/beta4 "make check" failed the "nglog-e" test case because the printer did not recognize address family 2 as IPv4: - 1 18:31:59.615994 version 0, resource ID 20, family IPv4 (2), + 1 18:31:59.615994 version 0, resource ID 20, family Unknown (2), Fix print-nflog.c to use the wire encoding AF code points rather than the OS libc AF constants. This fixes "make check" on Haiku and likely fixes IPv6 NFLOG decoding on a few non-Linux OSes.
* Lose a few always-true #ifdef wrappers. [skip ci]Denis Ovsienko2020-10-031-4/+0
|
* Remove useless 'return' at end of void functions (style)Francois-Xavier Le Bail2020-09-281-1/+0
|
* Rename a field of the netdissect_options structureFrancois-Xavier Le Bail2020-07-141-4/+4
|
* NFLOG: Add a missing nd_print_trunc() callFrancois-Xavier Le Bail2020-05-041-0/+1
|
* NFLOG: Update the link-layer dissector to a void functionFrancois-Xavier Le Bail2020-05-041-8/+13
| | | | | Moreover: Remove trailing "_if" from protocol name.
* NFLOG: Add two macrosFrancois-Xavier Le Bail2020-05-041-12/+16
|
* Revert "Print decoded attributes from NFLOG message"Michael Richardson2020-02-291-85/+0
| | | | This reverts commit 5ed759e023e20831a675d1432e12b08061ab1d08.
* Merge pull request #492 from vel21ripn/nflog-printMichael Richardson2020-02-291-0/+85
|\ | | | | Print attributes from NFLOG message
| * Print decoded attributes from NFLOG messageVitaly Lavrov2015-11-251-0/+85
| | | | | | | | | | | | | | | | | | | | print MARK,PREFIX attributes print HOOK,UID,GID,IFINDEX_INDEV,IFINDEX_OUTDEV, IFINDEX_PHYSINDEV,IFINDEX_PHYSOUTDEV attributes if -v print HWHEADER attributes if -vv print other attributes w/o decode if -vvv Аdding nflog_print.pcap for testing
* | Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-9/+9
| | | | | | | | | | | | | | 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.
* | Remove some useless testsFrancois-Xavier Le Bail2018-09-141-3/+3
| | | | | | | | | | | | Because packet length (length) >= capture length (caplen). (see the sanity checks in print.c, pretty_print_packet() function)
* | Use HTTPS in the www.tcpdump.org URLs.Denis Ovsienko2018-07-091-1/+1
| | | | | | | | [skip ci]
* | Update closing #endif comment.Guy Harris2018-05-241-1/+1
| |
* | Declare the NFLOG pseudo-header ourselves.Guy Harris2018-05-231-12/+72
| | | | | | | | | | | | | | | | | | | | It's not specified by a libpcap header that might have a different layout in different pcap releases, it's specified on the list of link-layer header types and must remain the same forever (except for getting additional bits defined), so we don't need to pick it up from libpcap. This means we get to use tcpdump's nd_ types; do so.
* | 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.
* | Don't define tstr[] if we won't be using it.Guy Harris2018-04-041-1/+3
| |
* | 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.
* | NFLOG: Add some bounds checksFrancois-Xavier Le Bail2018-02-081-20/+16
| | | | | | | | | | | | Moreover: Add and use tstr[]. Reduce the scope of the variable 'tlv'.
* | 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
| |
* | Fix indentationFrancois-Xavier Le Bail2018-01-091-6/+6
| |
* | Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-11/+11
| |
* | Get rid of unnecessary casts.Guy Harris2017-11-231-1/+1
| |
* | 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
* | Clean up version test.Guy Harris2016-03-251-1/+1
|/ | | | | | | | | | !(nfhdr->nflog_version) is equivalent to (nfhdr->nflog_version == 0). That will evaluate to 1 if nfhdr->nflog_version is 0 and to 0 otherwise. So !(nfhdr->nflog_version) == 0 is equivalent to nfhdr->nflog_version != 0, but 1) it's more obvious what it means and 2) compilers don't point out that it may not mean what you intended.
* Don't require IPv6 library support in order to support IPv6 addresses.Guy Harris2015-09-171-2/+2
| | | | | | | | | | | | | Have our own routines to convert between IPv4/IPv6 addresses and strings; that helps if, for example, we want to build binary versions of tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do. It also means that we don't require IPv6 library support on UN*X to print addresses (if somebody wants to build tcpdump for older UN*Xes lacking IPv6 support in the system library or in add-on libraries). Get rid of files in the missing directory that we don't need, and various no-longer-necessary autoconf tests.
* 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
|
* 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/+2
| | | | | | | | | | | | 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).
* Not all platforms we support define AF_INET6.Guy Harris2014-04-301-1/+3
|
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-2/+2
| | | | | | | | | 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-2/+2
| | | | | | | | 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/+2
| | | | | 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-3/+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
* Clean up the TLV processing loop.Guy Harris2014-02-031-16/+37
| | | | | | | | | We want to process TLVs until we run out of data, so make the main loop condition "length > 0". Break out of the loop if we see an NFULA_PAYLOAD TLV. Add in a bunch of length checks, and make those and existing length checks report "[|nflog]".
* Use the new libpcap <pcap/nflog.h> for NFLOG definitions and declarations.Guy Harris2014-02-021-21/+4
| | | | | | | | | | Use the header file for information about LINKTYPE_NFLOG files. Don't build the NFLOG printer if we don't have that header file. Fix some checks for pcap/XXX.h header files to look for "tcpdump-stdinc.h" rather than <tcpdump-stdinc.h>, so that we don't fail to find that header.
* Pull a bunch of headers into the only source file that includes them.Guy Harris2013-12-301-1/+15
| | | | | | 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.
* NFLOG: fix error messageDenis Ovsienko2013-10-311-1/+1
|
* NFLOG: more minor improvementsDenis Ovsienko2013-10-311-13/+9
| | | | Reduce pointer conversion and do version check before header decoding.
* nflog - minor changesPetar2013-10-291-21/+21
|
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-1/+1
| | | | | | Make sure all of them are declared const and most of them -- static. Proper declaration of token arrays is a common review point for new code that is based on existing decoders. Thus fix the issue at its root.
* NFLOG: remove header dependency, add a test caseDenis Ovsienko2013-09-091-3/+3
| | | | | | | | | | | | | This change removes detection of linux/netfilter/nfnetlink_log.h, which was only used to provide two constants. The constants are now defined in print-nflog.c, making it possible to compile (and test) the NFLOG decoder on all systems, not only Linux. There is now a test case for the decoder, it was produced on a Linux host with: iptables -A INPUT -p udp --source 74.82.42.42 -j NFLOG --nflog-group 20 dig @74.82.42.42 ...
* IP packet information printing from NFLOG packetPetar2013-08-141-11/+129
| | | | | | Added nflog.h to Makefile.in Alphabetical order in Makefile.in
* Clean up various things.Guy Harris2013-06-091-12/+10
| | | | | | Clean up white space, just add 104 (the length of the NFLOG header) to the pointer, and return the length of the NFLOG header from nflog_if_print(). Mark the caplen argument to nflog_print() as unused.
* Added IP information printing from NFLOG packetPetar2013-05-311-0/+38