netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Collaboration diagram for nf_tables:

Macros

#define NFNLMSG_NFT_TYPE(type)   NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
 
#define NFNLMSG_NFT_TYPE(type)   NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
 
#define NFNLMSG_NFT_TYPE(type)   NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
 
#define NFNLMSG_NFT_TYPE(type)   NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
 
#define NFNLMSG_NFT_TYPE(type)   NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
 

Functions

int nfnlmsg_nft_chain_parse (struct nlmsghdr *nlh, struct nfnl_nft_chain **result)
 
int nfnl_nft_chain_dump_request (struct nl_sock *h)
 
int nfnl_nft_chain_build_add_request (struct nfnl_nft_chain *chain, int flags, struct nl_msg **result)
 
int nfnl_nft_chain_add (struct nl_sock *h, struct nfnl_nft_chain *chain, int flags)
 
int nfnl_nft_chain_build_delete_request (struct nfnl_nft_chain *chain, int flags, struct nl_msg **result)
 
int nfnl_nft_chain_delete (struct nl_sock *h, struct nfnl_nft_chain *chain, int flags)
 
int nfnl_nft_chain_build_query_request (struct nfnl_nft_chain *chain, int flags, struct nl_msg **result)
 
int nfnl_nft_chain_query (struct nl_sock *h, struct nfnl_nft_chain *chain, int flags)
 
int nfnl_nft_expr_parse (struct nlattr *nla, struct nfnl_nft_expr **res)
 
int nfnl_nft_expr_build_message (struct nl_msg *msg, struct nfnl_nft_expr *expr)
 
int nfnlmsg_nft_rule_parse (struct nlmsghdr *nlh, struct nfnl_nft_rule **result)
 
int nfnl_nft_rule_dump_request (struct nl_sock *h)
 
int nfnl_nft_rule_build_add_request (struct nfnl_nft_rule *rule, int flags, struct nl_msg **result)
 
int nfnl_nft_rule_add (struct nl_sock *h, struct nfnl_nft_rule *rule, int flags)
 
int nfnl_nft_rule_build_delete_request (struct nfnl_nft_rule *rule, int flags, struct nl_msg **result)
 
int nfnl_nft_rule_delete (struct nl_sock *h, struct nfnl_nft_rule *rule, int flags)
 
int nfnl_nft_rule_build_query_request (struct nfnl_nft_rule *rule, int flags, struct nl_msg **result)
 
int nfnl_nft_rule_query (struct nl_sock *h, struct nfnl_nft_rule *rule, int flags)
 
int nfnlmsg_nft_set_parse (struct nlmsghdr *nlh, struct nfnl_nft_set **result)
 
int nfnl_nft_set_dump_request (struct nl_sock *h, int family, const char *table)
 
int nfnl_nft_set_build_add_request (struct nfnl_nft_set *set, int flags, struct nl_msg **result)
 
int nfnl_nft_set_add (struct nl_sock *h, struct nfnl_nft_set *set, int flags)
 
int nfnl_nft_set_build_delete_request (struct nfnl_nft_set *set, int flags, struct nl_msg **result)
 
int nfnl_nft_set_delete (struct nl_sock *h, struct nfnl_nft_set *set, int flags)
 
int nfnl_nft_set_build_query_request (struct nfnl_nft_set *set, int flags, struct nl_msg **result)
 
int nfnl_nft_set_query (struct nl_sock *h, struct nfnl_nft_set *set, int flags)
 
int nfnl_nft_setelem_dump_request (struct nl_sock *h, struct nfnl_nft_set *set)
 
int nfnl_nft_setelem_add (struct nl_sock *h, struct nfnl_nft_set *set, struct nl_cache *elements, int flags)
 
int nfnl_nft_setelem_build_delete_request (struct nfnl_nft_set *set, int flags, struct nl_msg **result)
 
int nfnl_nft_setelem_delete (struct nl_sock *h, struct nfnl_nft_set *set, struct nl_cache *elements, int flags)
 
int nfnl_nft_setelem_build_query_request (struct nfnl_nft_set *set, int flags, struct nl_msg **result)
 
int nfnl_nft_setelem_query (struct nl_sock *h, struct nfnl_nft_set *set, int flags)
 
int nfnlmsg_nft_table_parse (struct nlmsghdr *nlh, struct nfnl_nft_table **result)
 
int nfnl_nft_table_dump_request (struct nl_sock *h)
 
int nfnl_nft_table_build_add_request (struct nfnl_nft_table *table, int flags, struct nl_msg **result)
 
int nfnl_nft_table_add (struct nl_sock *h, struct nfnl_nft_table *table, int flags)
 
int nfnl_nft_table_build_delete_request (struct nfnl_nft_table *table, int flags, struct nl_msg **result)
 
int nfnl_nft_table_delete (struct nl_sock *h, struct nfnl_nft_table *table, int flags)
 
int nfnl_nft_table_build_query_request (struct nfnl_nft_table *table, int flags, struct nl_msg **result)
 
int nfnl_nft_table_query (struct nl_sock *h, struct nfnl_nft_table *table, int flags)
 

Cache Management

int nfnl_nft_chain_alloc_cache (struct nl_sock *sock, struct nl_cache **result)
 Build a conntrack cache holding all nf_tables chains currently in the kernel. More...
 

Cache Management

int nfnl_nft_rule_alloc_cache (struct nl_sock *sock, struct nl_cache **result)
 Build a rule cache holding all nf_tables rules currently in the kernel. More...
 

Cache Management

int nfnl_nft_set_alloc_cache (struct nl_sock *sock, int family, const char *table, struct nl_cache **result)
 Build a set cache holding all nf_tables sets currently in the kernel. More...
 

Cache Management

int nfnl_nft_setelem_alloc_cache (struct nl_sock *sock, struct nfnl_nft_set *set, struct nl_cache **result)
 Build a set cache holding all nf_tables sets currently in the kernel. More...
 

Cache Management

int nfnl_nft_table_alloc_cache (struct nl_sock *sock, struct nl_cache **result)
 Build a conntrack cache holding all nf_tables tables currently in the kernel. More...
 

Detailed Description

Macro Definition Documentation

#define NFNLMSG_NFT_TYPE (   type)    NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
#define NFNLMSG_NFT_TYPE (   type)    NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
#define NFNLMSG_NFT_TYPE (   type)    NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
#define NFNLMSG_NFT_TYPE (   type)    NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))
#define NFNLMSG_NFT_TYPE (   type)    NFNLMSG_TYPE(NFNL_SUBSYS_NFTABLES, (type))

Function Documentation

int nfnl_nft_chain_add ( struct nl_sock h,
struct nfnl_nft_chain chain,
int  flags 
)

References nfnl_nft_chain_build_add_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_chain_alloc_cache ( struct nl_sock sock,
struct nl_cache **  result 
)

Build a conntrack cache holding all nf_tables chains currently in the kernel.

  • sock netlink sock

Allocates a new cache, initializes it properly and updates it to contain all chains currently in the kernel.

Note
The caller is responsible for destroying and freeing the cache after using it.
Returns
The cache or NULL if an error has occured.

References nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_chain_build_add_request ( struct nfnl_nft_chain chain,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_NEWCHAIN, and NLM_F_CREATE.

Referenced by nfnl_nft_chain_add().

Here is the caller graph for this function:

int nfnl_nft_chain_build_delete_request ( struct nfnl_nft_chain chain,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_DELCHAIN.

Referenced by nfnl_nft_chain_delete().

Here is the caller graph for this function:

int nfnl_nft_chain_build_query_request ( struct nfnl_nft_chain chain,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_GETCHAIN.

Referenced by nfnl_nft_chain_query().

Here is the caller graph for this function:

int nfnl_nft_chain_delete ( struct nl_sock h,
struct nfnl_nft_chain chain,
int  flags 
)

References nfnl_nft_chain_build_delete_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_chain_dump_request ( struct nl_sock h)

References nfnl_send_simple(), NFNL_SUBSYS_NFTABLES, NFT_MSG_GETCHAIN, and NLM_F_DUMP.

Here is the call graph for this function:

int nfnl_nft_chain_query ( struct nl_sock h,
struct nfnl_nft_chain chain,
int  flags 
)

References nfnl_nft_chain_build_query_request(), nl_send_auto_complete(), and nlmsg_free().

Here is the call graph for this function:

int nfnl_nft_expr_build_message ( struct nl_msg msg,
struct nfnl_nft_expr expr 
)
int nfnl_nft_expr_parse ( struct nlattr nla,
struct nfnl_nft_expr **  res 
)
int nfnl_nft_rule_add ( struct nl_sock h,
struct nfnl_nft_rule rule,
int  flags 
)

References nfnl_nft_rule_build_add_request(), nl_send_auto_complete(), NLM_F_CREATE, and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_rule_alloc_cache ( struct nl_sock sock,
struct nl_cache **  result 
)

Build a rule cache holding all nf_tables rules currently in the kernel.

  • sock netlink sock

Allocates a new cache, initializes it properly and updates it to contain all rules currently in the kernel.

Note
The caller is responsible for destroying and freeing the cache after using it.
Returns
The cache or NULL if an error has occured.

References nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_rule_build_add_request ( struct nfnl_nft_rule rule,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_NEWRULE.

Referenced by nfnl_nft_rule_add().

Here is the caller graph for this function:

int nfnl_nft_rule_build_delete_request ( struct nfnl_nft_rule rule,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_DELRULE.

Referenced by nfnl_nft_rule_delete(), and nfnl_nft_rule_query().

Here is the caller graph for this function:

int nfnl_nft_rule_build_query_request ( struct nfnl_nft_rule rule,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_GETRULE.

int nfnl_nft_rule_delete ( struct nl_sock h,
struct nfnl_nft_rule rule,
int  flags 
)

References nfnl_nft_rule_build_delete_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_rule_dump_request ( struct nl_sock h)

References nfnl_send_simple(), NFNL_SUBSYS_NFTABLES, NFT_MSG_GETRULE, and NLM_F_DUMP.

Here is the call graph for this function:

int nfnl_nft_rule_query ( struct nl_sock h,
struct nfnl_nft_rule rule,
int  flags 
)

References nfnl_nft_rule_build_delete_request(), nl_send_auto_complete(), and nlmsg_free().

Here is the call graph for this function:

int nfnl_nft_set_add ( struct nl_sock h,
struct nfnl_nft_set set,
int  flags 
)

References nfnl_nft_set_build_add_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_set_alloc_cache ( struct nl_sock sock,
int  family,
const char *  table,
struct nl_cache **  result 
)

Build a set cache holding all nf_tables sets currently in the kernel.

  • sock netlink sock
  • family address family
  • table table
  • result

Allocates a new cache, initializes it properly and updates it to contain all sets currently in the specified table.

Note
The caller is responsible for destroying and freeing the cache after using it.
Returns
The cache or NULL if an error has occured.

References nl_cache::c_iarg1, nl_cache::c_iarg2, nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_set_build_add_request ( struct nfnl_nft_set set,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_NEWSET, and NLM_F_CREATE.

Referenced by nfnl_nft_set_add().

Here is the caller graph for this function:

int nfnl_nft_set_build_delete_request ( struct nfnl_nft_set set,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_DELSET.

Referenced by nfnl_nft_set_delete().

Here is the caller graph for this function:

int nfnl_nft_set_build_query_request ( struct nfnl_nft_set set,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_GETSET.

Referenced by nfnl_nft_set_query(), and nfnl_nft_setelem_query().

Here is the caller graph for this function:

int nfnl_nft_set_delete ( struct nl_sock h,
struct nfnl_nft_set set,
int  flags 
)

References nfnl_nft_set_build_delete_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_set_dump_request ( struct nl_sock h,
int  family,
const char *  table 
)
int nfnl_nft_set_query ( struct nl_sock h,
struct nfnl_nft_set set,
int  flags 
)

References nfnl_nft_set_build_query_request(), nl_send_auto_complete(), and nlmsg_free().

Here is the call graph for this function:

int nfnl_nft_setelem_add ( struct nl_sock h,
struct nfnl_nft_set set,
struct nl_cache elements,
int  flags 
)

References NFT_MSG_NEWSETELEM, and NLM_F_CREATE.

int nfnl_nft_setelem_alloc_cache ( struct nl_sock sock,
struct nfnl_nft_set set,
struct nl_cache **  result 
)

Build a set cache holding all nf_tables sets currently in the kernel.

  • sock netlink sock
  • set nftables set
  • result

Allocates a new cache, initializes it properly and updates it to contain all elements currently in the specified set.

Note
The caller is responsible for destroying and freeing the cache after using it.
Returns
The cache or NULL if an error has occured.

References nl_cache::c_iarg1, nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.

Here is the call graph for this function:

int nfnl_nft_setelem_build_delete_request ( struct nfnl_nft_set set,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_DELSETELEM, and NULL.

int nfnl_nft_setelem_build_query_request ( struct nfnl_nft_set set,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_GETSETELEM, and NULL.

int nfnl_nft_setelem_delete ( struct nl_sock h,
struct nfnl_nft_set set,
struct nl_cache elements,
int  flags 
)

References NFT_MSG_DELSETELEM.

int nfnl_nft_setelem_query ( struct nl_sock h,
struct nfnl_nft_set set,
int  flags 
)

References nfnl_nft_set_build_query_request(), nl_send_auto_complete(), and nlmsg_free().

Here is the call graph for this function:

int nfnl_nft_table_add ( struct nl_sock h,
struct nfnl_nft_table table,
int  flags 
)

References nfnl_nft_table_build_add_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_table_alloc_cache ( struct nl_sock sock,
struct nl_cache **  result 
)

Build a conntrack cache holding all nf_tables tables currently in the kernel.

  • sock netlink sock

Allocates a new cache, initializes it properly and updates it to contain all tables currently in the kernel.

Note
The caller is responsible for destroying and freeing the cache after using it.
Returns
The cache or NULL if an error has occured.

References nl_cache_alloc(), nl_cache_refill(), and NLE_NOMEM.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_table_build_add_request ( struct nfnl_nft_table table,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_NEWTABLE, and NLM_F_CREATE.

Referenced by nfnl_nft_table_add().

Here is the caller graph for this function:

int nfnl_nft_table_build_delete_request ( struct nfnl_nft_table table,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_DELTABLE.

Referenced by nfnl_nft_table_delete().

Here is the caller graph for this function:

int nfnl_nft_table_build_query_request ( struct nfnl_nft_table table,
int  flags,
struct nl_msg **  result 
)

References NFT_MSG_GETTABLE.

Referenced by nfnl_nft_table_query().

Here is the caller graph for this function:

int nfnl_nft_table_delete ( struct nl_sock h,
struct nfnl_nft_table table,
int  flags 
)

References nfnl_nft_table_build_delete_request(), nl_send_auto_complete(), and nlmsg_free().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_table_dump_request ( struct nl_sock h)

References nfnl_send_simple(), NFNL_SUBSYS_NFTABLES, NFT_MSG_GETTABLE, and NLM_F_DUMP.

Here is the call graph for this function:

int nfnl_nft_table_query ( struct nl_sock h,
struct nfnl_nft_table table,
int  flags 
)

References nfnl_nft_table_build_query_request(), nl_send_auto_complete(), and nlmsg_free().

Here is the call graph for this function: