expr: add nftnl_rule_del_expr()
Pablo Neira Ayuso
maintainerPATCH 1/1 expr: add nftnl_rule_del_expr()
Add a function to remove expression from the rule list.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- include/libnftnl/rule.h | 1 + src/libnftnl.map | 1 + src/rule.c | 6 ++++++ 3 files changed, 8 insertions(+)
include/libnftnl/rule.h +1 -0
@@ -51,6 +51,7 @@ uint32_t nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr);uint64_t nftnl_rule_get_u64 (const struct nftnl_rule *r,uint16_t attr);void nftnl_rule_add_expr (struct nftnl_rule *r,struct nftnl_expr *expr); +void nftnl_rule_del_expr (struct nftnl_expr *expr);struct nlmsghdr ;
src/libnftnl.map +1 -0
@@ -372,4 +372,5 @@ LIBNFTNL_14 { LIBNFTNL_15 { nftnl_obj_get_data; nftnl_expr_build_payload; + nftnl_rule_del_expr; } LIBNFTNL_14;
src/rule.c +6 -0
@@ -330,6 +330,12 @@ void nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_expr *expr)list_add_tail (&expr->head, &r->expr_list); } +EXPORT_SYMBOL (nftnl_rule_del_expr); +void nftnl_rule_del_expr (struct nftnl_expr *expr) +{ +list_del (&expr->head); +} +static int nftnl_rule_parse_attr_cb (const struct nlattr *attr,void *data) {const struct nlattr **tb = data;
Signature · 1 line
2.20.1