Skip to contentSkip to conversation

expr: expose nftnl_expr_build_payload()

PATCH New Pablo Neira Ayuso 1 participant 1 message Oct 16, 2020 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 expr: expose nftnl_expr_build_payload()

This function allows you to build the netlink attributes for expressions.

---
 include/libnftnl/expr.h | 2 ++
 src/expr.c              | 1 +
 src/libnftnl.map        | 1 +
 3 files changed, 4 insertions(+)
include/libnftnl/expr.h +2 -0
index dcbcf5c5c575..c2b2d8644bcd 100644
@@ -36,6 +36,8 @@ uint32_t nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type);
 uint64_t nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type);
 const char *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type);
 
+void nftnl_expr_build_payload(struct nlmsghdr *nlh, struct nftnl_expr *expr);
+
 int nftnl_expr_snprintf(char *buf, size_t buflen, const struct nftnl_expr *expr, uint32_t type, uint32_t flags);
 int nftnl_expr_fprintf(FILE *fp, const struct nftnl_expr *expr, uint32_t type, uint32_t flags);
 
src/expr.c +1 -0
index 80c4c36a9bd7..ed2f60e1429f 100644
@@ -203,6 +203,7 @@ const char *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type)
 	return (const char *)nftnl_expr_get(expr, type, &data_len);
 }
 
+EXPORT_SYMBOL(nftnl_expr_build_payload);
 void nftnl_expr_build_payload(struct nlmsghdr *nlh, struct nftnl_expr *expr)
 {
 	struct nlattr *nest;
src/libnftnl.map +1 -0
index ceafa3f6b117..7937e05b669d 100644
@@ -371,4 +371,5 @@ LIBNFTNL_14 {
 
 LIBNFTNL_15 {
   nftnl_obj_get_data;
+  nftnl_expr_build_payload;
 } LIBNFTNL_14;
Signature · 1 line
2.20.1