summaryrefslogtreecommitdiffstats
path: root/examples/nft-set-elem-get.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nft-set-elem-get.c')
-rw-r--r--examples/nft-set-elem-get.c32
1 files changed, 16 insertions, 16 deletions
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) {