allowedips_node
static struct allowedips_node *find_node(struct allowedips_node *trie, u8 bits,
struct allowedips_node *node = trie, *found = NULL;
static struct wg_peer *lookup(struct allowedips_node __rcu *root, u8 bits,
struct allowedips_node *node;
static bool node_placement(struct allowedips_node __rcu *trie, const u8 *key,
u8 cidr, u8 bits, struct allowedips_node **rnode,
struct allowedips_node *node = rcu_dereference_protected(trie, lockdep_is_held(lock));
struct allowedips_node *parent = NULL;
static inline void connect_node(struct allowedips_node __rcu **parent, u8 bit, struct allowedips_node *node)
static inline void choose_and_connect_node(struct allowedips_node *parent, struct allowedips_node *node)
static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key,
struct allowedips_node *node, *parent, *down, *newnode;
static void copy_and_assign_cidr(struct allowedips_node *node, const u8 *src,
static void remove_node(struct allowedips_node *node, struct mutex *lock)
struct allowedips_node *child, **parent_bit, *parent;
parent_bit = (struct allowedips_node **)(node->parent_bit_packed & ~3UL);
offsetof(struct allowedips_node, bit[node->parent_bit_packed & 1]);
*(struct allowedips_node **)(parent->parent_bit_packed & ~3UL) = child;
static int remove(struct allowedips_node __rcu **trie, u8 bits, const u8 *key,
struct allowedips_node *node;
struct allowedips_node __rcu *old4 = table->root4, *old6 = table->root6;
struct allowedips_node *node = rcu_dereference_protected(old4,
struct allowedips_node *node = rcu_dereference_protected(old6,
static inline u8 choose(struct allowedips_node *node, const u8 *key)
struct allowedips_node *node, *tmp;
int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr)
static void push_rcu(struct allowedips_node **stack,
node_cache = KMEM_CACHE(allowedips_node, 0);
struct allowedips_node __rcu *p, unsigned int *len)
struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH] = {
container_of(rcu, struct allowedips_node, rcu) };
static void root_remove_peer_lists(struct allowedips_node *root)
struct allowedips_node *node, *stack[MAX_ALLOWEDIPS_DEPTH] = { root };
static u8 common_bits(const struct allowedips_node *node, const u8 *key,
static bool prefix_matches(const struct allowedips_node *node, const u8 *key,
struct allowedips_node __rcu *bit[2];
struct allowedips_node __rcu *root4;
struct allowedips_node __rcu *root6;
int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr);
allowedips_node =
struct allowedips_node, peer_list);
if (!allowedips_node)
list_for_each_entry_from(allowedips_node, &peer->allowedips_list,
family = wg_allowedips_read_node(allowedips_node, ip, &cidr);
ctx->next_allowedip = allowedips_node;
struct allowedips_node *next_allowedip;
struct allowedips_node *allowedips_node = ctx->next_allowedip;
if (!allowedips_node) {
static __init void print_node(struct allowedips_node *node, u8 bits)
struct allowedips_node *iter_node;
static __init void print_tree(struct allowedips_node __rcu *top, u8 bits)