#include "config.h"
#include "linux_list.h"
#include <stdint.h>
#include <stdbool.h>
#include <libnftnl/common.h>
#include <linux/netfilter/nf_tables.h>
#include <stdio.h>
#include "expr/data_reg.h"
#include <string.h>
Data Structures | |
struct | nft_parse_err |
struct | nft_rule_expr |
struct | nft_set |
struct | nft_set_elem |
Macros | |
#define | EXPORT_SYMBOL |
#define | xfree(ptr) free((void *)ptr); |
#define | BASE_DEC 10 |
#define | BASE_HEX 16 |
#define | NFT_SNPRINTF_BUFSIZ 4096 |
#define | SNPRINTF_BUFFER_SIZE(ret, size, len, offset) |
#define | div_round_up(n, d) (((n) + (d) - 1) / (d)) |
#define | __init __attribute__((constructor)) |
#define | nft_assert(val, attr, expr) |
#define | nft_assert_validate(data, _validate_array, _attr, _data_len) |
#define | __noreturn __attribute__((__noreturn__)) |
#define | abi_breakage() __abi_breakage(__FILE__, __LINE__, strerror(errno)); |
Enumerations | |
enum | nft_type { NFT_TYPE_U8, NFT_TYPE_U16, NFT_TYPE_U32, NFT_TYPE_U64, NFT_TYPE_S8, NFT_TYPE_S16, NFT_TYPE_S32, NFT_TYPE_S64 } |
enum | nft_parse_input { NFT_PARSE_BUFFER, NFT_PARSE_FILE } |
Functions | |
int | nft_set_lookup_id (struct nft_rule_expr *e, struct nft_set_list *set_list, uint32_t *set_id) |
const char * | nft_family2str (uint32_t family) |
int | nft_str2family (const char *family) |
int | nft_strtoi (const char *string, int base, void *number, enum nft_type type) |
const char * | nft_verdict2str (uint32_t verdict) |
int | nft_str2verdict (const char *verdict, int *verdict_num) |
int | nft_get_value (enum nft_type type, void *val, void *out) |
int | nft_fprintf (FILE *fp, void *obj, uint32_t type, uint32_t flags, int(*snprintf_cb)(char *buf, size_t bufsiz, void *obj, uint32_t type, uint32_t flags)) |
int | nft_event_header_snprintf (char *buf, size_t bufsize, uint32_t format, uint32_t flags) |
int | nft_event_header_fprintf (FILE *fp, uint32_t format, uint32_t flags) |
int | nft_event_footer_snprintf (char *buf, size_t bufsize, uint32_t format, uint32_t flags) |
int | nft_event_footer_fprintf (FILE *fp, uint32_t format, uint32_t flags) |
void | __nft_assert_fail (uint16_t attr, const char *filename, int line) |
void __noreturn | __abi_breakage (const char *file, int line, const char *reason) |
#define __init __attribute__((constructor)) |
#define __noreturn __attribute__((__noreturn__)) |
#define abi_breakage | ( | ) | __abi_breakage(__FILE__, __LINE__, strerror(errno)); |
#define BASE_DEC 10 |
#define BASE_HEX 16 |
#define div_round_up | ( | n, | |
d | |||
) | (((n) + (d) - 1) / (d)) |
Referenced by concat_type_alloc(), and constant_expr_alloc().
#define EXPORT_SYMBOL |
#define nft_assert | ( | val, | |
attr, | |||
expr | |||
) |
Referenced by nft_chain_attr_get_s32(), nft_chain_attr_get_u32(), nft_chain_attr_get_u64(), nft_chain_attr_get_u8(), nft_rule_attr_get_u32(), nft_rule_attr_get_u64(), nft_rule_attr_get_u8(), and nft_set_attr_get_u32().
#define nft_assert_validate | ( | data, | |
_validate_array, | |||
_attr, | |||
_data_len | |||
) |
Referenced by nft_chain_attr_set_data(), nft_gen_attr_set_data(), nft_rule_attr_set_data(), nft_set_attr_set_data(), and nft_table_attr_set_data().
#define NFT_SNPRINTF_BUFSIZ 4096 |
Referenced by nft_fprintf().
Referenced by nft_chain_snprintf(), nft_gen_snprintf(), nft_rule_expr_snprintf(), nft_rule_snprintf(), nft_set_elem_snprintf(), nft_set_snprintf(), and nft_table_snprintf().
#define xfree | ( | ptr | ) | free((void *)ptr); |
Referenced by __fmtstring(), chain_free(), cmd_free(), concat_type_destroy(), export_free(), expr_free(), handle_free(), main(), mnl_err_list_free(), monitor_free(), nft_chain_attr_set_data(), nft_chain_attr_unset(), nft_chain_free(), nft_chain_list_free(), nft_chain_list_iter_destroy(), nft_gen_free(), nft_parse_err_free(), nft_rule_attr_set_data(), nft_rule_attr_unset(), nft_rule_expr_free(), nft_rule_expr_iter_destroy(), nft_rule_free(), nft_rule_list_free(), nft_rule_list_iter_destroy(), nft_rule_nlmsg_parse(), nft_ruleset_free(), nft_set_attr_set_data(), nft_set_attr_unset(), nft_set_elem_attr_set(), nft_set_elem_attr_unset(), nft_set_elem_free(), nft_set_elems_iter_destroy(), nft_set_free(), nft_set_list_free(), nft_set_list_iter_destroy(), nft_table_attr_set_data(), nft_table_attr_unset(), nft_table_free(), nft_table_list_free(), nft_table_list_iter_destroy(), rt_symbol_table_free(), rule_free(), scope_release(), set_free(), stmt_free(), and table_free().
enum nft_parse_input |
enum nft_type |
void __noreturn __abi_breakage | ( | const char * | file, |
int | line, | ||
const char * | reason | ||
) |
void __nft_assert_fail | ( | uint16_t | attr, |
const char * | filename, | ||
int | line | ||
) |
int nft_event_footer_fprintf | ( | FILE * | fp, |
uint32_t | format, | ||
uint32_t | flags | ||
) |
References nft_fprintf(), and NULL.
Referenced by nft_ruleset_fprintf().
int nft_event_footer_snprintf | ( | char * | buf, |
size_t | bufsize, | ||
uint32_t | format, | ||
uint32_t | flags | ||
) |
References NFT_OF_EVENT_ANY, NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.
Referenced by nft_chain_snprintf(), nft_gen_snprintf(), nft_rule_snprintf(), nft_set_elem_snprintf(), nft_set_snprintf(), and nft_table_snprintf().
int nft_event_header_fprintf | ( | FILE * | fp, |
uint32_t | format, | ||
uint32_t | flags | ||
) |
References nft_fprintf(), and NULL.
Referenced by nft_ruleset_fprintf().
int nft_event_header_snprintf | ( | char * | buf, |
size_t | bufsize, | ||
uint32_t | format, | ||
uint32_t | flags | ||
) |
References NFT_OF_EVENT_ANY, NFT_OF_EVENT_DEL, NFT_OF_EVENT_NEW, NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.
Referenced by nft_chain_snprintf(), nft_gen_snprintf(), nft_rule_snprintf(), nft_set_elem_snprintf(), nft_set_snprintf(), and nft_table_snprintf().
const char* nft_family2str | ( | uint32_t | family | ) |
References NULL.
int nft_fprintf | ( | FILE * | fp, |
void * | obj, | ||
uint32_t | type, | ||
uint32_t | flags, | ||
int(*)(char *buf, size_t bufsiz, void *obj, uint32_t type, uint32_t flags) | snprintf_cb | ||
) |
References NFT_SNPRINTF_BUFSIZ, NULL, and xfree().
Referenced by nft_chain_fprintf(), nft_event_footer_fprintf(), nft_event_header_fprintf(), nft_gen_fprintf(), nft_rule_fprintf(), nft_set_elem_fprintf(), nft_set_fprintf(), and nft_table_fprintf().
int nft_get_value | ( | enum nft_type | type, |
void * | val, | ||
void * | out | ||
) |
References len, max, min, NFT_TYPE_S16, NFT_TYPE_S32, NFT_TYPE_S64, NFT_TYPE_S8, NFT_TYPE_U16, NFT_TYPE_U32, NFT_TYPE_U64, NFT_TYPE_U8, and type.
Referenced by nft_strtoi().
int nft_set_lookup_id | ( | struct nft_rule_expr * | e, |
struct nft_set_list * | set_list, | ||
uint32_t * | set_id | ||
) |
References NFT_EXPR_LOOKUP_SET, nft_rule_expr_get_str(), nft_set_attr_get_u32(), NFT_SET_ATTR_ID, NULL, and s.
int nft_str2family | ( | const char * | family | ) |
References NFPROTO_NUMPROTO, and NULL.
int nft_str2verdict | ( | const char * | verdict, |
int * | verdict_num | ||
) |
References NF_ACCEPT, NF_DROP, NFT_GOTO, NFT_JUMP, and NFT_RETURN.
int nft_strtoi | ( | const char * | string, |
int | base, | ||
void * | number, | ||
enum nft_type | type | ||
) |
References nft_get_value(), NFT_TYPE_S16, NFT_TYPE_S32, NFT_TYPE_S64, NFT_TYPE_S8, NFT_TYPE_U16, NFT_TYPE_U32, NFT_TYPE_U64, and NFT_TYPE_U8.
const char* nft_verdict2str | ( | uint32_t | verdict | ) |
References NF_ACCEPT, NF_DROP, NFT_GOTO, NFT_JUMP, and NFT_RETURN.