|  | FD.io VPP
    v21.01.1
    Vector Packet Processing | 
 Include dependency graph for nat_ha.c:
 Include dependency graph for nat_ha.c:Go to the source code of this file.
| Data Structures | |
| struct | nat_ha_message_header_t | 
| struct | nat_ha_event_t | 
| struct | nat_ha_resend_entry_t | 
| struct | nat_ha_per_thread_data_t | 
| struct | nat_ha_main_s | 
| struct | nat_ha_trace_t | 
| struct | nat_ha_handoff_trace_t | 
| Macros | |
| #define | NAT_HA_RETRIES 3 | 
| #define | foreach_nat_ha_counter | 
| #define | NAT_HA_VERSION 0x01 | 
| #define | NAT_HA_FLAG_ACK 0x01 | 
| #define | skip_if_disabled() | 
| #define | foreach_nat_ha_error | 
| #define | foreach_nat_ha_handoff_error | 
| Typedefs | |
| typedef struct nat_ha_main_s | nat_ha_main_t | 
| Enumerations | |
| enum | nat_ha_event_type_t { NAT_HA_ADD = 1, NAT_HA_DEL, NAT_HA_REFRESH } | 
| enum | nat_ha_counter_t { NAT_HA_N_COUNTERS } | 
| enum | nat_ha_next_t { NAT_HA_NEXT_IP4_LOOKUP, NAT_HA_NEXT_DROP, NAT_HA_N_NEXT } | 
| enum | nat_ha_error_t { NAT_HA_N_ERROR } | 
| enum | nat_ha_handoff_error_t { NAT_HA_HANDOFF_N_ERROR } | 
| Functions | |
| static void | nat_ha_resync_fin (void) | 
| static int | nat_ha_resend_queue_add (u32 seq, u8 *data, u8 data_len, u8 is_resync, u32 thread_index) | 
| static_always_inline void | nat_ha_ack_recv (u32 seq, u32 thread_index) | 
| static void | nat_ha_resend_scan (f64 now, u32 thread_index) | 
| void | nat_ha_enable (nat_ha_sadd_cb_t sadd_cb, nat_ha_sdel_cb_t sdel_cb, nat_ha_sref_cb_t sref_cb) | 
| Enable NAT HA, set callbacks.  More... | |
| void | nat_ha_disable () | 
| Disable NAT HA.  More... | |
| void | nat_ha_init (vlib_main_t *vm, u32 num_workers, u32 num_threads) | 
| Initialize NAT HA.  More... | |
| int | nat_ha_set_listener (ip4_address_t *addr, u16 port, u32 path_mtu) | 
| Set HA listener (local settings)  More... | |
| void | nat_ha_get_listener (ip4_address_t *addr, u16 *port, u32 *path_mtu) | 
| Get HA listener/local configuration.  More... | |
| int | nat_ha_set_failover (ip4_address_t *addr, u16 port, u32 session_refresh_interval) | 
| Set HA failover (remote settings)  More... | |
| void | nat_ha_get_failover (ip4_address_t *addr, u16 *port, u32 *session_refresh_interval) | 
| Get HA failover/remote settings.  More... | |
| static_always_inline void | nat_ha_recv_add (nat_ha_event_t *event, f64 now, u32 thread_index) | 
| static_always_inline void | nat_ha_recv_del (nat_ha_event_t *event, u32 thread_index) | 
| static_always_inline void | nat_ha_recv_refresh (nat_ha_event_t *event, f64 now, u32 thread_index) | 
| static_always_inline void | nat_ha_event_process (nat_ha_event_t *event, f64 now, u32 thread_index) | 
| static void | nat_ha_header_create (vlib_buffer_t *b, u32 *offset, u32 thread_index) | 
| static void | nat_ha_send (vlib_frame_t *f, vlib_buffer_t *b, u8 is_resync, u32 thread_index) | 
| static_always_inline void | nat_ha_event_add (nat_ha_event_t *event, u8 do_flush, u32 thread_index, u8 is_resync) | 
| void | nat_ha_flush (u8 is_resync) | 
| Flush the current HA data (for testing)  More... | |
| void | nat_ha_sadd (ip4_address_t *in_addr, u16 in_port, ip4_address_t *out_addr, u16 out_port, ip4_address_t *eh_addr, u16 eh_port, ip4_address_t *ehn_addr, u16 ehn_port, u8 proto, u32 fib_index, u16 flags, u32 thread_index, u8 is_resync) | 
| Create session add HA event.  More... | |
| void | nat_ha_sdel (ip4_address_t *out_addr, u16 out_port, ip4_address_t *eh_addr, u16 eh_port, u8 proto, u32 fib_index, u32 thread_index) | 
| Create session delete HA event.  More... | |
| void | nat_ha_sref (ip4_address_t *out_addr, u16 out_port, ip4_address_t *eh_addr, u16 eh_port, u8 proto, u32 fib_index, u32 total_pkts, u64 total_bytes, u32 thread_index, f64 *last_refreshed, f64 now) | 
| Create session refresh HA event.  More... | |
| static_always_inline u8 | plugin_enabled () | 
| static uword | nat_ha_worker_fn (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f) | 
| static uword | nat_ha_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f) | 
| void | nat_ha_get_resync_status (u8 *in_resync, u32 *resync_ack_missed) | 
| Get resync status.  More... | |
| static u8 * | format_nat_ha_trace (u8 *s, va_list *args) | 
| static uword | nat_ha_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) | 
| static u8 * | format_nat_ha_handoff_trace (u8 *s, va_list *args) | 
| static uword | nat_ha_handoff_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) | 
| int | nat_ha_resync (u32 client_index, u32 pid, nat_ha_resync_event_cb_t event_callback) | 
| Resync HA (resend existing sessions to new failover)  More... | |
| Variables | |
| nat_ha_main_t | nat_ha_main | 
| vlib_node_registration_t | nat_ha_process_node | 
| (constructor) VLIB_REGISTER_NODE (nat_ha_process_node)  More... | |
| vlib_node_registration_t | nat_ha_worker_node | 
| (constructor) VLIB_REGISTER_NODE (nat_ha_worker_node)  More... | |
| vlib_node_registration_t | nat_ha_node | 
| (constructor) VLIB_REGISTER_NODE (nat_ha_node)  More... | |
| vlib_node_registration_t | nat_ha_handoff_node | 
| (constructor) VLIB_REGISTER_NODE (nat_ha_handoff_node)  More... | |
| static char * | nat_ha_error_strings [] | 
| static char * | nat_ha_handoff_error_strings [] | 
| #define foreach_nat_ha_counter | 
| #define foreach_nat_ha_error | 
| #define foreach_nat_ha_handoff_error | 
| #define skip_if_disabled | ( | ) | 
| typedef struct nat_ha_main_s nat_ha_main_t | 
| enum nat_ha_counter_t | 
| enum nat_ha_error_t | 
| enum nat_ha_event_type_t | 
| enum nat_ha_next_t | 
| static_always_inline void nat_ha_ack_recv | ( | u32 | seq, | 
| u32 | thread_index | ||
| ) | 
| void nat_ha_disable | ( | ) | 
| void nat_ha_enable | ( | nat_ha_sadd_cb_t | sadd_cb, | 
| nat_ha_sdel_cb_t | sdel_cb, | ||
| nat_ha_sref_cb_t | sref_cb | ||
| ) | 
| static_always_inline void nat_ha_event_add | ( | nat_ha_event_t * | event, | 
| u8 | do_flush, | ||
| u32 | thread_index, | ||
| u8 | is_resync | ||
| ) | 
| static_always_inline void nat_ha_event_process | ( | nat_ha_event_t * | event, | 
| f64 | now, | ||
| u32 | thread_index | ||
| ) | 
| void nat_ha_flush | ( | u8 | is_resync | ) | 
| void nat_ha_get_failover | ( | ip4_address_t * | addr, | 
| u16 * | port, | ||
| u32 * | session_refresh_interval | ||
| ) | 
| void nat_ha_get_listener | ( | ip4_address_t * | addr, | 
| u16 * | port, | ||
| u32 * | path_mtu | ||
| ) | 
| 
 | static | 
