print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
print-lmp.c print-lspping.c print-lwapp.c \
print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-mptcp.c print-msdp.c \
- print-msnlb.c print-nfs.c print-ntp.c print-null.c print-olsr.c \
- print-openflow.c print-openflow-1.0.c print-ospf.c \
+ print-msnlb.c print-nfs.c print-ntp.c print-null.c print-nflog.c \
+ print-olsr.c print-openflow.c print-openflow-1.0.c print-ospf.c \
print-pgm.c print-pim.c \
print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \
print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \
extern u_int ipnet_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
extern u_int ppi_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
+extern u_int nflog_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
+
extern u_int ieee802_15_4_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
#ifdef INET6
--- /dev/null
+#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 _U_)
+{
+ ip_print(ndo, p, length);
+ return;
+}
+
+u_int
+nflog_if_print(struct netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
+{
+ if (h->len < 104 || h->caplen < 104) {
+ ND_PRINT((ndo, "[!nflog]"));
+ return h->caplen;
+ }
+
+ nflog_print(ndo, p + 104, h->len - 104, h->caplen - 104);
+
+ return 104;
+}
+
+#endif /* DLT_NFLOG */
static char tstr[] = " [|ospf2]";
-#ifdef WIN32
-#define inline __inline
-#endif /* WIN32 */
-
static int ospf_print_lshdr(const struct lsa_hdr *);
static const u_char *ospf_print_lsa(const struct lsa *);
static int ospf_decode_v2(const struct ospfhdr *, const u_char *);
static char tstr[] = " [|ospf3]";
-#ifdef WIN32
-#define inline __inline
-#endif /* WIN32 */
-
/* Forwards */
static void ospf6_print_ls_type(u_int, const rtrid_t *);
static int ospf6_print_lshdr(const struct lsa6_hdr *);
extern int inet_pton (int, const char *, void *);
extern int inet_aton (const char *cp, struct in_addr *addr);
+/*
+ * With MSVC, for C, __inline is used to make a function an inline.
+ */
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN 46
#endif
};
static struct ndo_printer ndo_printers[] = {
+#ifdef DLT_NFLOG
+ { nflog_if_print, DLT_NFLOG},
+#endif
{ ether_if_print, DLT_EN10MB },
#ifdef DLT_IPNET
{ ipnet_if_print, DLT_IPNET },