aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_format.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-19 10:06:00 +0000
committerDave Barach <openvpp@barachs.net>2019-03-19 11:26:14 +0000
commit9f231d4f147c7e3fdf562680488ec5dfe7655b5e (patch)
treee190aff4497734c6ab13c512422c652e630f64bc /src/vnet/ipsec/ipsec_format.c
parentee94ffa35d69a56df894a31147a106f2a7d4c3de (diff)
IPSEC: tidy the policy types
Change-Id: I5e981f12ff44243623cfd18d5e0ae06a7dfd1eb8 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_format.c')
-rw-r--r--src/vnet/ipsec/ipsec_format.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index d65b2a7ee4f..aa5562caf63 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -41,6 +41,24 @@ format_ipsec_policy_action (u8 * s, va_list * args)
return s;
}
+u8 *
+format_ipsec_policy_type (u8 * s, va_list * args)
+{
+ u32 i = va_arg (*args, u32);
+ char *t = 0;
+
+ switch (i)
+ {
+#define _(f,str) case IPSEC_SPD_POLICY_##f: t = str; break;
+ foreach_ipsec_spd_policy_type
+#undef _
+ default:
+ s = format (s, "unknown");
+ }
+ s = format (s, "%s", t);
+ return s;
+}
+
uword
unformat_ipsec_policy_action (unformat_input_t * input, va_list * args)
{
@@ -143,8 +161,10 @@ format_ipsec_policy (u8 * s, va_list * args)
p = pool_elt_at_index (im->policies, pi);
- s = format (s, " [%d] priority %d action %U protocol ",
- pi, p->priority, format_ipsec_policy_action, p->policy);
+ s = format (s, " [%d] priority %d action %U type %U protocol ",
+ pi, p->priority,
+ format_ipsec_policy_action, p->policy,
+ format_ipsec_policy_type, p->type);
if (p->protocol)
{
s = format (s, "%U", format_ip_protocol, p->protocol);