]> The Tcpdump Group git mirrors - tcpdump/blob - print-nflog.c
Merge remote-tracking branch 'mcrhub/master'
[tcpdump] / print-nflog.c
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4
5 #include <tcpdump-stdinc.h>
6
7 #include <stdio.h>
8 #include <pcap.h>
9
10 #include "netdissect.h"
11 #include "interface.h"
12
13 #ifdef DLT_NFLOG
14
15 static void
16 nflog_print(struct netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
17 {
18 ip_print(ndo, p, length);
19 return;
20 }
21
22 u_int
23 nflog_if_print(struct netdissect_options *ndo,
24 const struct pcap_pkthdr *h, const u_char *p)
25 {
26 int j = 0;
27
28 /* Discard NFLOG header */
29 for (j = 0; j < 104; j++) {
30 *p++;
31 }
32
33 nflog_print(ndo, p, h->len - 104, h->caplen - 104);
34
35 return 0;
36 }
37
38 #endif /* DLT_NFLOG */