]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-gre.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-gre.c
index 30bb6c212a54d8c425463da3d72c0b30312cf8fa..1d545b3f8b076a2039e2e8b3300d34d7551b8f86 100644 (file)
@@ -44,9 +44,7 @@
  * Virtual Subnet ID (VSID) and an 8-bit FlowID.
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
 #include "addrtostr.h"
 #include "extract.h"
 #include "ethertype.h"
-
-
-#define        GRE_CP          0x8000          /* checksum present */
-#define        GRE_RP          0x4000          /* routing present */
-#define        GRE_KP          0x2000          /* key present */
-#define        GRE_SP          0x1000          /* sequence# present */
-#define        GRE_sP          0x0800          /* source routing */
-#define        GRE_AP          0x0080          /* acknowledgment# present */
+#include "gre.h"
 
 static const struct tok gre_flag_values[] = {
     { GRE_CP, "checksum present"},
@@ -239,7 +230,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
                 * use it for keep-alives; see, for example,
                 * https://www.cisco.com/c/en/us/support/docs/ip/generic-routing-encapsulation-gre/118370-technote-gre-00.html#anc1
                 */
-               printf("keep-alive");
+               ND_PRINT("keep-alive");
                break;
        case GRE_WCCP:
                /*
@@ -283,7 +274,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
                        bp += sizeof(*wccp);
                        len -= sizeof(*wccp);
 
-                       printf(": ");
+                       ND_PRINT(": ");
                }
                /* FALLTHROUGH */
        case ETHERTYPE_IP:
@@ -312,7 +303,10 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
                nsh_print(ndo, bp, len);
                break;
        case GRE_ERSPAN_I_II:
-               erspan_print(ndo, flags, bp, len);
+               erspan_i_ii_print(ndo, flags, bp, len);
+               break;
+       case GRE_ERSPAN_III:
+               erspan_iii_print(ndo, bp, len);
                break;
        case GRE_CDP:
                cdp_print(ndo, bp, len);
@@ -377,7 +371,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
        if (flags & GRE_KP) {
                /* Skip payload length? */
                ND_ICHECK_U(len, <, 2);
-               ND_TCHECK_LEN(bp, 2);
+               ND_TCHECK_2(bp);
                len -= 2;
                bp += 2;