Fixed compatibility issue between
nat ei and nat ed modes. Moved nat
syslogging to nat librarry. Deprecating
apis that will be integrated in upcoming
candidate configuration patch.
Type: refactor
Change-Id: I334b1b05b81b74667c5c76a05f768442e0dcf7e8
Signed-off-by: Filip Varga <fivarga@cisco.com>
22 files changed:
add_vpp_library(nat
SOURCES
lib/ipfix_logging.c
add_vpp_library(nat
SOURCES
lib/ipfix_logging.c
lib/alloc.c
INSTALL_HEADERS
lib/ipfix_logging.h
lib/alloc.c
INSTALL_HEADERS
lib/ipfix_logging.h
nat44_classify.c
nat_affinity.c
nat_format.c
nat44_classify.c
nat_affinity.c
nat_format.c
nat_ha.c
MULTIARCH_SOURCES
nat_ha.c
MULTIARCH_SOURCES
add_vpp_plugin(dslite
SOURCES
add_vpp_plugin(dslite
SOURCES
dslite/dslite_api.c
dslite/dslite_dpo.c
dslite/dslite.c
dslite/dslite_api.c
dslite/dslite_dpo.c
dslite/dslite.c
add_vpp_plugin(nat66
SOURCES
add_vpp_plugin(nat66
SOURCES
nat66/nat66.c
nat66/nat66_cli.c
nat66/nat66_api.c
nat66/nat66.c
nat66/nat66_cli.c
nat66/nat66_api.c
add_vpp_plugin(nat64
SOURCES
add_vpp_plugin(nat64
SOURCES
nat64/nat64.c
nat64/nat64_db.c
nat64/nat64_cli.c
nat64/nat64.c
nat64/nat64_db.c
nat64/nat64_cli.c
det44_reset_timeouts ()
{
det44_main_t *dm = &det44_main;
det44_reset_timeouts ()
{
det44_main_t *dm = &det44_main;
- dm->timeouts.udp = 300;
- dm->timeouts.tcp.established = 7440;
- dm->timeouts.tcp.transitory = 240;
- dm->timeouts.icmp = 60;
+ nat_reset_timeouts (&dm->timeouts);
u32 cached_ip4_address;
} det44_runtime_t;
u32 cached_ip4_address;
} det44_runtime_t;
-typedef struct nat_timeouts_s
-{
- u32 udp;
-
- struct
- {
- u32 transitory;
- u32 established;
- } tcp;
-
- u32 icmp;
-
-} nat_timeouts_t;
-
/* deterministic session outside key */
typedef struct
{
/* deterministic session outside key */
typedef struct
{
* limitations under the License.
*/
#include <nat/dslite/dslite.h>
* limitations under the License.
*/
#include <nat/dslite/dslite.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/nat_ha.h>
#include <vppinfra/hash.h>
#include <nat/nat_ha.h>
#include <vppinfra/hash.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/nat_ha.h>
#include <nat/nat44/ed_inlines.h>
#include <nat/lib/nat_inlines.h>
#include <nat/nat_ha.h>
#include <nat/nat44/ed_inlines.h>
#include <nat/lib/nat_inlines.h>
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, do_flush);
}
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, do_flush);
}
+int
+nat_ipfix_logging_enabled ()
+{
+ nat_ipfix_logging_main_t *silm = &nat_ipfix_logging_main;
+ return !clib_atomic_fetch_or(&silm->enabled, 0);
+}
+
void
nat_ipfix_flush_from_main (void)
{
void
nat_ipfix_flush_from_main (void)
{
extern nat_ipfix_logging_main_t nat_ipfix_logging_main;
extern nat_ipfix_logging_main_t nat_ipfix_logging_main;
+int nat_ipfix_logging_enabled ();
+
void nat_ipfix_logging_init (vlib_main_t * vm);
int nat_ipfix_logging_enable_disable (int enable, u32 domain_id, u16 src_port);
void nat_ipfix_logging_nat44_ses_create (u32 thread_index, u32 src_ip,
void nat_ipfix_logging_init (vlib_main_t * vm);
int nat_ipfix_logging_enable_disable (int enable, u32 domain_id, u16 src_port);
void nat_ipfix_logging_nat44_ses_create (u32 thread_index, u32 src_ip,
#undef _
} nat_protocol_t;
#undef _
} nat_protocol_t;
-/* default session timeouts */
+/* default protocol timeouts */
#define NAT_UDP_TIMEOUT 300
#define NAT_TCP_TRANSITORY_TIMEOUT 240
#define NAT_TCP_ESTABLISHED_TIMEOUT 7440
#define NAT_ICMP_TIMEOUT 60
#define NAT_UDP_TIMEOUT 300
#define NAT_TCP_TRANSITORY_TIMEOUT 240
#define NAT_TCP_ESTABLISHED_TIMEOUT 7440
#define NAT_ICMP_TIMEOUT 60
+typedef struct
+{
+ struct
+ {
+ u32 established;
+ u32 transitory;
+ } tcp;
+
+ u32 udp;
+ u32 icmp;
+
+} nat_timeouts_t;
+
+static_always_inline void
+nat_reset_timeouts (nat_timeouts_t * timeouts)
+{
+ timeouts->udp = NAT_UDP_TIMEOUT;
+ timeouts->tcp.established = NAT_TCP_ESTABLISHED_TIMEOUT;
+ timeouts->tcp.transitory = NAT_TCP_TRANSITORY_TIMEOUT;
+ timeouts->icmp = NAT_ICMP_TIMEOUT;
+}
+
// TODO: move common formating definitions here
#endif /* included_nat_lib_h__ */
// TODO: move common formating definitions here
#endif /* included_nat_lib_h__ */
- * Copyright (c) 2018 Cisco and/or its affiliates.
+ * Copyright (c) 2020 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
#include <vnet/ip/ip.h>
#include <vnet/syslog/syslog.h>
#include <vnet/ip/ip.h>
#include <vnet/syslog/syslog.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/lib/inlines.h>
#define NAT_FACILITY SYSLOG_FACILITY_LOCAL0
#include <nat/lib/inlines.h>
#define NAT_FACILITY SYSLOG_FACILITY_LOCAL0
- * Copyright (c) 2018 Cisco and/or its affiliates.
+ * Copyright (c) 2020 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
#include <nat/nat.h>
#include <nat/nat_dpo.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat.h>
#include <nat/nat_dpo.h>
#include <nat/lib/ipfix_logging.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
#include <nat/nat_affinity.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
#include <nat/nat_affinity.h>
-#include <nat/nat_syslog.h>
#include <nat/nat_ha.h>
#include <vnet/fib/fib_table.h>
#include <vnet/fib/ip4_fib.h>
#include <nat/nat_ha.h>
#include <vnet/fib/fib_table.h>
#include <vnet/fib/ip4_fib.h>
uword *bitmap = 0;
if (!sm->endpoint_dependent)
uword *bitmap = 0;
if (!sm->endpoint_dependent)
- return VNET_API_ERROR_FEATURE_DISABLED;
+ return VNET_API_ERROR_UNSUPPORTED;
init_nat_k (&kv, e_addr, e_port, 0, proto);
if (clib_bihash_search_8_8 (&sm->static_mapping_by_external, &kv, &value))
init_nat_k (&kv, e_addr, e_port, 0, proto);
if (clib_bihash_search_8_8 (&sm->static_mapping_by_external, &kv, &value))
sm->alloc_addr_and_port = nat_alloc_addr_and_port_default;
sm->addr_and_port_alloc_alg = NAT_ADDR_AND_PORT_ALLOC_ALG_DEFAULT;
//
sm->alloc_addr_and_port = nat_alloc_addr_and_port_default;
sm->addr_and_port_alloc_alg = NAT_ADDR_AND_PORT_ALLOC_ALG_DEFAULT;
//
- sm->udp_timeout = SNAT_UDP_TIMEOUT;
- sm->icmp_timeout = SNAT_ICMP_TIMEOUT;
- sm->tcp_transitory_timeout = SNAT_TCP_TRANSITORY_TIMEOUT;
- sm->tcp_established_timeout = SNAT_TCP_ESTABLISHED_TIMEOUT;
+ nat_reset_timeouts (&sm->timeouts);
// nat44 feature configuration
sm->endpoint_dependent = c.endpoint_dependent;
// nat44 feature configuration
sm->endpoint_dependent = c.endpoint_dependent;
#include <nat/lib/lib.h>
#include <nat/lib/inlines.h>
#include <nat/lib/lib.h>
#include <nat/lib/inlines.h>
-/* default session timeouts */
-#define SNAT_UDP_TIMEOUT 300
-#define SNAT_TCP_TRANSITORY_TIMEOUT 240
-#define SNAT_TCP_ESTABLISHED_TIMEOUT 7440
-#define SNAT_ICMP_TIMEOUT 60
-
/* number of worker handoff frame queue elements */
#define NAT_FQ_NELTS 64
/* number of worker handoff frame queue elements */
#define NAT_FQ_NELTS 64
u32 inside_vrf_id;
u32 inside_fib_index;
u32 inside_vrf_id;
u32 inside_fib_index;
- /* values of various timeouts */
- u32 udp_timeout;
- u32 tcp_transitory_timeout;
- u32 tcp_established_timeout;
- u32 icmp_timeout;
+ nat_timeouts_t timeouts;
/* TCP MSS clamping */
u16 mss_clamping;
/* TCP MSS clamping */
u16 mss_clamping;
import "plugins/nat/nat_types.api";
/**
import "plugins/nat/nat_types.api";
/**
* @brief VPP control-plane API messages.
*
* This file defines VPP control-plane API messages which are generally
* called through a shared memory interface.
*/
* @brief VPP control-plane API messages.
*
* This file defines VPP control-plane API messages which are generally
* called through a shared memory interface.
*/
-/*
- * Common NAT plugin APIs
- */
-
enum nat44_config_flags : u8
{
NAT44_IS_ENDPOINT_INDEPENDENT = 0x00,
enum nat44_config_flags : u8
{
NAT44_IS_ENDPOINT_INDEPENDENT = 0x00,
option in_progress;
u32 context;
i32 retval;
option in_progress;
u32 context;
i32 retval;
u32 inside_vrf;
u32 outside_vrf;
u32 inside_vrf;
u32 outside_vrf;
u32 users;
u32 sessions;
u32 user_sessions;
u32 users;
u32 sessions;
u32 user_sessions;
u32 user_buckets;
u32 translation_buckets;
u32 user_buckets;
u32 translation_buckets;
+ bool forwarding_enabled;
+ bool ipfix_logging_enabled;
+ vl_api_nat_timeouts_t timeouts;
+ vl_api_nat_log_level_t log_level;
vl_api_nat44_config_flags_t flags;
};
vl_api_nat44_config_flags_t flags;
};
-enum nat_log_level : u8
-{
- NAT_LOG_NONE = 0x00,
- NAT_LOG_ERROR = 0x01,
- NAT_LOG_WARNING = 0x02,
- NAT_LOG_NOTICE = 0x03,
- NAT_LOG_INFO = 0x04,
- NAT_LOG_DEBUG = 0x05,
-};
-
/** \brief Run nat44 garbage collection
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
/** \brief Run nat44 garbage collection
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param log_level - logging level
*/
autoreply define nat_set_log_level {
@param log_level - logging level
*/
autoreply define nat_set_log_level {
u32 client_index;
u32 context;
vl_api_nat_log_level_t log_level;
u32 client_index;
u32 context;
vl_api_nat_log_level_t log_level;
@param enable - true if enable, false if disable
*/
autoreply define nat_ipfix_enable_disable {
@param enable - true if enable, false if disable
*/
autoreply define nat_ipfix_enable_disable {
u32 client_index;
u32 context;
u32 domain_id;
u32 client_index;
u32 context;
u32 domain_id;
@param icmp - ICMP timeout (default 60sec)
*/
autoreply define nat_set_timeouts {
@param icmp - ICMP timeout (default 60sec)
*/
autoreply define nat_set_timeouts {
u32 client_index;
u32 context;
u32 udp;
u32 client_index;
u32 context;
u32 udp;
@param context - sender context, to match reply w/ request
*/
define nat_get_timeouts {
@param context - sender context, to match reply w/ request
*/
define nat_get_timeouts {
u32 client_index;
u32 context;
};
u32 client_index;
u32 context;
};
@param icmp - ICMP timeout
*/
define nat_get_timeouts_reply {
@param icmp - ICMP timeout
*/
define nat_get_timeouts_reply {
u32 context;
i32 retval;
u32 udp;
u32 context;
i32 retval;
u32 udp;
rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
};
rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
};
-/*
- * NAT44 APIs
- */
-
/** \brief Del NAT44 user
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
/** \brief Del NAT44 user
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@param enable - true for enable, false for disable
*/
autoreply define nat44_forwarding_enable_disable {
@param enable - true for enable, false for disable
*/
autoreply define nat44_forwarding_enable_disable {
u32 client_index;
u32 context;
bool enable;
u32 client_index;
u32 context;
bool enable;
@param context - sender context, to match reply w/ request
*/
define nat44_forwarding_is_enabled {
@param context - sender context, to match reply w/ request
*/
define nat44_forwarding_is_enabled {
u32 client_index;
u32 context;
};
u32 client_index;
u32 context;
};
@param enabled - true if enabled, false if disabled
*/
define nat44_forwarding_is_enabled_reply {
@param enabled - true if enabled, false if disabled
*/
define nat44_forwarding_is_enabled_reply {
u32 context;
bool enabled;
};
u32 context;
bool enabled;
};
rmp->user_buckets = htonl (sm->user_buckets);
rmp->translation_buckets = htonl (sm->translation_buckets);
rmp->user_buckets = htonl (sm->user_buckets);
rmp->translation_buckets = htonl (sm->translation_buckets);
+ rmp->timeouts.udp = htonl (sm->timeouts.udp);
+ rmp->timeouts.tcp_established = htonl (sm->timeouts.tcp.established);
+ rmp->timeouts.tcp_transitory = htonl (sm->timeouts.tcp.transitory);
+ rmp->timeouts.icmp = htonl (sm->timeouts.icmp);
+
+ rmp->forwarding_enabled = sm->forwarding_enabled == 1;
+ // consider how to split functionality between subplugins
+ rmp->ipfix_logging_enabled = nat_ipfix_logging_enabled ();
+
if (rc->endpoint_dependent)
rmp->flags |= NAT44_IS_ENDPOINT_DEPENDENT;
else
if (rc->endpoint_dependent)
rmp->flags |= NAT44_IS_ENDPOINT_DEPENDENT;
else
vl_api_nat_set_timeouts_reply_t *rmp;
int rv = 0;
vl_api_nat_set_timeouts_reply_t *rmp;
int rv = 0;
- sm->udp_timeout = ntohl (mp->udp);
- sm->tcp_established_timeout = ntohl (mp->tcp_established);
- sm->tcp_transitory_timeout = ntohl (mp->tcp_transitory);
- sm->icmp_timeout = ntohl (mp->icmp);
+ sm->timeouts.udp = ntohl (mp->udp);
+ sm->timeouts.tcp.established = ntohl (mp->tcp_established);
+ sm->timeouts.tcp.transitory = ntohl (mp->tcp_transitory);
+ sm->timeouts.icmp = ntohl (mp->icmp);
REPLY_MACRO (VL_API_NAT_SET_TIMEOUTS_REPLY);
}
REPLY_MACRO (VL_API_NAT_SET_TIMEOUTS_REPLY);
}
/* *INDENT-OFF* */
REPLY_MACRO2 (VL_API_NAT_GET_TIMEOUTS_REPLY,
({
/* *INDENT-OFF* */
REPLY_MACRO2 (VL_API_NAT_GET_TIMEOUTS_REPLY,
({
- rmp->udp = htonl (sm->udp_timeout);
- rmp->tcp_established = htonl (sm->tcp_established_timeout);
- rmp->tcp_transitory = htonl (sm->tcp_transitory_timeout);
- rmp->icmp = htonl (sm->icmp_timeout);
+ rmp->udp = htonl (sm->timeouts.udp);
+ rmp->tcp_established = htonl (sm->timeouts.tcp.established);
+ rmp->tcp_transitory = htonl (sm->timeouts.tcp.transitory);
+ rmp->icmp = htonl (sm->timeouts.icmp);
int rv = 0;
u16 port_start, port_end;
int rv = 0;
u16 port_start, port_end;
+ if (sm->endpoint_dependent)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
switch (mp->alg)
{
case NAT_ADDR_AND_PORT_ALLOC_ALG_DEFAULT:
switch (mp->alg)
{
case NAT_ADDR_AND_PORT_ALLOC_ALG_DEFAULT:
unformat_input_t _line_input, *line_input = &_line_input;
clib_error_t *error = 0;
u32 psid, psid_offset, psid_length, port_start, port_end;
unformat_input_t _line_input, *line_input = &_line_input;
clib_error_t *error = 0;
u32 psid, psid_offset, psid_length, port_start, port_end;
+ snat_main_t *sm = &snat_main;
+
+ if (sm->endpoint_dependent)
+ return clib_error_return (0, UNSUPPORTED_IN_ED_MODE_STR);
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
- if (unformat (line_input, "udp %u", &sm->udp_timeout));
+ if (unformat (line_input, "udp %u", &sm->timeouts.udp));
else if (unformat (line_input, "tcp-established %u",
else if (unformat (line_input, "tcp-established %u",
- &sm->tcp_established_timeout));
+ &sm->timeouts.tcp.established));
else if (unformat (line_input, "tcp-transitory %u",
else if (unformat (line_input, "tcp-transitory %u",
- &sm->tcp_transitory_timeout));
- else if (unformat (line_input, "icmp %u", &sm->icmp_timeout));
+ &sm->timeouts.tcp.transitory));
+ else if (unformat (line_input, "icmp %u", &sm->timeouts.icmp));
else if (unformat (line_input, "reset"))
else if (unformat (line_input, "reset"))
- {
- sm->udp_timeout = SNAT_UDP_TIMEOUT;
- sm->tcp_established_timeout = SNAT_TCP_ESTABLISHED_TIMEOUT;
- sm->tcp_transitory_timeout = SNAT_TCP_TRANSITORY_TIMEOUT;
- sm->icmp_timeout = SNAT_ICMP_TIMEOUT;
- }
+ nat_reset_timeouts (&sm->timeouts);
else
{
error = clib_error_return (0, "unknown input '%U'",
else
{
error = clib_error_return (0, "unknown input '%U'",
{
snat_main_t *sm = &snat_main;
{
snat_main_t *sm = &snat_main;
- vlib_cli_output (vm, "udp timeout: %dsec", sm->udp_timeout);
+ vlib_cli_output (vm, "udp timeout: %dsec", sm->timeouts.udp);
vlib_cli_output (vm, "tcp-established timeout: %dsec",
vlib_cli_output (vm, "tcp-established timeout: %dsec",
- sm->tcp_established_timeout);
+ sm->timeouts.tcp.established);
vlib_cli_output (vm, "tcp-transitory timeout: %dsec",
vlib_cli_output (vm, "tcp-transitory timeout: %dsec",
- sm->tcp_transitory_timeout);
- vlib_cli_output (vm, "icmp timeout: %dsec", sm->icmp_timeout);
+ sm->timeouts.tcp.transitory);
+ vlib_cli_output (vm, "icmp timeout: %dsec", sm->timeouts.icmp);
#include <vnet/fib/fib_table.h>
#include <nat/lib/ipfix_logging.h>
#include <vnet/fib/fib_table.h>
#include <nat/lib/ipfix_logging.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/lib/inlines.h>
#include <nat/nat64/nat64_db.h>
#include <nat/lib/inlines.h>
#include <nat/nat64/nat64_db.h>
-always_inline u8
-maximum_sessions_exceeded (snat_main_t * sm, u32 thread_index)
-{
- if (pool_elts (sm->per_thread_data[thread_index].sessions) >=
- sm->max_translations_per_thread)
- return 1;
-
- return 0;
-}
-
always_inline void
user_session_increment (snat_main_t * sm, snat_user_t * u, u8 is_static)
{
always_inline void
user_session_increment (snat_main_t * sm, snat_user_t * u, u8 is_static)
{
ses->state |= NAT44_SES_O2I_FIN_ACK;
if (nat44_is_ses_closed (ses))
{ // if session is now closed, save the timestamp
ses->state |= NAT44_SES_O2I_FIN_ACK;
if (nat44_is_ses_closed (ses))
{ // if session is now closed, save the timestamp
- ses->tcp_closed_timestamp = now + sm->tcp_transitory_timeout;
+ ses->tcp_closed_timestamp = now + sm->timeouts.tcp.transitory;
ses->last_lru_update = now;
}
}
ses->last_lru_update = now;
}
}
ses->state |= NAT44_SES_I2O_FIN_ACK;
if (nat44_is_ses_closed (ses))
{ // if session is now closed, save the timestamp
ses->state |= NAT44_SES_I2O_FIN_ACK;
if (nat44_is_ses_closed (ses))
{ // if session is now closed, save the timestamp
- ses->tcp_closed_timestamp = now + sm->tcp_transitory_timeout;
+ ses->tcp_closed_timestamp = now + sm->timeouts.tcp.transitory;
ses->last_lru_update = now;
}
}
ses->last_lru_update = now;
}
}
switch (s->nat_proto)
{
case NAT_PROTOCOL_ICMP:
switch (s->nat_proto)
{
case NAT_PROTOCOL_ICMP:
- return sm->icmp_timeout;
+ return sm->timeouts.icmp;
- return sm->udp_timeout;
+ return sm->timeouts.udp;
case NAT_PROTOCOL_TCP:
{
if (s->state)
case NAT_PROTOCOL_TCP:
{
if (s->state)
- return sm->tcp_transitory_timeout;
+ return sm->timeouts.tcp.transitory;
- return sm->tcp_established_timeout;
+ return sm->timeouts.tcp.established;
- return sm->udp_timeout;
+ return sm->timeouts.udp;
return value->value & ~(u32) 0;
}
return value->value & ~(u32) 0;
}
-always_inline void
-split_ed_value (clib_bihash_kv_16_8_t * value, u32 * thread_index,
- u32 * session_index)
-{
- if (thread_index)
- {
- *thread_index = ed_value_get_thread_index (value);
- }
- if (session_index)
- {
- *session_index = ed_value_get_session_index (value);
- }
-}
-
always_inline void
split_ed_kv (clib_bihash_kv_16_8_t * kv,
ip4_address_t * l_addr, ip4_address_t * r_addr, u8 * proto,
always_inline void
split_ed_kv (clib_bihash_kv_16_8_t * kv,
ip4_address_t * l_addr, ip4_address_t * r_addr, u8 * proto,
option version = "0.0.1";
option version = "0.0.1";
+typedef nat_timeouts
+{
+ u32 udp;
+ u32 tcp_established;
+ u32 tcp_transitory;
+ u32 icmp;
+};
+
+enum nat_log_level : u8
+{
+ NAT_LOG_NONE = 0x00,
+ NAT_LOG_ERROR = 0x01,
+ NAT_LOG_WARNING = 0x02,
+ NAT_LOG_NOTICE = 0x03,
+ NAT_LOG_INFO = 0x04,
+ NAT_LOG_DEBUG = 0x05,
+};
+
enum nat_config_flags : u8
{
NAT_IS_NONE = 0x00,
enum nat_config_flags : u8
{
NAT_IS_NONE = 0x00,
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/nat_ha.h>
#include <vppinfra/hash.h>
#include <nat/nat_ha.h>
#include <vppinfra/hash.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
#include <nat/lib/ipfix_logging.h>
#include <nat/nat_inlines.h>
#include <nat/nat44/inlines.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/nat_ha.h>
#include <nat/nat44/ed_inlines.h>
#include <nat/nat_ha.h>
#include <nat/nat44/ed_inlines.h>