summaryrefslogtreecommitdiff
path: root/print-pktap.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-03-28 10:40:28 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-03-28 10:44:30 +0100
commita0d6dc5065c803bc3f8be2260d8b5657a663d78e (patch)
treeadd3dff1ccea34aa459042cf8ebfacaec0c1c159 /print-pktap.c
parenta80bcdd550e701299d6b04f864922b43e4b69dd8 (diff)
downloadtcpdump-a0d6dc5065c803bc3f8be2260d8b5657a663d78e.tar.gz
PKTAP: Update the link-layer dissector to a void function
Moreover: Remove trailing "_if" from protocol name. Update the output of a test accordingly.
Diffstat (limited to 'print-pktap.c')
-rw-r--r--print-pktap.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/print-pktap.c b/print-pktap.c
index 182378ef..b38ad641 100644
--- a/print-pktap.c
+++ b/print-pktap.c
@@ -95,7 +95,7 @@ pktap_header_print(netdissect_options *ndo, const u_char *bp, u_int length)
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
pktap_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
@@ -106,10 +106,11 @@ pktap_if_print(netdissect_options *ndo,
const pktap_header_t *hdr;
struct pcap_pkthdr nhdr;
- ndo->ndo_protocol = "pktap_if";
+ ndo->ndo_protocol = "pktap";
if (caplen < sizeof(pktap_header_t)) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_header_length += caplen;
+ return;
}
hdr = (const pktap_header_t *)p;
dlt = GET_LE_U_4(hdr->pkt_dlt);
@@ -123,11 +124,13 @@ pktap_if_print(netdissect_options *ndo,
* be expanded in the future)?
*/
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_header_length += caplen;
+ return;
}
if (caplen < hdrlen) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_header_length += caplen;
+ return;
}
if (ndo->ndo_eflag)
@@ -166,6 +169,7 @@ pktap_if_print(netdissect_options *ndo,
break;
}
- return (hdrlen);
+ ndo->ndo_ll_header_length += hdrlen;
+ return;
}
#endif /* DLT_PKTAP */