Commit Graph

15 Commits

Author SHA1 Message Date
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
c305943806 Clean up the TLV processing loop.
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]".
2014-02-03 02:14:24 -08:00
Guy Harris
b485483022 Use the new libpcap <pcap/nflog.h> for NFLOG definitions and declarations.
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.
2014-02-02 20:14:26 -08: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
Denis Ovsienko
7781ecd3a2 NFLOG: fix error message 2013-10-31 19:16:05 +04:00
Denis Ovsienko
fc133e2edb NFLOG: more minor improvements
Reduce pointer conversion and do version check before header decoding.
2013-10-31 19:01:56 +04:00
Petar
a26b064bcb nflog - minor changes 2013-10-29 17:37:21 +01:00
Denis Ovsienko
7de355927b justify declarations of struct tok arrays
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.
2013-09-24 20:54:03 +04:00
Denis Ovsienko
af23176926 NFLOG: remove header dependency, add a test case
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 ...
2013-09-09 14:45:31 +04:00
Petar
05ec05a87b IP packet information printing from NFLOG packet
Added nflog.h to Makefile.in

Alphabetical order in Makefile.in
2013-08-14 09:38:49 +02:00
Guy Harris
85f8a99849 Clean up various things.
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.
2013-06-09 18:16:02 -07:00
Petar
20ad83658d Added IP information printing from NFLOG packet 2013-05-31 12:16:13 +02:00