27 #define foreach_cnat_ipv4_icmp_q_inside_input_exc_error \ 28 _(CNAT_V4_ICMP_Q_I2O_E_T_PKT, "v4 icmp query i2o-e transmit") \ 29 _(CNAT_V4_ICMP_Q_I2O_E_G_PKT, "v4 icmp query i2o-e gen icmp msg") \ 30 _(CNAT_V4_ICMP_Q_I2O_E_D_PKT, "v4 icmp query i2o-e pkt drop") \ 31 _(CNAT_V4_ICMP_Q_I2O_E_DC_PKT, "v4 icmp query i2o-e drop (no config)") \ 32 _(CNAT_V4_ICMP_Q_I2O_E_DR_PKT, "v4 icmp query i2o-e drop (not in run state)") \ 33 _(CNAT_V4_ICMP_Q_I2O_E_DD_PKT, "v4 icmp query i2o-e drop (no direct port)") \ 34 _(CNAT_V4_ICMP_Q_I2O_E_DA_PKT, "v4 icmp query i2o-e drop (no any port)") \ 35 _(CNAT_V4_ICMP_Q_I2O_E_DO_PKT, "v4 icmp query i2o-e drop (out of port limit)") \ 36 _(CNAT_V4_ICMP_Q_I2O_E_DS_PKT, "v4 icmp query i2o_e drop (out of session db)") 39 #define _(sym,str) sym, 47 #define _(sym,string) string, 68 #define CNAT_V4_ICMP_Q_E_I2O_GEN CNAT_V4_ICMP_Q_E_I2O_T 79 #define stage0 generic_stage0 86 int counter = CNAT_V4_ICMP_Q_I2O_E_T_PKT;
108 dest_info.
k.
port = 0;
118 printf(
"\nDUMPING ICMP PKT BEFORE\n");
135 printf(
"\nDUMPING ICMP PKT AFTER\n");
146 switch (info.
error) {
148 counter = CNAT_V4_ICMP_Q_I2O_E_DR_PKT;
151 counter = CNAT_V4_ICMP_Q_I2O_E_DO_PKT;
157 counter = CNAT_V4_ICMP_Q_I2O_E_DA_PKT;
163 counter = CNAT_V4_ICMP_Q_I2O_E_DD_PKT;
166 counter = CNAT_V4_ICMP_Q_I2O_E_DS_PKT;
169 counter = CNAT_V4_ICMP_Q_I2O_E_DC_PKT;
177 u32 *fd = (
u32*)ctx->feature_data;
182 counter = CNAT_V4_ICMP_Q_I2O_E_G_PKT;
185 counter = CNAT_V4_ICMP_Q_I2O_E_D_PKT;
190 em->
counters[node_counter_base_index + counter] += 1;
201 return dispatch_pipeline (vm, node, frame);
206 .name =
"vcgn-v4-icmp-q-i2o-e",
207 .vector_size =
sizeof (
u32),
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
void ipv4_decr_ttl_n_calc_csum(ipv4_header *ipv4)
void swap_ip_src_icmp_id(ipv4_header *ip, icmp_v4_t *icmp, cnat_main_db_entry_t *db, u16 vrf)
struct _vlib_node_registration vlib_node_registration_t
#define CNAT_DB_UPDATE_IN2OUT_TIMER
vnet_main_t * vnet_get_main(void)
#define VLIB_INIT_FUNCTION(x)
cnat_main_db_entry_t * cnat_get_main_db_entry_v2(cnat_db_key_bucket_t *ki, port_pair_t port_pair_type, port_type_t port_type, cnat_gen_icmp_info *info, cnat_key_t *dest_info)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_error_main_t error_main
#define CNAT_DEBUG_DROP_ICMP
#define DEBUG_I2O_DROP(debug_flag)
#define CNAT_ICMP_DEST_UNREACHABLE
u32 in2out_forwarding_count
#define VLIB_REGISTER_NODE(x,...)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
void print_icmp_pkt(ipv4_header *ip)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
cnat_icmp_msg_t gen_icmp_msg