netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
set_elem.c File Reference
#include "internal.h"
#include <time.h>
#include <endian.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <errno.h>
#include <libmnl/libmnl.h>
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/nf_tables.h>
#include <libnftnl/set.h>
#include <libnftnl/rule.h>
#include "linux_list.h"
#include "expr/data_reg.h"
Include dependency graph for set_elem.c:

Data Structures

struct  nft_set_elems_iter
 

Functions

struct nft_set_elemnft_set_elem_alloc (void)
 
 EXPORT_SYMBOL (nft_set_elem_alloc)
 
void nft_set_elem_free (struct nft_set_elem *s)
 
 EXPORT_SYMBOL (nft_set_elem_free)
 
bool nft_set_elem_attr_is_set (const struct nft_set_elem *s, uint16_t attr)
 
 EXPORT_SYMBOL (nft_set_elem_attr_is_set)
 
void nft_set_elem_attr_unset (struct nft_set_elem *s, uint16_t attr)
 
 EXPORT_SYMBOL (nft_set_elem_attr_unset)
 
void nft_set_elem_attr_set (struct nft_set_elem *s, uint16_t attr, const void *data, uint32_t data_len)
 
 EXPORT_SYMBOL (nft_set_elem_attr_set)
 
void nft_set_elem_attr_set_u32 (struct nft_set_elem *s, uint16_t attr, uint32_t val)
 
 EXPORT_SYMBOL (nft_set_elem_attr_set_u32)
 
void nft_set_elem_attr_set_str (struct nft_set_elem *s, uint16_t attr, const char *str)
 
 EXPORT_SYMBOL (nft_set_elem_attr_set_str)
 
const void * nft_set_elem_attr_get (struct nft_set_elem *s, uint16_t attr, uint32_t *data_len)
 
 EXPORT_SYMBOL (nft_set_elem_attr_get)
 
const char * nft_set_elem_attr_get_str (struct nft_set_elem *s, uint16_t attr)
 
 EXPORT_SYMBOL (nft_set_elem_attr_get_str)
 
uint32_t nft_set_elem_attr_get_u32 (struct nft_set_elem *s, uint16_t attr)
 
 EXPORT_SYMBOL (nft_set_elem_attr_get_u32)
 
void nft_set_elem_nlmsg_build_payload (struct nlmsghdr *nlh, struct nft_set_elem *e)
 
void nft_set_elems_nlmsg_build_payload (struct nlmsghdr *nlh, struct nft_set *s)
 
 EXPORT_SYMBOL (nft_set_elems_nlmsg_build_payload)
 
int nft_set_elems_nlmsg_parse (const struct nlmsghdr *nlh, struct nft_set *s)
 
 EXPORT_SYMBOL (nft_set_elems_nlmsg_parse)
 
int nft_set_elem_parse (struct nft_set_elem *e, enum nft_parse_type type, const char *data, struct nft_parse_err *err)
 
 EXPORT_SYMBOL (nft_set_elem_parse)
 
int nft_set_elem_parse_file (struct nft_set_elem *e, enum nft_parse_type type, FILE *fp, struct nft_parse_err *err)
 
 EXPORT_SYMBOL (nft_set_elem_parse_file)
 
int nft_set_elem_snprintf (char *buf, size_t size, struct nft_set_elem *e, uint32_t type, uint32_t flags)
 
 EXPORT_SYMBOL (nft_set_elem_snprintf)
 
int nft_set_elem_fprintf (FILE *fp, struct nft_set_elem *se, uint32_t type, uint32_t flags)
 
 EXPORT_SYMBOL (nft_set_elem_fprintf)
 
int nft_set_elem_foreach (struct nft_set *s, int(*cb)(struct nft_set_elem *e, void *data), void *data)
 
 EXPORT_SYMBOL (nft_set_elem_foreach)
 
struct nft_set_elems_iternft_set_elems_iter_create (struct nft_set *s)
 
 EXPORT_SYMBOL (nft_set_elems_iter_create)
 
struct nft_set_elemnft_set_elems_iter_cur (struct nft_set_elems_iter *iter)
 
 EXPORT_SYMBOL (nft_set_elems_iter_cur)
 
struct nft_set_elemnft_set_elems_iter_next (struct nft_set_elems_iter *iter)
 
 EXPORT_SYMBOL (nft_set_elems_iter_next)
 
void nft_set_elems_iter_destroy (struct nft_set_elems_iter *iter)
 
 EXPORT_SYMBOL (nft_set_elems_iter_destroy)
 
int nft_set_elems_nlmsg_build_payload_iter (struct nlmsghdr *nlh, struct nft_set_elems_iter *iter)
 
 EXPORT_SYMBOL (nft_set_elems_nlmsg_build_payload_iter)
 

Function Documentation

