From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH libnftnl 1/2] examples: nft-table-upd: don't use deprecated aliases
Date: Tue, 7 Jun 2016 17:04:31 +0200 [thread overview]
Message-ID: <1465311872-17878-1-git-send-email-pablo@netfilter.org> (raw)
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
next reply other threads:[~2016-06-07 15:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 15:04 Pablo Neira Ayuso [this message]
2016-06-07 15:04 ` [PATCH libnftnl 2/2] src: get rid of EXPORT_SYMBOL_ALIAS() Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465311872-17878-1-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).