extern u_int mfr_if_print IF_PRINTER_ARGS;
extern u_int netanalyzer_if_print IF_PRINTER_ARGS;
extern u_int netanalyzer_transparent_if_print IF_PRINTER_ARGS;
-extern u_int nflog_if_print IF_PRINTER_ARGS;
+extern void nflog_if_print IF_PRINTER_ARGS;
extern void null_if_print IF_PRINTER_ARGS;
extern u_int pflog_if_print IF_PRINTER_ARGS;
extern void pktap_if_print IF_PRINTER_ARGS;
ND_PRINT(", length %u: ", length);
}
-u_int
+void
nflog_if_print(netdissect_options *ndo,
- const struct pcap_pkthdr *h, const u_char *p)
+ const struct pcap_pkthdr *h, const u_char *p)
{
const nflog_hdr_t *hdr = (const nflog_hdr_t *)p;
uint16_t size;
u_int caplen = h->caplen;
u_int length = h->len;
- ndo->ndo_protocol = "nflog_if";
- if (caplen < NFLOG_HDR_LEN)
- goto trunc;
+ ndo->ndo_protocol = "nflog";
+ if (caplen < NFLOG_HDR_LEN) {
+ ndo->ndo_ll_header_length += caplen;
+ return;
+ }
+ ndo->ndo_ll_header_length += NFLOG_HDR_LEN;
ND_TCHECK_SIZE(hdr);
if (GET_U_1(hdr->nflog_version) != 0) {
ND_PRINT("version %u (unknown)", GET_U_1(hdr->nflog_version));
- return h_size;
+ return;
}
if (ndo->ndo_eflag)
break;
}
- return h_size;
+ ndo->ndo_ll_header_length += h_size - NFLOG_HDR_LEN;
+ return;
trunc:
nd_print_trunc(ndo);
- return h_size;
+ ndo->ndo_ll_header_length += h_size - NFLOG_HDR_LEN;
+ return;
}
#endif /* DLT_NFLOG */
#ifdef DLT_NETANALYZER_TRANSPARENT
{ netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
#endif
-#ifdef DLT_NFLOG
- { nflog_if_print, DLT_NFLOG},
-#endif
#ifdef DLT_CIP
{ cip_if_print, DLT_CIP },
#endif
#endif
#ifdef DLT_IPNET
{ ipnet_if_print, DLT_IPNET },
+#endif
+#ifdef DLT_NFLOG
+ { nflog_if_print, DLT_NFLOG},
#endif
{ null_if_print, DLT_NULL },
#ifdef DLT_LOOP