FD.io VPP  v20.05-21-gb1500e9ff
Vector Packet Processing
alloc.h File Reference

NAT port/address allocation lib. More...

+ Include dependency graph for alloc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nat_ip4_pool_addr_s
 
struct  nat_ip4_addr_port_s
 
struct  nat_ip4_pool_s
 

Typedefs

typedef struct nat_ip4_pool_addr_s nat_ip4_pool_addr_t
 
typedef struct nat_ip4_addr_port_s nat_ip4_addr_port_t
 
typedef struct nat_ip4_pool_s nat_ip4_pool_t
 
typedef void() nat_add_del_ip4_pool_addr_cb_t(ip4_address_t addr, u8 is_add, void *opaque)
 
typedef int() nat_alloc_ip4_addr_and_port_cb_t(nat_ip4_pool_t *pool, u32 fib_index, u32 thread_index, u32 nat_thread_index, u16 port_per_thread, u16 protocol, nat_ip4_addr_port_t *out)
 

Functions

int nat_add_del_ip4_pool_addr (nat_ip4_pool_t *pool, ip4_address_t addr, u8 is_add)
 
int nat_add_del_ip4_pool_addrs (nat_ip4_pool_t *pool, ip4_address_t addr, u32 count, u8 is_add, void *opaque)
 
int nat_alloc_ip4_addr_and_port_cb_default (nat_ip4_pool_t *pool, u32 fib_index, u32 thread_index, u32 nat_thread_index, u16 port_per_thread, u16 protocol, nat_ip4_addr_port_t *out)
 
int nat_alloc_ip4_addr_and_port (nat_ip4_pool_t *pool, u32 fib_index, u32 thread_index, u32 nat_thread_index, u16 port_per_thread, u16 protocol, nat_ip4_addr_port_t *out)
 
int nat_free_ip4_addr_and_port (nat_ip4_pool_t *pool, u32 thread_index, u16 protocol, nat_ip4_addr_port_t *in)
 

Detailed Description

NAT port/address allocation lib.

Definition in file alloc.h.

Typedef Documentation

◆ nat_add_del_ip4_pool_addr_cb_t

typedef void() nat_add_del_ip4_pool_addr_cb_t(ip4_address_t addr, u8 is_add, void *opaque)

Definition at line 29 of file alloc.h.

◆ nat_alloc_ip4_addr_and_port_cb_t

typedef int() nat_alloc_ip4_addr_and_port_cb_t(nat_ip4_pool_t *pool, u32 fib_index, u32 thread_index, u32 nat_thread_index, u16 port_per_thread, u16 protocol, nat_ip4_addr_port_t *out)

Definition at line 32 of file alloc.h.

◆ nat_ip4_addr_port_t

Definition at line 26 of file alloc.h.

◆ nat_ip4_pool_addr_t

Definition at line 25 of file alloc.h.

◆ nat_ip4_pool_t

Definition at line 27 of file alloc.h.

Function Documentation

◆ nat_add_del_ip4_pool_addr()

int nat_add_del_ip4_pool_addr ( nat_ip4_pool_t pool,
ip4_address_t  addr,
u8  is_add 
)

Definition at line 32 of file alloc.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_add_del_ip4_pool_addrs()

int nat_add_del_ip4_pool_addrs ( nat_ip4_pool_t pool,
ip4_address_t  addr,
u32  count,
u8  is_add,
void *  opaque 
)

Definition at line 76 of file alloc.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nat_alloc_ip4_addr_and_port()

int nat_alloc_ip4_addr_and_port ( nat_ip4_pool_t pool,
u32  fib_index,
u32  thread_index,
u32  nat_thread_index,
u16  port_per_thread,
u16  protocol,
nat_ip4_addr_port_t out 
)

Definition at line 195 of file alloc.c.

+ Here is the caller graph for this function:

◆ nat_alloc_ip4_addr_and_port_cb_default()

int nat_alloc_ip4_addr_and_port_cb_default ( nat_ip4_pool_t pool,
u32  fib_index,
u32  thread_index,
u32  nat_thread_index,
u16  port_per_thread,
u16  protocol,
nat_ip4_addr_port_t out 
)

Definition at line 112 of file alloc.c.

+ Here is the caller graph for this function:

◆ nat_free_ip4_addr_and_port()

int nat_free_ip4_addr_and_port ( nat_ip4_pool_t pool,
u32  thread_index,
u16  protocol,
nat_ip4_addr_port_t in 
)

Definition at line 211 of file alloc.c.

+ Here is the caller graph for this function: