]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: expose address_{hash,compare}_func()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 4 Sep 2020 01:55:40 +0000 (10:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Sep 2020 17:30:04 +0000 (02:30 +0900)
src/network/networkd-address.c
src/network/networkd-address.h

index 0349ca6f93d6056fd1ccaf7cfe38e8d3f647b917..1cf41126dcbe3f0f3fe726fce11e61e0317918fe 100644 (file)
@@ -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);
index 3fc9935d16ba7b2e5c7e089e5794762a9bf3ad38..1378901b8b1c3361e685f36f8d0038cff493a921 100644 (file)
@@ -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);