summaryrefslogtreecommitdiffstats
path: root/src/vnet/gre/gre.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-12-29 23:55:18 +0000
committerDamjan Marion <dmarion@me.com>2020-01-27 20:40:30 +0000
commit59ff918ea5b86112ffc89054aa38107703354585 (patch)
tree0e6dc887ead19b7be828954a08b1e15da81ddb58 /src/vnet/gre/gre.h
parent3b37125bdb0251181f90a429a4532b339711cf89 (diff)
tunnel: Common types for IP tunnels
Type: refactor Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I18dcdb7af3e327f6cacdbcb1e52b89f13d6ba6e2
Diffstat (limited to 'src/vnet/gre/gre.h')
-rw-r--r--src/vnet/gre/gre.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/vnet/gre/gre.h b/src/vnet/gre/gre.h
index 6989cf48ea0..7f6ff0be9dc 100644
--- a/src/vnet/gre/gre.h
+++ b/src/vnet/gre/gre.h
@@ -24,6 +24,7 @@
#include <vnet/pg/pg.h>
#include <vnet/ip/format.h>
#include <vnet/adj/adj_types.h>
+#include <vnet/tunnel/tunnel.h>
extern vnet_hw_interface_class_t gre_hw_interface_class;
extern vnet_hw_interface_class_t mgre_hw_interface_class;
@@ -61,18 +62,6 @@ typedef enum gre_tunnel_type_t_
extern u8 *format_gre_tunnel_type (u8 * s, va_list * args);
-#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
@@ -107,7 +96,7 @@ typedef struct gre_tunnel_key_common_t_
u32 fib_index;
u16 session_id;
gre_tunnel_type_t type;
- gre_tunnel_mode_t mode;
+ tunnel_mode_t mode;
};
u64 as_u64;
};
@@ -215,7 +204,7 @@ typedef struct
u32 hw_if_index;
u32 sw_if_index;
gre_tunnel_type_t type;
- gre_tunnel_mode_t mode;
+ tunnel_mode_t mode;
/**
* an L2 tunnel always rquires an L2 midchain. cache here for DP.
@@ -363,7 +352,7 @@ typedef struct
{
u8 is_add;
gre_tunnel_type_t type;
- gre_tunnel_mode_t mode;
+ tunnel_mode_t mode;
u8 is_ipv6;
u32 instance;
ip46_address_t src, dst;
@@ -379,7 +368,7 @@ gre_mk_key4 (ip4_address_t src,
ip4_address_t dst,
u32 fib_index,
gre_tunnel_type_t ttype,
- gre_tunnel_mode_t tmode, u16 session_id, gre_tunnel_key4_t * key)
+ tunnel_mode_t tmode, u16 session_id, gre_tunnel_key4_t * key)
{
key->gtk_src = src;
key->gtk_dst = dst;
@@ -402,7 +391,7 @@ gre_mk_key6 (const ip6_address_t * src,
const ip6_address_t * dst,
u32 fib_index,
gre_tunnel_type_t ttype,
- gre_tunnel_mode_t tmode, u16 session_id, gre_tunnel_key6_t * key)
+ tunnel_mode_t tmode, u16 session_id, gre_tunnel_key6_t * key)
{
key->gtk_src = *src;
key->gtk_dst = *dst;