aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/gre/gre.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-04-18 10:23:56 +0000
committerOle Trøan <otroan@employees.org>2019-12-04 22:45:11 +0000
commit5f8f6173328f8d77feea5fd100e150c3094c11f0 (patch)
tree16849c6e7619b227a93ce9846f344da2cc96ef2d /src/vnet/gre/gre.h
parent79619c10142e15754e2f0b2ba26c20d415e7c36f (diff)
gre: Multi-point interfaces
Type: feature Change-Id: I0129ad6ace44a50a8a3b26db8e445cd06b2b49e8 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/gre/gre.h')
-rw-r--r--src/vnet/gre/gre.h57
1 files changed, 34 insertions, 23 deletions
diff --git a/src/vnet/gre/gre.h b/src/vnet/gre/gre.h
index 99fe4ace5b4..11bcddd51b3 100644
--- a/src/vnet/gre/gre.h
+++ b/src/vnet/gre/gre.h
@@ -26,6 +26,7 @@
#include <vnet/adj/adj_types.h>
extern vnet_hw_interface_class_t gre_hw_interface_class;
+extern vnet_hw_interface_class_t mgre_hw_interface_class;
typedef enum
{
@@ -36,34 +37,42 @@ typedef enum
} gre_error_t;
/**
+ * L3: GRE (i.e. this tunnel is in L3 mode)
+ * TEB: Transparent Ethernet Bridging - the tunnel is in L2 mode
+ * ERSPAN: type 2 - the tunnel is for port mirror SPAN output. Each tunnel is
+ * associated with a session ID and expected to be used for encap
+ * and output of mirrored packet from a L2 network only. There is
+ * no support for receiving ERSPAN packets from a GRE ERSPAN tunnel
+ */
+#define foreach_gre_tunnel_type \
+ _(L3, "L3") \
+ _(TEB, "TEB") \
+ _(ERSPAN, "ERSPAN") \
+
+/**
* @brief The GRE tunnel type
*/
typedef enum gre_tunnel_type_t_
{
- /**
- * L3 GRE (i.e. this tunnel is in L3 mode)
- */
- GRE_TUNNEL_TYPE_L3 = 0,
- /**
- * Transparent Ethernet Bridging - the tunnel is in L2 mode
- */
- GRE_TUNNEL_TYPE_TEB = 1,
- /**
- * ERSPAN type 2 - the tunnel is for port mirror SPAN output. Each tunnel is
- * associated with a session ID and expected to be used for encap and output
- * of mirrored packet from a L2 network only. There is no support for
- * receiving ERSPAN packets from a GRE ERSPAN tunnel in VPP.
- */
- GRE_TUNNEL_TYPE_ERSPAN = 2,
-} gre_tunnel_type_t;
+#define _(n, s) GRE_TUNNEL_TYPE_##n,
+ foreach_gre_tunnel_type
+#undef _
+} __clib_packed gre_tunnel_type_t;
-#define GRE_TUNNEL_TYPE_N (GRE_TUNNEL_TYPE_ERSPAN + 1)
+extern u8 *format_gre_tunnel_type (u8 * s, va_list * args);
-#define GRE_TUNNEL_TYPE_NAMES { \
- [GRE_TUNNEL_TYPE_L3] = "L3", \
- [GRE_TUNNEL_TYPE_TEB] = "TEB", \
- [GRE_TUNNEL_TYPE_ERSPAN] = "ERSPAN", \
-}
+#define foreach_gre_tunnel_mode \
+ _(P2P, "point-to-point") \
+ _(MP, "multi-point") \
+
+typedef enum gre_tunnel_mode_t_
+{
+#define _(n, s) GRE_TUNNEL_MODE_##n,
+ foreach_gre_tunnel_mode
+#undef _
+} __clib_packed gre_tunnel_mode_t;
+
+extern u8 *format_gre_tunnel_mode (u8 * s, va_list * args);
/**
* A GRE payload protocol registration
@@ -201,6 +210,7 @@ typedef struct
u32 hw_if_index;
u32 sw_if_index;
gre_tunnel_type_t type;
+ gre_tunnel_mode_t mode;
/**
* an L2 tunnel always rquires an L2 midchain. cache here for DP.
@@ -348,10 +358,11 @@ typedef struct
{
u8 is_add;
gre_tunnel_type_t type;
+ gre_tunnel_mode_t mode;
u8 is_ipv6;
u32 instance;
ip46_address_t src, dst;
- u32 outer_fib_id;
+ u32 outer_table_id;
u16 session_id;
} vnet_gre_tunnel_add_del_args_t;