diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-06 19:12:49 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-06 22:55:05 +0200 |
commit | b30f3843b93c11e897e6d8888a91abf709a716ae (patch) | |
tree | f896ae7aeb0b456076d21243c3d130bedbeaf75b /print-pktap.c | |
parent | 0c93b15d38b3f63047344fcb2ea920e73498bb3d (diff) | |
download | tcpdump-b30f3843b93c11e897e6d8888a91abf709a716ae.tar.gz |
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.
Diffstat (limited to 'print-pktap.c')
-rw-r--r-- | print-pktap.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/print-pktap.c b/print-pktap.c index 43042d97..5365617d 100644 --- a/print-pktap.c +++ b/print-pktap.c @@ -102,7 +102,7 @@ pktap_if_print(netdissect_options *ndo, uint32_t dlt, hdrlen, rectype; u_int caplen = h->caplen; u_int length = h->len; - if_printer_t printer; + if_printer printer; const pktap_header_t *hdr; struct pcap_pkthdr nhdr; @@ -148,16 +148,13 @@ pktap_if_print(netdissect_options *ndo, break; case PKT_REC_PACKET: - 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) pktap_header_print(ndo, (const u_char *)hdr, |