16 #ifndef __CNAT_CLIENT_H__ 17 #define __CNAT_CLIENT_H__ 88 #define CC_INDEX_INVALID ((u32)(~0)) u32 session_refcnt
Session refcount for cleanup.
ip_address_t ** throttle_pool
u8 * format_cnat_client(u8 *s, va_list *args)
#define clib_atomic_add_fetch(a, b)
struct cnat_client_t_ cnat_client_t
A client is a representation of an IP address behind the NAT.
cnat_client_db_t cnat_client_db
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
dpo_id_t cc_parent
How to send packets to this client post translation.
u32 tr_refcnt
Translations refcount for cleanup.
index_t parent_cci
Parent cnat_client index if cloned via interpose or own index if vanilla client.
int cnat_client_purge(void)
Check all the clients were purged by translation & session purge.
struct cnat_client_db_t_ cnat_client_db_t
DB of clients.
#define static_always_inline
cnat_client_t * cnat_client_pool
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type() ...
static_always_inline u32 cnat_client_uncnt_session(cnat_client_t *cc)
Del a session refcnt to this client.
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
static_always_inline u32 cnat_client_cnt_session(cnat_client_t *cc)
Add a session refcnt to this client.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static_always_inline cnat_client_t * cnat_client_ip4_find(const ip4_address_t *ip)
Find a client from an IP4 address.
static_always_inline cnat_client_t * cnat_client_get(index_t i)
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.
#define clib_atomic_sub_fetch(a, b)
fib_node_index_t cc_fei
the FIB entry this client sources
clib_spinlock_t * throttle_pool_lock
sll srl srl sll sra u16x4 i
u32 fib_node_index_t
A typedef of a node index.
u32 cc_locks
number of DPO locks
cnat_entry_flag_t
CNat Client (dpo) flags.
void cnat_client_translation_added(index_t cci)
A translation that references this VIP was added.
static_always_inline cnat_client_t * cnat_client_ip6_find(const ip6_address_t *ip)
Find a client from an IP6 address.
void cnat_client_throttle_pool_process()
void cnat_client_translation_deleted(index_t cci)
A translation that references this VIP was deleted.
#define hash_get_mem(h, key)
ip_address_t cc_ip
the client's IP address
static_always_inline u32 cnat_client_ip4_find_index(const ip4_address_t *ip)
struct cnat_learn_arg_t_ cnat_learn_arg_t
index_t cnat_client_add(const ip_address_t *ip, u8 flags)
void cnat_client_free_by_ip(ip46_address_t *addr, u8 af)
dpo_type_t cnat_client_dpo
A client is a representation of an IP address behind the NAT.