]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-gre.c
Rename EXTRACT_ macros
[tcpdump] / print-gre.c
index a11cb9b84d3d940653a723b5c916a13cc9ebc5fb..64768d6a0c10a1a48999fca9fdc401fcba0f2064 100644 (file)
@@ -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;