diff options
Diffstat (limited to 'src/vnet/lisp-gpe/lisp_gpe_api.c')
-rw-r--r-- | src/vnet/lisp-gpe/lisp_gpe_api.c | 107 |
1 files changed, 51 insertions, 56 deletions
diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c index 29f7639f1f6..8d19f8ce466 100644 --- a/src/vnet/lisp-gpe/lisp_gpe_api.c +++ b/src/vnet/lisp-gpe/lisp_gpe_api.c @@ -30,10 +30,10 @@ #include <vnet/vnet_msg_enum.h> -#define vl_api_lisp_gpe_locator_pair_t_endian vl_noop_handler -#define vl_api_lisp_gpe_locator_pair_t_print vl_noop_handler -#define vl_api_lisp_gpe_add_del_fwd_entry_t_endian vl_noop_handler -#define vl_api_lisp_gpe_add_del_fwd_entry_t_print vl_noop_handler +#define vl_api_gpe_locator_pair_t_endian vl_noop_handler +#define vl_api_gpe_locator_pair_t_print vl_noop_handler +#define vl_api_gpe_add_del_fwd_entry_t_endian vl_noop_handler +#define vl_api_gpe_add_del_fwd_entry_t_print vl_noop_handler #define vl_typedefs /* define message structures */ #include <vnet/vnet_all_api_h.h> @@ -52,23 +52,23 @@ #include <vlibapi/api_helper_macros.h> #define foreach_vpe_api_msg \ -_(LISP_GPE_ADD_DEL_FWD_ENTRY, lisp_gpe_add_del_fwd_entry) \ -_(LISP_GPE_FWD_ENTRIES_GET, lisp_gpe_fwd_entries_get) \ -_(LISP_GPE_FWD_ENTRY_PATH_DUMP, lisp_gpe_fwd_entry_path_dump) \ -_(LISP_GPE_ENABLE_DISABLE, lisp_gpe_enable_disable) \ -_(LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface) +_(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \ +_(GPE_FWD_ENTRIES_GET, gpe_fwd_entries_get) \ +_(GPE_FWD_ENTRY_PATH_DUMP, gpe_fwd_entry_path_dump) \ +_(GPE_ENABLE_DISABLE, gpe_enable_disable) \ +_(GPE_ADD_DEL_IFACE, gpe_add_del_iface) static locator_pair_t * -unformat_lisp_loc_pairs (void *locs, u32 rloc_num) +unformat_gpe_loc_pairs (void *locs, u32 rloc_num) { u32 i; locator_pair_t *pairs = 0, pair, *p; - vl_api_lisp_gpe_locator_t *r; + vl_api_gpe_locator_t *r; for (i = 0; i < rloc_num; i++) { /* local locator */ - r = &((vl_api_lisp_gpe_locator_t *) locs)[i]; + r = &((vl_api_gpe_locator_t *) locs)[i]; memset (&pair, 0, sizeof (pair)); ip_address_set (&pair.lcl_loc, &r->addr, r->is_ip4 ? IP4 : IP6); @@ -79,7 +79,7 @@ unformat_lisp_loc_pairs (void *locs, u32 rloc_num) for (i = rloc_num; i < rloc_num * 2; i++) { /* remote locators */ - r = &((vl_api_lisp_gpe_locator_t *) locs)[i]; + r = &((vl_api_gpe_locator_t *) locs)[i]; p = &pairs[i - rloc_num]; ip_address_set (&p->rmt_loc, &r->addr, r->is_ip4 ? IP4 : IP6); } @@ -119,14 +119,14 @@ unformat_lisp_eid_api (gid_address_t * dst, u32 vni, u8 type, void *src, } static void - lisp_gpe_fwd_entry_path_dump_t_net_to_host - (vl_api_lisp_gpe_fwd_entry_path_dump_t * mp) + gpe_fwd_entry_path_dump_t_net_to_host + (vl_api_gpe_fwd_entry_path_dump_t * mp) { mp->fwd_entry_index = clib_net_to_host_u32 (mp->fwd_entry_index); } static void -lisp_api_set_locator (vl_api_lisp_gpe_locator_t * loc, +lisp_api_set_locator (vl_api_gpe_locator_t * loc, const ip_address_t * addr, u8 weight) { loc->weight = weight; @@ -143,16 +143,16 @@ lisp_api_set_locator (vl_api_lisp_gpe_locator_t * loc, } static void - vl_api_lisp_gpe_fwd_entry_path_dump_t_handler - (vl_api_lisp_gpe_fwd_entry_path_dump_t * mp) + vl_api_gpe_fwd_entry_path_dump_t_handler + (vl_api_gpe_fwd_entry_path_dump_t * mp) { lisp_fwd_path_t *path; - vl_api_lisp_gpe_fwd_entry_path_details_t *rmp = NULL; + vl_api_gpe_fwd_entry_path_details_t *rmp = NULL; lisp_gpe_main_t *lgm = &lisp_gpe_main; unix_shared_memory_queue_t *q = NULL; lisp_gpe_fwd_entry_t *lfe; - lisp_gpe_fwd_entry_path_dump_t_net_to_host (mp); + gpe_fwd_entry_path_dump_t_net_to_host (mp); q = vl_api_client_index_to_input_queue (mp->client_index); if (q == 0) @@ -173,7 +173,7 @@ static void const lisp_gpe_tunnel_t *lgt; rmp->_vl_msg_id = - clib_host_to_net_u16 (VL_API_LISP_GPE_FWD_ENTRY_PATH_DETAILS); + clib_host_to_net_u16 (VL_API_GPE_FWD_ENTRY_PATH_DETAILS); const lisp_gpe_adjacency_t *ladj = lisp_gpe_adjacency_get (path->lisp_adj); @@ -187,8 +187,8 @@ static void } static void -lisp_gpe_fwd_entries_copy (vl_api_lisp_gpe_fwd_entry_t * dst, - lisp_api_gpe_fwd_entry_t * src) +gpe_fwd_entries_copy (vl_api_gpe_fwd_entry_t * dst, + lisp_api_gpe_fwd_entry_t * src) { lisp_api_gpe_fwd_entry_t *e; u32 i = 0; @@ -230,54 +230,52 @@ lisp_gpe_fwd_entries_copy (vl_api_lisp_gpe_fwd_entry_t * dst, } static void - lisp_gpe_fwd_entries_get_t_net_to_host - (vl_api_lisp_gpe_fwd_entries_get_t * mp) +gpe_fwd_entries_get_t_net_to_host (vl_api_gpe_fwd_entries_get_t * mp) { mp->vni = clib_net_to_host_u32 (mp->vni); } static void -lisp_gpe_entry_t_host_to_net (vl_api_lisp_gpe_fwd_entry_t * e) +gpe_entry_t_host_to_net (vl_api_gpe_fwd_entry_t * e) { e->fwd_entry_index = clib_host_to_net_u32 (e->fwd_entry_index); e->dp_table = clib_host_to_net_u32 (e->dp_table); } static void - lisp_gpe_fwd_entries_get_reply_t_host_to_net - (vl_api_lisp_gpe_fwd_entries_get_reply_t * mp) + gpe_fwd_entries_get_reply_t_host_to_net + (vl_api_gpe_fwd_entries_get_reply_t * mp) { u32 i; - vl_api_lisp_gpe_fwd_entry_t *e; + vl_api_gpe_fwd_entry_t *e; for (i = 0; i < mp->count; i++) { e = &mp->entries[i]; - lisp_gpe_entry_t_host_to_net (e); + gpe_entry_t_host_to_net (e); } mp->count = clib_host_to_net_u32 (mp->count); } static void - vl_api_lisp_gpe_fwd_entries_get_t_handler - (vl_api_lisp_gpe_fwd_entries_get_t * mp) +vl_api_gpe_fwd_entries_get_t_handler (vl_api_gpe_fwd_entries_get_t * mp) { lisp_api_gpe_fwd_entry_t *e; - vl_api_lisp_gpe_fwd_entries_get_reply_t *rmp = 0; + vl_api_gpe_fwd_entries_get_reply_t *rmp = 0; u32 size = 0; int rv = 0; - lisp_gpe_fwd_entries_get_t_net_to_host (mp); + gpe_fwd_entries_get_t_net_to_host (mp); e = vnet_lisp_gpe_fwd_entries_get_by_vni (mp->vni); - size = vec_len (e) * sizeof (vl_api_lisp_gpe_fwd_entry_t); + size = vec_len (e) * sizeof (vl_api_gpe_fwd_entry_t); /* *INDENT-OFF* */ - REPLY_MACRO4 (VL_API_LISP_GPE_FWD_ENTRIES_GET_REPLY, size, + REPLY_MACRO4 (VL_API_GPE_FWD_ENTRIES_GET_REPLY, size, { rmp->count = vec_len (e); - lisp_gpe_fwd_entries_copy (rmp->entries, e); - lisp_gpe_fwd_entries_get_reply_t_host_to_net (rmp); + gpe_fwd_entries_copy (rmp->entries, e); + gpe_fwd_entries_get_reply_t_host_to_net (rmp); }); /* *INDENT-ON* */ @@ -285,8 +283,7 @@ static void } static void - lisp_gpe_add_del_fwd_entry_t_net_to_host - (vl_api_lisp_gpe_add_del_fwd_entry_t * mp) +gpe_add_del_fwd_entry_t_net_to_host (vl_api_gpe_add_del_fwd_entry_t * mp) { mp->vni = clib_net_to_host_u32 (mp->vni); mp->dp_table = clib_net_to_host_u32 (mp->dp_table); @@ -294,15 +291,14 @@ static void } static void - vl_api_lisp_gpe_add_del_fwd_entry_t_handler - (vl_api_lisp_gpe_add_del_fwd_entry_t * mp) +vl_api_gpe_add_del_fwd_entry_t_handler (vl_api_gpe_add_del_fwd_entry_t * mp) { - vl_api_lisp_gpe_add_del_fwd_entry_reply_t *rmp; + vl_api_gpe_add_del_fwd_entry_reply_t *rmp; vnet_lisp_gpe_add_del_fwd_entry_args_t _a, *a = &_a; locator_pair_t *pairs = 0; int rv = 0; - lisp_gpe_add_del_fwd_entry_t_net_to_host (mp); + gpe_add_del_fwd_entry_t_net_to_host (mp); memset (a, 0, sizeof (a[0])); rv = unformat_lisp_eid_api (&a->rmt_eid, mp->vni, mp->eid_type, @@ -315,7 +311,7 @@ static void rv = -1; goto send_reply; } - pairs = unformat_lisp_loc_pairs (mp->locs, mp->loc_num / 2); + pairs = unformat_gpe_loc_pairs (mp->locs, mp->loc_num / 2); if (rv || 0 == pairs) goto send_reply; @@ -329,27 +325,26 @@ static void rv = vnet_lisp_gpe_add_del_fwd_entry (a, 0); vec_free (pairs); send_reply: - REPLY_MACRO (VL_API_LISP_GPE_ADD_DEL_FWD_ENTRY_REPLY); + REPLY_MACRO (VL_API_GPE_ADD_DEL_FWD_ENTRY_REPLY); } static void -vl_api_lisp_gpe_enable_disable_t_handler (vl_api_lisp_gpe_enable_disable_t * - mp) +vl_api_gpe_enable_disable_t_handler (vl_api_gpe_enable_disable_t * mp) { - vl_api_lisp_gpe_enable_disable_reply_t *rmp; + vl_api_gpe_enable_disable_reply_t *rmp; int rv = 0; vnet_lisp_gpe_enable_disable_args_t _a, *a = &_a; a->is_en = mp->is_en; vnet_lisp_gpe_enable_disable (a); - REPLY_MACRO (VL_API_LISP_GPE_ENABLE_DISABLE_REPLY); + REPLY_MACRO (VL_API_GPE_ENABLE_DISABLE_REPLY); } static void -vl_api_lisp_gpe_add_del_iface_t_handler (vl_api_lisp_gpe_add_del_iface_t * mp) +vl_api_gpe_add_del_iface_t_handler (vl_api_gpe_add_del_iface_t * mp) { - vl_api_lisp_gpe_add_del_iface_reply_t *rmp; + vl_api_gpe_add_del_iface_reply_t *rmp; int rv = 0; if (mp->is_l2) @@ -375,11 +370,11 @@ vl_api_lisp_gpe_add_del_iface_t_handler (vl_api_lisp_gpe_add_del_iface_t * mp) lisp_gpe_tenant_l3_iface_unlock (mp->vni); } - REPLY_MACRO (VL_API_LISP_GPE_ADD_DEL_IFACE_REPLY); + REPLY_MACRO (VL_API_GPE_ADD_DEL_IFACE_REPLY); } /* - * lisp_gpe_api_hookup + * gpe_api_hookup * Add vpe's API message handlers to the table. * vlib has alread mapped shared memory and * added the client registration handlers. @@ -398,7 +393,7 @@ setup_message_id_table (api_main_t * am) } static clib_error_t * -lisp_gpe_api_hookup (vlib_main_t * vm) +gpe_api_hookup (vlib_main_t * vm) { api_main_t *am = &api_main; @@ -420,7 +415,7 @@ lisp_gpe_api_hookup (vlib_main_t * vm) return 0; } -VLIB_API_INIT_FUNCTION (lisp_gpe_api_hookup); +VLIB_API_INIT_FUNCTION (gpe_api_hookup); /* * fd.io coding-style-patch-verification: ON |