Lines Matching refs:allowedips_node

21 static void copy_and_assign_cidr(struct allowedips_node *node, const u8 *src,  in copy_and_assign_cidr()
34 static inline u8 choose(struct allowedips_node *node, const u8 *key) in choose()
39 static void push_rcu(struct allowedips_node **stack, in push_rcu()
40 struct allowedips_node __rcu *p, unsigned int *len) in push_rcu()
50 kmem_cache_free(node_cache, container_of(rcu, struct allowedips_node, rcu)); in node_free_rcu()
55 struct allowedips_node *node, *stack[128] = { in root_free_rcu()
56 container_of(rcu, struct allowedips_node, rcu) }; in root_free_rcu()
66 static void root_remove_peer_lists(struct allowedips_node *root) in root_remove_peer_lists()
68 struct allowedips_node *node, *stack[128] = { root }; in root_remove_peer_lists()
84 static u8 common_bits(const struct allowedips_node *node, const u8 *key, in common_bits()
96 static bool prefix_matches(const struct allowedips_node *node, const u8 *key, in prefix_matches()
108 static struct allowedips_node *find_node(struct allowedips_node *trie, u8 bits, in find_node()
111 struct allowedips_node *node = trie, *found = NULL; in find_node()
124 static struct wg_peer *lookup(struct allowedips_node __rcu *root, u8 bits, in lookup()
129 struct allowedips_node *node; in lookup()
146 static bool node_placement(struct allowedips_node __rcu *trie, const u8 *key, in node_placement()
147 u8 cidr, u8 bits, struct allowedips_node **rnode, in node_placement()
150 struct allowedips_node *node = rcu_dereference_protected(trie, lockdep_is_held(lock)); in node_placement()
151 struct allowedips_node *parent = NULL; in node_placement()
166 static inline void connect_node(struct allowedips_node __rcu **parent, u8 bit, struct allowedips_no… in connect_node()
172 static inline void choose_and_connect_node(struct allowedips_node *parent, struct allowedips_node *… in choose_and_connect_node()
178 static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key, in add()
181 struct allowedips_node *node, *parent, *down, *newnode; in add()
257 struct allowedips_node __rcu *old4 = table->root4, *old6 = table->root6; in wg_allowedips_free()
263 struct allowedips_node *node = rcu_dereference_protected(old4, in wg_allowedips_free()
270 struct allowedips_node *node = rcu_dereference_protected(old6, in wg_allowedips_free()
303 struct allowedips_node *node, *child, **parent_bit, *parent, *tmp; in wg_allowedips_remove_by_peer()
318 parent_bit = (struct allowedips_node **)(node->parent_bit_packed & ~3UL); in wg_allowedips_remove_by_peer()
321 offsetof(struct allowedips_node, bit[node->parent_bit_packed & 1]); in wg_allowedips_remove_by_peer()
335 *(struct allowedips_node **)(parent->parent_bit_packed & ~3UL) = child; in wg_allowedips_remove_by_peer()
340 int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr) in wg_allowedips_read_node()
376 node_cache = KMEM_CACHE(allowedips_node, 0); in wg_allowedips_slab_init()