X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat64.h;h=f13334447b02bbe4712ac9ffbddcdb4c49b9f576;hp=d365e12b2f7e94a36086951cec412bd7531794d8;hb=61717cc38;hpb=878c646aea9b9ccf68011ffd964694c43bbe5fdd diff --git a/src/plugins/nat/nat64.h b/src/plugins/nat/nat64.h index d365e12b2f7..f13334447b0 100644 --- a/src/plugins/nat/nat64.h +++ b/src/plugins/nat/nat64.h @@ -39,7 +39,7 @@ typedef enum #undef _ } nat64_tcp_ses_state_t; -enum +typedef enum { NAT64_CLEANER_RESCHEDULE = 1, } nat64_cleaner_process_event_e; @@ -89,13 +89,11 @@ typedef struct /** Pool of static BIB entries to be added/deleted in worker threads */ nat64_static_bib_to_update_t *static_bibs; - u32 error_node_index; - /** config parameters */ u32 bib_buckets; - u32 bib_memory_size; + uword bib_memory_size; u32 st_buckets; - u32 st_memory_size; + uword st_memory_size; /** values of various timeouts */ u32 udp_timeout; @@ -108,6 +106,18 @@ typedef struct /* The process node which orcherstrates the cleanup */ u32 nat64_expire_walk_node_index; + /* counters/gauges */ + vlib_simple_counter_main_t total_bibs; + vlib_simple_counter_main_t total_sessions; + + /** node index **/ + u32 error_node_index; + + u32 in2out_node_index; + u32 in2out_slowpath_node_index; + + u32 out2in_node_index; + ip4_main_t *ip4_main; snat_main_t *sm; } nat64_main_t; @@ -119,13 +129,15 @@ extern vlib_node_registration_t nat64_out2in_node; /** * @brief Add/delete address to NAT64 pool. * + * @param thread_index Thread index used by ipfix nat logging (not address per thread). * @param addr IPv4 address. * @param vrf_id VRF id of tenant, ~0 means independent of VRF. * @param is_add 1 if add, 0 if delete. * * @returns 0 on success, non-zero value otherwise. */ -int nat64_add_del_pool_addr (ip4_address_t * addr, u32 vrf_id, u8 is_add); +int nat64_add_del_pool_addr (u32 thread_index, + ip4_address_t * addr, u32 vrf_id, u8 is_add); /** * @brief Call back function when walking addresses in NAT64 pool, non-zero @@ -347,8 +359,8 @@ void nat64_extract_ip4 (ip6_address_t * ip6, ip4_address_t * ip4, * @param st_buckets Number of session table hash buckets. * @param st_memory_size Memory size of session table hash. */ -void nat64_set_hash (u32 bib_buckets, u32 bib_memory_size, u32 st_buckets, - u32 st_memory_size); +void nat64_set_hash (u32 bib_buckets, uword bib_memory_size, u32 st_buckets, + uword st_memory_size); /** * @brief Get worker thread index for NAT64 in2out. @@ -366,7 +378,7 @@ u32 nat64_get_worker_in2out (ip6_address_t * addr); * * @returns worker thread index. */ -u32 nat64_get_worker_out2in (ip4_header_t * ip); +u32 nat64_get_worker_out2in (vlib_buffer_t * b, ip4_header_t * ip); #endif /* __included_nat64_h__ */