summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_format.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-18 17:11:28 +0000
committerNeale Ranns <nranns@cisco.com>2019-03-19 14:53:26 +0000
commit231c4696872cb344f28648949603840136c0795d (patch)
treee70cec429dfa006c76f3a273ab64646953153a2c /src/vnet/ipsec/ipsec_format.c
parent9f231d4f147c7e3fdf562680488ec5dfe7655b5e (diff)
IPSEC: remove byte swap operations in DP during SPD classify
Change-Id: I4bfde738f9585b045cb5ba62cf51b141d639b1b2 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.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c
index aa5562caf63..3659a7a897f 100644
--- a/src/vnet/ipsec/ipsec_format.c
+++ b/src/vnet/ipsec/ipsec_format.c
@@ -177,28 +177,18 @@ format_ipsec_policy (u8 * s, va_list * args)
{
s = format (s, " sa %u", p->sa_id);
}
- if (p->is_ipv6)
- {
- s = format (s, "\n local addr range %U - %U port range %u - %u",
- format_ip6_address, &p->laddr.start.ip6,
- format_ip6_address, &p->laddr.stop.ip6,
- p->lport.start, p->lport.stop);
- s = format (s, "\n remote addr range %U - %U port range %u - %u",
- format_ip6_address, &p->raddr.start.ip6,
- format_ip6_address, &p->raddr.stop.ip6,
- p->rport.start, p->rport.stop);
- }
- else
- {
- s = format (s, "\n local addr range %U - %U port range %u - %u",
- format_ip4_address, &p->laddr.start.ip4,
- format_ip4_address, &p->laddr.stop.ip4,
- p->lport.start, p->lport.stop);
- s = format (s, "\n remote addr range %U - %U port range %u - %u",
- format_ip4_address, &p->raddr.start.ip4,
- format_ip4_address, &p->raddr.stop.ip4,
- p->rport.start, p->rport.stop);
- }
+
+ s = format (s, "\n local addr range %U - %U port range %u - %u",
+ format_ip46_address, &p->laddr.start, IP46_TYPE_ANY,
+ format_ip46_address, &p->laddr.stop, IP46_TYPE_ANY,
+ clib_net_to_host_u16 (p->lport.start),
+ clib_net_to_host_u16 (p->lport.stop));
+ s = format (s, "\n remote addr range %U - %U port range %u - %u",
+ format_ip46_address, &p->raddr.start, IP46_TYPE_ANY,
+ format_ip46_address, &p->raddr.stop, IP46_TYPE_ANY,
+ clib_net_to_host_u16 (p->rport.start),
+ clib_net_to_host_u16 (p->rport.stop));
+
vlib_get_combined_counter (&ipsec_spd_policy_counters, pi, &counts);
s = format (s, "\n packets %u bytes %u", counts.packets, counts.bytes);