diff options
author | Petar <petar.alilovic@gmail.com> | 2013-05-31 12:16:13 +0200 |
---|---|---|
committer | Petar <petar.alilovic@gmail.com> | 2013-05-31 12:16:13 +0200 |
commit | 20ad83658d2ffe2b7a63cf47e8d6292909606f68 (patch) | |
tree | b7cde8bccc69b7e82b675abbc2f399fcbe0fcf96 /print-nflog.c | |
parent | 62e953465041494c8b3be83927267f373e9dd6ef (diff) | |
download | tcpdump-20ad83658d2ffe2b7a63cf47e8d6292909606f68.tar.gz |
Added IP information printing from NFLOG packet
Diffstat (limited to 'print-nflog.c')
-rw-r--r-- | print-nflog.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/print-nflog.c b/print-nflog.c new file mode 100644 index 00000000..5cce7488 --- /dev/null +++ b/print-nflog.c @@ -0,0 +1,38 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <tcpdump-stdinc.h> + +#include <stdio.h> +#include <pcap.h> + +#include "netdissect.h" +#include "interface.h" + +#ifdef DLT_NFLOG + +static void +nflog_print(struct netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) +{ + ip_print(ndo, p, length); + return; +} + +u_int +nflog_if_print(struct netdissect_options *ndo, + const struct pcap_pkthdr *h, const u_char *p) +{ + int j = 0; + + /* Discard NFLOG header */ + for (j = 0; j < 104; j++) { + *p++; + } + + nflog_print(ndo, p, h->len - 104, h->caplen - 104); + + return 0; +} + +#endif /* DLT_NFLOG */ |