]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
expr: expose nftnl_expr_build_payload()
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 16 Oct 2020 16:53:37 +0000 (18:53 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 16 Oct 2020 16:55:30 +0000 (18:55 +0200)
This function allows you to build the netlink attributes for
expressions.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/libnftnl/expr.h
src/expr.c
src/libnftnl.map

index dcbcf5c5c575b7a82a093cf0caa95b7cae069f12..c2b2d8644bcdb2671bd65d8701f5c485b37ea728 100644 (file)
@@ -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);
 
index 80c4c36a9bd77490b3584103130d64dc66e3e582..ed2f60e1429f4ce6362762b3fa9b58dce3c2d817 100644 (file)
@@ -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;
index ceafa3f6b117476e7b11d290a6616e3839cbae89..7937e05b669dd1ef1e552728b04d8d35ac12885d 100644 (file)
@@ -371,4 +371,5 @@ LIBNFTNL_14 {
 
 LIBNFTNL_15 {
   nftnl_obj_get_data;
+  nftnl_expr_build_payload;
 } LIBNFTNL_14;