summaryrefslogtreecommitdiff
path: root/print-gre.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-gre.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-gre.c')
-rw-r--r--print-gre.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/print-gre.c b/print-gre.c
index a11cb9b8..64768d6a 100644
--- a/print-gre.c
+++ b/print-gre.c
@@ -92,7 +92,7 @@ gre_print(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 2);
if (len < 2)
goto trunc;
- vers = EXTRACT_BE_16BITS(bp) & GRE_VERS_MASK;
+ vers = EXTRACT_BE_U_2(bp) & GRE_VERS_MASK;
ND_PRINT((ndo, "GREv%u",vers));
switch(vers) {
@@ -120,7 +120,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
uint16_t flags, prot;
/* 16 bits ND_TCHECKed in gre_print() */
- flags = EXTRACT_BE_16BITS(bp);
+ flags = EXTRACT_BE_U_2(bp);
if (ndo->ndo_vflag)
ND_PRINT((ndo, ", Flags [%s]",
bittok2str(gre_flag_values,"none",flags)));
@@ -131,7 +131,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 2);
if (len < 2)
goto trunc;
- prot = EXTRACT_BE_16BITS(bp);
+ prot = EXTRACT_BE_U_2(bp);
len -= 2;
bp += 2;
@@ -140,14 +140,14 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
if (len < 2)
goto trunc;
if (ndo->ndo_vflag)
- ND_PRINT((ndo, ", sum 0x%x", EXTRACT_BE_16BITS(bp)));
+ ND_PRINT((ndo, ", sum 0x%x", EXTRACT_BE_U_2(bp)));
bp += 2;
len -= 2;
ND_TCHECK2(*bp, 2);
if (len < 2)
goto trunc;
- ND_PRINT((ndo, ", off 0x%x", EXTRACT_BE_16BITS(bp)));
+ ND_PRINT((ndo, ", off 0x%x", EXTRACT_BE_U_2(bp)));
bp += 2;
len -= 2;
}
@@ -156,7 +156,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 4);
if (len < 4)
goto trunc;
- ND_PRINT((ndo, ", key=0x%x", EXTRACT_BE_32BITS(bp)));
+ ND_PRINT((ndo, ", key=0x%x", EXTRACT_BE_U_4(bp)));
bp += 4;
len -= 4;
}
@@ -165,7 +165,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 4);
if (len < 4)
goto trunc;
- ND_PRINT((ndo, ", seq %u", EXTRACT_BE_32BITS(bp)));
+ ND_PRINT((ndo, ", seq %u", EXTRACT_BE_U_4(bp)));
bp += 4;
len -= 4;
}
@@ -179,9 +179,9 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 4);
if (len < 4)
goto trunc;
- af = EXTRACT_BE_16BITS(bp);
- sreoff = EXTRACT_8BITS(bp + 2);
- srelen = EXTRACT_8BITS(bp + 3);
+ af = EXTRACT_BE_U_2(bp);
+ sreoff = EXTRACT_U_1(bp + 2);
+ srelen = EXTRACT_U_1(bp + 3);
bp += 4;
len -= 4;
@@ -248,7 +248,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
uint16_t flags, prot;
/* 16 bits ND_TCHECKed in gre_print() */
- flags = EXTRACT_BE_16BITS(bp);
+ flags = EXTRACT_BE_U_2(bp);
len -= 2;
bp += 2;
@@ -259,7 +259,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 2);
if (len < 2)
goto trunc;
- prot = EXTRACT_BE_16BITS(bp);
+ prot = EXTRACT_BE_U_2(bp);
len -= 2;
bp += 2;
@@ -270,7 +270,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 4);
if (len < 4)
goto trunc;
- k = EXTRACT_BE_32BITS(bp);
+ k = EXTRACT_BE_U_4(bp);
ND_PRINT((ndo, ", call %d", k & 0xffff));
len -= 4;
bp += 4;
@@ -280,7 +280,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 4);
if (len < 4)
goto trunc;
- ND_PRINT((ndo, ", seq %u", EXTRACT_BE_32BITS(bp)));
+ ND_PRINT((ndo, ", seq %u", EXTRACT_BE_U_4(bp)));
bp += 4;
len -= 4;
}
@@ -289,7 +289,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
ND_TCHECK2(*bp, 4);
if (len < 4)
goto trunc;
- ND_PRINT((ndo, ", ack %u", EXTRACT_BE_32BITS(bp)));
+ ND_PRINT((ndo, ", ack %u", EXTRACT_BE_U_4(bp)));
bp += 4;
len -= 4;
}
@@ -414,7 +414,7 @@ gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen,
ND_PRINT((ndo, " %s%x",
((bp - up) == sreoff) ? "*" : "",
- EXTRACT_BE_16BITS(bp)));
+ EXTRACT_BE_U_2(bp)));
bp += 2;
len -= 2;