* 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"},
* 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:
/*
bp += sizeof(*wccp);
len -= sizeof(*wccp);
- printf(": ");
+ ND_PRINT(": ");
}
/* FALLTHROUGH */
case ETHERTYPE_IP:
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);
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;