#include <string.h>
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "addrtoname.h"
int llc_hdrlen;
ndo->ndo_protocol = "ipfc";
- if (caplen < IPFC_HDRLEN)
- goto trunc;
+ ND_TCHECK_LEN(p, IPFC_HDRLEN);
/*
* Get the network addresses into a canonical form
*/
- ND_TCHECK_SIZE(ipfcp);
extract_ipfc_addrs(ipfcp, (char *)srcmac, (char *)dstmac);
if (ndo->ndo_eflag)
llc_hdrlen = -llc_hdrlen;
}
return (IPFC_HDRLEN + llc_hdrlen);
-trunc:
- nd_print_trunc(ndo);
- return caplen;
}
/*
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
ipfc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
- ndo->ndo_protocol = "ipfc_if";
- return (ipfc_print(ndo, p, h->len, h->caplen));
+ ndo->ndo_protocol = "ipfc";
+ ndo->ndo_ll_hdr_len += ipfc_print(ndo, p, h->len, h->caplen);
}