*/
#include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
#include <vnet/gre/gre.h>
#include <vnet/ip/format.h>
-#include <vnet/fib/ip4_fib.h>
-#include <vnet/fib/ip6_fib.h>
+#include <vnet/fib/fib_table.h>
#include <vnet/adj/adj_midchain.h>
#include <vnet/adj/adj_nbr.h>
#include <vnet/mpls/mpls.h>
}
/**
- * An NHRP entry has been added
+ * An TEIB entry has been added
*/
static void
gre_teib_entry_added (const teib_entry_t * ne)
{
gre_main_t *gm = &gre_main;
- const ip46_address_t *nh;
+ const ip_address_t *nh;
gre_tunnel_key_t key;
gre_tunnel_t *t;
u32 sw_if_index;
};
nh = teib_entry_get_peer (ne);
adj_nbr_walk_nh (teib_entry_get_sw_if_index (ne),
- (ip46_address_is_ip4 (nh) ?
+ (AF_IP4 == ip_addr_version (nh) ?
FIB_PROTOCOL_IP4 :
- FIB_PROTOCOL_IP6), nh, mgre_mk_complete_walk, &ctx);
+ FIB_PROTOCOL_IP6),
+ &ip_addr_46 (nh), mgre_mk_complete_walk, &ctx);
}
static void
gre_teib_entry_deleted (const teib_entry_t * ne)
{
gre_main_t *gm = &gre_main;
- const ip46_address_t *nh;
+ const ip_address_t *nh;
gre_tunnel_key_t key;
gre_tunnel_t *t;
u32 sw_if_index;
/* make all the adjacencies incomplete */
adj_nbr_walk_nh (teib_entry_get_sw_if_index (ne),
- (ip46_address_is_ip4 (nh) ?
+ (AF_IP4 == ip_addr_version (nh) ?
FIB_PROTOCOL_IP4 :
- FIB_PROTOCOL_IP6), nh, mgre_mk_incomplete_walk, t);
+ FIB_PROTOCOL_IP6),
+ &ip_addr_46 (nh), mgre_mk_incomplete_walk, t);
}
static walk_rc_t
{
u32 outer_fib_index;
- if (!a->is_ipv6)
- outer_fib_index = ip4_fib_index_from_table_id (a->outer_table_id);
- else
- outer_fib_index = ip6_fib_index_from_table_id (a->outer_table_id);
+ outer_fib_index = fib_table_find ((a->is_ipv6 ?
+ FIB_PROTOCOL_IP6 :
+ FIB_PROTOCOL_IP4), a->outer_table_id);
if (~0 == outer_fib_index)
return VNET_API_ERROR_NO_SUCH_FIB;
VLIB_CLI_COMMAND (create_gre_tunnel_command, static) = {
.path = "create gre tunnel",
.short_help = "create gre tunnel src <addr> dst <addr> [instance <n>] "
- "[outer-fib-id <fib>] [teb | erspan <session-id>] [del]",
+ "[outer-fib-id <fib>] [teb | erspan <session-id>] [del] "
+ "[multipoint]",
.function = create_gre_tunnel_command_fn,
};
/* *INDENT-ON* */