Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH libnfnl] expr: expose nftnl_expr_build_payload()
@ 2020-10-16 16:56 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2020-10-16 16:56 UTC (permalink / raw)
  To: netfilter-devel

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

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/libnftnl/expr.h | 2 ++
 src/expr.c              | 1 +
 src/libnftnl.map        | 1 +
 3 files changed, 4 insertions(+)

diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h
index dcbcf5c5c575..c2b2d8644bcd 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 80c4c36a9bd7..ed2f60e1429f 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 ceafa3f6b117..7937e05b669d 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;
-- 
2.20.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 16:56 [PATCH libnfnl] expr: expose nftnl_expr_build_payload() Pablo Neira Ayuso

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org
	public-inbox-index netfilter-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git