#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <libnftnl/common.h>
Enumerations | |
enum | { NFT_RULESET_ATTR_TABLELIST = 0, NFT_RULESET_ATTR_CHAINLIST, NFT_RULESET_ATTR_SETLIST, NFT_RULESET_ATTR_RULELIST } |
Functions | |
struct nft_ruleset * | nft_ruleset_alloc (void) |
void | nft_ruleset_free (struct nft_ruleset *r) |
bool | nft_ruleset_attr_is_set (const struct nft_ruleset *r, uint16_t attr) |
void | nft_ruleset_attr_unset (struct nft_ruleset *r, uint16_t attr) |
void | nft_ruleset_attr_set (struct nft_ruleset *r, uint16_t attr, void *data) |
void * | nft_ruleset_attr_get (const struct nft_ruleset *r, uint16_t attr) |
int | nft_ruleset_parse (struct nft_ruleset *rs, enum nft_parse_type type, const char *data, struct nft_parse_err *err) |
int | nft_ruleset_parse_file (struct nft_ruleset *rs, enum nft_parse_type type, FILE *fp, struct nft_parse_err *err) |
int | nft_ruleset_snprintf (char *buf, size_t size, const struct nft_ruleset *rs, uint32_t type, uint32_t flags) |
int | nft_ruleset_fprintf (FILE *fp, const struct nft_ruleset *rs, uint32_t type, uint32_t flags) |
anonymous enum |
struct nft_ruleset* nft_ruleset_alloc | ( | void | ) |
Referenced by mnl_nft_ruleset_dump(), and mnl_ruleset_dump().
void* nft_ruleset_attr_get | ( | const struct nft_ruleset * | r, |
uint16_t | attr | ||
) |
bool nft_ruleset_attr_is_set | ( | const struct nft_ruleset * | r, |
uint16_t | attr | ||
) |
References nft_ruleset::flags.
Referenced by nft_ruleset_fprintf().
void nft_ruleset_attr_set | ( | struct nft_ruleset * | r, |
uint16_t | attr, | ||
void * | data | ||
) |
References nft_ruleset::chain_list, data, nft_ruleset::flags, NFT_RULESET_ATTR_CHAINLIST, NFT_RULESET_ATTR_RULELIST, NFT_RULESET_ATTR_SETLIST, NFT_RULESET_ATTR_TABLELIST, nft_ruleset_attr_unset(), nft_ruleset::rule_list, nft_ruleset::set_list, and nft_ruleset::table_list.
Referenced by mnl_nft_ruleset_dump(), and mnl_ruleset_dump().
void nft_ruleset_attr_unset | ( | struct nft_ruleset * | r, |
uint16_t | attr | ||
) |
References nft_ruleset::chain_list, nft_ruleset::flags, nft_chain_list_free(), nft_rule_list_free(), NFT_RULESET_ATTR_CHAINLIST, NFT_RULESET_ATTR_RULELIST, NFT_RULESET_ATTR_SETLIST, NFT_RULESET_ATTR_TABLELIST, nft_set_list_free(), nft_table_list_free(), NULL, nft_ruleset::rule_list, nft_ruleset::set_list, and nft_ruleset::table_list.
Referenced by nft_ruleset_attr_set().
int nft_ruleset_fprintf | ( | FILE * | fp, |
const struct nft_ruleset * | rs, | ||
uint32_t | type, | ||
uint32_t | flags | ||
) |
References nft_ruleset::chain_list, flags, len, nft_chain_list_is_empty(), nft_event_footer_fprintf(), nft_event_header_fprintf(), NFT_FPRINTF_RETURN_OR_FIXLEN, NFT_OF_EVENT_ANY, nft_rule_list_is_empty(), NFT_RULESET_ATTR_CHAINLIST, nft_ruleset_attr_is_set(), NFT_RULESET_ATTR_RULELIST, NFT_RULESET_ATTR_SETLIST, NFT_RULESET_ATTR_TABLELIST, nft_set_list_is_empty(), nft_table_list_is_empty(), NULL, nft_ruleset::rule_list, nft_ruleset::set_list, and nft_ruleset::table_list.
void nft_ruleset_free | ( | struct nft_ruleset * | r | ) |
References nft_ruleset::chain_list, nft_ruleset::flags, nft_chain_list_free(), nft_rule_list_free(), NFT_RULESET_ATTR_CHAINLIST, NFT_RULESET_ATTR_RULELIST, NFT_RULESET_ATTR_SETLIST, NFT_RULESET_ATTR_TABLELIST, nft_set_list_free(), nft_table_list_free(), nft_ruleset::rule_list, nft_ruleset::set_list, nft_ruleset::table_list, and xfree.
Referenced by mnl_nft_ruleset_dump(), and netlink_dump_ruleset().
int nft_ruleset_parse | ( | struct nft_ruleset * | rs, |
enum nft_parse_type | type, | ||
const char * | data, | ||
struct nft_parse_err * | err | ||
) |
References NFT_PARSE_BUFFER.
int nft_ruleset_parse_file | ( | struct nft_ruleset * | rs, |
enum nft_parse_type | type, | ||
FILE * | fp, | ||
struct nft_parse_err * | err | ||
) |
References NFT_PARSE_FILE.
int nft_ruleset_snprintf | ( | char * | buf, |
size_t | size, | ||
const struct nft_ruleset * | rs, | ||
uint32_t | type, | ||
uint32_t | flags | ||
) |
References NFT_OUTPUT_DEFAULT, NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.
Referenced by netlink_dump_ruleset().