33 #define foreach_cnat_ipv4_tcp_inside_input_error \ 34 _(CNAT_V4_TCP_I2O_PKT_IN, "tcp i2o packets received") \ 35 _(CNAT_V4_TCP_I2O_PKT_T, "tcp i2o packets natted") \ 36 _(CNAT_V4_TCP_I2O_EXCEPTION, "packets to tcp i2o exception") \ 37 _(CNAT_V4_TCP_I2O_TTL_GEN, "generated TTL expiry ICMP packets") \ 38 _(CNAT_V4_TCP_I2O_TTL_GEN_DROP, "could not generate TTL expiry ICMP packets") \ 39 _(CNAT_V4_TCP_I2O_SESSION_DROP, "could not generate session") \ 40 _(CNAT_V4_UDP_I2O_FRAG_DROP, "non-first fragment drop") 43 #define _(sym,str) sym, 50 #define _(sym,string) string, 71 #define CNAT_REWRITE_OUTPUT CNAT_V4_TCP_I2O_T 72 #define CNAT_V4_ICMP_GEN CNAT_V4_TCP_I2O_D 84 #define stage0 generic_stage0 105 clib_net_to_host_u16 (tcp->
src_port);
128 #define SPP_LOG2_CACHE_LINE_BYTES 6 129 #define SPP_CACHE_LINE_BYTES (1 << SPP_LOG2_CACHE_LINE_BYTES) 135 uword prefetch_target0, prefetch_target1;
151 prefetch_target1 = prefetch_target0 +
186 }
while (db_index !=
EMPTY);
201 int counter = CNAT_V4_TCP_I2O_PKT_T;
223 (ctx, ip, ctx->ru.rx.uidb_index)) {
227 counter = CNAT_V4_TCP_I2O_TTL_GEN;
231 counter = CNAT_V4_TCP_I2O_TTL_GEN_DROP;
240 counter = CNAT_V4_TCP_I2O_EXCEPTION;
271 counter = CNAT_V4_TCP_I2O_SESSION_DROP;
285 counter = CNAT_V4_TCP_I2O_SESSION_DROP;
292 window = window << session_db->
scale;
295 session_db->
scale = scale;
296 session_db->
window = window;
300 session_db->
window = window;
307 printf(
"\n In2out SDB stages seq no = %u," 308 " ack no = %u, window = %u\n",
321 window = window << db->
scale;
326 clib_net_to_host_u32(tcp->
seq_num);
328 clib_net_to_host_u32(tcp->
ack_num);
335 printf(
"\n In2out MainDB seq no = %u," 339 printf(
"\n In2out MAINDB window = %u\n",
345 counter = CNAT_V4_TCP_I2O_PKT_T;
381 em->
counters[node_counter_base_index + counter] += 1;
391 return dispatch_pipeline (vm, node, frame);
397 .name =
"vcgn-v4-tcp-i2o",
398 .vector_size =
sizeof (
u32),
#define ALG_ENABLED_DB(db)
cnat_main_db_entry_t * cnat_main_db
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 cnat_main_db_entry_t::@165::tcp_seq_chk_t tcp_seq_chk
#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
#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)
void calculate_window_scale(tcp_hdr_type *tcp_header, u8 *scale)
#define CLIB_PREFETCH(addr, size, type)
void cnat_add_dest_n_log(cnat_main_db_entry_t *mdb, cnat_key_t *dest_info)
#define INCREMENT_NODE_COUNTER(c)
#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_V4_GET_HASH(key64, hash, mask)
#define CLIB_CACHE_LINE_BYTES
union cnat_main_db_entry_t::@165 proto_data
#define V4_TCP_UPDATE_SESSION_DB_FLAG(sdb, tcp)
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.