diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-12-16 16:39:09 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-12-18 12:33:22 +0100 |
commit | e6d1d0d6119585a5cd63fcc02c0eb98e30b095cb (patch) | |
tree | 3b8c7c29b6b80a54dbfd4d485b73ce00d0f417f5 /include | |
parent | 242965f452e64fef9faff6689df4b2c205823209 (diff) |
src: add set element multi-statement support
Extend the set element infrastructure to support for several statements.
This patch places the statements right after the key when printing it.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/expression.h | 2 | ||||
-rw-r--r-- | include/list.h | 7 | ||||
-rw-r--r-- | include/rule.h | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/include/expression.h b/include/expression.h index 894a68d2..718dac5a 100644 --- a/include/expression.h +++ b/include/expression.h @@ -280,7 +280,7 @@ struct expr { uint64_t timeout; uint64_t expiration; const char *comment; - struct stmt *stmt; + struct list_head stmt_list; uint32_t elem_flags; }; struct { diff --git a/include/list.h b/include/list.h index 9c4da817..857921e3 100644 --- a/include/list.h +++ b/include/list.h @@ -348,6 +348,13 @@ static inline void list_splice_tail_init(struct list_head *list, #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) +/** + * list_next_entry - get the next element in list + * @pos: the type * to cursor + * @member: the name of the list_head within the struct. + */ +#define list_next_entry(pos, member) \ + list_entry((pos)->member.next, typeof(*(pos)), member) /** * list_for_each_entry - iterate over list of given type diff --git a/include/rule.h b/include/rule.h index 119fc19d..330a09aa 100644 --- a/include/rule.h +++ b/include/rule.h @@ -333,7 +333,7 @@ struct set { struct expr *init; struct expr *rg_cache; uint32_t policy; - struct stmt *stmt; + struct list_head stmt_list; bool root; bool automerge; bool key_typeof_valid; |