Electroneum
nftnlrdr_misc.h File Reference
#include <sys/queue.h>
Include dependency graph for nftnlrdr_misc.h:

Go to the source code of this file.

Classes

struct  rule_
 

Macros

#define NFT_TABLE_NAT   "nat"
 
#define NFT_TABLE_FILTER   "filter"
 

Typedefs

typedef struct rule_ rule_t
 

Enumerations

enum  rule_reg_type {
  RULE_REG_NONE, RULE_REG_IIF, RULE_REG_OIF, RULE_REG_IP_SRC_ADDR,
  RULE_REG_IP_DEST_ADDR, RULE_REG_IP_SD_ADDR, RULE_REG_IP_PROTO, RULE_REG_TCP_DPORT,
  RULE_REG_TCP_SD_PORT, RULE_REG_IMM_VAL, RULE_REG_MAX
}
 
enum  rule_type {
  RULE_NONE, RULE_NAT, RULE_SNAT, RULE_FILTER,
  RULE_COUNTER
}
 

Functions

 LIST_HEAD (rule_list, rule_)
 
int nft_send_request (struct nft_rule *rule, uint16_t cmd)
 
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)
 
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_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)
 
struct nft_rule * rule_del_handle (rule_t *r)
 
void reflesh_nft_cache (uint32_t family)
 
void print_rule (rule_t *r)
 

Variables

struct rule_list head
 
rule_t ** peer_cache
 
rule_t ** redirect_cache
 

Macro Definition Documentation

◆ NFT_TABLE_FILTER

#define NFT_TABLE_FILTER   "filter"

Definition at line 12 of file nftnlrdr_misc.h.

◆ NFT_TABLE_NAT

#define NFT_TABLE_NAT   "nat"

Definition at line 11 of file nftnlrdr_misc.h.

Typedef Documentation

◆ rule_t

typedef struct rule_ rule_t

Enumeration Type Documentation

◆ rule_reg_type

Enumerator
RULE_REG_NONE 
RULE_REG_IIF 
RULE_REG_OIF 
RULE_REG_IP_SRC_ADDR 
RULE_REG_IP_DEST_ADDR 
RULE_REG_IP_SD_ADDR 
RULE_REG_IP_PROTO 
RULE_REG_TCP_DPORT 
RULE_REG_TCP_SD_PORT 
RULE_REG_IMM_VAL 
RULE_REG_MAX 

Definition at line 14 of file nftnlrdr_misc.h.

◆ rule_type

enum rule_type
Enumerator
RULE_NONE 
RULE_NAT 
RULE_SNAT 
RULE_FILTER 
RULE_COUNTER 

Definition at line 28 of file nftnlrdr_misc.h.

Function Documentation

◆ LIST_HEAD()

LIST_HEAD ( rule_list  ,
rule_   
)

◆ nft_send_request()

int nft_send_request ( struct nft_rule *  rule,
uint16_t  cmd 
)

◆ print_rule()

void print_rule ( rule_t r)

◆ reflesh_nft_cache()

void reflesh_nft_cache ( uint32_t  family)

◆ rule_del_handle()

struct nft_rule* rule_del_handle ( rule_t r)

◆ rule_set_dnat()

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 
)

◆ rule_set_filter()

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_set_snat()

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 
)

Variable Documentation

◆ head

struct rule_list head

◆ peer_cache

rule_t** peer_cache

◆ redirect_cache

rule_t** redirect_cache