From 760768890e60617acfd144dce875a4a3be14513c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 1 Sep 2015 20:19:56 +0200 Subject: 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 --- examples/nft-set-elem-get.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'examples/nft-set-elem-get.c') diff --git a/examples/nft-set-elem-get.c b/examples/nft-set-elem-get.c index 6908c2a..66b5524 100644 --- a/examples/nft-set-elem-get.c +++ b/examples/nft-set-elem-get.c @@ -22,26 +22,26 @@ static int set_cb(const struct nlmsghdr *nlh, void *data) { - struct nft_set *t; + struct nftnl_set *t; char buf[4096]; uint32_t *type = data; - t = nft_set_alloc(); + t = nftnl_set_alloc(); if (t == NULL) { perror("OOM"); goto err; } - if (nft_set_elems_nlmsg_parse(nlh, t) < 0) { - perror("nft_set_nlmsg_parse"); + if (nftnl_set_elems_nlmsg_parse(nlh, t) < 0) { + perror("nftnl_set_nlmsg_parse"); goto err_free; } - nft_set_snprintf(buf, sizeof(buf), t, *type, 0); + nftnl_set_snprintf(buf, sizeof(buf), t, *type, 0); printf("%s\n", buf); err_free: - nft_set_free(t); + nftnl_set_free(t); err: return MNL_CB_OK; } @@ -52,8 +52,8 @@ int main(int argc, char *argv[]) char buf[MNL_SOCKET_BUFFER_SIZE]; struct nlmsghdr *nlh; uint32_t portid, seq, family; - uint32_t type = NFT_OUTPUT_DEFAULT; - struct nft_set *t = NULL; + uint32_t type = NFTNL_OUTPUT_DEFAULT; + struct nftnl_set *t = NULL; int ret; if (argc < 4 || argc > 5) { @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) argv[0]); return EXIT_FAILURE; } - t = nft_set_alloc(); + t = nftnl_set_alloc(); if (t == NULL) { perror("OOM"); exit(EXIT_FAILURE); @@ -81,16 +81,16 @@ int main(int argc, char *argv[]) } if (argc == 5 && strcmp(argv[4], "json") == 0 ) - type = NFT_OUTPUT_JSON; + type = NFTNL_OUTPUT_JSON; else if (argc == 5 && strcmp(argv[4], "xml") == 0) - type = NFT_OUTPUT_XML; + type = NFTNL_OUTPUT_XML; - nlh = nft_set_nlmsg_build_hdr(buf, NFT_MSG_GETSETELEM, family, + nlh = nftnl_set_nlmsg_build_hdr(buf, NFT_MSG_GETSETELEM, family, NLM_F_DUMP|NLM_F_ACK, seq); - nft_set_attr_set(t, NFT_SET_ATTR_NAME, argv[3]); - nft_set_attr_set(t, NFT_SET_ATTR_TABLE, argv[2]); - nft_set_elems_nlmsg_build_payload(nlh, t); - nft_set_free(t); + nftnl_set_attr_set(t, NFTNL_SET_ATTR_NAME, argv[3]); + nftnl_set_attr_set(t, NFTNL_SET_ATTR_TABLE, argv[2]); + nftnl_set_elems_nlmsg_build_payload(nlh, t); + nftnl_set_free(t); nl = mnl_socket_open(NETLINK_NETFILTER); if (nl == NULL) { -- cgit v1.2.3