diff options
author | Maria Matejka <mq@ucw.cz> | 2018-12-27 14:26:11 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2019-02-20 22:30:54 +0100 |
commit | 4c553c5a5b40c21ba67bd82455e79678b204cd07 (patch) | |
tree | 693d5744a125dc6dd6ed42124bf3a082cbf5503a /nest/route.h | |
parent | 967b88d9388b3800efed45798542cd0b41f2b903 (diff) |
Filter refactoring: dropped the recursion from the interpreter
This is a major change of how the filters are interpreted. If everything
works how it should, it should not affect you unless you are hacking the
filters themselves.
Anyway, this change should make a huge improvement in the filter performance
as previous benchmarks showed that our major problem lies in the
recursion itself.
There are also some changes in nest and protocols, related mostly to
spreading const declarations throughout the whole BIRD and also to
refactored dynamic attribute definitions. The need of these came up
during the whole work and it is too difficult to split out these
not-so-related changes.
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nest/route.h b/nest/route.h index 74446f48..c7ed80ff 100644 --- a/nest/route.h +++ b/nest/route.h @@ -473,7 +473,7 @@ typedef struct eattr { byte type; /* Attribute type and several flags (EAF_...) */ union { u32 data; - struct adata *ptr; /* Attribute data elsewhere */ + const struct adata *ptr; /* Attribute data elsewhere */ } u; } eattr; @@ -517,6 +517,8 @@ typedef struct adata { byte data[0]; } adata; +extern const adata null_adata; /* adata of length 0 */ + static inline struct adata * lp_alloc_adata(struct linpool *pool, uint len) { @@ -525,7 +527,7 @@ lp_alloc_adata(struct linpool *pool, uint len) return ad; } -static inline int adata_same(struct adata *a, struct adata *b) +static inline int adata_same(const struct adata *a, const struct adata *b) { return (a->length == b->length && !memcmp(a->data, b->data, a->length)); } |