| 
 | inlinestatic | 
| void nat_ha_init | ( | vlib_main_t * | vm, | 
| u32 | num_workers, | ||
| u32 | num_threads | ||
| ) | 
| 
 | static | 
| 
 | static | 
| static_always_inline void nat_ha_recv_add | ( | nat_ha_event_t * | event, | 
| f64 | now, | ||
| u32 | thread_index | ||
| ) | 
| static_always_inline void nat_ha_recv_del | ( | nat_ha_event_t * | event, | 
| u32 | thread_index | ||
| ) | 
| static_always_inline void nat_ha_recv_refresh | ( | nat_ha_event_t * | event, | 
| f64 | now, | ||
| u32 | thread_index | ||
| ) | 
| int nat_ha_resync | ( | u32 | client_index, | 
| u32 | pid, | ||
| nat_ha_resync_event_cb_t | event_callback | ||
| ) | 
| 
 | static | 
| void nat_ha_sadd | ( | ip4_address_t * | in_addr, | 
| u16 | in_port, | ||
| ip4_address_t * | out_addr, | ||
| u16 | out_port, | ||
| ip4_address_t * | eh_addr, | ||
| u16 | eh_port, | ||
| ip4_address_t * | ehn_addr, | ||
| u16 | ehn_port, | ||
| u8 | proto, | ||
| u32 | fib_index, | ||
| u16 | flags, | ||
| u32 | thread_index, | ||
| u8 | is_resync | ||
| ) | 
Create session add HA event.
| in_addr | inside IPv4 address | 
| in_port | inside L4 port number | 
| out_addr | outside IPv4 address | 
| out_port | outside L4 port number | 
| eh_addr | external host IPv4 address | 
| eh_port | external host L4 port number | 
| ehn_addr | external host IPv4 address after translation | 
| ehn_port | external host L4 port number after translation | 
| proto | L4 protocol | 
| fib_index | fib index | 
| flags | session flags | 
| thread_index | thread index | 
| is_resync | 1 if HA resync | 
Definition at line 692 of file nat_ha.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void nat_ha_sdel | ( | ip4_address_t * | out_addr, | 
| u16 | out_port, | ||
| ip4_address_t * | eh_addr, | ||
| u16 | eh_port, | ||
| u8 | proto, | ||
| u32 | fib_index, | ||
| u32 | thread_index | ||
| ) | 
Create session delete HA event.
| out_addr | outside IPv4 address | 
| out_port | outside L4 port number | 
| eh_addr | external host IPv4 address | 
| eh_port | external host L4 port number | 
| proto | L4 protocol | 
| fib_index | fib index | 
| thread_index | thread index | 
Definition at line 718 of file nat_ha.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | inlinestatic | 
| int nat_ha_set_failover | ( | ip4_address_t * | addr, | 
| u16 | port, | ||
| u32 | session_refresh_interval | ||
| ) | 
Set HA failover (remote settings)
| addr | failover IP4 address | 
| port | failvoer UDP port number | 
| session_refresh_interval | number of seconds after which to send session counters refresh | 
Definition at line 398 of file nat_ha.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| int nat_ha_set_listener | ( | ip4_address_t * | addr, | 
| u16 | port, | ||
| u32 | path_mtu | ||
| ) | 
Set HA listener (local settings)
| addr | local IP4 address | 
| port | local UDP port number | 
| path_mtu | path MTU between local and failover | 
Definition at line 355 of file nat_ha.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| void nat_ha_sref | ( | ip4_address_t * | out_addr, | 
| u16 | out_port, | ||
| ip4_address_t * | eh_addr, | ||
| u16 | eh_port, | ||
| u8 | proto, | ||
| u32 | fib_index, | ||
| u32 | total_pkts, | ||
| u64 | total_bytes, | ||
| u32 | thread_index, | ||
| f64 * | last_refreshed, | ||
| f64 | now | ||
| ) | 
Create session refresh HA event.
| out_addr | outside IPv4 address | 
| out_port | outside L4 port number | 
| eh_addr | external host IPv4 address | 
| eh_port | external host L4 port number | 
| proto | L4 protocol | 
| fib_index | fib index | 
| total_pkts | total packets processed | 
| total_bytes | total bytes processed | 
| thread_index | thread index | 
| last_refreshed | last session refresh time | 
| now | current time | 
Definition at line 737 of file nat_ha.c.
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | static | 
| static_always_inline u8 plugin_enabled | ( | ) | 
| 
 | static | 
| 
 | static | 
| vlib_node_registration_t nat_ha_handoff_node | 
(constructor) VLIB_REGISTER_NODE (nat_ha_handoff_node)
| nat_ha_main_t nat_ha_main | 
| vlib_node_registration_t nat_ha_node | 
(constructor) VLIB_REGISTER_NODE (nat_ha_node)
| vlib_node_registration_t nat_ha_process_node | 
(constructor) VLIB_REGISTER_NODE (nat_ha_process_node)
| vlib_node_registration_t nat_ha_worker_node | 
(constructor) VLIB_REGISTER_NODE (nat_ha_worker_node)