netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
nft_chain_obj.c File Reference
#include <sys/types.h>
#include <linux/netfilter/nf_tables.h>
#include <netlink-local.h>
#include <netlink/netfilter/nfnl.h>
#include <netlink/netfilter/netfilter.h>
#include <netlink/netfilter/nft_chain.h>
Include dependency graph for nft_chain_obj.c:

Macros

#define NFT_CHAIN_DIFF(ATTR, EXPR)   ATTR_DIFF(attrs, CHAIN_ATTR_##ATTR, a, b, EXPR)
 
#define NFT_CHAIN_DIFF_VAL(ATTR, FIELD)   NFT_CHAIN_DIFF(ATTR, a->FIELD != b->FIELD)
 
#define NFT_CHAIN_DIFF_DATA(ATTR, FIELD)
 

Functions

Allocation/Freeing
struct nfnl_nft_chainnfnl_nft_chain_alloc (void)
 
void nfnl_nft_chain_get (struct nfnl_nft_chain *chain)
 
void nfnl_nft_chain_put (struct nfnl_nft_chain *chain)
 
Attributes
void nfnl_nft_chain_set_family (struct nfnl_nft_chain *chain, uint8_t family)
 
int nfnl_nft_chain_test_family (struct nfnl_nft_chain *chain)
 
uint8_t nfnl_nft_chain_get_family (struct nfnl_nft_chain *chain)
 
int nfnl_nft_chain_set_table (struct nfnl_nft_chain *chain, const char *table, int len)
 
int nfnl_nft_chain_test_table (struct nfnl_nft_chain *chain)
 
const char * nfnl_nft_chain_get_table (struct nfnl_nft_chain *chain)
 
int nfnl_nft_chain_set_name (struct nfnl_nft_chain *chain, const char *name, int len)
 
int nfnl_nft_chain_test_name (struct nfnl_nft_chain *chain)
 
uint64_t nfnl_nft_chain_get_handle (struct nfnl_nft_chain *chain)
 
void nfnl_nft_chain_set_handle (struct nfnl_nft_chain *chain, uint64_t handle)
 
int nfnl_nft_chain_test_handle (struct nfnl_nft_chain *chain)
 
const char * nfnl_nft_chain_get_name (struct nfnl_nft_chain *chain)
 
void nfnl_nft_chain_set_hooknum (struct nfnl_nft_chain *chain, uint32_t hooknum)
 
int nfnl_nft_chain_test_hooknum (struct nfnl_nft_chain *chain)
 
uint32_t nfnl_nft_chain_get_hooknum (struct nfnl_nft_chain *chain)
 
void nfnl_nft_chain_set_priority (struct nfnl_nft_chain *chain, int32_t priority)
 
int nfnl_nft_chain_test_priority (struct nfnl_nft_chain *chain)
 
int32_t nfnl_nft_chain_get_priority (struct nfnl_nft_chain *chain)
 

Variables

struct nl_object_ops nft_chain_obj_ops
 

Macro Definition Documentation

#define NFT_CHAIN_DIFF (   ATTR,
  EXPR 
)    ATTR_DIFF(attrs, CHAIN_ATTR_##ATTR, a, b, EXPR)
#define NFT_CHAIN_DIFF_DATA (   ATTR,
  FIELD 
)
Value:
NFT_CHAIN_DIFF(ATTR, nl_data_get_size(a->FIELD) != nl_data_get_size(b->FIELD) || \
memcmp(nl_data_get(a->FIELD), nl_data_get(b->FIELD), \
nl_data_get_size(a->FIELD)))
void * nl_data_get(const struct nl_data *)
Get data buffer of abstract data object.
Definition: data.c:144
size_t nl_data_get_size(const struct nl_data *)
Get size of data buffer of abstract data object.
Definition: data.c:154
#define NFT_CHAIN_DIFF(ATTR, EXPR)
#define NFT_CHAIN_DIFF_VAL (   ATTR,
  FIELD 
)    NFT_CHAIN_DIFF(ATTR, a->FIELD != b->FIELD)

