FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
cnat_ports.h File Reference
+ Include dependency graph for cnat_ports.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cnat_portmap_t
 
struct  cnat_portmap_v2_t
 

Macros

#define PORTS_PER_ADDR   65536
 
#define CNAT_INSTS   PLATFORM_CNAT_INSTS
 
#define BITS_PER_INST   (PORTS_PER_ADDR)
 
#define MIN_STATIC_PORT_RANGE_FOR_RTSP   (9900)
 
#define PORT_PROBE_LIMIT   20
 

Enumerations

enum  port_pair_t { PORT_SINGLE =0, PORT_PAIR =1, PORT_S_EVEN =2, PORT_S_ODD =3 }
 
enum  port_type_t { PORT_TYPE_DYNAMIC =0, PORT_TYPE_STATIC =1, PORT_TYPE_RTSP =2 }
 
enum  port_alloc_t { PORT_ALLOC_ANY =1, PORT_ALLOC_DIRECTED =2 }
 

Functions

static u16 bit2port (u32 bit)
 
static uword port2bit (u16 port)
 
static u32 randq1 (u32 prev)
 
cnat_errno_t cnat_static_port_alloc_v2 (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 i_ipv4_address, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1)
 
cnat_errno_t cnat_mapped_static_port_alloc_v2 (cnat_portmap_v2_t *pm, port_alloc_t atype, u32 *index, u32 ipv4_address, u16 port, int *nfv9_log_req, bulk_alloc_size_t bulk_size, u16 ip_n_to_1)
 
cnat_errno_t cnat_dynamic_port_alloc_v2 (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 *index, u32 *o_ipv4_address, u16 *o_port, u16 static_port_range, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u16 ip_n_to_1, u32 *rseed_ip)
 
cnat_errno_t cnat_dynamic_port_alloc_rtsp (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u16 start_range, u16 end_range, u32 *index, u32 *o_ipv4_address, u16 *o_port, bulk_alloc_size_t bulk_size, int *nfv9_log_req, u32 *rseed_ip)
 
void cnat_port_free_v2 (cnat_portmap_v2_t *pm, int index, port_pair_t ptype, u16 base_port, u16 static_port_range)
 
void cnat_portmap_dump_v2 (cnat_portmap_v2_t *pm, u16 print_limit)
 
cnat_errno_t nat64_static_port_alloc (cnat_portmap_v2_t *pm, port_alloc_t atype, port_pair_t pair_type, u32 *i_ipv6_address, u16 i_port, u32 *index, u32 *o_ipv4_address, u16 *o_port)
 

Variables

u8 my_instance_number
 

Macro Definition Documentation

#define BITS_PER_INST   (PORTS_PER_ADDR)

Definition at line 30 of file cnat_ports.h.

#define CNAT_INSTS   PLATFORM_CNAT_INSTS

Definition at line 28 of file cnat_ports.h.

#define MIN_STATIC_PORT_RANGE_FOR_RTSP   (9900)

Definition at line 36 of file cnat_ports.h.

#define PORT_PROBE_LIMIT   20

Definition at line 101 of file cnat_ports.h.

#define PORTS_PER_ADDR   65536

Definition at line 26 of file cnat_ports.h.

Enumeration Type Documentation

Enumerator
PORT_ALLOC_ANY 
PORT_ALLOC_DIRECTED 

Definition at line 96 of file cnat_ports.h.

Enumerator
PORT_SINGLE 
PORT_PAIR 
PORT_S_EVEN 
PORT_S_ODD 

Definition at line 82 of file cnat_ports.h.

Enumerator
PORT_TYPE_DYNAMIC 
PORT_TYPE_STATIC 
PORT_TYPE_RTSP 

Definition at line 89 of file cnat_ports.h.

Function Documentation

static u16 bit2port ( u32  bit)
inlinestatic

Definition at line 43 of file cnat_ports.h.

+ Here is the caller graph for this function:

cnat_errno_t cnat_dynamic_port_alloc_rtsp ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u16  start_range,
u16  end_range,
u32 index,
u32 o_ipv4_address,
u16 o_port,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u32 rseed_ip 
)

Definition at line 906 of file cnat_ports.c.

+ Here is the caller graph for this function:

cnat_errno_t cnat_dynamic_port_alloc_v2 ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u32 index,
u32 o_ipv4_address,
u16 o_port,
u16  static_port_range,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u16  ip_n_to_1,
u32 rseed_ip 
)

Definition at line 554 of file cnat_ports.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_errno_t cnat_mapped_static_port_alloc_v2 ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
u32 index,
u32  ipv4_address,
u16  port,
int *  nfv9_log_req,
bulk_alloc_size_t  bulk_size,
u16  ip_n_to_1 
)

Definition at line 932 of file cnat_ports.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cnat_port_free_v2 ( cnat_portmap_v2_t pm,
int  index,
port_pair_t  ptype,
u16  base_port,
u16  static_port_range 
)

Definition at line 1037 of file cnat_ports.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cnat_portmap_dump_v2 ( cnat_portmap_v2_t pm,
u16  print_limit 
)

Definition at line 1072 of file cnat_ports.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_errno_t cnat_static_port_alloc_v2 ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u32  i_ipv4_address,
u16  i_port,
u32 index,
u32 o_ipv4_address,
u16 o_port,
u16  static_port_range,
bulk_alloc_size_t  bulk_size,
int *  nfv9_log_req,
u16  ip_n_to_1 
)

Definition at line 135 of file cnat_ports.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

cnat_errno_t nat64_static_port_alloc ( cnat_portmap_v2_t pm,
port_alloc_t  atype,
port_pair_t  pair_type,
u32 i_ipv6_address,
u16  i_port,
u32 index,
u32 o_ipv4_address,
u16 o_port 
)

+ Here is the caller graph for this function:

static uword port2bit ( u16  port)
inlinestatic

Definition at line 48 of file cnat_ports.h.

+ Here is the caller graph for this function:

static u32 randq1 ( u32  prev)
inlinestatic

Definition at line 111 of file cnat_ports.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

u8 my_instance_number

Definition at line 51 of file cnat_ports.c.