summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-02-07 07:26:12 -0800
committerDamjan Marion <dmarion@me.com>2019-06-18 13:54:35 +0000
commitc87b66c86201458c0475d50c6e93f1497f9eec2e (patch)
tree57bf69c2adb85a93b26a86b5a1110e4290e7f391 /src/vnet/ip
parent097fa66b986f06281f603767d321ab13ab6c88c3 (diff)
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 <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip6_packet.h17
1 files changed, 16 insertions, 1 deletions
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)
{