Lines Matching defs:table
298 void wg_allowedips_init(struct allowedips *table)
300 table->root4 = table->root6 = NULL;
301 table->seq = 1;
304 void wg_allowedips_free(struct allowedips *table, struct mutex *lock)
306 struct allowedips_node __rcu *old4 = table->root4, *old6 = table->root6;
308 ++table->seq;
309 RCU_INIT_POINTER(table->root4, NULL);
310 RCU_INIT_POINTER(table->root6, NULL);
327 int wg_allowedips_insert_v4(struct allowedips *table, const struct in_addr *ip,
333 ++table->seq;
335 return add(&table->root4, 32, key, cidr, peer, lock);
338 int wg_allowedips_insert_v6(struct allowedips *table, const struct in6_addr *ip,
344 ++table->seq;
346 return add(&table->root6, 128, key, cidr, peer, lock);
349 int wg_allowedips_remove_v4(struct allowedips *table, const struct in_addr *ip,
355 ++table->seq;
357 return remove(&table->root4, 32, key, cidr, peer, lock);
360 int wg_allowedips_remove_v6(struct allowedips *table, const struct in6_addr *ip,
366 ++table->seq;
368 return remove(&table->root6, 128, key, cidr, peer, lock);
371 void wg_allowedips_remove_by_peer(struct allowedips *table,
378 ++table->seq;
396 struct wg_peer *wg_allowedips_lookup_dst(struct allowedips *table,
400 return lookup(table->root4, 32, &ip_hdr(skb)->daddr);
402 return lookup(table->root6, 128, &ipv6_hdr(skb)->daddr);
407 struct wg_peer *wg_allowedips_lookup_src(struct allowedips *table,
411 return lookup(table->root4, 32, &ip_hdr(skb)->saddr);
413 return lookup(table->root6, 128, &ipv6_hdr(skb)->saddr);