diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-06-16 17:23:21 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2019-03-26 21:06:24 +0100 |
commit | ee68aa36460d7efeca48747f33b7f2adc0900bfb (patch) | |
tree | 72c1b65d29301835c0e064b433ea685fc856a68e /print-pppoe.c | |
parent | 1af20c3adc4dfef93de41d4fcd02f0aeb6bbfd4e (diff) | |
download | tcpdump-ee68aa36460d7efeca48747f33b7f2adc0900bfb.tar.gz |
Use the new GET_ macros instead of the EXTRACT_ ones
The exceptions are currently:
Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer.
An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer
pointer.
Diffstat (limited to 'print-pppoe.c')
-rw-r--r-- | print-pppoe.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/print-pppoe.c b/print-pppoe.c index 5e6dd526..e3d6e222 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -106,11 +106,11 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) length -= PPPOE_HDRLEN; pppoe_packet = bp; ND_TCHECK_LEN(pppoe_packet, PPPOE_HDRLEN); - pppoe_ver = (EXTRACT_U_1(pppoe_packet) & 0xF0) >> 4; - pppoe_type = (EXTRACT_U_1(pppoe_packet) & 0x0F); - pppoe_code = EXTRACT_U_1(pppoe_packet + 1); - pppoe_sessionid = EXTRACT_BE_U_2(pppoe_packet + 2); - pppoe_length = EXTRACT_BE_U_2(pppoe_packet + 4); + pppoe_ver = (GET_U_1(pppoe_packet) & 0xF0) >> 4; + pppoe_type = (GET_U_1(pppoe_packet) & 0x0F); + pppoe_code = GET_U_1(pppoe_packet + 1); + pppoe_sessionid = GET_BE_U_2(pppoe_packet + 2); + pppoe_length = GET_BE_U_2(pppoe_packet + 4); pppoe_payload = pppoe_packet + PPPOE_HDRLEN; if (pppoe_ver != 1) { @@ -144,8 +144,8 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) */ while (tag_type && p < pppoe_payload + pppoe_length) { ND_TCHECK_4(p); - tag_type = EXTRACT_BE_U_2(p); - tag_len = EXTRACT_BE_U_2(p + 2); + tag_type = GET_BE_U_2(p); + tag_len = GET_BE_U_2(p + 2); p += 4; /* p points to tag_value */ @@ -158,8 +158,8 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) /* TODO print UTF-8 decoded text */ ND_TCHECK_LEN(p, tag_len); for (v = p; v < p + tag_len && tag_str_len < MAXTAGPRINT-1; v++) - if (ND_ISPRINT(EXTRACT_U_1(v))) { - tag_str[tag_str_len++] = EXTRACT_U_1(v); + if (ND_ISPRINT(GET_U_1(v))) { + tag_str[tag_str_len++] = GET_U_1(v); ascii_count++; } else { tag_str[tag_str_len++] = '.'; @@ -177,7 +177,7 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) /* Print hex, not fast to abuse printf but this doesn't get used much */ ND_PRINT(" [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type)); for (v=p; v<p+tag_len; v++) { - ND_PRINT("%02X", EXTRACT_U_1(v)); + ND_PRINT("%02X", GET_U_1(v)); } ND_PRINT("]"); } |