diff options
author | Neale Ranns <nranns@cisco.com> | 2019-02-04 01:10:30 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-02-05 14:59:44 +0000 |
commit | a09c1ff5b6ae535932b4fc9477ffc4e39748ca62 (patch) | |
tree | e7162669c6224358f28e5614c782e2ba73a08e6c /src/vnet/ipsec/ipsec_spd.c | |
parent | 3117ad8aa50afba68b2fa2c7f2b6f91eeb5a555e (diff) |
IPSEC: SPD counters in the stats sgement
- return the stats_index of each SPD in the create API call
- no ip_any in the API as this creates 2 SPD entries. client must add both v4 and v6 explicitly
- only one pool of SPD entries (rhter than one per-SPD) to support this
- no packets/bytes in the dump API. Polling the stats segment is much more efficient
(if the SA lifetime is based on packet/bytes)
- emit the policy index in the packet trace and CLI commands.
Change-Id: I7eaf52c9d0495fa24450facf55229941279b8569
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_spd.c')
-rw-r--r-- | src/vnet/ipsec/ipsec_spd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vnet/ipsec/ipsec_spd.c b/src/vnet/ipsec/ipsec_spd.c index 7e17bb91fdb..19525b206a6 100644 --- a/src/vnet/ipsec/ipsec_spd.c +++ b/src/vnet/ipsec/ipsec_spd.c @@ -42,12 +42,10 @@ ipsec_add_del_spd (vlib_main_t * vm, u32 spd_id, int is_add) })); /* *INDENT-ON* */ hash_unset (im->spd_index_by_spd_id, spd_id); - pool_free (spd->policies); - vec_free (spd->ipv4_outbound_policies); - vec_free (spd->ipv6_outbound_policies); - vec_free (spd->ipv4_inbound_protect_policy_indices); - vec_free (spd->ipv4_inbound_policy_discard_and_bypass_indices); - pool_put (im->spds, spd); +#define _(s,v) vec_free(spd->policies[IPSEC_SPD_POLICY_##s]); + foreach_ipsec_spd_policy_type +#undef _ + pool_put (im->spds, spd); } else /* create new SPD */ { |