19 #ifndef __included_nat64_h__ 20 #define __included_nat64_h__ 25 #define foreach_nat64_tcp_ses_state \ 26 _(0, CLOSED, "closed") \ 27 _(1, V4_INIT, "v4-init") \ 28 _(2, V6_INIT, "v6-init") \ 29 _(3, ESTABLISHED, "established") \ 30 _(4, V4_FIN_RCV, "v4-fin-rcv") \ 31 _(5, V6_FIN_RCV, "v6-fin-rcv") \ 32 _(6, V6_FIN_V4_FIN_RCV, "v6-fin-v4-fin-rcv") \ 37 #define _(v, N, s) NAT64_TCP_STATE_##N = v, u32 in2out_reass_node_index
nat64_db_t * db
BIB and session DB per thread.
snat_address_t * addr_pool
Address pool vector.
u32 nat64_expire_walk_node_index
void nat64_set_hash(u32 bib_buckets, u32 bib_memory_size, u32 st_buckets, u32 st_memory_size)
Set NAT64 hash tables configuration.
int nat64_add_interface_address(u32 sw_if_index, int is_add)
NAT64 pool address from specific (DHCP addressed) interface.
u32 nat64_get_worker_out2in(ip4_header_t *ip)
Get worker thread index for NAT64 out2in.
int nat64_set_tcp_timeouts(u32 trans, u32 est)
Set TCP session timeouts.
struct _tcp_header tcp_header_t
u32 * auto_add_sw_if_indices
sw_if_indices whose interface addresses should be auto-added
int nat64_add_del_interface(u32 sw_if_index, u8 is_inside, u8 is_add)
Enable/disable NAT64 feature on the interface.
#define foreach_nat64_tcp_ses_state
int nat64_add_del_static_bib_entry(ip6_address_t *in_addr, ip4_address_t *out_addr, u16 in_port, u16 out_port, u8 proto, u32 vrf_id, u8 is_add)
Add/delete static NAT64 BIB entry.
vlib_node_registration_t nat64_in2out_node
(constructor) VLIB_REGISTER_NODE (nat64_in2out_node)
A collection of simple counters.
snat_interface_t * interfaces
Interface pool.
u32 in2out_slowpath_node_index
u32 udp_timeout
values of various timeouts
u32 nat64_get_icmp_timeout(void)
Get ICMP session timeout.
void nat64_tcp_session_set_state(nat64_db_st_entry_t *ste, tcp_header_t *tcp, u8 is_ip6)
Set NAT64 TCP session state.
nat64_prefix_t * pref64
Pref64 vector.
u32 nat64_get_worker_in2out(ip6_address_t *addr)
Get worker thread index for NAT64 in2out.
int nat64_add_del_prefix(ip6_address_t *prefix, u8 plen, u32 vrf_id, u8 is_add)
Add/delete NAT64 prefix.
int nat64_set_udp_timeout(u32 timeout)
Set UDP session timeout.
void nat64_pool_addr_walk(nat64_pool_addr_walk_fn_t fn, void *ctx)
Walk NAT64 pool.
vlib_simple_counter_main_t total_sessions
vlib_node_registration_t nat64_out2in_node
(constructor) VLIB_REGISTER_NODE (nat64_out2in_node)
u32 nat64_get_tcp_trans_timeout(void)
Get TCP transitory timeout.
int nat64_alloc_out_addr_and_port(u32 fib_index, snat_protocol_t proto, ip4_address_t *addr, u16 *port, u32 thread_index)
Alloce IPv4 address and port pair from NAT64 pool.
u32 nat64_get_udp_timeout(void)
Get UDP session timeout.
u32 nat64_get_tcp_est_timeout(void)
Get TCP established timeout.
u32 bib_buckets
config parameters
u32 out2in_reass_node_index
void nat64_interfaces_walk(nat64_interface_walk_fn_t fn, void *ctx)
Walk NAT64 interfaces.
clib_error_t * nat64_init(vlib_main_t *vm)
Initialize NAT64.
u32 fq_in2out_index
Worker handoff.
int nat64_add_del_pool_addr(u32 thread_index, ip4_address_t *addr, u32 vrf_id, u8 is_add)
Add/delete address to NAT64 pool.
nat64_static_bib_to_update_t * static_bibs
Pool of static BIB entries to be added/deleted in worker threads.
int nat64_set_icmp_timeout(u32 timeout)
Set ICMP session timeout.
nat64_cleaner_process_event_e
struct _vlib_node_registration vlib_node_registration_t
u32 error_node_index
node index
void nat64_session_reset_timeout(nat64_db_st_entry_t *ste, vlib_main_t *vm)
Reset NAT64 session timeout.
void nat64_extract_ip4(ip6_address_t *ip6, ip4_address_t *ip4, u32 fib_index)
Extract IPv4 address from the IPv4-embedded IPv6 addresses.
void nat64_prefix_walk(nat64_prefix_walk_fn_t fn, void *ctx)
Walk NAT64 prefixes.
void nat64_compose_ip6(ip6_address_t *ip6, ip4_address_t *ip4, u32 fib_index)
Compose IPv4-embedded IPv6 addresses.
int(* nat64_prefix_walk_fn_t)(nat64_prefix_t *pref64, void *ctx)
Call back function when walking addresses in NAT64 prefixes, non-zero return value stop walk...
int(* nat64_interface_walk_fn_t)(snat_interface_t *i, void *ctx)
Call back function when walking interfaces with NAT64 feature, non-zero return value stop walk...
vlib_simple_counter_main_t total_bibs
int(* nat64_pool_addr_walk_fn_t)(snat_address_t *addr, void *ctx)
Call back function when walking addresses in NAT64 pool, non-zero return value stop walk...