#include "internal.h"
#include <time.h>
#include <endian.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <limits.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/expr.h>
#include "linux_list.h"
#include "expr/data_reg.h"
Data Structures | |
struct | nft_set_list |
struct | nft_set_list_iter |
EXPORT_SYMBOL | ( | nft_set_alloc | ) |
EXPORT_SYMBOL | ( | nft_set_free | ) |
EXPORT_SYMBOL | ( | nft_set_attr_is_set | ) |
EXPORT_SYMBOL | ( | nft_set_attr_unset | ) |
EXPORT_SYMBOL | ( | nft_set_attr_set_data | ) |
EXPORT_SYMBOL | ( | nft_set_attr_set | ) |
EXPORT_SYMBOL | ( | nft_set_attr_set_u32 | ) |
EXPORT_SYMBOL | ( | nft_set_attr_set_str | ) |
EXPORT_SYMBOL | ( | nft_set_attr_get_data | ) |
EXPORT_SYMBOL | ( | nft_set_attr_get | ) |
EXPORT_SYMBOL | ( | nft_set_attr_get_str | ) |
EXPORT_SYMBOL | ( | nft_set_attr_get_u32 | ) |
EXPORT_SYMBOL | ( | nft_set_nlmsg_build_payload | ) |
EXPORT_SYMBOL | ( | nft_set_nlmsg_parse | ) |
EXPORT_SYMBOL | ( | nft_set_parse | ) |
EXPORT_SYMBOL | ( | nft_set_parse_file | ) |
EXPORT_SYMBOL | ( | nft_set_snprintf | ) |
EXPORT_SYMBOL | ( | nft_set_fprintf | ) |
EXPORT_SYMBOL | ( | nft_set_elem_add | ) |
EXPORT_SYMBOL | ( | nft_set_list_alloc | ) |
EXPORT_SYMBOL | ( | nft_set_list_free | ) |
EXPORT_SYMBOL | ( | nft_set_list_is_empty | ) |
EXPORT_SYMBOL | ( | nft_set_list_add | ) |
EXPORT_SYMBOL | ( | nft_set_list_add_tail | ) |
EXPORT_SYMBOL | ( | nft_set_list_del | ) |
EXPORT_SYMBOL | ( | nft_set_list_foreach | ) |
EXPORT_SYMBOL | ( | nft_set_list_iter_create | ) |
EXPORT_SYMBOL | ( | nft_set_list_iter_cur | ) |
EXPORT_SYMBOL | ( | nft_set_list_iter_next | ) |
EXPORT_SYMBOL | ( | nft_set_list_iter_destroy | ) |
References nft_set::element_list, INIT_LIST_HEAD, NULL, and s.
Referenced by alloc_nft_set(), mnl_nft_set_dump(), and mnl_set_dump().
References nft_set_attr_get_data().
Referenced by nft_set_attr_get_str().
References nft_set::data_len, nft_set::data_type, nft_set::desc, nft_set::family, nft_set::flags, nft_set::id, nft_set::key_len, nft_set::key_type, nft_set::name, NFT_SET_ATTR_DATA_LEN, NFT_SET_ATTR_DATA_TYPE, NFT_SET_ATTR_DESC_SIZE, NFT_SET_ATTR_FAMILY, NFT_SET_ATTR_FLAGS, NFT_SET_ATTR_ID, NFT_SET_ATTR_KEY_LEN, NFT_SET_ATTR_KEY_TYPE, NFT_SET_ATTR_NAME, NFT_SET_ATTR_POLICY, NFT_SET_ATTR_TABLE, NULL, nft_set::policy, nft_set::set_flags, nft_set::size, and nft_set::table.
Referenced by nft_set_attr_get(), and nft_set_attr_get_u32().
References nft_assert, and nft_set_attr_get_data().
Referenced by mnl_nft_set_add(), mnl_nft_set_batch_add(), mnl_nft_set_batch_del(), mnl_nft_set_delete(), mnl_nft_set_get(), mnl_nft_setelem_add(), mnl_nft_setelem_batch_add(), mnl_nft_setelem_batch_del(), mnl_nft_setelem_delete(), mnl_nft_setelem_get(), mnl_setelem_get(), and nft_set_lookup_id().
References nft_set::flags.
References nft_set_attr_set_data().
Referenced by mnl_nft_set_dump(), mnl_set_dump(), nft_set_attr_set_str(), and nft_set_attr_set_u32().
void nft_set_attr_set_data | ( | struct nft_set * | s, |
uint16_t | attr, | ||
const void * | data, | ||
uint32_t | data_len | ||
) |
References nft_set::data_len, nft_set::data_type, nft_set::desc, nft_set::family, nft_set::flags, nft_set::id, nft_set::key_len, nft_set::key_type, nft_set::name, nft_assert_validate, NFT_SET_ATTR_DATA_LEN, NFT_SET_ATTR_DATA_TYPE, NFT_SET_ATTR_DESC_SIZE, NFT_SET_ATTR_FAMILY, NFT_SET_ATTR_FLAGS, NFT_SET_ATTR_ID, NFT_SET_ATTR_KEY_LEN, NFT_SET_ATTR_KEY_TYPE, NFT_SET_ATTR_MAX, NFT_SET_ATTR_NAME, NFT_SET_ATTR_POLICY, NFT_SET_ATTR_TABLE, nft_set::policy, nft_set::set_flags, nft_set::size, nft_set::table, and xfree.
Referenced by nft_set_attr_set().
References nft_set_attr_set().
Referenced by alloc_nft_set().
References nft_set_attr_set().
Referenced by alloc_nft_set().
References nft_set::flags, nft_set::name, NFT_SET_ATTR_DATA_LEN, NFT_SET_ATTR_DATA_TYPE, NFT_SET_ATTR_DESC_SIZE, NFT_SET_ATTR_FAMILY, NFT_SET_ATTR_FLAGS, NFT_SET_ATTR_ID, NFT_SET_ATTR_KEY_LEN, NFT_SET_ATTR_KEY_TYPE, NFT_SET_ATTR_NAME, NFT_SET_ATTR_POLICY, NFT_SET_ATTR_TABLE, NULL, nft_set::table, and xfree.
void nft_set_elem_add | ( | struct nft_set * | s, |
struct nft_set_elem * | elem | ||
) |
References nft_set::element_list, and nft_set_elem::head.
References nft_set::element_list, nft_set_elem::head, list_for_each_entry_safe, nft_set::name, nft_set_elem_free(), NULL, nft_set::table, and xfree.
Referenced by mnl_nft_set_dump(), mnl_set_dump(), netlink_get_set(), netlink_get_setelems(), and nft_set_list_free().
void nft_set_list_add | ( | struct nft_set * | s, |
struct nft_set_list * | list | ||
) |
References nft_set::head, and nft_set_list::list.
void nft_set_list_add_tail | ( | struct nft_set * | s, |
struct nft_set_list * | list | ||
) |
References nft_set::head, and nft_set_list::list.
struct nft_set_list* nft_set_list_alloc | ( | void | ) |
References INIT_LIST_HEAD, nft_set_list::list, and NULL.
Referenced by mnl_nft_set_dump(), mnl_ruleset_dump(), and mnl_set_dump().
References nft_set::head.
int nft_set_list_foreach | ( | struct nft_set_list * | set_list, |
int(*)(struct nft_set *t, void *data) | cb, | ||
void * | data | ||
) |
References nft_set::head, nft_set_list::list, and list_for_each_entry_safe.
Referenced by netlink_list_sets().
void nft_set_list_free | ( | struct nft_set_list * | list | ) |
References nft_set::head, nft_set_list::list, list_for_each_entry_safe, nft_set_free(), s, and xfree.
Referenced by mnl_nft_set_dump(), mnl_set_dump(), netlink_list_sets(), nft_ruleset_attr_unset(), and nft_ruleset_free().
int nft_set_list_is_empty | ( | struct nft_set_list * | list | ) |
References nft_set_list::list.
Referenced by nft_ruleset_fprintf().
struct nft_set_list_iter* nft_set_list_iter_create | ( | struct nft_set_list * | l | ) |
References nft_set_list_iter::cur, nft_set_list_iter::list, nft_set_list::list, list_entry, list_head::next, and NULL.
Referenced by mnl_nft_ruleset_dump().
struct nft_set* nft_set_list_iter_cur | ( | struct nft_set_list_iter * | iter | ) |
References nft_set_list_iter::cur.
void nft_set_list_iter_destroy | ( | struct nft_set_list_iter * | iter | ) |
struct nft_set* nft_set_list_iter_next | ( | struct nft_set_list_iter * | iter | ) |
References nft_set_list_iter::cur, nft_set::head, nft_set_list_iter::list, nft_set_list::list, list_entry, list_head::next, NULL, and s.
Referenced by mnl_nft_ruleset_dump().
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.
References nft_set::data_len, nft_set::data_type, nft_set::flags, nft_set::id, nft_set::key_len, nft_set::key_type, mnl_attr_put_strz(), mnl_attr_put_u32(), nft_set::name, NFT_SET_ATTR_DATA_LEN, NFT_SET_ATTR_DATA_TYPE, NFT_SET_ATTR_DESC_SIZE, NFT_SET_ATTR_FLAGS, NFT_SET_ATTR_ID, NFT_SET_ATTR_KEY_LEN, NFT_SET_ATTR_KEY_TYPE, NFT_SET_ATTR_NAME, NFT_SET_ATTR_POLICY, NFT_SET_ATTR_TABLE, NFTA_SET_DATA_LEN, NFTA_SET_DATA_TYPE, NFTA_SET_FLAGS, NFTA_SET_ID, NFTA_SET_KEY_LEN, NFTA_SET_KEY_TYPE, NFTA_SET_NAME, NFTA_SET_POLICY, NFTA_SET_TABLE, nft_set::policy, nft_set::set_flags, and nft_set::table.
Referenced by mnl_nft_set_add(), mnl_nft_set_batch_add(), mnl_nft_set_batch_del(), mnl_nft_set_delete(), mnl_nft_set_dump(), mnl_nft_set_get(), mnl_nft_setelem_get(), mnl_set_dump(), and mnl_setelem_get().
References nft_set::data_len, nft_set::data_type, nft_set::family, nft_set::flags, nft_set::id, nft_set::key_len, nft_set::key_type, mnl_attr_get_str(), mnl_attr_get_u32(), mnl_attr_parse(), mnl_nlmsg_get_payload(), nft_set::name, nfgenmsg::nfgen_family, NFT_SET_ATTR_DATA_LEN, NFT_SET_ATTR_DATA_TYPE, NFT_SET_ATTR_FAMILY, NFT_SET_ATTR_FLAGS, NFT_SET_ATTR_ID, NFT_SET_ATTR_KEY_LEN, NFT_SET_ATTR_KEY_TYPE, NFT_SET_ATTR_NAME, NFT_SET_ATTR_POLICY, NFT_SET_ATTR_TABLE, NFTA_SET_DATA_LEN, NFTA_SET_DATA_TYPE, NFTA_SET_DESC, NFTA_SET_FLAGS, NFTA_SET_ID, NFTA_SET_KEY_LEN, NFTA_SET_KEY_TYPE, NFTA_SET_MAX, NFTA_SET_NAME, NFTA_SET_POLICY, NFTA_SET_TABLE, nft_set::policy, nft_set::set_flags, and nft_set::table.
int nft_set_parse | ( | struct nft_set * | s, |
enum nft_parse_type | type, | ||
const char * | data, | ||
struct nft_parse_err * | err | ||
) |
References NFT_PARSE_BUFFER.
int nft_set_parse_file | ( | struct nft_set * | s, |
enum nft_parse_type | type, | ||
FILE * | fp, | ||
struct nft_parse_err * | err | ||
) |
References NFT_PARSE_FILE.
References flags, nft_event_footer_snprintf(), nft_event_header_snprintf(), NFT_OF_EVENT_ANY, NFT_OUTPUT_DEFAULT, NFT_OUTPUT_JSON, NFT_OUTPUT_XML, size, and SNPRINTF_BUFFER_SIZE.
Referenced by netlink_dump_set().