From 1b1fe1c4090ee98908f216d13af0c766df772714 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Tue, 2 Apr 2019 13:57:48 -0400 Subject: lib: Add hash function for nexthop groups Add a hash function to turn a nexthop group into a 32 bit unsigned hash key with jhash. We do not care to hash any recursively resolved nexthops, just the group. Signed-off-by: Stephen Worley --- lib/nexthop_group.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/nexthop_group.h') diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index d96d0ab9f..f68033c20 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -47,6 +47,8 @@ void nexthop_del(struct nexthop_group *nhg, struct nexthop *nexthop); void copy_nexthops(struct nexthop **tnh, const struct nexthop *nh, struct nexthop *rparent); +uint32_t nexthop_group_hash(const struct nexthop_group *nhg); + /* The following for loop allows to iterate over the nexthop * structure of routes. * -- cgit v1.2.3