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, 311 #define u8_ptr_add(ptr, index) (((u8 *)ptr) + index) 312 #define u16_net_add(u, val) clib_host_to_net_u16(clib_net_to_host_u16(u) + (val))
sll srl srl sll sra u16x4 i
snat_address_t * addr_pool
Address pool vector.
int nat64_add_del_pool_addr(ip4_address_t *addr, u32 vrf_id, u8 is_add)
Add/delete address to NAT64 pool.
struct _vlib_node_registration vlib_node_registration_t
struct _tcp_header tcp_header_t
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_alloc_out_addr_and_port(u32 fib_index, snat_protocol_t proto, ip4_address_t *addr, u16 *port)
Alloce IPv4 address and port pair from NAT64 pool.
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)
int nat64_set_tcp_timeouts(u32 trans, u32 est, u32 incoming_syn)
Set TCP session timeouts.
snat_interface_t * interfaces
Interface pool.
u32 tcp_incoming_syn_timeout
nat64_db_t db
BIB and session DB.
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.
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.
void nat64_free_out_addr_and_port(ip4_address_t *addr, u16 port, snat_protocol_t proto)
Free IPv4 address and port pair from NAT64 pool.
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.
u32 nat64_get_udp_timeout(void)
Get UDP session timeout.
u32 nat64_get_tcp_est_timeout(void)
Get TCP established timeout.
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.
int nat64_set_icmp_timeout(u32 timeout)
Set ICMP session timeout.
u32 nat64_get_tcp_incoming_syn_timeout(void)
Get TCP incoming SYN timeout.
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...
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...