network: make several hash_ops static
This commit is contained in:
@@ -314,7 +314,12 @@ int address_compare_func(const Address *a1, const Address *a2) {
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(address_hash_ops, Address, address_hash_func, address_compare_func, address_free);
|
||||
DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
address_hash_ops,
|
||||
Address,
|
||||
address_hash_func,
|
||||
address_compare_func,
|
||||
address_free);
|
||||
|
||||
int address_dup(const Address *src, Address **ret) {
|
||||
_cleanup_(address_freep) Address *dest = NULL;
|
||||
|
||||
@@ -97,7 +97,6 @@ void network_drop_invalid_addresses(Network *network);
|
||||
|
||||
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;
|
||||
|
||||
DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(Address, address);
|
||||
static inline void address_enter_probing(Address *address) {
|
||||
|
||||
@@ -1245,7 +1245,7 @@ static int ipv6_token_compare_func(const IPv6Token *a, const IPv6Token *b) {
|
||||
return memcmp(&a->prefix, &b->prefix, sizeof(struct in6_addr));
|
||||
}
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
ipv6_token_hash_ops,
|
||||
IPv6Token,
|
||||
ipv6_token_hash_func,
|
||||
|
||||
@@ -149,7 +149,7 @@ int nexthop_compare_func(const NextHop *a, const NextHop *b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
nexthop_hash_ops,
|
||||
NextHop,
|
||||
nexthop_hash_func,
|
||||
|
||||
@@ -394,7 +394,7 @@ int route_compare_func(const Route *a, const Route *b) {
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
route_hash_ops,
|
||||
Route,
|
||||
route_hash_func,
|
||||
|
||||
@@ -67,7 +67,6 @@ typedef struct Route {
|
||||
|
||||
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);
|
||||
Route *route_free(Route *route);
|
||||
|
||||
Reference in New Issue
Block a user