diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-09-01 20:19:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-09-07 19:24:19 +0200 |
commit | 760768890e60617acfd144dce875a4a3be14513c (patch) | |
tree | 14a3a4f53e81fd9b44c8481e123f2c0ceb6f2bff /examples/nft-table-add.c | |
parent | b7154e52fc417e927bef0bbfa5db6e7a71f28602 (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-table-add.c')
-rw-r--r-- | examples/nft-table-add.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/nft-table-add.c b/examples/nft-table-add.c index 9340128..f8ae46f 100644 --- a/examples/nft-table-add.c +++ b/examples/nft-table-add.c @@ -20,9 +20,9 @@ #include <libmnl/libmnl.h> #include <libnftnl/table.h> -static struct nft_table *table_add_parse(int argc, char *argv[]) +static struct nftnl_table *table_add_parse(int argc, char *argv[]) { - struct nft_table *t; + struct nftnl_table *t; uint16_t family; if (strcmp(argv[1], "ip") == 0) @@ -38,14 +38,14 @@ static struct nft_table *table_add_parse(int argc, char *argv[]) return NULL; } - t = nft_table_alloc(); + t = nftnl_table_alloc(); if (t == NULL) { perror("OOM"); return NULL; } - nft_table_attr_set_u32(t, NFT_TABLE_ATTR_FAMILY, family); - nft_table_attr_set_str(t, NFT_TABLE_ATTR_NAME, argv[2]); + nftnl_table_attr_set_u32(t, NFTNL_TABLE_ATTR_FAMILY, family); + nftnl_table_attr_set_str(t, NFTNL_TABLE_ATTR_NAME, argv[2]); return t; } @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) char buf[MNL_SOCKET_BUFFER_SIZE]; struct nlmsghdr *nlh; uint32_t portid, seq, table_seq, family; - struct nft_table *t; + struct nftnl_table *t; struct mnl_nlmsg_batch *batch; int ret, batching; @@ -69,7 +69,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); @@ -79,21 +79,21 @@ 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); } table_seq = seq; - family = nft_table_attr_get_u32(t, NFT_TABLE_ATTR_FAMILY); - nlh = nft_table_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch), + family = nftnl_table_attr_get_u32(t, NFTNL_TABLE_ATTR_FAMILY); + 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); } |