summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/lib/lib.h
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-11-09 12:24:03 +0100
committerOle Tr�an <otroan@employees.org>2020-11-13 15:45:23 +0000
commit25fd8ad03e6ef321604437fe8fc56ab2b3858cd7 (patch)
treef362bfad633f80ebad6c811dbf7c98ef5a701ddb /src/plugins/nat/lib/lib.h
parente655240550f0670279b0ca40942887715b8f514e (diff)
nat: cleanup & reorganization
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>
Diffstat (limited to 'src/plugins/nat/lib/lib.h')
-rw-r--r--src/plugins/nat/lib/lib.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/plugins/nat/lib/lib.h b/src/plugins/nat/lib/lib.h
index febe829ce56..04bad5c74f7 100644
--- a/src/plugins/nat/lib/lib.h
+++ b/src/plugins/nat/lib/lib.h
@@ -67,12 +67,34 @@ typedef enum
#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
+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__ */