EXPORT_SYMBOL ( nft_set_elem_alloc  )
EXPORT_SYMBOL ( nft_set_elem_free  )
EXPORT_SYMBOL ( nft_set_elem_attr_is_set  )
EXPORT_SYMBOL ( nft_set_elem_attr_unset  )
EXPORT_SYMBOL ( nft_set_elem_attr_set  )
EXPORT_SYMBOL ( nft_set_elem_attr_set_u32  )
EXPORT_SYMBOL ( nft_set_elem_attr_set_str  )
EXPORT_SYMBOL ( nft_set_elem_attr_get  )
EXPORT_SYMBOL ( nft_set_elem_attr_get_str  )
EXPORT_SYMBOL ( nft_set_elem_attr_get_u32  )
EXPORT_SYMBOL ( nft_set_elems_nlmsg_build_payload  )
EXPORT_SYMBOL ( nft_set_elems_nlmsg_parse  )
EXPORT_SYMBOL ( nft_set_elem_parse  )
EXPORT_SYMBOL ( nft_set_elem_parse_file  )
EXPORT_SYMBOL ( nft_set_elem_snprintf  )
EXPORT_SYMBOL ( nft_set_elem_fprintf  )
EXPORT_SYMBOL ( nft_set_elem_foreach  )
EXPORT_SYMBOL ( nft_set_elems_iter_create  )
EXPORT_SYMBOL ( nft_set_elems_iter_cur  )
EXPORT_SYMBOL ( nft_set_elems_iter_next  )
EXPORT_SYMBOL ( nft_set_elems_iter_destroy  )
struct nft_set_elem* nft_set_elem_alloc ( void  )

References NULL, and s.

const char* nft_set_elem_attr_get_str ( struct nft_set_elem s,
uint16_t  attr 
)

References nft_set_elem_attr_get(), and size.

Here is the call graph for this function:

uint32_t nft_set_elem_attr_get_u32 ( struct nft_set_elem s,
uint16_t  attr 
)

References nft_set_elem_attr_get(), and size.

Here is the call graph for this function:

bool nft_set_elem_attr_is_set ( const struct nft_set_elem s,
uint16_t  attr 
)

References nft_set_elem::flags.

void nft_set_elem_attr_set_str ( struct nft_set_elem s,
uint16_t  attr,
const char *  str 
)

References nft_set_elem_attr_set().

Here is the call graph for this function:

void nft_set_elem_attr_set_u32 ( struct nft_set_elem s,
uint16_t  attr,
uint32_t  val 
)

References nft_set_elem_attr_set().

Here is the call graph for this function:

int nft_set_elem_foreach ( struct nft_set s,
int(*)(struct nft_set_elem *e, void *data cb,
void *  data 
)

References nft_set::element_list, nft_set_elem::head, and list_for_each_entry.

Referenced by netlink_get_setelems().

Here is the caller graph for this function:

int nft_set_elem_fprintf ( FILE *  fp,
struct nft_set_elem se,
uint32_t  type,
uint32_t  flags 
)

References nft_fprintf().

Here is the call graph for this function:

void nft_set_elem_free ( struct nft_set_elem s)

References nft_data_reg::chain, nft_set_elem::data, nft_set_elem::flags, NFT_SET_ELEM_ATTR_CHAIN, NULL, and xfree.

Referenced by nft_set_free().

Here is the caller graph for this function:

int nft_set_elem_parse ( struct nft_set_elem e,
enum nft_parse_type  type,
const char *  data,
struct nft_parse_err err 
)

References NFT_PARSE_BUFFER.

int nft_set_elem_parse_file ( struct nft_set_elem e,
enum nft_parse_type  type,
FILE *  fp,
struct nft_parse_err err 
)

References NFT_PARSE_FILE.

int nft_set_elem_snprintf ( char *  buf,
size_t  size,
struct nft_set_elem e,
uint32_t  type,
uint32_t  flags 
)
struct nft_set_elems_iter* nft_set_elems_iter_create ( struct nft_set s)
struct nft_set_elem* nft_set_elems_iter_cur ( struct nft_set_elems_iter iter)
void nft_set_elems_iter_destroy ( struct nft_set_elems_iter iter)

References xfree.

Referenced by mnl_nft_setelem_add(), and mnl_nft_setelem_batch_add().

Here is the caller graph for this function:

struct nft_set_elem* nft_set_elems_iter_next ( struct nft_set_elems_iter iter)

References nft_set_elems_iter::cur, nft_set_elem::head, nft_set_elems_iter::list, list_entry, list_head::next, NULL, and s.

Referenced by nft_set_elems_nlmsg_build_payload_iter().

Here is the caller graph for this function:

void nft_set_elems_nlmsg_build_payload ( struct nlmsghdr nlh,
struct nft_set s 
)

References nft_set::element_list, list_for_each_entry, mnl_attr_nest_end(), mnl_attr_nest_start(), and NFTA_SET_ELEM_LIST_ELEMENTS.

Referenced by mnl_nft_setelem_batch_del(), and mnl_nft_setelem_delete().

Here is the call graph for this function:

Here is the caller graph for this function:

int nft_set_elems_nlmsg_build_payload_iter ( struct nlmsghdr nlh,
struct nft_set_elems_iter iter 
)