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

Functions

struct nft_rule_exprnft_rule_expr_alloc (const char *name)
 
 EXPORT_SYMBOL (nft_rule_expr_alloc)
 
void nft_rule_expr_free (struct nft_rule_expr *expr)
 
 EXPORT_SYMBOL (nft_rule_expr_free)
 
bool nft_rule_expr_is_set (const struct nft_rule_expr *expr, uint16_t type)
 
 EXPORT_SYMBOL (nft_rule_expr_is_set)
 
void nft_rule_expr_set (struct nft_rule_expr *expr, uint16_t type, const void *data, uint32_t data_len)
 
 EXPORT_SYMBOL (nft_rule_expr_set)
 
void nft_rule_expr_set_u8 (struct nft_rule_expr *expr, uint16_t type, uint8_t data)
 
 EXPORT_SYMBOL (nft_rule_expr_set_u8)
 
void nft_rule_expr_set_u16 (struct nft_rule_expr *expr, uint16_t type, uint16_t data)
 
 EXPORT_SYMBOL (nft_rule_expr_set_u16)
 
void nft_rule_expr_set_u32 (struct nft_rule_expr *expr, uint16_t type, uint32_t data)
 
 EXPORT_SYMBOL (nft_rule_expr_set_u32)
 
void nft_rule_expr_set_u64 (struct nft_rule_expr *expr, uint16_t type, uint64_t data)
 
 EXPORT_SYMBOL (nft_rule_expr_set_u64)
 
void nft_rule_expr_set_str (struct nft_rule_expr *expr, uint16_t type, const char *str)
 
 EXPORT_SYMBOL (nft_rule_expr_set_str)
 
const void * nft_rule_expr_get (const struct nft_rule_expr *expr, uint16_t type, uint32_t *data_len)
 
 EXPORT_SYMBOL (nft_rule_expr_get)
 
uint8_t nft_rule_expr_get_u8 (const struct nft_rule_expr *expr, uint16_t type)
 
 EXPORT_SYMBOL (nft_rule_expr_get_u8)
 
uint16_t nft_rule_expr_get_u16 (const struct nft_rule_expr *expr, uint16_t type)
 
 EXPORT_SYMBOL (nft_rule_expr_get_u16)
 
uint32_t nft_rule_expr_get_u32 (const struct nft_rule_expr *expr, uint16_t type)
 
 EXPORT_SYMBOL (nft_rule_expr_get_u32)
 
uint64_t nft_rule_expr_get_u64 (const struct nft_rule_expr *expr, uint16_t type)
 
 EXPORT_SYMBOL (nft_rule_expr_get_u64)
 
const char * nft_rule_expr_get_str (const struct nft_rule_expr *expr, uint16_t type)
 
 EXPORT_SYMBOL (nft_rule_expr_get_str)
 
void nft_rule_expr_build_payload (struct nlmsghdr *nlh, struct nft_rule_expr *expr)
 
 EXPORT_SYMBOL (nft_rule_expr_build_payload)
 
int nft_rule_expr_snprintf (char *buf, size_t size, struct nft_rule_expr *expr, uint32_t type, uint32_t flags)
 
 EXPORT_SYMBOL (nft_rule_expr_snprintf)
 

Function Documentation

EXPORT_SYMBOL ( nft_rule_expr_alloc  )
EXPORT_SYMBOL ( nft_rule_expr_free  )
EXPORT_SYMBOL ( nft_rule_expr_is_set  )
EXPORT_SYMBOL ( nft_rule_expr_set  )
EXPORT_SYMBOL ( nft_rule_expr_set_u8  )
EXPORT_SYMBOL ( nft_rule_expr_set_u16  )
EXPORT_SYMBOL ( nft_rule_expr_set_u32  )
EXPORT_SYMBOL ( nft_rule_expr_set_u64  )
EXPORT_SYMBOL ( nft_rule_expr_set_str  )
EXPORT_SYMBOL ( nft_rule_expr_get  )
EXPORT_SYMBOL ( nft_rule_expr_get_u8  )
EXPORT_SYMBOL ( nft_rule_expr_get_u16  )
EXPORT_SYMBOL ( nft_rule_expr_get_u32  )
EXPORT_SYMBOL ( nft_rule_expr_get_u64  )
EXPORT_SYMBOL ( nft_rule_expr_get_str  )
EXPORT_SYMBOL ( nft_rule_expr_build_payload  )
EXPORT_SYMBOL ( nft_rule_expr_snprintf  )
struct nft_rule_expr* nft_rule_expr_alloc ( const char *  name)
void nft_rule_expr_build_payload ( struct nlmsghdr nlh,
struct nft_rule_expr expr 
)

