summaryrefslogtreecommitdiff
path: root/print-chdlc.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-22 23:54:09 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-22 23:54:09 +0100
commitda20bc56d6100b5275d6f85c4a25bac1dab4e57e (patch)
tree643c746e737c54d5a13d0b0083049d847d2cff24 /print-chdlc.c
parent3c8f3e13b03380742c24070f8a7b56fe12c6b8ee (diff)
downloadtcpdump-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-chdlc.c')
-rw-r--r--print-chdlc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/print-chdlc.c b/print-chdlc.c
index 2e6481a6..1fdd37b9 100644
--- a/print-chdlc.c
+++ b/print-chdlc.c
@@ -59,7 +59,7 @@ chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length)
if (length < CHDLC_HDRLEN)
goto trunc;
ND_TCHECK2(*p, CHDLC_HDRLEN);
- proto = EXTRACT_BE_16BITS(p + 2);
+ proto = EXTRACT_BE_U_2(p + 2);
if (ndo->ndo_eflag) {
ND_PRINT((ndo, "%s, ethertype %s (0x%04x), length %u: ",
tok2str(chdlc_cast_values, "0x%02x", p[0]),
@@ -151,7 +151,7 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
slarp = (const struct cisco_slarp *)cp;
ND_TCHECK2(*slarp, SLARP_MIN_LEN);
- switch (EXTRACT_BE_32BITS(&slarp->code)) {
+ switch (EXTRACT_BE_U_4(&slarp->code)) {
case SLARP_REQUEST:
ND_PRINT((ndo, "request"));
/*
@@ -171,14 +171,14 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
break;
case SLARP_KEEPALIVE:
ND_PRINT((ndo, "keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x",
- EXTRACT_BE_32BITS(&slarp->un.keep.myseq),
- EXTRACT_BE_32BITS(&slarp->un.keep.yourseq),
- EXTRACT_BE_16BITS(&slarp->un.keep.rel)));
+ EXTRACT_BE_U_4(&slarp->un.keep.myseq),
+ EXTRACT_BE_U_4(&slarp->un.keep.yourseq),
+ EXTRACT_BE_U_2(&slarp->un.keep.rel)));
if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */
cp += SLARP_MIN_LEN;
ND_TCHECK2(*cp, 4);
- sec = EXTRACT_BE_32BITS(cp) / 1000;
+ sec = EXTRACT_BE_U_4(cp) / 1000;
min = sec / 60; sec -= min * 60;
hrs = min / 60; min -= hrs * 60;
days = hrs / 24; hrs -= days * 24;
@@ -186,7 +186,7 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
}
break;
default:
- ND_PRINT((ndo, "0x%02x unknown", EXTRACT_BE_32BITS(&slarp->code)));
+ ND_PRINT((ndo, "0x%02x unknown", EXTRACT_BE_U_4(&slarp->code)));
if (ndo->ndo_vflag <= 1)
print_unknown_data(ndo,cp+4,"\n\t",length-4);
break;