1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Filter: Add some minor functions for f_tree and EC

Add some supportive functions for f_tree and EC. These functions are used
by L3VPN code.
This commit is contained in:
Ondrej Zajicek
2022-09-27 16:47:52 +02:00
parent da0b589e7b
commit 92a8565547
4 changed files with 25 additions and 3 deletions

View File

@@ -192,6 +192,7 @@ struct f_tree *f_new_tree(void);
struct f_tree *build_tree(struct f_tree *);
const struct f_tree *find_tree(const struct f_tree *t, const struct f_val *val);
int same_tree(const struct f_tree *t0, const struct f_tree *t2);
int tree_node_count(const struct f_tree *t);
void tree_format(const struct f_tree *t, buffer *buf);
void tree_walk(const struct f_tree *t, void (*hook)(const struct f_tree *, void *), void *data);
@@ -286,6 +287,10 @@ static inline int lclist_set_type(const struct f_tree *set)
static inline int path_set_type(const struct f_tree *set)
{ return !set || set->from.type == T_INT; }
int clist_match_set(const struct adata *clist, const struct f_tree *set);
int eclist_match_set(const struct adata *list, const struct f_tree *set);
int lclist_match_set(const struct adata *list, const struct f_tree *set);
const struct adata *clist_filter(struct linpool *pool, const struct adata *list, const struct f_val *set, int pos);
const struct adata *eclist_filter(struct linpool *pool, const struct adata *list, const struct f_val *set, int pos);
const struct adata *lclist_filter(struct linpool *pool, const struct adata *list, const struct f_val *set, int pos);