From b30f3843b93c11e897e6d8888a91abf709a716ae Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 6 Aug 2020 19:12:49 +0200 Subject: Apply the last step of the new way to update the link-layer header length All the link-layer dissectors are now void functions. All the functions were moved to the void_printers[] array. Rename this array to printers[]. Remove the uint_printers[] array, now empty. Remove the 'ndo_void_printer' flag field, now useless, from netdissect_options. Remove other transitional code. --- print-ppi.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'print-ppi.c') diff --git a/print-ppi.c b/print-ppi.c index 17fd9833..8534b00c 100644 --- a/print-ppi.c +++ b/print-ppi.c @@ -67,7 +67,7 @@ void 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; @@ -111,16 +111,13 @@ ppi_if_print(netdissect_options *ndo, 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_hdr_len; - } 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); -- cgit v1.2.1