From c87b66c86201458c0475d50c6e93f1497f9eec2e Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 7 Feb 2019 07:26:12 -0800 Subject: ipsec: ipsec-tun protect please consult the new tunnel proposal at: https://wiki.fd.io/view/VPP/IPSec Type: feature Change-Id: I52857fc92ae068b85f59be08bdbea1bd5932e291 Signed-off-by: Neale Ranns --- src/vnet/ip/ip6_packet.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/vnet/ip') diff --git a/src/vnet/ip/ip6_packet.h b/src/vnet/ip/ip6_packet.h index ff47830dff3..c8bc4c817e8 100644 --- a/src/vnet/ip/ip6_packet.h +++ b/src/vnet/ip/ip6_packet.h @@ -75,7 +75,7 @@ typedef enum } ip46_type_t; /* *INDENT-OFF* */ -typedef CLIB_PACKED (union { +typedef CLIB_PACKED (union ip46_address_t_ { struct { u32 pad[3]; ip4_address_t ip4; @@ -95,6 +95,21 @@ typedef CLIB_PACKED (union { && ((a1)->as_u64[1] == (a2)->as_u64[1])) #define ip46_address_initializer {{{ 0 }}} +static_always_inline int +ip46_address_is_equal_v4 (const ip46_address_t * ip46, + const ip4_address_t * ip4) +{ + return (ip46->ip4.as_u32 == ip4->as_u32); +} + +static_always_inline int +ip46_address_is_equal_v6 (const ip46_address_t * ip46, + const ip6_address_t * ip6) +{ + return ((ip46->ip6.as_u64[0] == ip6->as_u64[0]) && + (ip46->ip6.as_u64[1] == ip6->as_u64[1])); +} + static_always_inline void ip46_address_copy (ip46_address_t * dst, const ip46_address_t * src) { -- cgit 1.2.3-korg