netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
nft_table_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/nft_table.h>
Include dependency graph for nft_table_obj.c:

Macros

#define NFT_TABLE_DIFF(ATTR, EXPR)   ATTR_DIFF(attrs, TABLE_ATTR_##ATTR, a, b, EXPR)
 
#define NFT_TABLE_DIFF_VAL(ATTR, FIELD)   NFT_TABLE_DIFF(ATTR, a->FIELD != b->FIELD)
 
#define NFT_TABLE_DIFF_DATA(ATTR, FIELD)
 

Functions

Allocation/Freeing
struct nfnl_nft_tablenfnl_nft_table_alloc (void)
 
void nfnl_nft_table_get (struct nfnl_nft_table *table)
 
void nfnl_nft_table_put (struct nfnl_nft_table *table)
 
Attributes
void nfnl_nft_table_set_family (struct nfnl_nft_table *table, uint8_t family)
 
int nfnl_nft_table_test_family (struct nfnl_nft_table *table)
 
uint8_t nfnl_nft_table_get_family (struct nfnl_nft_table *table)
 
int nfnl_nft_table_set_name (struct nfnl_nft_table *table, const char *name, int len)
 
int nfnl_nft_table_test_name (struct nfnl_nft_table *table)
 
const char * nfnl_nft_table_get_name (struct nfnl_nft_table *table)
 

Variables

struct nl_object_ops nft_table_obj_ops
 

Macro Definition Documentation

#define NFT_TABLE_DIFF (   ATTR,
  EXPR 
)    ATTR_DIFF(attrs, TABLE_ATTR_##ATTR, a, b, EXPR)
#define NFT_TABLE_DIFF_DATA (   ATTR,
  FIELD 
)
Value:
NFT_TABLE_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_TABLE_DIFF(ATTR, EXPR)
#define NFT_TABLE_DIFF_VAL (   ATTR,
  FIELD 
)    NFT_TABLE_DIFF(ATTR, a->FIELD != b->FIELD)

Function Documentation

struct nfnl_nft_table* nfnl_nft_table_alloc ( void  )

References nft_table_obj_ops, and nl_object_alloc().

Referenced by main(), and nfnlmsg_nft_table_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void nfnl_nft_table_get ( struct nfnl_nft_table table)

References nl_object_get().

Here is the call graph for this function:

uint8_t nfnl_nft_table_get_family ( struct nfnl_nft_table table)
const char* nfnl_nft_table_get_name ( struct nfnl_nft_table table)

References nl_data_get(), and nfnl_nft_table::table_name.

Here is the call graph for this function:

void nfnl_nft_table_put ( struct nfnl_nft_table table)

References nl_object_put().

Referenced by main(), and nfnlmsg_nft_table_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void nfnl_nft_table_set_family ( struct nfnl_nft_table table,
uint8_t  family 
)

References nfnl_nft_table::table_family.

Referenced by main(), and nfnlmsg_nft_table_parse().

Here is the caller graph for this function:

int nfnl_nft_table_set_name ( struct nfnl_nft_table table,
const char *  name,
int  len 
)

References data, nl_data_alloc(), nl_data_free(), NLE_NOMEM, NULL, and nfnl_nft_table::table_name.

Referenced by main(), and nfnlmsg_nft_table_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

int nfnl_nft_table_test_family ( struct nfnl_nft_table table)
int nfnl_nft_table_test_name ( struct nfnl_nft_table table)

Variable Documentation

struct nl_object_ops nft_table_obj_ops
Initial value:
= {
.oo_name = "netfilter/nft_table",
.oo_size = sizeof(struct nfnl_nft_table),
.oo_free_data = nft_table_free_data,
.oo_clone = nft_table_clone,
.oo_dump = {
[NL_DUMP_LINE] = nft_table_dump,
[NL_DUMP_DETAILS] = nft_table_dump,
[NL_DUMP_STATS] = nft_table_dump,
},
.oo_compare = nft_table_compare,
.oo_attrs2str = nft_table_attrs2str,
}
Dump object briefly on one line.
Definition: types.h:22
Definition: netlink-types.h:829
Dump all attributes but no statistics.
Definition: types.h:23
Dump all attributes including statistics.
Definition: types.h:24

Referenced by nfnl_nft_table_alloc().