aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_packet.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-08-31 02:51:45 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-11-02 13:58:44 +0000
commitc92341d5c6ab052d458471e26d6c27f9e303fe31 (patch)
tree343996ac03334533564e0433716e191e305a2cce /src/vnet/ip/ip6_packet.h
parent975b4b1f7a568ec3d6704232286418c554c04cc1 (diff)
Use throttle_t for ND throttling (VPP-1480)
Change-Id: I93c6b7bccd1a1ab71625ae29c99c974581186c4d Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip6_packet.h')
-rw-r--r--src/vnet/ip/ip6_packet.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vnet/ip/ip6_packet.h b/src/vnet/ip/ip6_packet.h
index ea2fa155b5e..cdcffa59b8b 100644
--- a/src/vnet/ip/ip6_packet.h
+++ b/src/vnet/ip/ip6_packet.h
@@ -347,6 +347,18 @@ ip6_is_solicited_node_multicast_address (const ip6_address_t * a)
&& a->as_u8[12] == 0xff);
}
+always_inline u32
+ip6_address_hash_to_u32 (const ip6_address_t * a)
+{
+ return (a->as_u32[0] ^ a->as_u32[1] ^ a->as_u32[2] ^ a->as_u32[3]);
+}
+
+always_inline u64
+ip6_address_hash_to_u64 (const ip6_address_t * a)
+{
+ return (a->as_u64[0] ^ a->as_u64[1]);
+}
+
typedef struct
{
/* 4 bit version, 8 bit traffic class and 20 bit flow label. */