aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-09 06:39:23 -0800
committerDave Barach <openvpp@barachs.net>2018-01-11 19:46:01 +0000
commit6c4dae27e75fc668f86c9cca0f3f58273b680621 (patch)
tree88c2adee0a2eb2c5e48471da2ef010e46cc270ab /src/vnet/ipsec
parentf72212e00282712f5829a7f76a8cb6f486cdae60 (diff)
api: remove transport specific code from handlers
This does not update api client code. In other words, if the client assumes the transport is shmem based, this patch does not change that. Furthermore, code that checks queue size, for tail dropping, is not updated. Done for the following apis: Plugins - acl - gtpu - memif - nat - pppoe VNET - bfd - bier - tapv2 - vhost user - dhcp - flow - geneve - ip - punt - ipsec/ipsec-gre - l2 - l2tp - lisp-cp/one-cp - lisp-gpe - map - mpls - policer - session - span - udp - tap - vxlan/vxlan-gpe - interface VPP - api/api.c OAM - oam_api.c Stats - stats.c Change-Id: I0e33ecefb2bdab0295698c0add948068a5a83345 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/ipsec')
-rw-r--r--src/vnet/ipsec/ipsec_api.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c
index 361bddbc8d0..da78f3d2496 100644
--- a/src/vnet/ipsec/ipsec_api.c
+++ b/src/vnet/ipsec/ipsec_api.c
@@ -252,7 +252,8 @@ out:
}
static void
-send_ipsec_spd_details (ipsec_policy_t * p, svm_queue_t * q, u32 context)
+send_ipsec_spd_details (ipsec_policy_t * p, vl_api_registration_t * reg,
+ u32 context)
{
vl_api_ipsec_spd_details_t *mp;
@@ -289,21 +290,21 @@ send_ipsec_spd_details (ipsec_policy_t * p, svm_queue_t * q, u32 context)
mp->bytes = clib_host_to_net_u64 (p->counter.bytes);
mp->packets = clib_host_to_net_u64 (p->counter.packets);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
vl_api_ipsec_spd_dump_t_handler (vl_api_ipsec_spd_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
ipsec_main_t *im = &ipsec_main;
ipsec_policy_t *policy;
ipsec_spd_t *spd;
uword *p;
u32 spd_index;
#if WITH_LIBSSL > 0
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0)
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg)
return;
p = hash_get (im->spd_index_by_spd_id, ntohl (mp->spd_id));
@@ -317,7 +318,7 @@ vl_api_ipsec_spd_dump_t_handler (vl_api_ipsec_spd_dump_t * mp)
pool_foreach (policy, spd->policies,
({
if (mp->sa_id == ~(0) || ntohl (mp->sa_id) == policy->sa_id)
- send_ipsec_spd_details (policy, q,
+ send_ipsec_spd_details (policy, reg,
mp->context);}
));
/* *INDENT-ON* */
@@ -399,7 +400,7 @@ vl_api_ipsec_tunnel_if_add_del_t_handler (vl_api_ipsec_tunnel_if_add_del_t *
}
static void
-send_ipsec_sa_details (ipsec_sa_t * sa, svm_queue_t * q,
+send_ipsec_sa_details (ipsec_sa_t * sa, vl_api_registration_t * reg,
u32 context, u32 sw_if_index)
{
vl_api_ipsec_sa_details_t *mp;
@@ -455,14 +456,14 @@ send_ipsec_sa_details (ipsec_sa_t * sa, svm_queue_t * q,
mp->replay_window = clib_host_to_net_u64 (sa->replay_window);
mp->total_data_size = clib_host_to_net_u64 (sa->total_data_size);
- vl_msg_api_send_shmem (q, (u8 *) & mp);
+ vl_api_send_msg (reg, (u8 *) mp);
}
static void
vl_api_ipsec_sa_dump_t_handler (vl_api_ipsec_sa_dump_t * mp)
{
- svm_queue_t *q;
+ vl_api_registration_t *reg;
ipsec_main_t *im = &ipsec_main;
vnet_main_t *vnm = im->vnet_main;
ipsec_sa_t *sa;
@@ -470,8 +471,8 @@ vl_api_ipsec_sa_dump_t_handler (vl_api_ipsec_sa_dump_t * mp)
u32 *sa_index_to_tun_if_index = 0;
#if WITH_LIBSSL > 0
- q = vl_api_client_index_to_input_queue (mp->client_index);
- if (q == 0 || pool_elts (im->sad) == 0)
+ reg = vl_api_client_index_to_registration (mp->client_index);
+ if (!reg || pool_elts (im->sad) == 0)
return;
vec_validate_init_empty (sa_index_to_tun_if_index, vec_len (im->sad) - 1,
@@ -492,7 +493,7 @@ vl_api_ipsec_sa_dump_t_handler (vl_api_ipsec_sa_dump_t * mp)
pool_foreach (sa, im->sad,
({
if (mp->sa_id == ~(0) || ntohl (mp->sa_id) == sa->id)
- send_ipsec_sa_details (sa, q, mp->context,
+ send_ipsec_sa_details (sa, reg, mp->context,
sa_index_to_tun_if_index[sa - im->sad]);
}));
/* *INDENT-ON* */