netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libnftnl 1/2] examples: nft-table-upd: don't use deprecated aliases
@ 2016-06-07 15:04 Pablo Neira Ayuso
  2016-06-07 15:04 ` [PATCH libnftnl 2/2] src: get rid of EXPORT_SYMBOL_ALIAS() Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-06-07 15:04 UTC (permalink / raw)
  To: netfilter-devel

Convert this example not to use the deprecated aliases anymore.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
This is a leftover from previous conversion.

 examples/nft-table-upd.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/examples/nft-table-upd.c b/examples/nft-table-upd.c
index bc6e02a..9b960bb 100644
--- a/examples/nft-table-upd.c
+++ b/examples/nft-table-upd.c
@@ -26,7 +26,7 @@ int main(int argc, char *argv[])
 	char buf[MNL_SOCKET_BUFFER_SIZE];
 	struct nlmsghdr *nlh;
 	uint32_t portid, seq, table_seq, family, flags;
-	struct nft_table *t = NULL;
+	struct nftnl_table *t = NULL;
 	struct mnl_nlmsg_batch *batch;
 	int ret, batching;
 
@@ -35,13 +35,13 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	t = nft_table_alloc();
+	t = nftnl_table_alloc();
 	if (t == NULL) {
 		perror("OOM");
 		exit(EXIT_FAILURE);
 	}
 
-	batching = nft_batch_is_supported();
+	batching = nftnl_batch_is_supported();
 	if (batching < 0) {
 		perror("cannot talk to nfnetlink");
 		exit(EXIT_FAILURE);
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
 	batch = mnl_nlmsg_batch_start(buf, sizeof(buf));
 
 	if (batching) {
-		nft_batch_begin(mnl_nlmsg_batch_current(batch), seq++);
+		nftnl_batch_begin(mnl_nlmsg_batch_current(batch), seq++);
 		mnl_nlmsg_batch_next(batch);
 	}
 
@@ -80,19 +80,19 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	nft_table_attr_set(t, NFT_TABLE_ATTR_NAME, argv[2]);
-	nft_table_attr_set_u32(t, NFT_TABLE_ATTR_FLAGS, flags);
+	nftnl_table_set(t, NFTNL_TABLE_NAME, argv[2]);
+	nftnl_table_set_u32(t, NFTNL_TABLE_FLAGS, flags);
 
 	table_seq = seq;
-	nlh = nft_table_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+	nlh = nftnl_table_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
 					NFT_MSG_NEWTABLE, family,
 					NLM_F_ACK, seq++);
-	nft_table_nlmsg_build_payload(nlh, t);
-	nft_table_free(t);
+	nftnl_table_nlmsg_build_payload(nlh, t);
+	nftnl_table_free(t);
 	mnl_nlmsg_batch_next(batch);
 
 	if (batching) {
-		nft_batch_end(mnl_nlmsg_batch_current(batch), seq++);
+		nftnl_batch_end(mnl_nlmsg_batch_current(batch), seq++);
 		mnl_nlmsg_batch_next(batch);
 	}
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-07 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-07 15:04 [PATCH libnftnl 1/2] examples: nft-table-upd: don't use deprecated aliases Pablo Neira Ayuso
2016-06-07 15:04 ` [PATCH libnftnl 2/2] src: get rid of EXPORT_SYMBOL_ALIAS() Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).