summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-05-05 20:12:46 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-05-05 20:21:27 +0200
commitd0d564ed1fba00cc3b2fdf4d646f080b2790b76a (patch)
tree698d17c51a94b3d82512b7ce1608a505a6e649ea /src/rule.c
parenteea03c8fb560a8a6deede1bccbce78b52b2c2905 (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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index 0759bec5..c58aa359 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -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)
{