+/** \brief Check if NAT static mapping is load-balancing.
+ @param sm NAT static mapping
+ @return 1 if load-balancing
+*/
+#define is_lb_static_mapping(sm) (sm->flags & NAT_STATIC_MAPPING_FLAG_LB)
+
+/* logging */
+#define nat_log_err(...) \
+ vlib_log(VLIB_LOG_LEVEL_ERR, snat_main.log_class, __VA_ARGS__)
+#define nat_log_warn(...) \
+ vlib_log(VLIB_LOG_LEVEL_WARNING, snat_main.log_class, __VA_ARGS__)
+#define nat_log_notice(...) \
+ vlib_log(VLIB_LOG_LEVEL_NOTICE, snat_main.log_class, __VA_ARGS__)
+#define nat_log_info(...) \
+ vlib_log(VLIB_LOG_LEVEL_INFO, snat_main.log_class, __VA_ARGS__)
+#define nat_log_debug(...)\
+ vlib_log(VLIB_LOG_LEVEL_DEBUG, snat_main.log_class, __VA_ARGS__)
+
+/* ICMP session match functions */
+u32 icmp_match_in2out_fast (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+u32 icmp_match_in2out_slow (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+u32 icmp_match_out2in_fast (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+u32 icmp_match_out2in_slow (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+
+/* ICMP deterministic NAT session match functions */
+u32 icmp_match_out2in_det (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+u32 icmp_match_in2out_det (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+
+/* ICMP endpoint-dependent session match functions */
+u32 icmp_match_out2in_ed (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+u32 icmp_match_in2out_ed (snat_main_t * sm, vlib_node_runtime_t * node,
+ u32 thread_index, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u8 * p_proto,
+ snat_session_key_t * p_value,
+ u8 * p_dont_translate, void *d, void *e);
+
+u32 icmp_in2out (snat_main_t * sm, vlib_buffer_t * b0, ip4_header_t * ip0,
+ icmp46_header_t * icmp0, u32 sw_if_index0, u32 rx_fib_index0,
+ vlib_node_runtime_t * node, u32 next0, u32 thread_index,
+ void *d, void *e);
+
+u32 icmp_out2in (snat_main_t * sm, vlib_buffer_t * b0, ip4_header_t * ip0,
+ icmp46_header_t * icmp0, u32 sw_if_index0, u32 rx_fib_index0,
+ vlib_node_runtime_t * node, u32 next0, u32 thread_index,
+ void *d, void *e);
+
+/* hairpinning functions */
+u32 snat_icmp_hairpinning (snat_main_t * sm, vlib_buffer_t * b0,
+ ip4_header_t * ip0, icmp46_header_t * icmp0,
+ int is_ed);
+void nat_hairpinning_sm_unknown_proto (snat_main_t * sm, vlib_buffer_t * b,
+ ip4_header_t * ip);
+void nat44_ed_hairpinning_unknown_proto (snat_main_t * sm, vlib_buffer_t * b,
+ ip4_header_t * ip);
+int snat_hairpinning (snat_main_t * sm, vlib_buffer_t * b0,
+ ip4_header_t * ip0, udp_header_t * udp0,
+ tcp_header_t * tcp0, u32 proto0, int is_ed);
+void nat44_reass_hairpinning (snat_main_t * sm, vlib_buffer_t * b0,
+ ip4_header_t * ip0, u16 sport, u16 dport,
+ u32 proto0, int is_ed);
+
+/* Call back functions for clib_bihash_add_or_overwrite_stale */
+int nat44_i2o_ed_is_idle_session_cb (clib_bihash_kv_16_8_t * kv, void *arg);
+int nat44_o2i_ed_is_idle_session_cb (clib_bihash_kv_16_8_t * kv, void *arg);
+int nat44_i2o_is_idle_session_cb (clib_bihash_kv_8_8_t * kv, void *arg);
+int nat44_o2i_is_idle_session_cb (clib_bihash_kv_8_8_t * kv, void *arg);
+
+/**
+ * @brief Increment IPv4 address
+ */
+void increment_v4_address (ip4_address_t * a);