summaryrefslogtreecommitdiffstats
path: root/examples/nft-chain-add.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-09-01 20:19:56 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-09-07 19:24:19 +0200
commit760768890e60617acfd144dce875a4a3be14513c (patch)
tree14a3a4f53e81fd9b44c8481e123f2c0ceb6f2bff /examples/nft-chain-add.c
parentb7154e52fc417e927bef0bbfa5db6e7a71f28602 (diff)
src: rename existing functions to use the nftnl_ prefix
So we can use the nft_* prefix anytime soon for our upcoming higher level library. After this patch, the nft_* symbols become an alias of the nftnl_* symbols. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/nft-chain-add.c')
-rw-r--r--examples/nft-chain-add.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/nft-chain-add.c b/examples/nft-chain-add.c
index f7f640a..c50369e 100644
--- a/examples/nft-chain-add.c
+++ b/examples/nft-chain-add.c
@@ -20,9 +20,9 @@
#include <libmnl/libmnl.h>
#include <libnftnl/chain.h>
-static struct nft_chain *chain_add_parse(int argc, char *argv[])
+static struct nftnl_chain *chain_add_parse(int argc, char *argv[])
{
- struct nft_chain *t;
+ struct nftnl_chain *t;
int hooknum = 0;
if (argc == 6) {
@@ -43,16 +43,16 @@ static struct nft_chain *chain_add_parse(int argc, char *argv[])
}
}
- t = nft_chain_alloc();
+ t = nftnl_chain_alloc();
if (t == NULL) {
perror("OOM");
return NULL;
}
- nft_chain_attr_set(t, NFT_CHAIN_ATTR_TABLE, argv[2]);
- nft_chain_attr_set(t, NFT_CHAIN_ATTR_NAME, argv[3]);
+ nftnl_chain_attr_set(t, NFTNL_CHAIN_ATTR_TABLE, argv[2]);
+ nftnl_chain_attr_set(t, NFTNL_CHAIN_ATTR_NAME, argv[3]);
if (argc == 6) {
- nft_chain_attr_set_u32(t, NFT_CHAIN_ATTR_HOOKNUM, hooknum);
- nft_chain_attr_set_u32(t, NFT_CHAIN_ATTR_PRIO, atoi(argv[5]));
+ nftnl_chain_attr_set_u32(t, NFTNL_CHAIN_ATTR_HOOKNUM, hooknum);
+ nftnl_chain_attr_set_u32(t, NFTNL_CHAIN_ATTR_PRIO, atoi(argv[5]));
}
return t;
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
struct nlmsghdr *nlh;
uint32_t portid, seq, chain_seq;
int ret, family;
- struct nft_chain *t;
+ struct nftnl_chain *t;
struct mnl_nlmsg_batch *batch;
int batching;
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
if (t == NULL)
exit(EXIT_FAILURE);
- batching = nft_batch_is_supported();
+ batching = nftnl_batch_is_supported();
if (batching < 0) {
perror("cannot talk to nfnetlink");
exit(EXIT_FAILURE);
@@ -103,20 +103,20 @@ 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);
}
chain_seq = seq;
- nlh = nft_chain_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
+ nlh = nftnl_chain_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch),
NFT_MSG_NEWCHAIN, family,
NLM_F_ACK, seq++);
- nft_chain_nlmsg_build_payload(nlh, t);
- nft_chain_free(t);
+ nftnl_chain_nlmsg_build_payload(nlh, t);
+ nftnl_chain_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);
}