diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-22 23:54:09 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-11-22 23:54:09 +0100 |
commit | da20bc56d6100b5275d6f85c4a25bac1dab4e57e (patch) | |
tree | 643c746e737c54d5a13d0b0083049d847d2cff24 /print-ether.c | |
parent | 3c8f3e13b03380742c24070f8a7b56fe12c6b8ee (diff) | |
download | tcpdump-da20bc56d6100b5275d6f85c4a25bac1dab4e57e.tar.gz |
Rename EXTRACT_ macros
Now all the macros have a name meaning a count in bytes.
With _S_: signed, _U_: unsigned
e.g.:
EXTRACT_BE_32BITS -> EXTRACT_BE_U_4
EXTRACT_LE_32BITS -> EXTRACT_LE_U_4
...
EXTRACT_BE_INT32 -> EXTRACT_BE_S_4
and have:
EXTRACT_8BITS -> EXTRACT_U_1
EXTRACT_INT8 -> EXTRACT_S_1
Diffstat (limited to 'print-ether.c')
-rw-r--r-- | print-ether.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/print-ether.c b/print-ether.c index 5ffbb273..8d8341ba 100644 --- a/print-ether.c +++ b/print-ether.c @@ -102,7 +102,7 @@ ether_hdr_print(netdissect_options *ndo, etheraddr_string(ndo, ESRC(ep)), etheraddr_string(ndo, EDST(ep)))); - length_type = EXTRACT_BE_16BITS(&ep->ether_length_type); + length_type = EXTRACT_BE_U_2(&ep->ether_length_type); if (!ndo->ndo_qflag) { if (length_type <= ETHERMTU) { ND_PRINT((ndo, ", 802.3")); @@ -168,7 +168,7 @@ ether_print(netdissect_options *ndo, src.addr_string = etheraddr_string; dst.addr = EDST(ep); dst.addr_string = etheraddr_string; - length_type = EXTRACT_BE_16BITS(&ep->ether_length_type); + length_type = EXTRACT_BE_U_2(&ep->ether_length_type); recurse: /* @@ -201,12 +201,12 @@ recurse: return (hdrlen + length); } if (ndo->ndo_eflag) { - uint16_t tag = EXTRACT_BE_16BITS(p); + uint16_t tag = EXTRACT_BE_U_2(p); ND_PRINT((ndo, "%s, ", ieee8021q_tci_string(tag))); } - length_type = EXTRACT_BE_16BITS(p + 2); + length_type = EXTRACT_BE_U_2(p + 2); if (ndo->ndo_eflag && length_type > ETHERMTU) ND_PRINT((ndo, "ethertype %s, ", tok2str(ethertype_values,"0x%04x", length_type))); p += 4; |