From: Pablo Neira Ayuso Date: Fri, 16 Oct 2020 16:53:37 +0000 (+0200) Subject: expr: expose nftnl_expr_build_payload() X-Git-Tag: libnftnl-1.1.8~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dab7890f30c2d3b3fd39b63f23e70e78e8dba09e;p=thirdparty%2Flibnftnl.git expr: expose nftnl_expr_build_payload() This function allows you to build the netlink attributes for expressions. Signed-off-by: Pablo Neira Ayuso --- diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h index dcbcf5c5..c2b2d864 100644 --- a/include/libnftnl/expr.h +++ b/include/libnftnl/expr.h @@ -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); diff --git a/src/expr.c b/src/expr.c index 80c4c36a..ed2f60e1 100644 --- a/src/expr.c +++ b/src/expr.c @@ -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; diff --git a/src/libnftnl.map b/src/libnftnl.map index ceafa3f6..7937e05b 100644 --- a/src/libnftnl.map +++ b/src/libnftnl.map @@ -371,4 +371,5 @@ LIBNFTNL_14 { LIBNFTNL_15 { nftnl_obj_get_data; + nftnl_expr_build_payload; } LIBNFTNL_14;