From 99a2878457b5e1a1b87ba2f638bf7aeacee98662 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 4 Sep 2020 10:55:40 +0900 Subject: [PATCH] network: expose address_{hash,compare}_func() --- src/network/networkd-address.c | 4 ++-- src/network/networkd-address.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 0349ca6f93..1cf41126dc 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -162,7 +162,7 @@ static uint32_t address_prefix(const Address *a) { return be32toh(a->in_addr.in.s_addr) >> (32 - a->prefixlen); } -static void address_hash_func(const Address *a, struct siphash *state) { +void address_hash_func(const Address *a, struct siphash *state) { assert(a); siphash24_compress(&a->family, sizeof(a->family), state); @@ -187,7 +187,7 @@ static void address_hash_func(const Address *a, struct siphash *state) { } } -static int address_compare_func(const Address *a1, const Address *a2) { +int address_compare_func(const Address *a1, const Address *a2) { int r; r = CMP(a1->family, a2->family); diff --git a/src/network/networkd-address.h b/src/network/networkd-address.h index 3fc9935d16..1378901b8b 100644 --- a/src/network/networkd-address.h +++ b/src/network/networkd-address.h @@ -75,6 +75,8 @@ int generate_ipv6_eui_64_address(Link *link, struct in6_addr *ret); DEFINE_NETWORK_SECTION_FUNCTIONS(Address, address_free); +void address_hash_func(const Address *a, struct siphash *state); +int address_compare_func(const Address *a1, const Address *a2); extern const struct hash_ops address_hash_ops; CONFIG_PARSER_PROTOTYPE(config_parse_address);