]> The Tcpdump Group git mirrors - tcpdump/blob - print-nflog.c
Merge pull request #317 from tejblum/strict-aliasing
[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 _U_)
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 if (h->len < 104 || h->caplen < 104) {
27 ND_PRINT((ndo, "[!nflog]"));
28 return h->caplen;
29 }
30
31 nflog_print(ndo, p + 104, h->len - 104, h->caplen - 104);
32
33 return 104;
34 }
35
36 #endif /* DLT_NFLOG */