Lines Matching refs:allowedips_node
23 static void copy_and_assign_cidr(struct allowedips_node *node, const u8 *src, in copy_and_assign_cidr()
36 static inline u8 choose(struct allowedips_node *node, const u8 *key) in choose()
41 static void push_rcu(struct allowedips_node **stack, in push_rcu()
42 struct allowedips_node __rcu *p, unsigned int *len) in push_rcu()
53 kmem_cache_free(node_cache, container_of(rcu, struct allowedips_node, rcu)); in node_free_rcu()
58 struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS] = { in root_free_rcu()
59 container_of(rcu, struct allowedips_node, rcu) }; in root_free_rcu()
69 static void root_remove_peer_lists(struct allowedips_node *root) in root_remove_peer_lists()
71 struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_BITS] = { root }; in root_remove_peer_lists()
87 static u8 common_bits(const struct allowedips_node *node, const u8 *key, in common_bits()
99 static bool prefix_matches(const struct allowedips_node *node, const u8 *key, in prefix_matches()
111 static struct allowedips_node *find_node(struct allowedips_node *trie, u8 bits, in find_node()
114 struct allowedips_node *node = trie, *found = NULL; in find_node()
127 static struct wg_peer *lookup(struct allowedips_node __rcu *root, u8 bits, in lookup()
132 struct allowedips_node *node; in lookup()
149 static bool node_placement(struct allowedips_node __rcu *trie, const u8 *key, in node_placement()
150 u8 cidr, u8 bits, struct allowedips_node **rnode, in node_placement()
153 struct allowedips_node *node = rcu_dereference_protected(trie, lockdep_is_held(lock)); in node_placement()
154 struct allowedips_node *parent = NULL; in node_placement()
169 static inline void connect_node(struct allowedips_node __rcu **parent, u8 bit, struct allowedips_no… in connect_node()
175 static inline void choose_and_connect_node(struct allowedips_node *parent, struct allowedips_node *… in choose_and_connect_node()
181 static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key, in add()
184 struct allowedips_node *node, *parent, *down, *newnode; in add()
260 struct allowedips_node __rcu *old4 = table->root4, *old6 = table->root6; in wg_allowedips_free()
266 struct allowedips_node *node = rcu_dereference_protected(old4, in wg_allowedips_free()
273 struct allowedips_node *node = rcu_dereference_protected(old6, in wg_allowedips_free()
306 struct allowedips_node *node, *child, **parent_bit, *parent, *tmp; in wg_allowedips_remove_by_peer()
321 parent_bit = (struct allowedips_node **)(node->parent_bit_packed & ~3UL); in wg_allowedips_remove_by_peer()
324 offsetof(struct allowedips_node, bit[node->parent_bit_packed & 1]); in wg_allowedips_remove_by_peer()
338 *(struct allowedips_node **)(parent->parent_bit_packed & ~3UL) = child; in wg_allowedips_remove_by_peer()
343 int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr) in wg_allowedips_read_node()
379 node_cache = KMEM_CACHE(allowedips_node, 0); in wg_allowedips_slab_init()