34 #define foreach_cnat_ipv4_udp_inside_input_exc_error \ 35 _(CNAT_V4_UDP_I2O_T_PKT, "v4 udp i2o transmit") \ 36 _(CNAT_V4_UDP_I2O_D_PKT, "v4 udp i2o drop") \ 37 _(CNAT_V4_ICMP_G_I2O_T_PKT, "v4 udp i2o icmp msg gen") \ 38 _(CNAT_V4_UDP_I2O_DC_PKT, "v4 udp i2o (no config) drop") \ 39 _(CNAT_V4_UDP_I2O_DR_PKT, "v4 udp i2o (not in run state) drop") \ 40 _(CNAT_V4_UDP_I2O_DD_PKT, "v4 udp i2o (no direct port) drop") \ 41 _(CNAT_V4_UDP_I2O_DA_PKT, "v4 udp i2o (no any port) drop") \ 42 _(CNAT_V4_UDP_I2O_DO_PKT, "v4 udp i2o (out of port limit) drop") \ 43 _(CNAT_V4_UDP_I2O_DI_PKT, "v4 udp i2o (invalid packet) drop") \ 44 _(CNAT_V4_UDP_I2O_DS_PKT, "v4 udp i2o (no sessoon db) drop") 47 #define _(sym,str) sym, 55 #define _(sym,string) string, 85 #define stage0 generic_stage0 105 int counter = CNAT_V4_UDP_I2O_T_PKT;
124 clib_net_to_host_u16(udp->
src_port);
131 u16 *feature_data_ports = (
u16 *)&ctx->feature_data[2];
132 ki.
k.
k.
port = *feature_data_ports;
133 feature_data_ports++;
134 dest_info.
k.
port = *feature_data_ports;
138 clib_net_to_host_u16(udp->
src_port);
191 switch (info.
error) {
193 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DR_PKT] += 1;
196 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DO_PKT] += 1;
202 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DA_PKT] += 1;
208 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DD_PKT] += 1;
211 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DI_PKT] += 1;
214 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DS_PKT] += 1;
217 em->
counters[node_counter_base_index + CNAT_V4_UDP_I2O_DC_PKT] += 1;
225 u32 *fd = (
u32*)ctx->feature_data;
230 counter = CNAT_V4_ICMP_G_I2O_T_PKT;
233 counter = CNAT_V4_UDP_I2O_D_PKT;
238 em->
counters[node_counter_base_index + counter] += 1;
250 return dispatch_pipeline (vm, node, frame);
255 .name =
"vcgn-v4-udp-i2o-e",
256 .vector_size =
sizeof (
u32),
u16 query_and_update_db_timeout(void *db, u8 db_type)
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
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 CNAT_DB_UPDATE_IN2OUT_TIMER
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)
#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)
vlib_error_main_t error_main
#define DEBUG_I2O_DROP(debug_flag)
#define CNAT_DEBUG_DROP_UDP
always_inline void ipv4_decr_ttl_n_calc_csum(ipv4_header *ipv4)
struct _spp_ctx spp_ctx_t
#define CNAT_ICMP_DEST_UNREACHABLE
u32 in2out_forwarding_count
void swap_ip_src_udp_port(ipv4_header *ip, udp_hdr_type_t *udp, cnat_main_db_entry_t *db)
#define VLIB_REGISTER_NODE(x,...)
always_inline 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