#include <libmnl/libmnl.h>
#include <libnftnl/common.h>
#include <libnftnl/ruleset.h>
#include <libnftnl/table.h>
#include <libnftnl/chain.h>
#include <libnftnl/set.h>
#include <libnftnl/rule.h>
#include "config.h"
Functions | |
struct nft_rule_list * | mnl_rule_dump (struct mnl_socket *nf_sock, int family) |
struct nft_chain_list * | mnl_chain_dump (struct mnl_socket *nf_sock, int family) |
struct nft_table_list * | mnl_table_dump (struct mnl_socket *nf_sock, int family) |
struct nft_set_list * | mnl_set_dump (struct mnl_socket *nf_sock, int family, const char *table) |
int | mnl_setelem_get (struct mnl_socket *nf_sock, struct nft_set *nls) |
struct nft_ruleset * | mnl_ruleset_dump (struct mnl_socket *nf_sock) |
int | nfts_socket_open (struct nft_sync_inst *nfts_inst) |
void | nfts_socket_close (struct nft_sync_inst *nfts_inst) |
const char * | netlink_dump_ruleset (struct mnl_socket *s) |
struct nft_chain_list* mnl_chain_dump | ( | struct mnl_socket * | nf_sock, |
int | family | ||
) |
References MNL_SOCKET_BUFFER_SIZE, nft_chain_list_alloc(), nft_chain_list_free(), nft_chain_nlmsg_build_hdr, NFT_MSG_GETCHAIN, nlh, NLM_F_DUMP, nlmsghdr::nlmsg_len, and NULL.
Referenced by mnl_ruleset_dump().
struct nft_rule_list* mnl_rule_dump | ( | struct mnl_socket * | nf_sock, |
int | family | ||
) |
References MNL_SOCKET_BUFFER_SIZE, NFT_MSG_GETRULE, nft_rule_list_alloc(), nft_rule_list_free(), nft_rule_nlmsg_build_hdr, nlh, NLM_F_DUMP, nlmsghdr::nlmsg_len, and NULL.
Referenced by mnl_ruleset_dump().
struct nft_ruleset* mnl_ruleset_dump | ( | struct mnl_socket * | nf_sock | ) |
References nft_table::family, mnl_chain_dump(), mnl_rule_dump(), mnl_set_dump(), mnl_table_dump(), NFPROTO_UNSPEC, nft_ruleset_alloc(), NFT_RULESET_ATTR_CHAINLIST, NFT_RULESET_ATTR_RULELIST, nft_ruleset_attr_set(), NFT_RULESET_ATTR_SETLIST, NFT_RULESET_ATTR_TABLELIST, nft_set_list_alloc(), NFT_TABLE_ATTR_FAMILY, nft_table_attr_get_str(), nft_table_attr_get_u32(), NFT_TABLE_ATTR_NAME, nft_table_list_iter_create(), nft_table_list_iter_destroy(), nft_table_list_iter_next(), NULL, and s.
Referenced by netlink_dump_ruleset().
struct nft_set_list* mnl_set_dump | ( | struct mnl_socket * | nf_sock, |
int | family, | ||
const char * | table | ||
) |
References MNL_SOCKET_BUFFER_SIZE, NFT_MSG_GETSET, nft_set_alloc(), nft_set_attr_set(), NFT_SET_ATTR_TABLE, nft_set_free(), nft_set_list_alloc(), nft_set_list_free(), nft_set_nlmsg_build_hdr, nft_set_nlmsg_build_payload(), nlh, NLM_F_ACK, NLM_F_DUMP, nlmsghdr::nlmsg_len, NULL, and s.
Referenced by mnl_ruleset_dump().
int mnl_setelem_get | ( | struct mnl_socket * | nf_sock, |
struct nft_set * | nls | ||
) |
References MNL_SOCKET_BUFFER_SIZE, NFT_MSG_GETSETELEM, NFT_SET_ATTR_FAMILY, nft_set_attr_get_u32(), nft_set_nlmsg_build_hdr, nft_set_nlmsg_build_payload(), nlh, NLM_F_ACK, NLM_F_DUMP, and nlmsghdr::nlmsg_len.
struct nft_table_list* mnl_table_dump | ( | struct mnl_socket * | nf_sock, |
int | family | ||
) |
References MNL_SOCKET_BUFFER_SIZE, NFT_MSG_GETTABLE, nft_table_list_alloc(), nft_table_list_free(), nft_table_nlmsg_build_hdr, nlh, NLM_F_DUMP, nlmsghdr::nlmsg_len, and NULL.
Referenced by mnl_ruleset_dump().
const char* netlink_dump_ruleset | ( | struct mnl_socket * | s | ) |
References buf, mnl_ruleset_dump(), NFT_OUTPUT_XML, nft_ruleset_free(), nft_ruleset_snprintf(), NULL, and SNPRINTF_BUFSIZ.
void nfts_socket_close | ( | struct nft_sync_inst * | nfts_inst | ) |
References mnl_socket_close(), and nft_sync_inst::nl_query_sock.
Referenced by main().
int nfts_socket_open | ( | struct nft_sync_inst * | nfts_inst | ) |
References nft_sync_inst::nl_query_sock, NULL, and s.
Referenced by main().