3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4 * (c) 2015 Tomofumi Hayashi
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution.
11 #define NFT_TABLE_NAT "nat"
12 #define NFT_TABLE_FILTER "filter"
19 RULE_REG_IP_DEST_ADDR
,
20 RULE_REG_IP_SD_ADDR
, /* source & dest */
23 RULE_REG_TCP_SD_PORT
, /* source & dest */
36 typedef struct rule_
{
37 LIST_ENTRY(rule_t
) entry
;
43 uint32_t filter_action
;
45 uint32_t ingress_ifidx
;
46 uint32_t egress_ifidx
;
54 enum rule_reg_type reg1_type
;
55 enum rule_reg_type reg2_type
;
63 LIST_HEAD(rule_list
, rule_
);
64 extern struct rule_list head
;
65 extern rule_t
**peer_cache
;
66 extern rule_t
**redirect_cache
;
69 nft_send_request(struct nft_rule
* rule
, uint16_t cmd
);
71 rule_set_dnat(uint8_t family
, const char * ifname
, uint8_t proto
,
72 in_addr_t rhost
, unsigned short eport
,
73 in_addr_t ihost
, uint32_t iport
,
77 rule_set_snat(uint8_t family
, uint8_t proto
,
78 in_addr_t rhost
, unsigned short rport
,
79 in_addr_t ehost
, unsigned short eport
,
80 in_addr_t ihost
, unsigned short iport
,
84 rule_set_filter(uint8_t family
, const char * ifname
, uint8_t proto
,
85 in_addr_t rhost
, in_addr_t iaddr
, unsigned short eport
,
86 unsigned short iport
, const char * descr
, const char *handle
);
88 rule_del_handle(rule_t
*r
);
90 reflesh_nft_cache(uint32_t family
);
91 void print_rule(rule_t
*r
);