27 #define foreach_cnat_ipv4_icmp_q_inside_input_error \ 28 _(CNAT_V4_ICMP_Q_I2O_T_PKT, "cnat v4 icmp_q i2o packet transmit") \ 29 _(CNAT_V4_ICMP_Q_I2O_MISS_PKT, "cnat v4 icmp_q i2o db miss") \ 30 _(CNAT_V4_ICMP_Q_I2O_TTL_GEN, "cnat v4 icmp_q i2o ttl generate") \ 31 _(CNAT_V4_ICMP_Q_I2O_TTL_DROP, "cnat v4 icmp_q i2o ttl drop") \ 32 _(CNAT_V4_ICMP_Q_I2O_NO_SESSION_DROP, "cnat v4 icmp_q i2o no session drop") 35 #define _(sym,str) sym, 42 #define _(sym,string) string, 84 old_ip = spp_net_to_host_byte_order_32(&(ip->
dest_addr));
85 old_postmap_ip = spp_net_to_host_byte_order_32(&postmap_ip);
88 ((
u16)(old_ip >> 16)),
89 (spp_net_to_host_byte_order_16(&(ip->
checksum))),
90 ((
u16)(old_postmap_ip & 0xFFFF)),
91 ((
u16)(old_postmap_ip >> 16)))
95 spp_host_to_net_byte_order_16(new_l3_c);
109 (clib_net_to_host_u16(ip->
checksum)),
110 (clib_net_to_host_u16(icmp->
checksum)),
118 clib_host_to_net_u16(new_l3_c);
124 clib_host_to_net_u16(new_l4_c);
131 #define stage0 generic_stage0 167 #define SPP_LOG2_CACHE_LINE_BYTES 6 168 #define SPP_CACHE_LINE_BYTES (1 << SPP_LOG2_CACHE_LINE_BYTES) 174 uword prefetch_target0, prefetch_target1;
190 prefetch_target1 = prefetch_target0 +
225 }
while (db_index !=
EMPTY);
239 int counter = CNAT_V4_ICMP_Q_I2O_T_PKT;
256 (ctx, ip, ctx->ru.rx.uidb_index)) {
260 counter = CNAT_V4_ICMP_Q_I2O_TTL_GEN;
264 counter = CNAT_V4_ICMP_Q_I2O_TTL_DROP;
272 dest_info.
k.
port = 0;
291 counter = CNAT_V4_ICMP_Q_I2O_NO_SESSION_DROP;
311 counter = CNAT_V4_ICMP_Q_I2O_NO_SESSION_DROP;
320 printf(
"\nDUMPING ICMP PKT BEFORE\n");
338 printf(
"\nDUMPING ICMP PKT AFTER\n");
356 counter = CNAT_V4_ICMP_Q_I2O_MISS_PKT;
361 em->
counters[node_counter_base_index + counter] += 1;
371 return dispatch_pipeline (vm, node, frame);
377 .name =
"vcgn-v4-icmp-q-i2o",
378 .vector_size =
sizeof (
u32),
cnat_main_db_entry_t * cnat_main_db
#define CNAT_UPDATE_L3_ICMP_CHECKSUM(old_l3_1, old_l3_2, old_l4, old_l3_c, old_l4_c, new_l3_1, new_l3_2, new_l4)
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.
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
int icmpv4_generate_with_throttling(spp_ctx_t *ctx, ipv4_header *ipv4, u16 rx_uidb_index)
#define CLIB_PREFETCH(addr, size, type)
void cnat_add_dest_n_log(cnat_main_db_entry_t *mdb, cnat_key_t *dest_info)
#define CNAT_UPDATE_L3_CHECKSUM_DECLARE
#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
void print_icmp_pkt(ipv4_header *ip)
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define CNAT_UPDATE_L3_CHECKSUM(old_l3_1, old_l3_2, old_l3_c,new_l3_1, new_l3_2)