From 501b09dbf2ab75d90cd05ec4b44c92341e201e46 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 4 Sep 2020 10:56:03 +0900 Subject: [PATCH] network: expose route_{hash,compare}_func() --- src/network/networkd-route.c | 4 ++-- src/network/networkd-route.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 541bf1e793e..e18d7973966 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -161,7 +161,7 @@ void route_free(Route *route) { free(route); } -static void route_hash_func(const Route *route, struct siphash *state) { +void route_hash_func(const Route *route, struct siphash *state) { assert(route); siphash24_compress(&route->family, sizeof(route->family), state); @@ -196,7 +196,7 @@ static void route_hash_func(const Route *route, struct siphash *state) { } } -static int route_compare_func(const Route *a, const Route *b) { +int route_compare_func(const Route *a, const Route *b) { int r; r = CMP(a->family, b->family); diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index 3beee9b03b1..75651fa5122 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -62,6 +62,8 @@ struct Route { LIST_FIELDS(Route, routes); }; +void route_hash_func(const Route *route, struct siphash *state); +int route_compare_func(const Route *a, const Route *b); extern const struct hash_ops route_hash_ops; int route_new(Route **ret); -- 2.47.3