* https://web.archive.org/web/20160328114748/http://www.cacetech.com/documents/PPI%20Header%20format%201.0.7.pdf
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
ppi_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
- if_printer_t printer;
+ if_printer printer;
const ppi_header_t *hdr;
u_int caplen = h->caplen;
u_int length = h->len;
ndo->ndo_protocol = "ppi";
if (caplen < sizeof(ppi_header_t)) {
nd_print_trunc(ndo);
- ndo->ndo_ll_header_length += caplen;
+ ndo->ndo_ll_hdr_len += caplen;
return;
}
ND_PRINT(" [length %u < %zu or > 65532]", len,
sizeof(ppi_header_t));
nd_print_invalid(ndo);
- ndo->ndo_ll_header_length += caplen;
+ ndo->ndo_ll_hdr_len += caplen;
return;
}
if (caplen < len) {
* bother.
*/
nd_print_trunc(ndo);
- ndo->ndo_ll_header_length += caplen;
+ ndo->ndo_ll_hdr_len += caplen;
return;
}
dlt = GET_LE_U_4(hdr->ppi_dlt);
caplen -= len;
p += len;
- printer = lookup_printer(ndo, dlt);
- if (printer.printer != NULL) {
+ printer = lookup_printer(dlt);
+ if (printer != NULL) {
nhdr = *h;
nhdr.caplen = caplen;
nhdr.len = length;
- if (ndo->ndo_void_printer == TRUE) {
- printer.void_printer(ndo, &nhdr, p);
- hdrlen = ndo->ndo_ll_header_length;
- } else
- hdrlen = printer.uint_printer(ndo, &nhdr, p);
+ printer(ndo, &nhdr, p);
+ hdrlen = ndo->ndo_ll_hdr_len;
} else {
if (!ndo->ndo_eflag)
ppi_header_print(ndo, (const u_char *)hdr, length + len);
ND_DEFAULTPRINT(p, caplen);
hdrlen = 0;
}
- ndo->ndo_ll_header_length += len + hdrlen;
- return;
+ ndo->ndo_ll_hdr_len += len + hdrlen;
}
#endif /* DLT_PPI */