From: Yu Watanabe Date: Fri, 4 Sep 2020 01:55:40 +0000 (+0900) Subject: network: expose address_{hash,compare}_func() X-Git-Tag: v247-rc1~286^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99a2878457b5e1a1b87ba2f638bf7aeacee98662;p=thirdparty%2Fsystemd.git network: expose address_{hash,compare}_func() --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 0349ca6f93d..1cf41126dcb 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 3fc9935d16b..1378901b8b1 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);