]> 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 732903f84fbeebc79ae21cdac3fd276936f10336..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"},
@@ -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;