34 #define foreach_cnat_ipv4_tcp_inside_input_exc_error \ 35 _(CNAT_V4_TCP_I2O_E_T_PKT, "v4 tcp i2o-e transmit natted pkt") \ 36 _(CNAT_V4_TCP_I2O_E_D_NON_SYN_PKT, "v4 tcp i2o-e non syn drop") \ 37 _(CNAT_V4_TCP_I2O_E_D_INVALID_PKT, "v4 tcp i2o-e invalid pkt drop") \ 38 _(CNAT_V4_TCP_I2O_E_DROP, "v4 tcp i2o-e drop") \ 39 _(CNAT_V4_TCP_I2O_E_GEN_ICMP, "v4 tcp i2o-e gen icmp msg") \ 40 _(CNAT_V4_TCP_I2O_E_D_NO_SESSION, "v4 tcp i2o-e no session db entry drop") 43 #define _(sym,str) sym, 51 #define _(sym,string) string, 72 #define CNAT_V4_TCP_I2O_E_ICMP CNAT_V4_TCP_I2O_E_D 83 #define stage0 generic_stage0 102 int counter = CNAT_V4_TCP_I2O_E_T_PKT;
124 counter = CNAT_V4_TCP_I2O_E_D_INVALID_PKT;
126 counter = CNAT_V4_TCP_I2O_E_D_NON_SYN_PKT;
144 printf(
"create db %x ip %x->%x port %x->%x dst_ip %x\n", db,
164 u32 *fd = (
u32*)ctx->feature_data;
173 ctx->ru.rx.direction = 0;
176 counter = CNAT_V4_TCP_I2O_E_GEN_ICMP;
180 counter = CNAT_V4_TCP_I2O_E_DROP;
215 clib_net_to_host_u32(tcp->
seq_num);
217 clib_net_to_host_u32(tcp->
ack_num);
223 "ack no = %u, window = %u," 241 counter = CNAT_V4_TCP_I2O_E_D_NO_SESSION;
265 counter = CNAT_V4_TCP_I2O_E_T_PKT;
271 em->
counters[node_counter_base_index + counter] += 1;
282 return dispatch_pipeline (vm, node, frame);
287 .name =
"vcgn-v4-tcp-i2o-e",
288 .vector_size =
sizeof (
u32),
#define ALG_ENABLED_DB(db)
cnat_main_db_entry_t * cnat_main_db
u16 query_and_update_db_timeout(void *db, u8 db_type)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
void ipv4_decr_ttl_n_calc_csum(ipv4_header *ipv4)
#define V4_TCP_UPDATE_SESSION_FLAG(db, tcp)
void tcp_in2out_nat_mss_n_checksum(ipv4_header *ip, tcp_hdr_type *tcp, u32 ipv4_addr, u16 port, cnat_main_db_entry_t *db)
struct _vlib_node_registration vlib_node_registration_t
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.
union cnat_main_db_entry_t::@214 proto_data
vlib_error_main_t error_main
struct cnat_main_db_entry_t::@214::tcp_seq_chk_t tcp_seq_chk
void calculate_window_scale(tcp_hdr_type *tcp_header, u8 *scale)
cnat_session_entry_t * cnat_session_db_lookup_entry(cnat_key_t *ko, u32 main_db_index)
#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.
#define V4_TCP_UPDATE_SESSION_DB_FLAG(sdb, tcp)
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