in-addr-util: introduce in_addr_data_hash_ops_free and expose its compare and hash functions

Preparation for later commits.
This commit is contained in:
Yu Watanabe
2022-12-13 20:32:44 +09:00
parent 0f17886390
commit 4596c83658
2 changed files with 23 additions and 4 deletions
+3
View File
@@ -177,10 +177,13 @@ static inline size_t FAMILY_ADDRESS_SIZE(int family) {
* See also oss-fuzz#11344. */
#define IN_ADDR_NULL ((union in_addr_union) { .in6 = {} })
void in_addr_data_hash_func(const struct in_addr_data *a, struct siphash *state);
int in_addr_data_compare_func(const struct in_addr_data *x, const struct in_addr_data *y);
void in6_addr_hash_func(const struct in6_addr *addr, struct siphash *state);
int in6_addr_compare_func(const struct in6_addr *a, const struct in6_addr *b);
extern const struct hash_ops in_addr_data_hash_ops;
extern const struct hash_ops in_addr_data_hash_ops_free;
extern const struct hash_ops in6_addr_hash_ops;
extern const struct hash_ops in6_addr_hash_ops_free;