18#define NFT_DESCR_SIZE 1024
97print_rule(
const char *func,
int line,
const struct nftnl_rule *rule);
100print_redirect_rules(
const char *
ifname);
102#define debug_rule(rule) do { print_rule(__func__, __LINE__, rule); } while (0)
105#define debug_rule(rule)
112 in_addr_t rhost,
unsigned short eport,
118 in_addr_t rhost,
unsigned short rport,
119 in_addr_t ehost,
unsigned short eport,
120 in_addr_t ihost,
unsigned short iport,
125 in_addr_t rhost, in_addr_t iaddr,
126 unsigned short eport,
unsigned short iport,
127 unsigned short rport,
const char *
descr,
const char *handle);
130 struct in6_addr *rhost6,
struct in6_addr *iaddr6,
131 unsigned short eport,
unsigned short iport,
132 unsigned short rport,
const char *
descr,
const char *handle);
135 uint8_t proto,
unsigned short eport,
unsigned short iport,
136 unsigned short rport,
const char *
descr,
const char *handle);
147 const char *
name,
const char * type,
uint32_t hooknum,
signed int priority );
149struct mnl_nlmsg_batch *
const char * descr
Definition cpu_power_test.cpp:29
struct rule_list head_peer
Definition nftnlrdr_misc.c:80
struct rule_list head_filter
Definition nftnlrdr_misc.c:76
const char * nft_postrouting_chain
Definition nftnlrdr_misc.c:68
struct rule_list head_redirect
Definition nftnlrdr_misc.c:78
const char * nft_prerouting_chain
Definition nftnlrdr_misc.c:67
const char * nft_forward_chain
Definition nftnlrdr_misc.c:69
const char * nft_table
Definition nftnlrdr_misc.c:66
int refresh_nft_cache_filter(void)
Definition nftnlrdr_misc.c:618
rule_chain_type
Definition nftnlrdr_misc.h:45
@ RULE_CHAIN_REDIRECT
Definition nftnlrdr_misc.h:48
@ RULE_CHAIN_FILTER
Definition nftnlrdr_misc.h:46
@ RULE_CHAIN_PEER
Definition nftnlrdr_misc.h:47
struct nftnl_rule * rule_set_filter_common(struct nftnl_rule *r, uint8_t family, const char *ifname, uint8_t proto, unsigned short eport, unsigned short iport, unsigned short rport, const char *descr, const char *handle)
Definition nftnlrdr_misc.c:1093
LIST_HEAD(rule_list, rule_t)
int refresh_nft_cache_redirect(void)
Definition nftnlrdr_misc.c:640
int nft_send_rule(struct nftnl_rule *rule, uint16_t cmd, enum rule_chain_type type)
Definition nftnlrdr_misc.c:1187
struct nftnl_rule * rule_set_filter6(uint8_t family, const char *ifname, uint8_t proto, struct in6_addr *rhost6, struct in6_addr *iaddr6, unsigned short eport, unsigned short iport, unsigned short rport, const char *descr, const char *handle)
Definition nftnlrdr_misc.c:1052
int send_batch(struct mnl_nlmsg_batch *batch)
Definition nftnlrdr_misc.c:1366
struct nftnl_rule * rule_set_snat(uint8_t family, uint8_t proto, in_addr_t rhost, unsigned short rport, in_addr_t ehost, unsigned short eport, in_addr_t ihost, unsigned short iport, const char *descr, const char *handle)
Definition nftnlrdr_misc.c:862
struct nftnl_rule * rule_del_handle(rule_t *r)
Definition nftnlrdr_misc.c:1151
int refresh_nft_cache_peer(void)
Definition nftnlrdr_misc.c:629
void nft_mnl_disconnect(void)
Definition nftnlrdr_misc.c:108
int nft_mnl_connect(void)
Definition nftnlrdr_misc.c:91
struct nftnl_rule * rule_set_dnat(uint8_t family, const char *ifname, uint8_t proto, in_addr_t rhost, unsigned short eport, in_addr_t ihost, uint32_t iport, const char *descr, const char *handle)
Definition nftnlrdr_misc.c:938
rule_type
Definition nftnlrdr_misc.h:38
@ RULE_FILTER
Definition nftnlrdr_misc.h:41
@ RULE_NAT
Definition nftnlrdr_misc.h:40
@ RULE_NONE
Definition nftnlrdr_misc.h:39
@ RULE_COUNTER
Definition nftnlrdr_misc.h:42
int table_op(enum nf_tables_msg_types op, uint16_t family, const char *name)
Definition nftnlrdr_misc.c:1228
int refresh_nft_cache(struct rule_list *head, const char *table, const char *chain, uint32_t family, enum rule_type type)
Definition nftnlrdr_misc.c:677
struct nftnl_rule * rule_set_filter(uint8_t family, const char *ifname, uint8_t proto, in_addr_t rhost, in_addr_t iaddr, unsigned short eport, unsigned short iport, unsigned short rport, const char *descr, const char *handle)
Definition nftnlrdr_misc.c:1010
struct mnl_nlmsg_batch * start_batch(char *buf, size_t buf_size)
Definition nftnlrdr_misc.c:1337
int chain_op(enum nf_tables_msg_types op, uint16_t family, const char *table, const char *name, const char *type, uint32_t hooknum, signed int priority)
Definition nftnlrdr_misc.c:1276
rule_reg_type
Definition nftnlrdr_misc.h:20
@ RULE_REG_TCP_SD_PORT
Definition nftnlrdr_misc.h:33
@ RULE_REG_IP6_DEST_ADDR
Definition nftnlrdr_misc.h:28
@ RULE_REG_IP_SRC_ADDR
Definition nftnlrdr_misc.h:24
@ RULE_REG_IP_PROTO
Definition nftnlrdr_misc.h:30
@ RULE_REG_IMM_VAL
Definition nftnlrdr_misc.h:34
@ RULE_REG_NONE
Definition nftnlrdr_misc.h:21
@ RULE_REG_IP_SD_ADDR
Definition nftnlrdr_misc.h:26
@ RULE_REG_TCP_DPORT
Definition nftnlrdr_misc.h:32
@ RULE_REG_IP6_PROTO
Definition nftnlrdr_misc.h:31
@ RULE_REG_OIF
Definition nftnlrdr_misc.h:23
@ RULE_REG_IP6_SD_ADDR
Definition nftnlrdr_misc.h:29
@ RULE_REG_IIF
Definition nftnlrdr_misc.h:22
@ RULE_REG_IP6_SRC_ADDR
Definition nftnlrdr_misc.h:27
@ RULE_REG_IP_DEST_ADDR
Definition nftnlrdr_misc.h:25
@ RULE_REG_MAX
Definition nftnlrdr_misc.h:35
const char * name
Definition options.c:30
const char * buf
Definition slow_memmem.cpp:73
unsigned short uint16_t
Definition stdint.h:125
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Definition nftnlrdr_misc.h:51
uint32_t family
Definition nftnlrdr_misc.h:59
uint64_t bytes
Definition nftnlrdr_misc.h:76
uint32_t desc_len
Definition nftnlrdr_misc.h:78
char * chain
Definition nftnlrdr_misc.h:54
uint32_t egress_ifidx
Definition nftnlrdr_misc.h:61
uint16_t eport
Definition nftnlrdr_misc.h:67
uint32_t nat_type
Definition nftnlrdr_misc.h:57
uint64_t packets
Definition nftnlrdr_misc.h:75
enum rule_reg_type reg2_type
Definition nftnlrdr_misc.h:72
uint16_t iport
Definition nftnlrdr_misc.h:68
char * desc
Definition nftnlrdr_misc.h:77
enum rule_reg_type reg1_type
Definition nftnlrdr_misc.h:71
uint32_t filter_action
Definition nftnlrdr_misc.h:58
uint32_t reg1_val
Definition nftnlrdr_misc.h:73
struct in6_addr rhost6
Definition nftnlrdr_misc.h:66
uint8_t proto
Definition nftnlrdr_misc.h:70
enum rule_type type
Definition nftnlrdr_misc.h:56
in_addr_t rhost
Definition nftnlrdr_misc.h:64
uint32_t reg2_val
Definition nftnlrdr_misc.h:74
uint32_t ingress_ifidx
Definition nftnlrdr_misc.h:60
in_addr_t iaddr
Definition nftnlrdr_misc.h:63
uint64_t handle
Definition nftnlrdr_misc.h:55
char * table
Definition nftnlrdr_misc.h:53
struct in6_addr iaddr6
Definition nftnlrdr_misc.h:65
uint16_t rport
Definition nftnlrdr_misc.h:69
in_addr_t eaddr
Definition nftnlrdr_misc.h:62
static const char * ifname
Definition testipfwrdr.c:17