aboutsummaryrefslogtreecommitdiffstats
path: root/vpp/vpp-api
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-12-22 10:03:25 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-22 16:33:14 +0000
commit56f32cc3a77d2c7d82e3ee57779abb30e1dd7586 (patch)
tree57e49a835ad7c236a7af0b597eb9b312f8e43c3a /vpp/vpp-api
parent9c7ef0309b0f525dfd8cdfbe7954ee2d4a17ebc1 (diff)
API refactoring : ipsec-gre
Change-Id: I984c6f2c5aaeeef98aadd5a66159cac046a86586 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vpp/vpp-api')
-rw-r--r--vpp/vpp-api/api.c94
-rw-r--r--vpp/vpp-api/vpe.api59
2 files changed, 1 insertions, 152 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index ec261818..4ac0afd3 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -82,7 +82,6 @@
#include <vnet/ip/ip_source_and_port_range_check.h>
#include <vnet/policer/policer.h>
#include <vnet/flow/flow_report.h>
-#include <vnet/ipsec-gre/ipsec_gre.h>
#include <vnet/flow/flow_report_classify.h>
#include <vnet/ip/punt.h>
#include <vnet/feature/feature.h>
@@ -250,8 +249,6 @@ _(IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
ip_source_and_port_range_check_add_del) \
_(IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
ip_source_and_port_range_check_interface_add_del) \
-_(IPSEC_GRE_ADD_DEL_TUNNEL, ipsec_gre_add_del_tunnel) \
-_(IPSEC_GRE_TUNNEL_DUMP, ipsec_gre_tunnel_dump) \
_(DELETE_SUBIF, delete_subif) \
_(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite) \
_(PUNT, punt) \
@@ -5735,97 +5732,6 @@ reply:
}
static void
-vl_api_ipsec_gre_add_del_tunnel_t_handler (vl_api_ipsec_gre_add_del_tunnel_t *
- mp)
-{
- vl_api_ipsec_gre_add_del_tunnel_reply_t *rmp;
- int rv = 0;
- vnet_ipsec_gre_add_del_tunnel_args_t _a, *a = &_a;
- u32 sw_if_index = ~0;
-
- /* Check src & dst are different */
- if (memcmp (mp->src_address, mp->dst_address, 4) == 0)
- {
- rv = VNET_API_ERROR_SAME_SRC_DST;
- goto out;
- }
-
- memset (a, 0, sizeof (*a));
-
- /* ip addresses sent in network byte order */
- clib_memcpy (&(a->src), mp->src_address, 4);
- clib_memcpy (&(a->dst), mp->dst_address, 4);
- a->is_add = mp->is_add;
- a->lsa = ntohl (mp->local_sa_id);
- a->rsa = ntohl (mp->remote_sa_id);
-
- rv = vnet_ipsec_gre_add_del_tunnel (a, &sw_if_index);
-
-out:
- /* *INDENT-OFF* */
- REPLY_MACRO2(VL_API_GRE_ADD_DEL_TUNNEL_REPLY,
- ({
- rmp->sw_if_index = ntohl (sw_if_index);
- }));
- /* *INDENT-ON* */
-}
-
-static void send_ipsec_gre_tunnel_details
- (ipsec_gre_tunnel_t * t, unix_shared_memory_queue_t * q, u32 context)
-{
- vl_api_ipsec_gre_tunnel_details_t *rmp;
-
- rmp = vl_msg_api_alloc (sizeof (*rmp));
- memset (rmp, 0, sizeof (*rmp));
- rmp->_vl_msg_id = ntohs (VL_API_IPSEC_GRE_TUNNEL_DETAILS);
- clib_memcpy (rmp->src_address, &(t->tunnel_src), 4);
- clib_memcpy (rmp->dst_address, &(t->tunnel_dst), 4);
- rmp->sw_if_index = htonl (t->sw_if_index);
- rmp->local_sa_id = htonl (t->local_sa_id);
- rmp->remote_sa_id = htonl (t->remote_sa_id);
- rmp->context = context;
-
- vl_msg_api_send_shmem (q, (u8 *) & rmp);
-}
-
-static void vl_api_ipsec_gre_tunnel_dump_t_handler
- (vl_api_ipsec_gre_tunnel_dump_t * mp)
-{
- unix_shared_memory_queue_t *q;
- ipsec_gre_main_t *igm = &ipsec_gre_main;
- ipsec_gre_tunnel_t *t;
- u32 sw_if_index;
-
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
- {
- return;
- }
-
- sw_if_index = ntohl (mp->sw_if_index);
-
- if (~0 == sw_if_index)
- {
- /* *INDENT-OFF* */
- pool_foreach (t, igm->tunnels,
- ({
- send_ipsec_gre_tunnel_details(t, q, mp->context);
- }));
- /* *INDENT-ON* */
- }
- else
- {
- if ((sw_if_index >= vec_len (igm->tunnel_index_by_sw_if_index)) ||
- (~0 == igm->tunnel_index_by_sw_if_index[sw_if_index]))
- {
- return;
- }
- t = &igm->tunnels[igm->tunnel_index_by_sw_if_index[sw_if_index]];
- send_ipsec_gre_tunnel_details (t, q, mp->context);
- }
-}
-
-static void
vl_api_delete_subif_t_handler (vl_api_delete_subif_t * mp)
{
vl_api_delete_subif_reply_t *rmp;
diff --git a/vpp/vpp-api/vpe.api b/vpp/vpp-api/vpe.api
index 0d7de596..52254cd3 100644
--- a/vpp/vpp-api/vpe.api
+++ b/vpp/vpp-api/vpe.api
@@ -34,6 +34,7 @@
* L2TP APIs: see .../vnet/vnet/l2tp/{l2tp.api, l2tp_api.c}
* BFD APIs: see .../vnet/vnet/bfd/{bfd.api, bfd_api.c}
* 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}
*/
/** \brief Create a new subinterface with the given vlan id
@@ -3519,64 +3520,6 @@ define ip_source_and_port_range_check_interface_add_del_reply
i32 retval;
};
-/** \brief Add / del ipsec gre tunnel request
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
- @param local_sa_id - local SA id
- @param remote_sa_id - remote SA id
- @param is_add - 1 if adding the tunnel, 0 if deleting
- @param src_address - tunnel source address
- @param dst_address - tunnel destination address
-*/
-define ipsec_gre_add_del_tunnel {
- u32 client_index;
- u32 context;
- u32 local_sa_id;
- u32 remote_sa_id;
- u8 is_add;
- u8 src_address[4];
- u8 dst_address[4];
-};
-
-/** \brief Reply for add / del ipsec gre tunnel request
- @param context - returned sender context, to match reply w/ request
- @param retval - return code
- @param sw_if_index - software index of the new ipsec gre tunnel
-*/
-define ipsec_gre_add_del_tunnel_reply {
- u32 context;
- i32 retval;
- u32 sw_if_index;
-};
-
-/** \brief Dump ipsec gre tunnel table
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
- @param tunnel_index - gre tunnel identifier or -1 in case of all tunnels
-*/
-define ipsec_gre_tunnel_dump {
- u32 client_index;
- u32 context;
- u32 sw_if_index;
-};
-
-/** \brief mpls gre tunnel operational state response
- @param context - returned sender context, to match reply w/ request
- @param sw_if_index - software index of the ipsec gre tunnel
- @param local_sa_id - local SA id
- @param remote_sa_id - remote SA id
- @param src_address - tunnel source address
- @param dst_address - tunnel destination address
-*/
-define ipsec_gre_tunnel_details {
- u32 context;
- u32 sw_if_index;
- u32 local_sa_id;
- u32 remote_sa_id;
- u8 src_address[4];
- u8 dst_address[4];
-};
-
/** \brief Delete sub interface request
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request