FD.io VPP  v21.01.1
Vector Packet Processing
alloc.c File Reference

NAT port/address allocation lib. More...

+ Include dependency graph for alloc.c:

Go to the source code of this file.

Functions

static_always_inline void nat_ip4_addr_increment (ip4_address_t *addr)
 
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)
 
static_always_inline u16 nat_random_port (u32 *random_seed, u16 min, u16 max)
 
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 *addr_port)
 

Detailed Description

NAT port/address allocation lib.

Definition in file alloc.c.

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 addr_port 
)

Definition at line 211 of file alloc.c.

+ Here is the caller graph for this function:

◆ nat_ip4_addr_increment()

static_always_inline void nat_ip4_addr_increment ( ip4_address_t addr)

Definition at line 24 of file alloc.c.

+ Here is the caller graph for this function:

◆ nat_random_port()

static_always_inline u16 nat_random_port ( u32 random_seed,
u16  min,
u16  max 
)

Definition at line 105 of file alloc.c.

+ Here is the call graph for this function: