FD.io VPP
v21.01.1
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | cnat_client_t_ |
A client is a representation of an IP address behind the NAT. More... | |
struct | cnat_learn_arg_t_ |
struct | cnat_client_db_t_ |
DB of clients. More... | |
Macros | |
#define | CC_INDEX_INVALID ((u32)(~0)) |
Typedefs | |
typedef struct cnat_client_t_ | cnat_client_t |
A client is a representation of an IP address behind the NAT. More... | |
typedef struct cnat_learn_arg_t_ | cnat_learn_arg_t |
typedef struct cnat_client_db_t_ | cnat_client_db_t |
DB of clients. More... | |
Enumerations | |
enum | cnat_entry_flag_t { CNAT_FLAG_EXCLUSIVE = (1 << 1), CNAT_FLAG_EXPIRES = (1 << 2) } |
CNat Client (dpo) flags. More... | |
Variables | |
cnat_client_t * | cnat_client_pool |
dpo_type_t | cnat_client_dpo |
cnat_client_db_t | cnat_client_db |
#define CC_INDEX_INVALID ((u32)(~0)) |
Definition at line 88 of file cnat_client.h.
typedef struct cnat_client_db_t_ cnat_client_db_t |
DB of clients.
typedef struct cnat_client_t_ cnat_client_t |
A client is a representation of an IP address behind the NAT.
A client thus sends packet to a VIP. Clients are learned in the Data-plane when they send packets, but, since they make additions to the FIB they must be programmed in the main thread. They are aged out when they become idle.
A client interposes in the FIB graph for the prefix corresponding to the client (e.g. client's-IP/32). As a result this client object is cloned as the interpose DPO. The clones are removed when the lock count drops to zero. The originals are removed when the client ages. At forwarding time the client preforms the reverse translation and then ships the packet to where the FIB would send it.
typedef struct cnat_learn_arg_t_ cnat_learn_arg_t |
enum cnat_entry_flag_t |
CNat Client (dpo) flags.
Enumerator | |
---|---|
CNAT_FLAG_EXCLUSIVE | |
CNAT_FLAG_EXPIRES |
Definition at line 126 of file cnat_client.h.
index_t cnat_client_add | ( | const ip_address_t * | ip, |
u8 | flags | ||
) |
Definition at line 151 of file cnat_client.c.
static_always_inline u32 cnat_client_cnt_session | ( | cnat_client_t * | cc | ) |
Add a session refcnt to this client.
Definition at line 202 of file cnat_client.h.
void cnat_client_free_by_ip | ( | ip46_address_t * | addr, |
u8 | af | ||
) |
Definition at line 58 of file cnat_client.c.
static_always_inline cnat_client_t* cnat_client_get | ( | index_t | i | ) |
static_always_inline cnat_client_t* cnat_client_ip4_find | ( | const ip4_address_t * | ip | ) |
Find a client from an IP4 address.
Definition at line 157 of file cnat_client.h.
static_always_inline u32 cnat_client_ip4_find_index | ( | const ip4_address_t * | ip | ) |
Definition at line 170 of file cnat_client.h.
static_always_inline cnat_client_t* cnat_client_ip6_find | ( | const ip6_address_t * | ip | ) |
Find a client from an IP6 address.
Definition at line 186 of file cnat_client.h.
void cnat_client_learn | ( | const cnat_learn_arg_t * | l | ) |
Called in the main thread by RPC from the workers to learn a new client.
Definition at line 202 of file cnat_client.c.
int cnat_client_purge | ( | void | ) |
Check all the clients were purged by translation & session purge.
Definition at line 242 of file cnat_client.c.
void cnat_client_throttle_pool_process | ( | ) |
Definition at line 71 of file cnat_client.c.
void cnat_client_translation_added | ( | index_t | cci | ) |
A translation that references this VIP was added.
Definition at line 109 of file cnat_client.c.
void cnat_client_translation_deleted | ( | index_t | cci | ) |
A translation that references this VIP was deleted.
Definition at line 121 of file cnat_client.c.
static_always_inline u32 cnat_client_uncnt_session | ( | cnat_client_t * | cc | ) |
Del a session refcnt to this client.
Definition at line 212 of file cnat_client.h.
Definition at line 258 of file cnat_client.c.
cnat_client_db_t cnat_client_db |
Definition at line 24 of file cnat_client.c.
dpo_type_t cnat_client_dpo |
Definition at line 26 of file cnat_client.c.
cnat_client_t* cnat_client_pool |
Definition at line 22 of file cnat_client.c.