FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | nat44_ei_address_t |
struct | icmp_echo_header_t |
struct | tcp_udp_header_t |
struct | nat44_ei_user_key_t |
struct | nat44_ei_config_t |
struct | nat44_ei_static_map_resolve_t |
struct | nat44_ei_lb_addr_port_t |
struct | nat44_ei_static_mapping_t |
struct | nat44_ei_interface_t |
struct | nat44_ei_fib_t |
struct | nat44_ei_outside_fib_t |
struct | nat44_ei_main_per_thread_data_t |
struct | nat44_ei_runtime_t |
struct | nat44_ei_is_idle_session_ctx_t |
struct | nat44_ei_main_s |
Typedefs | |
typedef int() | nat44_ei_alloc_out_addr_and_port_function_t(nat44_ei_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index) |
typedef struct nat44_ei_main_s | nat44_ei_main_t |
Enumerations | |
enum | nat44_ei_addr_and_port_alloc_alg_t { foreach_nat44_ei_addr_and_port_alloc_alg } |
Variables | |
nat44_ei_main_t | nat44_ei_main |
NAT44 endpoint independent plugin declarations
Definition in file nat44_ei.h.
#define foreach_nat44_ei_addr_and_port_alloc_alg |
Definition at line 44 of file nat44_ei.h.
#define NAT44_EI_INTERFACE_FLAG_IS_INSIDE (1 << 0) |
Definition at line 57 of file nat44_ei.h.
#define NAT44_EI_INTERFACE_FLAG_IS_OUTSIDE (1 << 1) |
Definition at line 58 of file nat44_ei.h.
#define nat44_ei_interface_is_inside | ( | ip | ) | (ip->flags & NAT44_EI_INTERFACE_FLAG_IS_INSIDE) |
Definition at line 672 of file nat44_ei.h.
#define nat44_ei_interface_is_outside | ( | ip | ) | (ip->flags & NAT44_EI_INTERFACE_FLAG_IS_OUTSIDE) |
Definition at line 674 of file nat44_ei.h.
#define nat44_ei_is_addr_only_static_mapping | ( | mp | ) | (mp->flags & NAT44_EI_STATIC_MAPPING_FLAG_ADDR_ONLY) |
Definition at line 677 of file nat44_ei.h.
#define nat44_ei_is_identity_static_mapping | ( | mp | ) | (mp->flags & NAT44_EI_STATIC_MAPPING_FLAG_IDENTITY_NAT) |
Definition at line 679 of file nat44_ei.h.
#define nat44_ei_is_session_static | ( | sp | ) | (sp->flags & NAT44_EI_SESSION_FLAG_STATIC_MAPPING) |
Definition at line 667 of file nat44_ei.h.
#define nat44_ei_is_unk_proto_session | ( | sp | ) | (sp->flags & NAT44_EI_SESSION_FLAG_UNKNOWN_PROTO) |
Definition at line 669 of file nat44_ei.h.
#define nat44_ei_log_debug | ( | ... | ) | vlib_log (VLIB_LOG_LEVEL_DEBUG, nat44_ei_main.log_class, __VA_ARGS__) |
Definition at line 691 of file nat44_ei.h.
#define nat44_ei_log_err | ( | ... | ) | vlib_log (VLIB_LOG_LEVEL_ERR, nat44_ei_main.log_class, __VA_ARGS__) |
Definition at line 683 of file nat44_ei.h.
#define nat44_ei_log_info | ( | ... | ) | vlib_log (VLIB_LOG_LEVEL_INFO, nat44_ei_main.log_class, __VA_ARGS__) |
Definition at line 689 of file nat44_ei.h.
#define nat44_ei_log_notice | ( | ... | ) | vlib_log (VLIB_LOG_LEVEL_NOTICE, nat44_ei_main.log_class, __VA_ARGS__) |
Definition at line 687 of file nat44_ei.h.
#define nat44_ei_log_warn | ( | ... | ) | vlib_log (VLIB_LOG_LEVEL_WARNING, nat44_ei_main.log_class, __VA_ARGS__) |
Definition at line 685 of file nat44_ei.h.
#define NAT44_EI_SESSION_FLAG_STATIC_MAPPING (1 << 0) |
Definition at line 61 of file nat44_ei.h.
#define NAT44_EI_SESSION_FLAG_UNKNOWN_PROTO (1 << 1) |
Definition at line 62 of file nat44_ei.h.
#define NAT44_EI_STATIC_MAPPING_FLAG_ADDR_ONLY (1 << 0) |
Definition at line 65 of file nat44_ei.h.
#define NAT44_EI_STATIC_MAPPING_FLAG_IDENTITY_NAT (1 << 1) |
Definition at line 66 of file nat44_ei.h.
#define NAT_FQ_NELTS_DEFAULT 64 |
Definition at line 41 of file nat44_ei.h.
typedef int() nat44_ei_alloc_out_addr_and_port_function_t(nat44_ei_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t s_addr, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index) |
Definition at line 83 of file nat44_ei.h.
typedef struct nat44_ei_main_s nat44_ei_main_t |
Enumerator | |
---|---|
foreach_nat44_ei_addr_and_port_alloc_alg |
Definition at line 49 of file nat44_ei.h.
typedef CLIB_PACKED | ( | struct { ip4_address_t addr;u32 fib_index;u32 sessions_per_user_list_head_index;u32 nsessions;u32 nstaticsessions;} | ) |
typedef CLIB_PACKED | ( | struct { struct { ip4_address_t addr;u32 fib_index;u16 port;} out2in;struct { ip4_address_t addr;u32 fib_index;u16 port;} in2out;nat_protocol_t nat_proto;u32 flags;u32 per_user_index;u32 per_user_list_head_index;u32 lru_head_index;u32 lru_index;f64 last_lru_update;f64 last_heard;f64 ha_last_refreshed;u64 total_bytes;u32 total_pkts;ip4_address_t ext_host_addr;u16 ext_host_port;ip4_address_t ext_host_nat_addr;u16 ext_host_nat_port;u8 state;u32 i2o_fin_seq;u32 o2i_fin_seq;u64 tcp_closed_timestamp;u32 user_index;} | ) |
int nat44_ei_add_address | ( | nat44_ei_main_t * | nm, |
ip4_address_t * | addr, | ||
u32 | vrf_id | ||
) |
Definition at line 2575 of file nat44_ei.c.
void nat44_ei_add_del_address_dpo | ( | ip4_address_t | addr, |
u8 | is_add | ||
) |
Definition at line 1019 of file nat44_ei.c.
int nat44_ei_add_del_static_mapping | ( | ip4_address_t | l_addr, |
ip4_address_t | e_addr, | ||
u16 | l_port, | ||
u16 | e_port, | ||
nat_protocol_t | proto, | ||
u32 | sw_if_index, | ||
u32 | vrf_id, | ||
u8 | addr_only, | ||
u8 | identity_nat, | ||
u8 * | tag, | ||
u8 | is_add | ||
) |
Add/delete NAT44-EI static mapping.
l_addr | local IPv4 address |
e_addr | external IPv4 address |
l_port | local port number |
e_port | external port number |
proto | L4 protocol |
sw_if_index | use interface address as external IPv4 address |
vrf_id | local VRF ID |
addr_only | 1 = 1:1NAT, 0 = 1:1NAPT |
identity_nat | identity NAT |
tag | opaque string tag |
is_add | 1 = add, 0 = delete |
Definition at line 1853 of file nat44_ei.c.
int nat44_ei_add_interface_address | ( | nat44_ei_main_t * | nm, |
u32 | sw_if_index, | ||
int | is_del | ||
) |
Definition at line 2632 of file nat44_ei.c.
clib_error_t* nat44_ei_api_hookup | ( | vlib_main_t * | vm | ) |
Definition at line 1188 of file nat44_ei_api.c.
int nat44_ei_del_address | ( | nat44_ei_main_t * | nm, |
ip4_address_t | addr, | ||
u8 | delete_sm | ||
) |
Definition at line 2708 of file nat44_ei.c.
int nat44_ei_del_session | ( | nat44_ei_main_t * | nm, |
ip4_address_t * | addr, | ||
u16 | port, | ||
nat_protocol_t | proto, | ||
u32 | vrf_id, | ||
int | is_in | ||
) |
Delete NAT44-EI session.
addr | IPv4 address |
port | L4 port number |
proto | L4 protocol |
vrf_id | VRF ID |
is_in | 1 = inside network address and port pair, 0 = outside |
Definition at line 1785 of file nat44_ei.c.
void nat44_ei_delete_session | ( | nat44_ei_main_t * | nm, |
nat44_ei_session_t * | ses, | ||
u32 | thread_index | ||
) |
Definition at line 1753 of file nat44_ei.c.
void nat44_ei_free_outside_address_and_port | ( | nat44_ei_address_t * | addresses, |
u32 | thread_index, | ||
ip4_address_t * | addr, | ||
u16 | port, | ||
nat_protocol_t | protocol | ||
) |
void nat44_ei_free_session_data | ( | nat44_ei_main_t * | nm, |
nat44_ei_session_t * | s, | ||
u32 | thread_index, | ||
u8 | is_ha | ||
) |
Definition at line 1252 of file nat44_ei.c.
void nat44_ei_free_session_data_v2 | ( | nat44_ei_main_t * | nm, |
nat44_ei_session_t * | s, | ||
u32 | thread_index, | ||
u8 | is_ha | ||
) |
Definition at line 1079 of file nat44_ei.c.
u32 nat44_ei_get_in2out_worker_index | ( | ip4_header_t * | ip0, |
u32 | rx_fib_index0, | ||
u8 | is_output | ||
) |
Definition at line 1408 of file nat44_ei.c.
u32 nat44_ei_get_out2in_worker_index | ( | vlib_buffer_t * | b, |
ip4_header_t * | ip0, | ||
u32 | rx_fib_index0, | ||
u8 | is_output | ||
) |
Definition at line 1428 of file nat44_ei.c.
int nat44_ei_hairpinning | ( | vlib_main_t * | vm, |
vlib_node_runtime_t * | node, | ||
nat44_ei_main_t * | nm, | ||
u32 | thread_index, | ||
vlib_buffer_t * | b0, | ||
ip4_header_t * | ip0, | ||
udp_header_t * | udp0, | ||
tcp_header_t * | tcp0, | ||
u32 | proto0, | ||
int | do_trace, | ||
u32 * | required_thread_index | ||
) |
Definition at line 124 of file nat44_ei_hairpinning.c.
void nat44_ei_hairpinning_sm_unknown_proto | ( | nat44_ei_main_t * | nm, |
vlib_buffer_t * | b, | ||
ip4_header_t * | ip | ||
) |
Definition at line 97 of file nat44_ei_hairpinning.c.
u32 nat44_ei_icmp_hairpinning | ( | nat44_ei_main_t * | nm, |
vlib_buffer_t * | b0, | ||
u32 | thread_index, | ||
ip4_header_t * | ip0, | ||
icmp46_header_t * | icmp0, | ||
u32 * | required_thread_index | ||
) |
Definition at line 251 of file nat44_ei_hairpinning.c.
Definition at line 496 of file nat44_ei.c.
Definition at line 747 of file nat44_ei.c.
int nat44_ei_plugin_disable | ( | ) |
Definition at line 920 of file nat44_ei.c.
int nat44_ei_plugin_enable | ( | nat44_ei_config_t | c | ) |
Definition at line 419 of file nat44_ei.c.
nat44_ei_session_t* nat44_ei_session_alloc_or_recycle | ( | nat44_ei_main_t * | nm, |
nat44_ei_user_t * | u, | ||
u32 | thread_index, | ||
f64 | now | ||
) |
Definition at line 1180 of file nat44_ei.c.
void nat44_ei_sessions_clear | ( | ) |
Clear all active NAT44-EI sessions.
Definition at line 2478 of file nat44_ei.c.
void nat44_ei_set_alloc_default | ( | void | ) |
Set address and port assignment algorithm to default/standard.
Definition at line 1697 of file nat44_ei.c.
Set address and port assignment algorithm for MAP-E CE.
psid | Port Set Identifier value |
psid_offset | number of offset bits |
psid_length | length of PSID |
Definition at line 1717 of file nat44_ei.c.
Set address and port assignment algorithm for port range.
start_port | beginning of the port range |
end_port | end of the port range |
Definition at line 1706 of file nat44_ei.c.
int nat44_ei_set_frame_queue_nelts | ( | u32 | frame_queue_nelts | ) |
int nat44_ei_set_outside_address_and_port | ( | nat44_ei_address_t * | addresses, |
u32 | thread_index, | ||
ip4_address_t | addr, | ||
u16 | port, | ||
nat_protocol_t | protocol | ||
) |
int nat44_ei_set_workers | ( | uword * | bitmap | ) |
Definition at line 252 of file nat44_ei.c.
void nat44_ei_static_mapping_del_sessions | ( | nat44_ei_main_t * | nm, |
nat44_ei_main_per_thread_data_t * | tnm, | ||
nat44_ei_user_key_t | u_key, | ||
int | addr_only, | ||
ip4_address_t | e_addr, | ||
u16 | e_port | ||
) |
Delete session for static mapping.
addr | IPv4 address |
fib_index | FIB table index |
Definition at line 1356 of file nat44_ei.c.
int nat44_ei_static_mapping_match | ( | ip4_address_t | match_addr, |
u16 | match_port, | ||
u32 | match_fib_index, | ||
nat_protocol_t | match_protocol, | ||
ip4_address_t * | mapping_addr, | ||
u16 * | mapping_port, | ||
u32 * | mapping_fib_index, | ||
u8 | by_external, | ||
u8 * | is_addr_only, | ||
u8 * | is_identity_nat | ||
) |
Match NAT44-EI static mapping.
key | address and port to match |
addr | external/local address of the matched mapping |
port | port of the matched mapping |
fib_index | fib index of the matched mapping |
by_external | if 0 match by local address otherwise match by external address |
is_addr_only | 1 if matched mapping is address only |
is_identity_nat | 1 if indentity mapping |
Definition at line 2253 of file nat44_ei.c.
int nat44_ei_user_del | ( | ip4_address_t * | addr, |
u32 | fib_index | ||
) |
Delete specific NAT44 EI user and his sessions.
addr | IPv4 address |
fib_index | FIB table index |
Definition at line 1314 of file nat44_ei.c.
nat44_ei_user_t* nat44_ei_user_get_or_create | ( | nat44_ei_main_t * | nm, |
ip4_address_t * | addr, | ||
u32 | fib_index, | ||
u32 | thread_index | ||
) |
Definition at line 1121 of file nat44_ei.c.
int nat44_i2o_is_idle_session_cb | ( | clib_bihash_kv_8_8_t * | kv, |
void * | arg | ||
) |
Definition at line 250 of file nat44_ei_in2out.c.
int nat44_o2i_is_idle_session_cb | ( | clib_bihash_kv_8_8_t * | kv, |
void * | arg | ||
) |
Definition at line 103 of file nat44_ei_out2in.c.
nat44_ei_main_t nat44_ei_main |
Definition at line 40 of file nat44_ei.c.