extern u_int ieee802_15_4_tap_if_print IF_PRINTER_ARGS;
extern u_int ipfc_if_print IF_PRINTER_ARGS;
extern u_int ipoib_if_print IF_PRINTER_ARGS;
-extern u_int ipnet_if_print IF_PRINTER_ARGS;
+extern void ipnet_if_print IF_PRINTER_ARGS;
extern u_int juniper_atm1_if_print IF_PRINTER_ARGS;
extern u_int juniper_atm2_if_print IF_PRINTER_ARGS;
extern u_int juniper_chdlc_if_print IF_PRINTER_ARGS;
{
const ipnet_hdr_t *hdr;
- ndo->ndo_protocol = "ipnet";
- if (caplen < sizeof(ipnet_hdr_t))
- goto trunc;
+ if (caplen < sizeof(ipnet_hdr_t)) {
+ ndo->ndo_ll_header_length += caplen;
+ nd_print_trunc(ndo);
+ return;
+ }
+ ndo->ndo_ll_header_length += sizeof(ipnet_hdr_t);
if (ndo->ndo_eflag)
ipnet_hdr_print(ndo, p, length);
hdr = (const ipnet_hdr_t *)p;
p += sizeof(ipnet_hdr_t);
- ND_TCHECK_1(hdr->iph_family);
switch (GET_U_1(hdr->iph_family)) {
case IPH_AF_INET:
break;
}
return;
-trunc:
- nd_print_trunc(ndo);
}
/*
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
ipnet_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
- ndo->ndo_protocol = "ipnet_if";
+ ndo->ndo_protocol = "ipnet";
ipnet_print(ndo, p, h->len, h->caplen);
-
- return (sizeof(ipnet_hdr_t));
}
#endif /* DLT_IPNET */
static const struct uint_printer uint_printers[] = {
{ ether_if_print, DLT_EN10MB },
-#ifdef DLT_IPNET
- { ipnet_if_print, DLT_IPNET },
-#endif
#ifdef DLT_IEEE802_15_4
{ ieee802_15_4_if_print, DLT_IEEE802_15_4 },
#endif
#endif
#ifdef DLT_ENC
{ enc_if_print, DLT_ENC },
+#endif
+#ifdef DLT_IPNET
+ { ipnet_if_print, DLT_IPNET },
#endif
{ null_if_print, DLT_NULL },
#ifdef DLT_LOOP