32 #define foreach_cnat_ipv4_udp_inside_input_error \ 33 _(CNAT_V4_UDP_I2O_T_PKT, "v4 udp i2o transmit") \ 34 _(CNAT_V4_UDP_I2O_MISS_PKT, "v4 udp i2o db miss") \ 35 _(CNAT_V4_UDP_I2O_TTL_GEN, "v4 udp i2o TTL gen") \ 36 _(CNAT_V4_UDP_I2O_TTL_DROP, "v4 udp i2o TTL drop") \ 37 _(CNAT_V4_PCP_PKT, "v4 pcp pkt") \ 38 _(CNAT_V4_UDP_I2O_SESSION_DROP, "v4 udp i2o session drop") 41 #define _(sym,str) sym, 48 #define _(sym,string) string, 70 #define CNAT_V4_UDP_I2O_D CNAT_V4_I2O_FIXME 71 #define CNAT_V4_PCP_T CNAT_V4_I2O_FIXME 82 #define stage0 generic_stage0 128 (clib_net_to_host_u16(ip->
checksum)),
137 #ifdef UDP_PACKET_DEBUG 139 printf(
"\nIn2Out UDP packet before translation");
148 clib_host_to_net_u16(new_l3_c);
166 clib_host_to_net_u16(new_l4_c);
170 #ifdef UDP_PACKET_DEBUG 172 printf(
"\nIn2Out UDP checksum 0x%x disabled by force", new_l4_c);
176 printf(
"\nIn2Out UDP packet after translation");
198 clib_net_to_host_u16 (udp->
src_port);
220 #define SPP_LOG2_CACHE_LINE_BYTES 6 221 #define SPP_CACHE_LINE_BYTES (1 << SPP_LOG2_CACHE_LINE_BYTES) 227 uword prefetch_target0, prefetch_target1;
243 prefetch_target1 = prefetch_target0 +
278 }
while (db_index !=
EMPTY);
293 int counter = CNAT_V4_UDP_I2O_T_PKT;
310 counter = CNAT_V4_PCP_PKT;
320 (ctx, ip, ctx->ru.rx.uidb_index)) {
323 counter = CNAT_V4_UDP_I2O_TTL_GEN;
327 counter = CNAT_V4_UDP_I2O_TTL_DROP;
341 #if 0 // DONOT REMOVE THIS if 0 345 u16 *feature_data_ports = (
u16 *)&ctx->feature_data[4];
346 dest_info.
k.
port = *feature_data_ports;
403 counter = CNAT_V4_UDP_I2O_SESSION_DROP;
426 counter = CNAT_V4_UDP_I2O_SESSION_DROP;
457 counter = CNAT_V4_UDP_I2O_MISS_PKT;
463 em->
counters[node_counter_base_index + counter] += 1;
474 return dispatch_pipeline (vm, node, frame);
480 .name =
"vcgn-v4-udp-i2o",
481 .vector_size =
sizeof (
u32),
cnat_main_db_entry_t * cnat_main_db
u32 udp_inside_checksum_disable
cnat_session_entry_t * cnat_create_session_db_entry(cnat_key_t *ko, cnat_main_db_entry_t *bdb, u8 log)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
struct _vlib_node_registration vlib_node_registration_t
#define STRUCT_OFFSET_OF(t, f)
index_slist_t in2out_hash
cnat_session_entry_t * cnat_handle_1to2_session(cnat_main_db_entry_t *mdb, cnat_key_t *dest_info)
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define CNAT_UPDATE_L3_L4_CHECKSUM(old_l3_1, old_l3_2, old_l4, old_l3_c, old_l4_c, new_l3_1, new_l3_2, new_l4)
vnet_main_t * vnet_get_main(void)
index_slist_t * cnat_in2out_hash
#define CNAT_DB_TIMEOUT_RST(db)
#define VLIB_INIT_FUNCTION(x)
vlib_error_main_t error_main
u16 vrf_map_array[CNAT_MAX_VRFMAP_ENTRIES]
#define PCP_INCR(counter)
int icmpv4_generate_with_throttling(spp_ctx_t *ctx, ipv4_header *ipv4, u16 rx_uidb_index)
void print_udp_pkt(ipv4_header *ip)
#define CLIB_PREFETCH(addr, size, type)
void cnat_add_dest_n_log(cnat_main_db_entry_t *mdb, cnat_key_t *dest_info)
#define VRF_MAP_ENTRY_EMPTY
cnat_vrfmap_t * cnat_map_by_vrf
#define CNAT_MAIN_HASH_MASK
always_inline void ipv4_decr_ttl_n_calc_csum(ipv4_header *ipv4)
struct _spp_ctx spp_ctx_t
u32 in2out_forwarding_count
#define VLIB_REGISTER_NODE(x,...)
#define CNAT_UPDATE_L3_L4_CHECKSUM_DECLARE
#define CNAT_V4_GET_HASH(key64, hash, mask)
#define CLIB_CACHE_LINE_BYTES
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
u32 udp_inside_packet_dump_enable