Electroneum
Loading...
Searching...
No Matches
nftnlrdr_misc.h
Go to the documentation of this file.
1/*
2 * MiniUPnP project
3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4 * (c) 2015 Tomofumi Hayashi
5 *
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution.
8 */
9#include <sys/queue.h>
10
11#define NFT_TABLE_NAT "nat"
12#define NFT_TABLE_FILTER "filter"
13
27
35
62
63LIST_HEAD(rule_list, rule_);
64extern struct rule_list head;
65extern rule_t **peer_cache;
66extern rule_t **redirect_cache;
67
68int
69nft_send_request(struct nft_rule * rule, uint16_t cmd);
70struct nft_rule *
71rule_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,
74 const char *descr,
75 const char *handle);
76struct nft_rule *
78 in_addr_t rhost, unsigned short rport,
79 in_addr_t ehost, unsigned short eport,
80 in_addr_t ihost, unsigned short iport,
81 const char *descr,
82 const char *handle);
83struct nft_rule *
84rule_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);
87struct nft_rule *
89void
struct nft_rule * rule_del_handle(rule_t *r)
struct nft_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)
struct nft_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)
LIST_HEAD(rule_list, rule_)
struct rule_ rule_t
void print_rule(rule_t *r)
void reflesh_nft_cache(uint32_t family)
rule_t ** redirect_cache
rule_t ** peer_cache
struct nft_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, const char *descr, const char *handle)
rule_type
@ RULE_FILTER
@ RULE_SNAT
@ RULE_NAT
@ RULE_NONE
@ RULE_COUNTER
int nft_send_request(struct nft_rule *rule, uint16_t cmd)
struct rule_list head
rule_reg_type
@ RULE_REG_TCP_SD_PORT
@ RULE_REG_IP_SRC_ADDR
@ RULE_REG_IP_PROTO
@ RULE_REG_IMM_VAL
@ RULE_REG_NONE
@ RULE_REG_IP_SD_ADDR
@ RULE_REG_TCP_DPORT
@ RULE_REG_OIF
@ RULE_REG_IIF
@ RULE_REG_IP_DEST_ADDR
@ RULE_REG_MAX
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
uint32_t reg1_val
uint8_t proto
uint64_t handle
uint32_t egress_ifidx
uint16_t iport
char * table
uint16_t eport
uint32_t nat_type
uint32_t ingress_ifidx
uint32_t family
char * desc
uint16_t rport
enum rule_type type
in_addr_t iaddr
uint64_t packets
char * chain
in_addr_t rhost
enum rule_reg_type reg1_type
LIST_ENTRY(rule_t) entry
uint32_t filter_action
uint32_t reg2_val
enum rule_reg_type reg2_type
in_addr_t eaddr
uint64_t bytes