]>
git.ipfire.org Git - thirdparty/bird.git/blob - filter/filter.h
2 * BIRD Internet Routing Daemon -- Filters
4 * (c) 1999 Pavel Machek <pavel@ucw.cz>
5 * (c) 2018--2019 Maria Matejka <mq@jmq.cz>
7 * Can be freely distributed and used under the terms of the GNU GPL.
13 #include "lib/resource.h"
15 #include "lib/macro.h"
16 #include "nest/route.h"
17 #include "nest/attrs.h"
19 /* Possible return values of filter execution */
24 F_ACCEPT
, /* Need to preserve ordering: accepts < rejects! */
30 static inline const char *filter_return_str(const enum filter_return fret
) {
32 #define FRS(x) case x: return #x
41 default: bug("This shall not happen");
47 /* The filter encapsulating structure to be pointed-to from outside */
56 enum filter_return
f_run(const struct filter
*filter
, struct rte
**rte
, struct linpool
*tmp_pool
, int flags
);
57 enum filter_return
f_eval_rte(const struct f_line
*expr
, struct rte
**rte
, struct linpool
*tmp_pool
);
58 uint
f_eval_int(const struct f_line
*expr
);
59 enum filter_return
f_eval_buf(const struct f_line
*expr
, struct linpool
*tmp_pool
, buffer
*buf
);
61 char *filter_name(struct filter
*filter
);
62 int filter_same(struct filter
*new, struct filter
*old
);
63 int f_same(const struct f_line
*f1
, const struct f_line
*f2
);
65 #define FILTER_ACCEPT NULL
66 #define FILTER_REJECT ((void *) 1)
67 #define FILTER_UNDEF ((void *) 2) /* Used in BGP */
69 #define FF_SILENT 2 /* Silent filter execution */
71 /* Custom route attributes */
72 struct custom_attribute
{
74 struct f_dynamic_attr
*fda
;
78 struct custom_attribute
*ca_lookup(pool
*p
, const char *name
, int ea_type
);