diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-02 09:46:30 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-02 10:35:09 +0200 |
commit | dc8a38c2899c29b29c1893ae1eeab0e26a5a1ca6 (patch) | |
tree | c8a4aa4d75483aeca51d5f4ea5fdb23e2cf56f73 /print-802_11.c | |
parent | a4e0f7d9df751eec6e872b80ac05f3d7512d239f (diff) | |
download | tcpdump-dc8a38c2899c29b29c1893ae1eeab0e26a5a1ca6.tar.gz |
IEEE 802.11: Update the link-layer dissectors to void functions
Diffstat (limited to 'print-802_11.c')
-rw-r--r-- | print-802_11.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/print-802_11.c b/print-802_11.c index 270870e6..9c9e77cf 100644 --- a/print-802_11.c +++ b/print-802_11.c @@ -2265,12 +2265,12 @@ ieee802_11_print(netdissect_options *ndo, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -u_int +void ieee802_11_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { ndo->ndo_protocol = "802.11_if"; - return ieee802_11_print(ndo, p, h->len, h->caplen, 0, 0); + ndo->ndo_ll_hdr_len += ieee802_11_print(ndo, p, h->len, h->caplen, 0, 0); } @@ -3458,7 +3458,7 @@ ieee802_11_radio_avs_print(netdissect_options *ndo, * the AVS header, and the first 4 bytes of the header are used to * indicate whether it's a Prism header or an AVS header). */ -u_int +void prism_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { @@ -3469,33 +3469,39 @@ prism_if_print(netdissect_options *ndo, ndo->ndo_protocol = "prism_if"; if (caplen < 4) { nd_print_trunc(ndo); - return caplen; + ndo->ndo_ll_hdr_len += caplen; + return; } msgcode = GET_BE_U_4(p); if (msgcode == WLANCAP_MAGIC_COOKIE_V1 || - msgcode == WLANCAP_MAGIC_COOKIE_V2) - return ieee802_11_radio_avs_print(ndo, p, length, caplen); + msgcode == WLANCAP_MAGIC_COOKIE_V2) { + ndo->ndo_ll_hdr_len += ieee802_11_radio_avs_print(ndo, p, length, caplen); + return; + } if (caplen < PRISM_HDR_LEN) { nd_print_trunc(ndo); - return caplen; + ndo->ndo_ll_hdr_len += caplen; + return; } - return PRISM_HDR_LEN + ieee802_11_print(ndo, p + PRISM_HDR_LEN, - length - PRISM_HDR_LEN, caplen - PRISM_HDR_LEN, 0, 0); + p += PRISM_HDR_LEN; + length -= PRISM_HDR_LEN; + caplen -= PRISM_HDR_LEN; + ndo->ndo_ll_hdr_len += PRISM_HDR_LEN + ieee802_11_print(ndo, p, length, caplen, 0, 0); } /* * For DLT_IEEE802_11_RADIO; like DLT_IEEE802_11, but with an extra * header, containing information such as radio information. */ -u_int +void ieee802_11_radio_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { ndo->ndo_protocol = "802.11_radio_if"; - return ieee802_11_radio_print(ndo, p, h->len, h->caplen); + ndo->ndo_ll_hdr_len += ieee802_11_radio_print(ndo, p, h->len, h->caplen); } /* @@ -3503,10 +3509,10 @@ ieee802_11_radio_if_print(netdissect_options *ndo, * extra header, containing information such as radio information, * which we currently ignore. */ -u_int +void ieee802_11_radio_avs_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { ndo->ndo_protocol = "802.11_radio_avs_if"; - return ieee802_11_radio_avs_print(ndo, p, h->len, h->caplen); + ndo->ndo_ll_hdr_len += ieee802_11_radio_avs_print(ndo, p, h->len, h->caplen); } |