From d0d564ed1fba00cc3b2fdf4d646f080b2790b76a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 5 May 2020 20:12:46 +0200 Subject: 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 --- src/rule.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/rule.c') 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) { -- cgit v1.2.3