45 s =
format (s,
"not found");
84 if (iproto != IP_PROTOCOL_UDP && iproto != IP_PROTOCOL_TCP)
97 ip46_address_t ip46_dst_address;
135 CNAT_ERROR_EXHAUSTED_PORTS, 1);
193 .name =
"ip4-cnat-snat",
194 .vector_size =
sizeof (
u32),
208 .name =
"ip6-cnat-snat",
209 .vector_size =
sizeof (
u32),
225 .arc_name =
"ip4-unicast",.node_name =
"ip4-cnat-snat",};
229 .arc_name =
"ip6-unicast",.node_name =
"ip6-cnat-snat",};
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
struct cnat_snat_trace_ cnat_snat_trace_t
u16 cs_port[VLIB_N_DIR]
ports in rx/tx
u8 * format_cnat_session(u8 *s, va_list *args)
VNET_FEATURE_INIT(cnat_snat_ip4_node, static)
static_always_inline void ip46_address_set_ip6(ip46_address_t *dst, const ip6_address_t *src)
#define VLIB_NODE_FN(node)
vlib_node_registration_t cnat_snat_ip4_node
(constructor) VLIB_REGISTER_NODE (cnat_snat_ip4_node)
#define clib_memcpy(d, s, n)
A session represents the memory of a translation.
ip46_address_t cs_ip[VLIB_N_DIR]
IP 4/6 address in the rx/tx direction.
u32 cs_ts_index
Timestamp index this session was last used.
vl_api_fib_path_type_t type
enum ip_protocol ip_protocol_t
static int cnat_allocate_port(cnat_main_t *cm, u16 *port)
static int cnat_search_snat_prefix(ip46_address_t *addr, ip_address_family_t af)
static uword cnat_snat_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, cnat_node_ctx_t *ctx, int rv, cnat_session_t *session)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static_always_inline void cnat_translation_ip6(const cnat_session_t *session, ip6_header_t *ip6, udp_header_t *udp)
index_t cs_lbi
The load balance object to use to forward.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static u8 * format_cnat_snat_trace(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t * node
u32 flags
Indicates a return path session that was source NATed on the way in.
struct cnat_session_t_::@637 value
this value sits in the same memory location a 'value' in the bihash kvp
static void cnat_timestamp_update(u32 index, f64 t)
vlib_node_registration_t cnat_snat_ip6_node
(constructor) VLIB_REGISTER_NODE (cnat_snat_ip6_node)
static_always_inline void cnat_translation_ip4(const cnat_session_t *session, ip4_header_t *ip4, udp_header_t *udp)
struct _vlib_node_registration vlib_node_registration_t
enum cnat_snat_next_ cnat_snat_next_t
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static_always_inline void cnat_session_create(cnat_session_t *session, cnat_node_ctx_t *ctx, u8 rsession_flags)
Create NAT sessions.
#define VLIB_NODE_FLAG_TRACE
char * cnat_error_strings[]
static void ip46_address_set_ip4(ip46_address_t *ip46, const ip4_address_t *ip)
static uword cnat_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, cnat_node_sub_t cnat_sub, ip_address_family_t af, u8 do_trace)