FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | nat44_config_t |
struct | nat_pre_trace_t |
union | nat_6t_t |
struct | nat_6t_flow_t |
struct | snat_address_t |
struct | nat_fib_t |
struct | nat_outside_fib_t |
struct | nat44_lb_addr_port_t |
struct | snat_static_mapping_t |
struct | snat_interface_t |
struct | snat_static_map_resolve_t |
struct | snat_main_per_thread_data_t |
struct | snat_main_s |
struct | nat44_is_idle_session_ctx_t |
struct | snat_runtime_t |
struct | icmp_echo_header_t |
struct | tcp_udp_header_t |
Typedefs | |
typedef enum nat44_config_flags_t_ | nat44_config_flags_t |
typedef int() | nat_alloc_out_addr_and_port_function_t(snat_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index) |
typedef struct snat_main_s | snat_main_t |
Functions | |
typedef | CLIB_PACKED (struct { u32 ses_count;u32 rx_fib_index;u32 tx_fib_index;u8 expired;}) per_vrf_sessions_t |
STATIC_ASSERT_SIZEOF (nat_6t_t, 2 *sizeof(u64)) | |
void | nat44_ed_forwarding_enable_disable (u8 is_enable) |
static void | nat_6t_flow_saddr_rewrite_set (nat_6t_flow_t *f, u32 saddr) |
static void | nat_6t_flow_daddr_rewrite_set (nat_6t_flow_t *f, u32 daddr) |
static void | nat_6t_flow_sport_rewrite_set (nat_6t_flow_t *f, u32 sport) |
static void | nat_6t_flow_dport_rewrite_set (nat_6t_flow_t *f, u32 dport) |
static void | nat_6t_flow_txfib_rewrite_set (nat_6t_flow_t *f, u32 tx_fib_index) |
static void | nat_6t_flow_icmp_id_rewrite_set (nat_6t_flow_t *f, u16 id) |
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;nat_6t_flow_t i2o;nat_6t_flow_t o2i;u32 flags;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 per_vrf_sessions_index;u32 thread_index;}) snat_session_t |
u32 | nat44_ed_get_in2out_worker_index (vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index, u8 is_output) |
u32 | nat44_ed_get_out2in_worker_index (vlib_buffer_t *b, ip4_header_t *ip, u32 rx_fib_index, u8 is_output) |
static bool | tcp_flags_is_init (u8 f) |
Check if client initiating TCP connection (received SYN from client) More... | |
int | nat44_plugin_enable (nat44_config_t c) |
Enable NAT44 plugin. More... | |
int | nat44_plugin_disable () |
Disable NAT44 plugin. More... | |
int | snat_add_address (snat_main_t *sm, ip4_address_t *addr, u32 vrf_id, u8 twice_nat) |
Add external address to NAT44 pool. More... | |
int | snat_del_address (snat_main_t *sm, ip4_address_t addr, u8 delete_sm, u8 twice_nat) |
Delete external address from NAT44 pool. More... | |
void | nat44_add_del_address_dpo (ip4_address_t addr, u8 is_add) |
Add/delete external address to FIB DPO (out2in DPO mode) More... | |
int | snat_add_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr, u16 l_port, u16 e_port, u32 vrf_id, int addr_only, u32 sw_if_index, nat_protocol_t proto, int is_add, twice_nat_type_t twice_nat, u8 out2in_only, u8 *tag, u8 identity_nat, ip4_address_t pool_addr, int exact) |
Add/delete NAT44 static mapping. More... | |
int | nat44_add_del_lb_static_mapping (ip4_address_t e_addr, u16 e_port, nat_protocol_t proto, nat44_lb_addr_port_t *locals, u8 is_add, twice_nat_type_t twice_nat, u8 out2in_only, u8 *tag, u32 affinity) |
Add/delete static mapping with load-balancing (multiple backends) More... | |
int | nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port, ip4_address_t l_addr, u16 l_port, nat_protocol_t proto, u32 vrf_id, u8 probability, u8 is_add) |
clib_error_t * | nat44_api_hookup (vlib_main_t *vm) |
int | snat_set_workers (uword *bitmap) |
Set NAT plugin workers. More... | |
int | snat_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) |
Enable/disable NAT44 feature on the interface. More... | |
int | snat_interface_add_del_output_feature (u32 sw_if_index, u8 is_inside, int is_del) |
Enable/disable NAT44 output feature on the interface (postrouting NAT) More... | |
int | snat_add_interface_address (snat_main_t *sm, u32 sw_if_index, int is_del, u8 twice_nat) |
Add/delete NAT44 pool address from specific interface. More... | |
int | nat44_del_ed_session (snat_main_t *sm, ip4_address_t *addr, u16 port, ip4_address_t *eh_addr, u16 eh_port, u8 proto, u32 vrf_id, int is_in) |
Delete NAT44 endpoint-dependent session. More... | |
void | nat_free_session_data (snat_main_t *sm, snat_session_t *s, u32 thread_index, u8 is_ha) |
Free NAT44 session data (lookup keys, external address port) More... | |
int | nat44_set_session_limit (u32 session_limit, u32 vrf_id) |
Set NAT44 session limit (session limit, vrf id) More... | |
int | nat44_update_session_limit (u32 session_limit, u32 vrf_id) |
Update NAT44 session limit flushing all data (session limit, vrf id) More... | |
void | snat_free_outside_address_and_port (snat_address_t *addresses, u32 thread_index, ip4_address_t *addr, u16 port, nat_protocol_t protocol) |
Free outside address and port pair. More... | |
void | expire_per_vrf_sessions (u32 fib_index) |
int | snat_static_mapping_match (vlib_main_t *vm, snat_main_t *sm, 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, twice_nat_type_t *twice_nat, lb_nat_type_t *lb, ip4_address_t *ext_host_addr, u8 *is_identity_nat, snat_static_mapping_t **out) |
Match NAT44 static mapping. More... | |
void | snat_add_del_addr_to_fib (ip4_address_t *addr, u8 p_len, u32 sw_if_index, int is_add) |
Add/del NAT address to FIB. More... | |
int | nat_set_outside_address_and_port (snat_address_t *addresses, u32 thread_index, ip4_address_t addr, u16 port, nat_protocol_t protocol) |
u32 | get_thread_idx_by_port (u16 e_port) |
u8 * | format_static_mapping_kvp (u8 *s, va_list *args) |
u8 * | format_session_kvp (u8 *s, va_list *args) |
u32 | nat_calc_bihash_buckets (u32 n_elts) |
void | nat44_addresses_free (snat_address_t **addresses) |
void | nat44_ed_sessions_clear () |
int | nat44_ed_set_frame_queue_nelts (u32 frame_queue_nelts) |
nat_translation_error_e | nat_6t_flow_buf_translate (snat_main_t *sm, vlib_buffer_t *b, ip4_header_t *ip, nat_6t_flow_t *f, nat_protocol_t proto, int is_output_feature) |
void | nat_6t_l3_l4_csum_calc (nat_6t_flow_t *f) |
#define foreach_nat44_config_flag |
Definition at line 45 of file nat44_ed.h.
#define foreach_nat_addr_and_port_alloc_alg |
Definition at line 95 of file nat44_ed.h.
#define foreach_nat_in2out_ed_error |
Definition at line 127 of file nat44_ed.h.
#define foreach_nat_out2in_ed_error |
Definition at line 143 of file nat44_ed.h.
#define foreach_snat_session_state |
Definition at line 108 of file nat44_ed.h.
#define is_addr_only_static_mapping | ( | sm | ) | (sm->flags & NAT_STATIC_MAPPING_FLAG_ADDR_ONLY) |
Check if NAT static mapping is address only (1:1NAT).
sm | NAT static mapping |
Definition at line 790 of file nat44_ed.h.
#define is_affinity_sessions | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_AFFINITY) |
Check if NAT session has affinity record.
s | NAT session |
Definition at line 760 of file nat44_ed.h.
#define is_ed_session | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_ENDPOINT_DEPENDENT) |
Check if NAT session is endpoint dependent.
s | NAT session |
Definition at line 754 of file nat44_ed.h.
#define is_exact_address | ( | s | ) | (s->flags & NAT_STATIC_MAPPING_FLAG_EXACT_ADDRESS) |
Check if exact pool address should be used.
s | SNAT session |
Definition at line 814 of file nat44_ed.h.
#define is_exact_address_session | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_EXACT_ADDRESS) |
Check if exact pool address should be used.
s | SNAT session |
Definition at line 766 of file nat44_ed.h.
#define is_fwd_bypass_session | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_FWD_BYPASS) |
Check if NAT session is forwarding bypass.
s | NAT session |
Definition at line 748 of file nat44_ed.h.
#define is_identity_static_mapping | ( | sm | ) | (sm->flags & NAT_STATIC_MAPPING_FLAG_IDENTITY_NAT) |
Check if NAT static mapping is identity NAT.
sm | NAT static mapping |
Definition at line 802 of file nat44_ed.h.
#define is_lb_session | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_LOAD_BALANCING) |
Check if NAT session is load-balancing.
s | NAT session |
Definition at line 742 of file nat44_ed.h.
#define is_lb_static_mapping | ( | sm | ) | (sm->flags & NAT_STATIC_MAPPING_FLAG_LB) |
Check if NAT static mapping is load-balancing.
sm | NAT static mapping |
Definition at line 808 of file nat44_ed.h.
#define is_out2in_only_static_mapping | ( | sm | ) | (sm->flags & NAT_STATIC_MAPPING_FLAG_OUT2IN_ONLY) |
Check if NAT static mapping match only out2in direction.
sm | NAT static mapping |
Definition at line 796 of file nat44_ed.h.
#define is_twice_nat_session | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_TWICE_NAT) |
Check if NAT session is twice NAT.
s | NAT session |
Definition at line 736 of file nat44_ed.h.
#define nat44_is_ses_closed | ( | s | ) | s->state == 0xf |
Check if NAT44 endpoint-dependent TCP session is closed.
s | NAT session |
Definition at line 784 of file nat44_ed.h.
#define NAT44_SES_I2O_FIN 1 |
Definition at line 163 of file nat44_ed.h.
#define NAT44_SES_I2O_FIN_ACK 4 |
Definition at line 165 of file nat44_ed.h.
#define NAT44_SES_I2O_SYN 16 |
Definition at line 167 of file nat44_ed.h.
#define NAT44_SES_O2I_FIN 2 |
Definition at line 164 of file nat44_ed.h.
#define NAT44_SES_O2I_FIN_ACK 8 |
Definition at line 166 of file nat44_ed.h.
#define NAT44_SES_O2I_SYN 32 |
Definition at line 168 of file nat44_ed.h.
#define NAT44_SES_RST 64 |
Definition at line 169 of file nat44_ed.h.
#define NAT_FLOW_OP_DADDR_REWRITE (1 << 3) |
Definition at line 225 of file nat44_ed.h.
#define NAT_FLOW_OP_DPORT_REWRITE (1 << 4) |
Definition at line 226 of file nat44_ed.h.
#define NAT_FLOW_OP_ICMP_ID_REWRITE (1 << 5) |
Definition at line 227 of file nat44_ed.h.
#define NAT_FLOW_OP_SADDR_REWRITE (1 << 1) |
Definition at line 223 of file nat44_ed.h.
#define NAT_FLOW_OP_SPORT_REWRITE (1 << 2) |
Definition at line 224 of file nat44_ed.h.
#define NAT_FLOW_OP_TXFIB_REWRITE (1 << 6) |
Definition at line 228 of file nat44_ed.h.
#define NAT_FQ_NELTS_DEFAULT 64 |
Definition at line 39 of file nat44_ed.h.
#define NAT_INTERFACE_FLAG_IS_INSIDE 1 |
Definition at line 183 of file nat44_ed.h.
#define NAT_INTERFACE_FLAG_IS_OUTSIDE 2 |
Definition at line 184 of file nat44_ed.h.
#define nat_interface_is_inside | ( | i | ) | i->flags & NAT_INTERFACE_FLAG_IS_INSIDE |
Check if NAT interface is inside.
i | NAT interface |
Definition at line 772 of file nat44_ed.h.
#define nat_interface_is_outside | ( | i | ) | i->flags & NAT_INTERFACE_FLAG_IS_OUTSIDE |
Check if NAT interface is outside.
i | NAT interface |
Definition at line 778 of file nat44_ed.h.
#define nat_log_debug | ( | ... | ) | vlib_log(VLIB_LOG_LEVEL_DEBUG, snat_main.log_class, __VA_ARGS__) |
Definition at line 835 of file nat44_ed.h.
#define nat_log_err | ( | ... | ) | vlib_log(VLIB_LOG_LEVEL_ERR, snat_main.log_class, __VA_ARGS__) |
Definition at line 827 of file nat44_ed.h.
#define nat_log_info | ( | ... | ) | vlib_log(VLIB_LOG_LEVEL_INFO, snat_main.log_class, __VA_ARGS__) |
Definition at line 833 of file nat44_ed.h.
#define nat_log_notice | ( | ... | ) | vlib_log(VLIB_LOG_LEVEL_NOTICE, snat_main.log_class, __VA_ARGS__) |
Definition at line 831 of file nat44_ed.h.
#define nat_log_warn | ( | ... | ) | vlib_log(VLIB_LOG_LEVEL_WARNING, snat_main.log_class, __VA_ARGS__) |
Definition at line 829 of file nat44_ed.h.
#define NAT_STATIC_MAPPING_FLAG_ADDR_ONLY 1 |
Definition at line 187 of file nat44_ed.h.
#define NAT_STATIC_MAPPING_FLAG_EXACT_ADDRESS 16 |
Definition at line 191 of file nat44_ed.h.
#define NAT_STATIC_MAPPING_FLAG_IDENTITY_NAT 4 |
Definition at line 189 of file nat44_ed.h.
#define NAT_STATIC_MAPPING_FLAG_LB 8 |
Definition at line 190 of file nat44_ed.h.
#define NAT_STATIC_MAPPING_FLAG_OUT2IN_ONLY 2 |
Definition at line 188 of file nat44_ed.h.
#define SNAT_FLAG_HAIRPINNING (1 << 0) |
Definition at line 42 of file nat44_ed.h.
#define snat_is_session_static | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_STATIC_MAPPING) |
Check if SNAT session is created from static mapping.
s | SNAT session |
Definition at line 724 of file nat44_ed.h.
#define snat_is_unk_proto_session | ( | s | ) | (s->flags & SNAT_SESSION_FLAG_UNKNOWN_PROTO) |
Check if SNAT session for unknown protocol.
s | SNAT session |
Definition at line 730 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_AFFINITY (1 << 6) |
Definition at line 178 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_ENDPOINT_DEPENDENT (1 << 4) |
Definition at line 176 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_EXACT_ADDRESS (1 << 7) |
Definition at line 179 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_FWD_BYPASS (1 << 5) |
Definition at line 177 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_HAIRPINNING (1 << 8) |
Definition at line 180 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_LOAD_BALANCING (1 << 2) |
Definition at line 174 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_STATIC_MAPPING (1 << 0) |
Definition at line 172 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_TWICE_NAT (1 << 3) |
Definition at line 175 of file nat44_ed.h.
#define SNAT_SESSION_FLAG_UNKNOWN_PROTO (1 << 1) |
Definition at line 173 of file nat44_ed.h.
typedef enum nat44_config_flags_t_ nat44_config_flags_t |
typedef int() nat_alloc_out_addr_and_port_function_t(snat_address_t *addresses, u32 fib_index, u32 thread_index, nat_protocol_t proto, ip4_address_t *addr, u16 *port, u16 port_per_thread, u32 snat_thread_index) |
Definition at line 500 of file nat44_ed.h.
typedef struct snat_main_s snat_main_t |
enum lb_nat_type_t |
Enumerator | |
---|---|
NO_LB_NAT | |
LB_NAT | |
AFFINITY_LB_NAT |
Definition at line 398 of file nat44_ed.h.
Enumerator | |
---|---|
foreach_nat44_config_flag |
Definition at line 52 of file nat44_ed.h.
Enumerator | |
---|---|
foreach_nat_addr_and_port_alloc_alg |
Definition at line 100 of file nat44_ed.h.
Enumerator | |
---|---|
NAT_IN2OUT_ED_N_ERROR |
Definition at line 135 of file nat44_ed.h.
enum nat_next_t |
Definition at line 73 of file nat44_ed.h.
Enumerator | |
---|---|
NAT_OUT2IN_ED_N_ERROR |
Definition at line 153 of file nat44_ed.h.
Enumerator | |
---|---|
NAT_ED_TRNSL_ERR_SUCCESS | |
NAT_ED_TRNSL_ERR_TRANSLATION_FAILED | |
NAT_ED_TRNSL_ERR_FLOW_MISMATCH |
Definition at line 1147 of file nat44_ed.h.
enum snat_session_state_t |
Enumerator | |
---|---|
foreach_snat_session_state |
Definition at line 120 of file nat44_ed.h.
enum twice_nat_type_t |
Enumerator | |
---|---|
TWICE_NAT_DISABLED | |
TWICE_NAT | |
TWICE_NAT_SELF |
Definition at line 388 of file nat44_ed.h.
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;nat_6t_flow_t i2o;nat_6t_flow_t o2i;u32 flags;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 per_vrf_sessions_index;u32 thread_index;} | ) |
void expire_per_vrf_sessions | ( | u32 | fib_index | ) |
Definition at line 426 of file nat44_ed.c.
void nat44_add_del_address_dpo | ( | ip4_address_t | addr, |
u8 | is_add | ||
) |
Add/delete external address to FIB DPO (out2in DPO mode)
addr | IPv4 address |
is_add | 1 = add, 0 = delete |
int nat44_add_del_lb_static_mapping | ( | ip4_address_t | e_addr, |
u16 | e_port, | ||
nat_protocol_t | proto, | ||
nat44_lb_addr_port_t * | locals, | ||
u8 | is_add, | ||
twice_nat_type_t | twice_nat, | ||
u8 | out2in_only, | ||
u8 * | tag, | ||
u32 | affinity | ||
) |
Add/delete static mapping with load-balancing (multiple backends)
e_addr | external IPv4 address |
e_port | external port number |
proto | L4 protocol |
locals | list of local backends |
is_add | 1 = add, 0 = delete |
twice_nat | twice-nat mode |
out2in_only | if 1 rule match only out2in direction |
tag | opaque string tag |
affinity | 0 = disabled, otherwise client IP affinity sticky time |
Definition at line 856 of file nat44_ed.c.
void nat44_addresses_free | ( | snat_address_t ** | addresses | ) |
clib_error_t* nat44_api_hookup | ( | vlib_main_t * | vm | ) |
Definition at line 1552 of file nat44_ed_api.c.
int nat44_del_ed_session | ( | snat_main_t * | sm, |
ip4_address_t * | addr, | ||
u16 | port, | ||
ip4_address_t * | eh_addr, | ||
u16 | eh_port, | ||
u8 | proto, | ||
u32 | vrf_id, | ||
int | is_in | ||
) |
Delete NAT44 endpoint-dependent session.
sm | snat global configuration data |
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 3144 of file nat44_ed.c.
void nat44_ed_forwarding_enable_disable | ( | u8 | is_enable | ) |
Definition at line 2246 of file nat44_ed.c.
u32 nat44_ed_get_in2out_worker_index | ( | vlib_buffer_t * | b, |
ip4_header_t * | ip, | ||
u32 | rx_fib_index, | ||
u8 | is_output | ||
) |
Definition at line 2503 of file nat44_ed.c.
u32 nat44_ed_get_out2in_worker_index | ( | vlib_buffer_t * | b, |
ip4_header_t * | ip, | ||
u32 | rx_fib_index, | ||
u8 | is_output | ||
) |
Definition at line 2606 of file nat44_ed.c.
void nat44_ed_sessions_clear | ( | ) |
Definition at line 2909 of file nat44_ed.c.
int nat44_ed_set_frame_queue_nelts | ( | u32 | frame_queue_nelts | ) |
int nat44_lb_static_mapping_add_del_local | ( | ip4_address_t | e_addr, |
u16 | e_port, | ||
ip4_address_t | l_addr, | ||
u16 | l_port, | ||
nat_protocol_t | proto, | ||
u32 | vrf_id, | ||
u8 | probability, | ||
u8 | is_add | ||
) |
Definition at line 1084 of file nat44_ed.c.
int nat44_plugin_disable | ( | ) |
Disable NAT44 plugin.
Definition at line 2179 of file nat44_ed.c.
int nat44_plugin_enable | ( | nat44_config_t | c | ) |
Enable NAT44 plugin.
c | nat44_config_t |
Definition at line 2099 of file nat44_ed.c.
Set NAT44 session limit (session limit, vrf id)
session_limit | Session limit |
vrf_id | VRF id |
Definition at line 2770 of file nat44_ed.c.
Update NAT44 session limit flushing all data (session limit, vrf id)
session_limit | Session limit |
vrf_id | VRF id |
Definition at line 2789 of file nat44_ed.c.
nat_translation_error_e nat_6t_flow_buf_translate | ( | snat_main_t * | sm, |
vlib_buffer_t * | b, | ||
ip4_header_t * | ip, | ||
nat_6t_flow_t * | f, | ||
nat_protocol_t | proto, | ||
int | is_output_feature | ||
) |
Definition at line 3424 of file nat44_ed.c.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
void nat_6t_l3_l4_csum_calc | ( | nat_6t_flow_t * | f | ) |
Definition at line 3205 of file nat44_ed.c.
void nat_free_session_data | ( | snat_main_t * | sm, |
snat_session_t * | s, | ||
u32 | thread_index, | ||
u8 | is_ha | ||
) |
Free NAT44 session data (lookup keys, external address port)
sm | snat global configuration data |
s | NAT session |
thread_index | thread index |
is_ha | is HA event |
Definition at line 231 of file nat44_ed.c.
int nat_set_outside_address_and_port | ( | snat_address_t * | addresses, |
u32 | thread_index, | ||
ip4_address_t | addr, | ||
u16 | port, | ||
nat_protocol_t | protocol | ||
) |
Definition at line 2317 of file nat44_ed.c.
int snat_add_address | ( | snat_main_t * | sm, |
ip4_address_t * | addr, | ||
u32 | vrf_id, | ||
u8 | twice_nat | ||
) |
Add external address to NAT44 pool.
sm | snat global configuration data |
addr | IPv4 address |
vrf_id | VRF id of tenant, ~0 means independent of VRF |
twice_nat | 1 if twice NAT address |
Definition at line 320 of file nat44_ed.c.
void snat_add_del_addr_to_fib | ( | ip4_address_t * | addr, |
u8 | p_len, | ||
u32 | sw_if_index, | ||
int | is_add | ||
) |
Add/del NAT address to FIB.
Add the external NAT address to the FIB as receive entries. This ensures that VPP will reply to ARP for this address and we don't need to enable proxy ARP on the outside interface.
addr | IPv4 address |
plen | address prefix length |
sw_if_index | software index of the outside interface |
is_add | 0 = delete, 1 = add. |
Definition at line 291 of file nat44_ed.c.
int snat_add_interface_address | ( | snat_main_t * | sm, |
u32 | sw_if_index, | ||
int | is_del, | ||
u8 | twice_nat | ||
) |
Add/delete NAT44 pool address from specific interface.
sw_if_index | software index of the interface |
is_del | 1 = delete, 0 = add |
twice_nat | 1 = twice NAT address for external hosts |
Definition at line 3076 of file nat44_ed.c.
int snat_add_static_mapping | ( | ip4_address_t | l_addr, |
ip4_address_t | e_addr, | ||
u16 | l_port, | ||
u16 | e_port, | ||
u32 | vrf_id, | ||
int | addr_only, | ||
u32 | sw_if_index, | ||
nat_protocol_t | proto, | ||
int | is_add, | ||
twice_nat_type_t | twice_nat, | ||
u8 | out2in_only, | ||
u8 * | tag, | ||
u8 | identity_nat, | ||
ip4_address_t | pool_addr, | ||
int | exact | ||
) |
Add/delete NAT44 static mapping.
l_addr | local IPv4 address |
e_addr | external IPv4 address |
l_port | local port number |
e_port | external port number |
vrf_id | local VRF ID |
addr_only | 1 = 1:1NAT, 0 = 1:1NAPT |
sw_if_index | use interface address as external IPv4 address |
proto | L4 protocol |
is_add | 1 = add, 0 = delete |
twice_nat | twice-nat mode |
out2in_only | if 1 rule match only out2in direction |
tag | opaque string tag |
identity_nat | identity NAT |
pool_addr | pool IPv4 address |
exact | 1 = exact pool address |
Definition at line 484 of file nat44_ed.c.
int snat_del_address | ( | snat_main_t * | sm, |
ip4_address_t | addr, | ||
u8 | delete_sm, | ||
u8 | twice_nat | ||
) |
Delete external address from NAT44 pool.
sm | snat global configuration data |
addr | IPv4 address |
delete_sm | 1 if delete static mapping using address |
twice_nat | 1 if twice NAT address |
Definition at line 1224 of file nat44_ed.c.
void snat_free_outside_address_and_port | ( | snat_address_t * | addresses, |
u32 | thread_index, | ||
ip4_address_t * | addr, | ||
u16 | port, | ||
nat_protocol_t | protocol | ||
) |
Free outside address and port pair.
addresses | vector of outside addresses |
thread_index | thread index |
key | address, port and protocol |
Definition at line 2280 of file nat44_ed.c.
Enable/disable NAT44 feature on the interface.
sw_if_index | software index of the interface |
is_inside | 1 = inside, 0 = outside |
is_del | 1 = delete, 0 = add |
Definition at line 1397 of file nat44_ed.c.
Enable/disable NAT44 output feature on the interface (postrouting NAT)
sw_if_index | software index of the interface |
is_inside | 1 = inside, 0 = outside |
is_del | 1 = delete, 0 = add |
Definition at line 1595 of file nat44_ed.c.
int snat_set_workers | ( | uword * | bitmap | ) |
Set NAT plugin workers.
bitmap | NAT workers bitmap |
Definition at line 1759 of file nat44_ed.c.
int snat_static_mapping_match | ( | vlib_main_t * | vm, |
snat_main_t * | sm, | ||
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, | ||
twice_nat_type_t * | twice_nat, | ||
lb_nat_type_t * | lb, | ||
ip4_address_t * | ext_host_addr, | ||
u8 * | is_identity_nat, | ||
snat_static_mapping_t ** | out | ||
) |
Match NAT44 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 |
twice_nat | matched mapping is twice NAT type |
lb | 1 if matched mapping is load-balanced |
ext_host_addr | external host address |
is_identity_nat | 1 if indentity mapping |
out | if !=0 set to pointer of the mapping structure |
Definition at line 2354 of file nat44_ed.c.
STATIC_ASSERT_SIZEOF | ( | nat_6t_t | , |
2 * | sizeofu64 | ||
) |
Check if client initiating TCP connection (received SYN from client)
t | TCP header |
Definition at line 821 of file nat44_ed.h.
format_function_t format_ed_session_kvp |
Definition at line 1163 of file nat44_ed.h.
format_function_t format_nat_6t_flow |
Definition at line 1162 of file nat44_ed.h.
format_function_t format_nat_addr_and_port_alloc_alg |
Definition at line 716 of file nat44_ed.h.
format_function_t format_nat_ed_translation_error |
Definition at line 1161 of file nat44_ed.h.
format_function_t format_nat_protocol |
Definition at line 715 of file nat44_ed.h.
format_function_t format_snat_key |
Definition at line 713 of file nat44_ed.h.
format_function_t format_snat_session |
Definition at line 712 of file nat44_ed.h.
format_function_t format_snat_static_map_to_resolve |
Definition at line 711 of file nat44_ed.h.
format_function_t format_snat_static_mapping |
Definition at line 710 of file nat44_ed.h.
format_function_t format_static_mapping_key |
Definition at line 714 of file nat44_ed.h.
vlib_node_registration_t nat44_ed_in2out_node |
(constructor) VLIB_REGISTER_NODE (nat44_ed_in2out_node)
Definition at line 1513 of file nat44_ed_in2out.c.
vlib_node_registration_t nat44_ed_in2out_output_node |
(constructor) VLIB_REGISTER_NODE (nat44_ed_in2out_output_node)
Definition at line 1538 of file nat44_ed_in2out.c.
vlib_node_registration_t nat44_ed_out2in_node |
(constructor) VLIB_REGISTER_NODE (nat44_ed_out2in_node)
Definition at line 1403 of file nat44_ed_out2in.c.
vlib_node_registration_t nat_default_node |
(constructor) VLIB_REGISTER_NODE (nat_default_node)
Definition at line 3183 of file nat44_ed.c.
fib_source_t nat_fib_src_hi |
fib_source_t nat_fib_src_low |
vlib_node_registration_t nat_pre_in2out_node |
(constructor) VLIB_REGISTER_NODE (nat_pre_in2out_node)
Definition at line 1624 of file nat44_ed_in2out.c.
vlib_node_registration_t nat_pre_out2in_node |
(constructor) VLIB_REGISTER_NODE (nat_pre_out2in_node)
Definition at line 1454 of file nat44_ed_out2in.c.
vlib_node_registration_t snat_in2out_node |
vlib_node_registration_t snat_in2out_output_node |
vlib_node_registration_t snat_in2out_output_worker_handoff_node |
(constructor) VLIB_REGISTER_NODE (snat_in2out_output_worker_handoff_node)
Definition at line 318 of file nat44_ed_handoff.c.
vlib_node_registration_t snat_in2out_worker_handoff_node |
(constructor) VLIB_REGISTER_NODE (snat_in2out_worker_handoff_node)
Definition at line 298 of file nat44_ed_handoff.c.
snat_main_t snat_main |
Definition at line 41 of file nat44_ed.c.
vlib_node_registration_t snat_out2in_node |
vlib_node_registration_t snat_out2in_worker_handoff_node |
(constructor) VLIB_REGISTER_NODE (snat_out2in_worker_handoff_node)
Definition at line 337 of file nat44_ed_handoff.c.
unformat_function_t unformat_nat_protocol |
Definition at line 718 of file nat44_ed.h.