--- /dev/null
+/* $OpenBSD: print-gre.c,v 1.6 2002/10/30 03:04:04 fgsch Exp $ */
+
+/*
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* \summary: Header flags for Generic Routing Encapsulation (GRE) */
+
+#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 */
#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "extract.h"
+#include "gre.h"
#define ERSPAN2_VER_SHIFT 28
#define ERSPAN2_VER_MASK (0xfU << ERSPAN2_VER_SHIFT)
#define ERSPAN2_INDEX_SHIFT 0
#define ERSPAN2_INDEX_MASK (0xfffffU << ERSPAN2_INDEX_SHIFT)
-/*
- * XXX - eh?
- */
-#define GRE_SP 0x1000 /* sequence# present */
-
void
erspan_print(netdissect_options *ndo, uint16_t flags, const u_char *bp, u_int len)
{
#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"},