aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/lisp-gpe/lisp_gpe.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-05-19 14:25:44 +0200
committerFilip Tehlar <ftehlar@cisco.com>2016-05-23 09:15:39 +0200
commit53f09e36f97a28a42a2e3eb58032c75691de4f4c (patch)
tree262b23ab69175d30a8e98fb47310556c88b0c551 /vnet/vnet/lisp-gpe/lisp_gpe.c
parent071d610dc446f2914c0ca4c709be38719baa041c (diff)
Add LISP RTR support
Change-Id: I8a3770f8f1cd1fde6765b81d35aacaaf4ff98b82 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vnet/vnet/lisp-gpe/lisp_gpe.c')
-rw-r--r--vnet/vnet/lisp-gpe/lisp_gpe.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/vnet/vnet/lisp-gpe/lisp_gpe.c b/vnet/vnet/lisp-gpe/lisp_gpe.c
index c00a9cf43b6..35e16bbcf7c 100644
--- a/vnet/vnet/lisp-gpe/lisp_gpe.c
+++ b/vnet/vnet/lisp-gpe/lisp_gpe.c
@@ -195,7 +195,14 @@ add_del_negative_fwd_entry (lisp_gpe_main_t * lgm,
/* TODO check if route/next-hop for eid exists in fib and add
* more specific for the eid with the next-hop found */
case SEND_MAP_REQUEST:
- /* TODO insert tunnel that always sends map-request */
+ /* insert tunnel that always sends map-request */
+ adj.rewrite_header.sw_if_index = ~0;
+ adj.lookup_next_index = (u32) (ip_prefix_version(dpref) == IP4) ?
+ LGPE_IP4_LOOKUP_NEXT_LISP_CP_LOOKUP:
+ LGPE_IP6_LOOKUP_NEXT_LISP_CP_LOOKUP;
+ /* add/delete route for prefix */
+ return ip_sd_fib_add_del_route (lgm, dpref, spref, a->table_id, &adj,
+ a->is_add);
case DROP:
/* for drop fwd entries, just add route, no need to add encap tunnel */
adj.lookup_next_index = (u32) (ip_prefix_version(dpref) == IP4 ?
@@ -204,7 +211,6 @@ add_del_negative_fwd_entry (lisp_gpe_main_t * lgm,
/* add/delete route for prefix */
return ip_sd_fib_add_del_route (lgm, dpref, spref, a->table_id, &adj,
a->is_add);
- break;
default:
return -1;
}
@@ -546,6 +552,27 @@ VLIB_CLI_COMMAND (enable_disable_lisp_gpe_command, static) = {
.function = lisp_gpe_enable_disable_command_fn,
};
+static clib_error_t *
+lisp_show_iface_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ lisp_gpe_main_t * lgm = &lisp_gpe_main;
+ hash_pair_t * p;
+
+ vlib_cli_output (vm, "%=10s%=12s", "vrf", "hw_if_index");
+ hash_foreach_pair (p, lgm->lisp_gpe_hw_if_index_by_table_id, ({
+ vlib_cli_output (vm, "%=10d%=10d", p->key, p->value[0]);
+ }));
+ return 0;
+}
+
+VLIB_CLI_COMMAND (lisp_show_iface_command) = {
+ .path = "show lisp gpe interface",
+ .short_help = "show lisp gpe interface",
+ .function = lisp_show_iface_command_fn,
+};
+
clib_error_t *
lisp_gpe_init (vlib_main_t *vm)
{