Function Documentation

struct nfnl_nft_chain* nfnl_nft_chain_alloc ( void  )

References nft_chain_obj_ops, and nl_object_alloc().

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void nfnl_nft_chain_get ( struct nfnl_nft_chain chain)

References nl_object_get().

Here is the call graph for this function:

uint8_t nfnl_nft_chain_get_family ( struct nfnl_nft_chain chain)
uint64_t nfnl_nft_chain_get_handle ( struct nfnl_nft_chain chain)
uint32_t nfnl_nft_chain_get_hooknum ( struct nfnl_nft_chain chain)
const char* nfnl_nft_chain_get_name ( struct nfnl_nft_chain chain)

References nfnl_nft_chain::chain_name, and nl_data_get().

Here is the call graph for this function:

int32_t nfnl_nft_chain_get_priority ( struct nfnl_nft_chain chain)
const char* nfnl_nft_chain_get_table ( struct nfnl_nft_chain chain)

References nfnl_nft_chain::chain_table, and nl_data_get().

Here is the call graph for this function:

void nfnl_nft_chain_put ( struct nfnl_nft_chain chain)

References nl_object_put().

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void nfnl_nft_chain_set_family ( struct nfnl_nft_chain chain,
uint8_t  family 
)

References nfnl_nft_chain::chain_family.

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the caller graph for this function:

void nfnl_nft_chain_set_handle ( struct nfnl_nft_chain chain,
uint64_t  handle 
)

References nfnl_nft_chain::chain_handle.

Referenced by nfnlmsg_nft_chain_parse().

Here is the caller graph for this function:

void nfnl_nft_chain_set_hooknum ( struct nfnl_nft_chain chain,
uint32_t  hooknum 
)

References nfnl_nft_chain::chain_hooknum.

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the caller graph for this function:

int nfnl_nft_chain_set_name ( struct nfnl_nft_chain chain,
const char *  name,
int  len 
)

References nfnl_nft_chain::chain_name, data, nl_data_alloc(), nl_data_free(), NLE_NOMEM, and NULL.

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void nfnl_nft_chain_set_priority ( struct nfnl_nft_chain chain,
int32_t  priority 
)

References nfnl_nft_chain::chain_priority.

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the caller graph for this function:

int nfnl_nft_chain_set_table ( struct nfnl_nft_chain chain,
const char *  table,
int  len 
)

References nfnl_nft_chain::chain_table, data, nl_data_alloc(), nl_data_free(), NLE_NOMEM, and NULL.

Referenced by main(), and nfnlmsg_nft_chain_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_chain_test_family ( struct nfnl_nft_chain chain)
int nfnl_nft_chain_test_handle ( struct nfnl_nft_chain chain)
int nfnl_nft_chain_test_hooknum ( struct nfnl_nft_chain chain)
int nfnl_nft_chain_test_name ( struct nfnl_nft_chain chain)
int nfnl_nft_chain_test_priority ( struct nfnl_nft_chain chain)
int nfnl_nft_chain_test_table ( struct nfnl_nft_chain chain)

Variable Documentation

struct nl_object_ops nft_chain_obj_ops
Initial value:
= {
.oo_name = "netfilter/nft_chain",
.oo_size = sizeof(struct nfnl_nft_chain),
.oo_free_data = nft_chain_free_data,
.oo_clone = nft_chain_clone,
.oo_dump = {
},
.oo_compare = nft_chain_compare,
.oo_attrs2str = nft_chain_attrs2str,
}
Dump object briefly on one line.
Definition: types.h:22
struct nft_chain_list * nft_chain_dump(struct nft_handle *h)
Definition: nft.c:1088
Dump all attributes but no statistics.
Definition: types.h:23
Definition: netlink-types.h:836
Dump all attributes including statistics.
Definition: types.h:24

Referenced by nfnl_nft_chain_alloc().