#include <stdint.h>
#include <nftables.h>
#include <list.h>
#include <payload.h>
#include <expression.h>
Data Structures | |
struct | handle |
struct handle - handle for tables, chains, rules and sets More... | |
struct | scope |
struct scope More... | |
struct | symbol |
struct symbol More... | |
struct | table |
struct table - nftables table More... | |
struct | chain |
struct chain - nftables chain More... | |
struct | rule |
struct rule - nftables rule More... | |
struct | set |
struct set - nftables set More... | |
struct | export |
struct | monitor |
struct | cmd |
struct | eval_ctx |
struct eval_ctx - evaluation context More... | |
Enumerations | |
enum | chain_flags { CHAIN_F_BASECHAIN = 0x1 } |
enum chain_flags - chain flags More... | |
enum | set_flags { SET_F_ANONYMOUS = 0x1, SET_F_CONSTANT = 0x2, SET_F_INTERVAL = 0x4, SET_F_MAP = 0x8 } |
enum set_flags More... | |
enum | cmd_ops { CMD_INVALID, CMD_ADD, CMD_CREATE, CMD_INSERT, CMD_DELETE, CMD_LIST, CMD_FLUSH, CMD_RENAME, CMD_EXPORT, CMD_MONITOR, CMD_DESCRIBE } |
enum cmd_ops - command operations More... | |
enum | cmd_obj { CMD_OBJ_INVALID, CMD_OBJ_SETELEM, CMD_OBJ_SET, CMD_OBJ_SETS, CMD_OBJ_RULE, CMD_OBJ_CHAIN, CMD_OBJ_TABLE, CMD_OBJ_RULESET, CMD_OBJ_EXPR, CMD_OBJ_MONITOR, CMD_OBJ_EXPORT } |
enum cmd_obj - command objects More... | |
enum | { CMD_MONITOR_OBJ_ANY, CMD_MONITOR_OBJ_TABLES, CMD_MONITOR_OBJ_CHAINS, CMD_MONITOR_OBJ_RULES, CMD_MONITOR_OBJ_SETS, CMD_MONITOR_OBJ_ELEMS, CMD_MONITOR_OBJ_MAX } |
anonymous enum |
enum chain_flags |
enum cmd_obj |
enum cmd_obj - command objects
: invalid : set element(s) : set : multiple sets : rule : chain : table : ruleset : expression : monitor : export
Enumerator | |
---|---|
CMD_OBJ_INVALID | |
CMD_OBJ_SETELEM | |
CMD_OBJ_SET | |
CMD_OBJ_SETS | |
CMD_OBJ_RULE | |
CMD_OBJ_CHAIN | |
CMD_OBJ_TABLE | |
CMD_OBJ_RULESET | |
CMD_OBJ_EXPR | |
CMD_OBJ_MONITOR | |
CMD_OBJ_EXPORT |
enum cmd_ops |
enum cmd_ops - command operations
: invalid : add object (non-exclusive) : create object (exclusive) : insert object : delete object : list container : flush container : rename object : export the ruleset in a given format : event listener : describe an expression
Enumerator | |
---|---|
CMD_INVALID | |
CMD_ADD | |
CMD_CREATE | |
CMD_INSERT | |
CMD_DELETE | |
CMD_LIST | |
CMD_FLUSH | |
CMD_RENAME | |
CMD_EXPORT | |
CMD_MONITOR | |
CMD_DESCRIBE |
enum set_flags |
References table::chains, and chain::list.
References handle::chain, chain::chain, chain::handle, NULL, chain::rules, chain::scope, scope::symbols, xstrdup(), and xzalloc().
References chain::handle, handle_free(), rule::list, list_for_each_entry_safe, rule_free(), chain::rules, chain::scope, scope_release(), and xfree.
Referenced by cmd_free(), and table_free().
const char* chain_hookname_lookup | ( | const char * | name | ) |
References NULL.
References handle::chain, chain::chain, table::chains, chain::handle, chain::list, list_for_each_entry, and NULL.
References handle::chain, CHAIN_F_BASECHAIN, handle::family, family2str(), chain::flags, chain::handle, chain::hooknum, chain::priority, handle::table, and chain::type.
const char* chain_type_name_lookup | ( | const char * | name | ) |
References NULL.
struct cmd* cmd_alloc | ( | enum cmd_ops | op, |
enum cmd_obj | obj, | ||
const struct handle * | h, | ||
const struct location * | loc, | ||
void * | data | ||
) |
References cmd::data, data, cmd::handle, cmd::list, cmd::location, cmd::obj, cmd::op, and xzalloc().
References BUG, eval_ctx::cmd, CMD_ADD, CMD_CREATE, CMD_DELETE, CMD_DESCRIBE, CMD_EXPORT, CMD_FLUSH, CMD_INSERT, CMD_LIST, CMD_MONITOR, CMD_RENAME, erec_create(), EREC_INFORMATIONAL, erec_print(), cmd::location, and cmd::op.
References cmd::arg, BUG, cmd::chain, chain_free(), CMD_OBJ_CHAIN, CMD_OBJ_EXPORT, CMD_OBJ_EXPR, CMD_OBJ_MONITOR, CMD_OBJ_RULE, CMD_OBJ_SET, CMD_OBJ_SETELEM, CMD_OBJ_TABLE, cmd::data, cmd::export, export_free(), cmd::expr, expr_free(), cmd::handle, handle_free(), cmd::monitor, monitor_free(), NULL, cmd::obj, cmd::rule, rule_free(), cmd::set, set_free(), cmd::table, table_free(), and xfree.
Referenced by nft_run().
int do_command | ( | struct netlink_ctx * | ctx, |
struct cmd * | cmd | ||
) |
References BUG, CMD_ADD, CMD_CREATE, CMD_DELETE, CMD_DESCRIBE, CMD_EXPORT, CMD_FLUSH, CMD_INSERT, CMD_LIST, CMD_MONITOR, CMD_RENAME, cmd::obj, and cmd::op.
const char* family2str | ( | unsigned int | family | ) |
References NFPROTO_ARP, NFPROTO_BRIDGE, NFPROTO_INET, NFPROTO_IPV4, and NFPROTO_IPV6.
Referenced by chain_print_plain(), and set_print_plain().
References handle::chain, handle::comment, handle::set, handle::table, and xfree.
Referenced by chain_free(), cmd_free(), rule_free(), set_free(), and table_free().
References handle::chain, handle::comment, handle::family, handle::handle, NULL, handle::position, handle::set, handle::table, and xstrdup().
References monitor::event, monitor::flags, format(), monitor::format, monitor::type, type, and xmalloc().
References rule::handle, rule::list, rule::location, NULL, rule::stmts, and xzalloc().
Referenced by netlink_delinearize_rule().
References rule::handle, handle_free(), stmt_list_free(), rule::stmts, and xfree.
Referenced by chain_free(), and cmd_free().
struct error_record* rule_postprocess | ( | struct rule * | rule | ) |
References NULL.
References handle::handle, rule::handle, handle_output, stmt::list, list_for_each_entry, stmt::ops, stmt_ops::print, and rule::stmts.
References scope::parent.
References symbol::expr, expr_free(), symbol::identifier, symbol::list, list_for_each_entry_safe, scope::symbols, and xfree.
Referenced by chain_free(), and table_free().
References set::location, NULL, set::refcnt, and xzalloc().
References expr_free(), set::handle, handle_free(), set::init, NULL, set::refcnt, and xfree.
Referenced by cmd_free().
References set::refcnt.
Referenced by set_ref_expr_alloc().
References set::handle, set::list, list_for_each_entry, NULL, handle::set, and table::sets.
Referenced by set_lookup_global().
References handle::family, NULL, set_lookup(), handle::table, and table_lookup().
References print_fmt_options::tab.
References handle::family, family2str(), set::handle, print_fmt_options::tab, and handle::table.
References symbol::expr, symbol::identifier, symbol::list, scope::symbols, xstrdup(), and xzalloc().
References symbol::identifier, symbol::list, list_for_each_entry, NULL, scope::parent, and scope::symbols.
References table::list.
References table::chains, table::scope, table::sets, scope::symbols, and xzalloc().
References chain::chain, chain_free(), table::chains, table::handle, handle_free(), chain::list, list_for_each_entry_safe, table::scope, scope_release(), and xfree.
Referenced by cmd_free().
References handle::family, table::handle, table::list, list_for_each_entry, NULL, and handle::table.
Referenced by netlink_delinearize_rule(), and set_lookup_global().