netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mnl.c File Reference
#include <errno.h>
#include <stdlib.h>
#include "mnl.h"
#include "linux/netfilter/nf_tables.h"
#include "linux/netfilter.h"
Include dependency graph for mnl.c:

Macros

#define SNPRINTF_BUFSIZ   4096
 

Functions

struct nft_rule_listmnl_rule_dump (struct mnl_socket *nf_sock, int family)
 
struct nft_chain_listmnl_chain_dump (struct mnl_socket *nf_sock, int family)
 
struct nft_table_listmnl_table_dump (struct mnl_socket *nf_sock, int family)
 
struct nft_set_listmnl_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_rulesetmnl_ruleset_dump (struct mnl_socket *nf_sock)
 
int nfts_socket_open (struct nft_sync_inst *inst)
 
void nfts_socket_close (struct nft_sync_inst *inst)
 
const char * netlink_dump_ruleset (struct mnl_socket *s)
 

Macro Definition Documentation

#define SNPRINTF_BUFSIZ   4096

Referenced by netlink_dump_ruleset().

Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

struct nft_set_list* mnl_set_dump ( struct mnl_socket nf_sock,
int  family,
const char *  table 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

void nfts_socket_close ( struct nft_sync_inst inst)

References mnl_socket_close(), and nft_sync_inst::nl_query_sock.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfts_socket_open ( struct nft_sync_inst inst)

References nft_sync_inst::nl_query_sock, NULL, and s.

Referenced by main().

Here is the caller graph for this function: