aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-gpe
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-06-05 13:40:13 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-06-05 15:31:07 +0000
commit560274d042d12f31aceabff6a293cdf71429552d (patch)
treeb46615b680e84138b908d7765029a0b13e6f5d8e /src/vnet/lisp-gpe
parent719aef4835403125284a4fa71093e8b536997841 (diff)
LISP-GPE: return index of newly created fwd entry, VPP-868
Change-Id: I4fc45097cb994ab6a59503d9fcfb693d1c7ec442 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/lisp-gpe')
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe.api9
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe.h3
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_api.c7
-rw-r--r--src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c3
4 files changed, 20 insertions, 2 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe.api b/src/vnet/lisp-gpe/lisp_gpe.api
index 7af153355b7..706f20d4585 100644
--- a/src/vnet/lisp-gpe/lisp_gpe.api
+++ b/src/vnet/lisp-gpe/lisp_gpe.api
@@ -43,7 +43,7 @@ typeonly manual_print manual_endian define gpe_locator
@param loc_num - number of locators
@param locs - array of remote locators
*/
-autoreply manual_print manual_endian define gpe_add_del_fwd_entry
+manual_print manual_endian define gpe_add_del_fwd_entry
{
u32 client_index;
u32 context;
@@ -60,6 +60,13 @@ autoreply manual_print manual_endian define gpe_add_del_fwd_entry
vl_api_gpe_locator_t locs[loc_num];
};
+define gpe_add_del_fwd_entry_reply
+{
+ i32 retval;
+ u32 context;
+ u32 fwd_entry_index;
+};
+
/** \brief enable or disable gpe protocol
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
diff --git a/src/vnet/lisp-gpe/lisp_gpe.h b/src/vnet/lisp-gpe/lisp_gpe.h
index d86a225f5f8..f0405644b11 100644
--- a/src/vnet/lisp-gpe/lisp_gpe.h
+++ b/src/vnet/lisp-gpe/lisp_gpe.h
@@ -221,6 +221,9 @@ typedef enum
/** */
typedef struct
{
+ /** forwarding entry index of */
+ u32 fwd_entry_index;
+
u8 is_src_dst;
u8 is_add;
diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c
index e2c055bafaf..ab081b350d1 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_api.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_api.c
@@ -358,7 +358,12 @@ vl_api_gpe_add_del_fwd_entry_t_handler (vl_api_gpe_add_del_fwd_entry_t * mp)
rv = vnet_lisp_gpe_add_del_fwd_entry (a, 0);
vec_free (pairs);
send_reply:
- REPLY_MACRO (VL_API_GPE_ADD_DEL_FWD_ENTRY_REPLY);
+ /* *INDENT-OFF* */
+ REPLY_MACRO2 (VL_API_GPE_ADD_DEL_FWD_ENTRY_REPLY,
+ {
+ rmp->fwd_entry_index = clib_host_to_net_u32 (a->fwd_entry_index);
+ });
+ /* *INDENT-ON* */
}
static void
diff --git a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
index c898b9f7c31..c1fea804c56 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
@@ -478,6 +478,7 @@ add_ip_fwd_entry (lisp_gpe_main_t * lgm,
hash_set_mem (lgm->lisp_gpe_fwd_entries, lfe->key,
lfe - lgm->lisp_fwd_entry_pool);
+ a->fwd_entry_index = lfe - lgm->lisp_fwd_entry_pool;
fproto = (IP4 == ip_prefix_version (&fid_addr_ippref (&lfe->key->rmt)) ?
FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6);
@@ -791,6 +792,7 @@ add_l2_fwd_entry (lisp_gpe_main_t * lgm,
hash_set_mem (lgm->lisp_gpe_fwd_entries, lfe->key,
lfe - lgm->lisp_fwd_entry_pool);
+ a->fwd_entry_index = lfe - lgm->lisp_fwd_entry_pool;
lfe->type = (a->is_negative ?
LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE :
@@ -1064,6 +1066,7 @@ add_nsh_fwd_entry (lisp_gpe_main_t * lgm,
hash_set_mem (lgm->lisp_gpe_fwd_entries, lfe->key,
lfe - lgm->lisp_fwd_entry_pool);
+ a->fwd_entry_index = lfe - lgm->lisp_fwd_entry_pool;
lfe->type = (a->is_negative ?
LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE :