summaryrefslogtreecommitdiff
path: root/print-ether.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-16 17:23:21 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2019-03-26 21:06:24 +0100
commitee68aa36460d7efeca48747f33b7f2adc0900bfb (patch)
tree72c1b65d29301835c0e064b433ea685fc856a68e /print-ether.c
parent1af20c3adc4dfef93de41d4fcd02f0aeb6bbfd4e (diff)
downloadtcpdump-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-ether.c')
-rw-r--r--print-ether.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/print-ether.c b/print-ether.c
index ba488343..8e07bb32 100644
--- a/print-ether.c
+++ b/print-ether.c
@@ -118,8 +118,7 @@ ether_hdr_print(netdissect_options *ndo,
etheraddr_string(ndo, ehp->ether_shost),
etheraddr_string(ndo, ehp->ether_dhost));
- length_type = EXTRACT_BE_U_2(bp +
- (hdrlen - sizeof(ehp->ether_length_type)));
+ length_type = GET_BE_U_2(bp + (hdrlen - sizeof(ehp->ether_length_type)));
if (!ndo->ndo_qflag) {
if (length_type <= MAX_ETHERNET_LENGTH_VAL) {
ND_PRINT(", 802.3");
@@ -193,8 +192,7 @@ ether_print_hdr_len(netdissect_options *ndo,
src.addr_string = etheraddr_string;
dst.addr = ehp->ether_dhost;
dst.addr_string = etheraddr_string;
- length_type = EXTRACT_BE_U_2((const u_char *)ehp +
- (hdrlen - sizeof(ehp->ether_length_type)));
+ length_type = GET_BE_U_2((const u_char *)ehp + (hdrlen - sizeof(ehp->ether_length_type)));
recurse:
/*
@@ -229,12 +227,12 @@ recurse:
return (hdrlen + length);
}
if (ndo->ndo_eflag) {
- uint16_t tag = EXTRACT_BE_U_2(p);
+ uint16_t tag = GET_BE_U_2(p);
ND_PRINT("%s, ", ieee8021q_tci_string(tag));
}
- length_type = EXTRACT_BE_U_2(p + 2);
+ length_type = GET_BE_U_2(p + 2);
if (ndo->ndo_eflag && length_type > MAX_ETHERNET_LENGTH_VAL)
ND_PRINT("ethertype %s, ", tok2str(ethertype_values,"0x%04x", length_type));
p += 4;