87 case IP_PROTOCOL_ICMP:
89 case IP_PROTOCOL_ICMP6:
111 *port = clib_net_to_host_u16 (*port);
121 *port = clib_bitmap_next_clear (ca->
bmap, *port);
128 *port = clib_host_to_net_u16 (*port);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
int cnat_allocate_port(u16 *port, ip_protocol_t iproto)
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
This session source port was allocated, free it on cleanup.
void(* cnat_free_port_cb)(u16 port, ip_protocol_t iproto)
Port cleanup callback.
cnat_src_policy_main_t cnat_src_policy_main
static cnat_src_port_allocator_t * cnat_get_src_port_allocator(ip_protocol_t iproto)
u16 cs_port[VLIB_N_DIR]
ports in rx/tx
A Translation represents the translation of a VEP to one of a set of real server addresses.
void cnat_free_port(u16 port, ip_protocol_t iproto)
enum cnat_source_policy_errors_ cnat_source_policy_errors_t
static uword clib_bitmap_get_no_check(uword *ai, uword i)
Gets the ith bit value from a bitmap Does not sanity-check the bit position.
static uword clib_bitmap_set_no_check(uword *a, uword i, uword new_value)
Sets the ith bit of a bitmap to new_value.
#define clib_bitmap_validate(v, n_bits)
A session represents the memory of a translation.
#define VLIB_INIT_FUNCTION(x)
cnat_source_policy_errors_t(* cnat_vip_source_policy_t)(vlib_main_t *vm, vlib_buffer_t *b, cnat_session_t *session, u32 *rsession_flags, const cnat_translation_t *ct, cnat_node_ctx_t *ctx)
cnat_src_port_allocator_t * src_ports
static void clib_spinlock_init(clib_spinlock_t *p)
Indicates a return path session that was source NATed on the way in.
enum ip_protocol ip_protocol_t
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
cnat_vip_source_policy_t default_policy
sll srl srl sll sra u16x4 i
cnat_source_policy_errors_t cnat_vip_default_source_policy(vlib_main_t *vm, vlib_buffer_t *b, cnat_session_t *session, u32 *rsession_flags, const cnat_translation_t *ct, cnat_node_ctx_t *ctx)
u32 flags
session flags if cs_lbi == INDEX_INVALID
void cnat_register_vip_src_policy(cnat_vip_source_policy_t fp)
VLIB buffer representation.
u8 flags
Translation flags.
cnat_vip_source_policy_t vip_policy
struct cnat_session_t_::@633 value
this value sits in the same memory location a 'value' in the bihash kvp
static clib_error_t * cnat_src_policy_init(vlib_main_t *vm)