#include <vnet/gre/gre.h>
#include <vnet/fib/fib_table.h>
+#include <vnet/tunnel/tunnel_types_api.h>
#include <vnet/ip/ip_types_api.h>
#include <vnet/vnet_msg_enum.h>
return (out);
}
-static int
-gre_tunnel_mode_decode (vl_api_gre_tunnel_mode_t in, gre_tunnel_mode_t * out)
-{
- switch (in)
- {
-#define _(n, v) \
- case GRE_API_TUNNEL_MODE_##n: \
- *out = GRE_TUNNEL_MODE_##n; \
- return (0);
- foreach_gre_tunnel_mode
-#undef _
- }
-
- return (VNET_API_ERROR_INVALID_VALUE_2);
-}
-
-static vl_api_gre_tunnel_mode_t
-gre_tunnel_mode_encode (gre_tunnel_mode_t in)
-{
- vl_api_gre_tunnel_mode_t out = GRE_API_TUNNEL_MODE_P2P;
-
- switch (in)
- {
-#define _(n, v) \
- case GRE_TUNNEL_MODE_##n: \
- out = GRE_API_TUNNEL_MODE_##n; \
- break;
- foreach_gre_tunnel_mode
-#undef _
- }
-
- return (out);
-}
-
static void vl_api_gre_tunnel_add_del_t_handler
(vl_api_gre_tunnel_add_del_t * mp)
{
if (rv)
goto out;
- rv = gre_tunnel_mode_decode (mp->tunnel.mode, &a->mode);
+ rv = tunnel_mode_decode (mp->tunnel.mode, &a->mode);
if (rv)
goto out;
(t->outer_fib_index, t->tunnel_dst.fp_proto));
rmp->tunnel.type = gre_tunnel_type_encode (t->type);
- rmp->tunnel.mode = gre_tunnel_mode_encode (t->mode);
+ rmp->tunnel.mode = tunnel_mode_encode (t->mode);
rmp->tunnel.instance = htonl (t->user_instance);
rmp->tunnel.sw_if_index = htonl (t->sw_if_index);
rmp->tunnel.session_id = htons (t->session_id);