aboutsummaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-12-21 15:50:08 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-22 16:33:14 +0000
commitabea9664983b723023e692d77fd4fe3ca29c1e34 (patch)
treeca7751bcdfd7c456cb165c0cc53bd7afbe5d0294 /vpp
parentcfb7be88783d443a013d904de6d69a1ef169c5d2 (diff)
API refactoring : lisp-gpe
Change-Id: I47b38a9b5ae8ead2a161402974205982669851a7 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vpp')
-rw-r--r--vpp/vpp-api/api.c105
-rw-r--r--vpp/vpp-api/vpe.api101
2 files changed, 1 insertions, 205 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index 2e080d66..01022608 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -72,9 +72,6 @@
#include <vnet/vxlan/vxlan.h>
#include <vnet/l2/l2_vtr.h>
#include <vnet/vxlan-gpe/vxlan_gpe.h>
-#include <vnet/lisp-gpe/lisp_gpe.h>
-#include <vnet/lisp-gpe/lisp_gpe_fwd_entry.h>
-#include <vnet/lisp-gpe/lisp_gpe_tenant.h>
#include <vnet/map/map.h>
#include <vnet/cop/cop.h>
#include <vnet/ip/ip6_hop_by_hop.h>
@@ -187,9 +184,6 @@ _(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) \
_(GET_NODE_GRAPH, get_node_graph) \
_(IOAM_ENABLE, ioam_enable) \
_(IOAM_DISABLE, ioam_disable) \
-_(LISP_GPE_ENABLE_DISABLE, lisp_gpe_enable_disable) \
-_(LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface) \
-_(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \
_(SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del) \
_(POLICER_ADD_DEL, policer_add_del) \
_(POLICER_DUMP, policer_dump) \
@@ -2980,105 +2974,6 @@ static void vl_api_vxlan_gpe_tunnel_dump_t_handler
}
static void
-vl_api_lisp_gpe_enable_disable_t_handler (vl_api_lisp_gpe_enable_disable_t *
- mp)
-{
- vl_api_lisp_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);
-}
-
-static void
-vl_api_lisp_gpe_add_del_iface_t_handler (vl_api_lisp_gpe_add_del_iface_t * mp)
-{
- vl_api_lisp_gpe_add_del_iface_reply_t *rmp;
- int rv = 0;
-
- if (mp->is_l2)
- {
- if (mp->is_add)
- {
- if (~0 ==
- lisp_gpe_tenant_l2_iface_add_or_lock (mp->vni, mp->dp_table))
- rv = 1;
- }
- else
- lisp_gpe_tenant_l2_iface_unlock (mp->vni);
- }
- else
- {
- if (mp->is_add)
- {
- if (~0 ==
- lisp_gpe_tenant_l3_iface_add_or_lock (mp->vni, mp->dp_table))
- rv = 1;
- }
- else
- lisp_gpe_tenant_l3_iface_unlock (mp->vni);
- }
-
- REPLY_MACRO (VL_API_LISP_GPE_ADD_DEL_IFACE_REPLY);
-}
-
-static void
-send_lisp_gpe_fwd_entry_details (lisp_gpe_fwd_entry_t * lfe,
- unix_shared_memory_queue_t * q, u32 context)
-{
- vl_api_lisp_gpe_tunnel_details_t *rmp;
- lisp_gpe_main_t *lgm = &lisp_gpe_main;
-
- rmp = vl_msg_api_alloc (sizeof (*rmp));
- memset (rmp, 0, sizeof (*rmp));
- rmp->_vl_msg_id = ntohs (VL_API_LISP_GPE_TUNNEL_DETAILS);
-
- rmp->tunnels = lfe - lgm->lisp_fwd_entry_pool;
-
- rmp->is_ipv6 = ip_prefix_version (&(lfe->key->rmt.ippref)) == IP6 ? 1 : 0;
- ip_address_copy_addr (rmp->source_ip,
- &ip_prefix_addr (&(lfe->key->rmt.ippref)));
- ip_address_copy_addr (rmp->destination_ip,
- &ip_prefix_addr (&(lfe->key->rmt.ippref)));
-
- rmp->encap_fib_id = htonl (0);
- rmp->decap_fib_id = htonl (lfe->eid_fib_index);
- rmp->iid = htonl (lfe->key->vni);
- rmp->context = context;
-
- vl_msg_api_send_shmem (q, (u8 *) & rmp);
-}
-
-static void
-vl_api_lisp_gpe_tunnel_dump_t_handler (vl_api_lisp_gpe_tunnel_dump_t * mp)
-{
- unix_shared_memory_queue_t *q = NULL;
- lisp_gpe_main_t *lgm = &lisp_gpe_main;
- lisp_gpe_fwd_entry_t *lfe = NULL;
-
- if (pool_elts (lgm->lisp_fwd_entry_pool) == 0)
- {
- return;
- }
-
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- {
- return;
- }
-
- /* *INDENT-OFF* */
- pool_foreach(lfe, lgm->lisp_fwd_entry_pool,
- ({
- send_lisp_gpe_fwd_entry_details(lfe, q, mp->context);
- }));
- /* *INDENT-ON* */
-}
-
-static void
vl_api_interface_name_renumber_t_handler (vl_api_interface_name_renumber_t *
mp)
{
diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api
index 9c173653..abd0e8f1 100644
--- a/vpp/vpp-api/vpe.api
+++ b/vpp/vpp-api/vpe.api
@@ -36,6 +36,7 @@
* IPSEC APIs: see .../vnet/vnet/ipsec/{ipsec.api, ipsec_api.c}
* IPSEC-GRE APIs: see .../vnet/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
* LISP APIs: see .../vnet/vnet/lisp/{lisp.api, lisp_api.c}
+ * LISP-GPE APIs: see .../vnet/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
*/
/** \brief Create a new subinterface with the given vlan id
@@ -1491,106 +1492,6 @@ define l2_fib_table_dump
u32 bd_id;
};
-/** \brief add or delete lisp gpe tunnel
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
- @param is_add - add address if non-zero, else delete
- @param eid_type -
- 0 : ipv4
- 1 : ipv6
- 2 : mac
- @param rmt_eid - remote eid
- @param lcl_eid - local eid
- @param rmt_len - remote prefix len
- @param lcl_len - local prefix len
- @param vni - virtual network identifier
- @param dp_table - vrf/bridge domain id
- @param loc_num - number of locators
- @param lcl_locs - array of local locators
- @param rmt_locs - array of remote locators
- @param action - negative action when 0 locators configured
-*/
-define lisp_gpe_add_del_fwd_entry
-{
- u32 client_index;
- u32 context;
- u8 is_add;
- u8 eid_type;
- u8 rmt_eid[16];
- u8 lcl_eid[16];
- u8 rmt_len;
- u8 lcl_len;
- u32 vni;
- u32 dp_table;
- u32 loc_num;
- u8 lcl_locs[loc_num];
- u8 rmt_locs[loc_num];
- u8 action;
-};
-
-/** \brief Reply for gpe_fwd_entry add/del
- @param context - returned sender context, to match reply w/ request
- @param retval - return code
-*/
-define lisp_gpe_add_del_fwd_entry_reply
-{
- u32 context;
- i32 retval;
-};
-
-/** \brief add or delete gpe_iface
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
- @param is_add - add address if non-zero, else delete
-*/
-define lisp_gpe_add_del_iface
-{
- u32 client_index;
- u32 context;
- u8 is_add;
- u8 is_l2;
- u32 dp_table;
- u32 vni;
-};
-
-/** \brief Reply for gpe_iface add/del
- @param context - returned sender context, to match reply w/ request
- @param retval - return code
-*/
-define lisp_gpe_add_del_iface_reply
-{
- u32 context;
- i32 retval;
-};
-
-define lisp_gpe_tunnel_details
-{
- u32 context;
- u32 tunnels;
- u8 is_ipv6;
- u8 source_ip[16];
- u8 destination_ip[16];
- u32 encap_fib_id;
- u32 decap_fib_id;
- u32 dcap_next;
- u8 lisp_ver;
- u8 next_protocol;
- u8 flags;
- u8 ver_res;
- u8 res;
- u32 iid;
-};
-
-/** \brief Request for gpe tunnel summary status
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
- */
-define lisp_gpe_tunnel_dump
-{
- u32 client_index;
- u32 context;
-};
-
/* Gross kludge, DGMS */
define interface_name_renumber
{