diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-05-05 20:12:46 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-05-05 20:21:27 +0200 |
commit | d0d564ed1fba00cc3b2fdf4d646f080b2790b76a (patch) | |
tree | 698d17c51a94b3d82512b7ce1608a505a6e649ea /src/rule.c | |
parent | eea03c8fb560a8a6deede1bccbce78b52b2c2905 (diff) |
src: add rule_stmt_append() and use it
This helper function adds a statement at the end of the rule statement
list and it updates the rule statement counter.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -686,6 +686,12 @@ struct rule *rule_lookup_by_index(const struct chain *chain, uint64_t index) return NULL; } +void rule_stmt_append(struct rule *rule, struct stmt *stmt) +{ + list_add_tail(&stmt->list, &rule->stmts); + rule->num_stmts++; +} + void rule_stmt_insert_at(struct rule *rule, struct stmt *nstmt, struct stmt *stmt) { |