48 s =
format (s,
"created: %U\n tr: %U",
51 s =
format (s,
"not found");
91 if (iproto != IP_PROTOCOL_UDP && iproto != IP_PROTOCOL_TCP
92 && iproto != IP_PROTOCOL_ICMP && iproto != IP_PROTOCOL_ICMP6)
105 ip46_address_t ip46_dst_address;
142 CNAT_ERROR_EXHAUSTED_PORTS, 1);
148 if (iproto == IP_PROTOCOL_TCP || iproto == IP_PROTOCOL_UDP)
205 .name =
"ip4-cnat-snat",
206 .vector_size =
sizeof (
u32),
220 .name =
"ip6-cnat-snat",
221 .vector_size =
sizeof (
u32),
235 .arc_name =
"ip4-unicast",
236 .node_name =
"ip4-cnat-snat",
241 .arc_name =
"ip6-unicast",
242 .node_name =
"ip6-cnat-snat",
int cnat_allocate_port(u16 *port, ip_protocol_t iproto)
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)
This session source port was allocated, free it on cleanup.
This session doesn't have a client, do not attempt to free it.
struct cnat_snat_trace_ cnat_snat_trace_t
u16 cs_port[VLIB_N_DIR]
ports in rx/tx
static uword cnat_snat_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, cnat_node_ctx_t *ctx, int rv, cnat_session_t *session)
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)
static void cnat_timestamp_update(u32 index, f64 t)
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.
description fragment has unexpected format
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
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.
int cnat_search_snat_prefix(ip46_address_t *addr, ip_address_family_t af)
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
session flags if cs_lbi == INDEX_INVALID
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)
struct cnat_session_t_::@633 value
this value sits in the same memory location a 'value' in the bihash kvp