References expr_ops::build, mnl_attr_nest_end(), mnl_attr_nest_start(), mnl_attr_put_strz(), expr_ops::name, NFTA_EXPR_DATA, NFTA_EXPR_NAME, NFTA_LIST_ELEM, and nft_rule_expr::ops.

Referenced by nft_rule_nlmsg_build_payload().

Here is the call graph for this function:

Here is the caller graph for this function:

void nft_rule_expr_free ( struct nft_rule_expr expr)

References expr_ops::free, nft_rule_expr::ops, and xfree.

Referenced by nft_rule_free().

Here is the caller graph for this function:

const void* nft_rule_expr_get ( const struct nft_rule_expr expr,
uint16_t  type,
uint32_t *  data_len 
)
const char* nft_rule_expr_get_str ( const struct nft_rule_expr expr,
uint16_t  type 
)

References nft_rule_expr_get().

Referenced by nft_parse_immediate(), nft_parse_target(), nft_rule_to_arptables_command_state(), nft_rule_to_iptables_command_state(), and nft_set_lookup_id().

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t nft_rule_expr_get_u16 ( const struct nft_rule_expr expr,
uint16_t  type 
)

References data, nft_rule_expr_get(), and NULL.

Here is the call graph for this function:

uint32_t nft_rule_expr_get_u32 ( const struct nft_rule_expr expr,
uint16_t  type 
)

References data, nft_rule_expr_get(), and NULL.

Referenced by get_cmp_data(), nft_parse_bitwise(), nft_parse_cmp(), nft_parse_immediate(), nft_parse_meta(), nft_parse_payload(), nft_parse_target(), and parse_meta().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t nft_rule_expr_get_u64 ( const struct nft_rule_expr expr,
uint16_t  type 
)

References data, nft_rule_expr_get(), and NULL.

Referenced by nft_parse_counter().

Here is the call graph for this function:

Here is the caller graph for this function:

uint8_t nft_rule_expr_get_u8 ( const struct nft_rule_expr expr,
uint16_t  type 
)

References data, nft_rule_expr_get(), and NULL.

Here is the call graph for this function:

bool nft_rule_expr_is_set ( const struct nft_rule_expr expr,
uint16_t  type 
)

References nft_rule_expr::flags, and type.

void nft_rule_expr_set ( struct nft_rule_expr expr,
uint16_t  type,
const void *  data,
uint32_t  data_len 
)
void nft_rule_expr_set_str ( struct nft_rule_expr expr,
uint16_t  type,
const char *  str 
)

References nft_rule_expr_set().

Referenced by add_jumpto().

Here is the call graph for this function:

Here is the caller graph for this function:

void nft_rule_expr_set_u16 ( struct nft_rule_expr expr,
uint16_t  type,
uint16_t  data 
)

References nft_rule_expr_set().

Here is the call graph for this function:

void nft_rule_expr_set_u32 ( struct nft_rule_expr expr,
uint16_t  type,
uint32_t  data 
)

References nft_rule_expr_set().

Referenced by add_bitwise_u16(), add_cmp_ptr(), add_jumpto(), add_meta(), add_payload(), and add_verdict().

Here is the call graph for this function:

Here is the caller graph for this function:

void nft_rule_expr_set_u64 ( struct nft_rule_expr expr,
uint16_t  type,
uint64_t  data 
)

References nft_rule_expr_set().

Referenced by add_counters().

Here is the call graph for this function:

Here is the caller graph for this function:

void nft_rule_expr_set_u8 ( struct nft_rule_expr expr,
uint16_t  type,
uint8_t  data 
)

References nft_rule_expr_set().

Here is the call graph for this function:

int nft_rule_expr_snprintf ( char *  buf,
size_t  size,
struct nft_rule_expr expr,
uint32_t  type,
uint32_t  flags 
)

References len, nft_rule_expr::ops, size, expr_ops::snprintf, and SNPRINTF_BUFFER_SIZE.

Referenced by netlink_dump_expr().

Here is the caller graph for this function: