summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/in2out.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-04-12 03:36:13 -0700
committerOle Trøan <otroan@employees.org>2017-04-12 13:09:34 +0000
commit6a0946f078183361a5b757f6405165089b659c5c (patch)
tree23ea7f7b823f9e987e18234365dd90de013d308f /src/plugins/snat/in2out.c
parentf3ebb452ca26318b75b8f93569c3c752f05aed25 (diff)
CGN: configurable timeouts
add API and CLI configuration of deterministic NAT session timeout for TCP, UDP and ICMP protocol Change-Id: I577440452e7eaedcb5d80501a7fd4b76e31e8c9c Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/snat/in2out.c')
-rw-r--r--src/plugins/snat/in2out.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/snat/in2out.c b/src/plugins/snat/in2out.c
index 2dbaeb40355..1e8e14484c3 100644
--- a/src/plugins/snat/in2out.c
+++ b/src/plugins/snat/in2out.c
@@ -1687,16 +1687,16 @@ snat_det_in2out_node_fn (vlib_main_t * vm,
switch(ses0->state)
{
case SNAT_SESSION_UDP_ACTIVE:
- ses0->expire = now + SNAT_UDP_TIMEOUT;
+ ses0->expire = now + sm->udp_timeout;
break;
case SNAT_SESSION_TCP_SYN_SENT:
case SNAT_SESSION_TCP_FIN_WAIT:
case SNAT_SESSION_TCP_CLOSE_WAIT:
case SNAT_SESSION_TCP_LAST_ACK:
- ses0->expire = now + SNAT_TCP_TRANSITORY_TIMEOUT;
+ ses0->expire = now + sm->tcp_transitory_timeout;
break;
case SNAT_SESSION_TCP_ESTABLISHED:
- ses0->expire = now + SNAT_TCP_ESTABLISHED_TIMEOUT;
+ ses0->expire = now + sm->tcp_established_timeout;
break;
}
@@ -1831,16 +1831,16 @@ snat_det_in2out_node_fn (vlib_main_t * vm,
switch(ses1->state)
{
case SNAT_SESSION_UDP_ACTIVE:
- ses1->expire = now + SNAT_UDP_TIMEOUT;
+ ses1->expire = now + sm->udp_timeout;
break;
case SNAT_SESSION_TCP_SYN_SENT:
case SNAT_SESSION_TCP_FIN_WAIT:
case SNAT_SESSION_TCP_CLOSE_WAIT:
case SNAT_SESSION_TCP_LAST_ACK:
- ses1->expire = now + SNAT_TCP_TRANSITORY_TIMEOUT;
+ ses1->expire = now + sm->tcp_transitory_timeout;
break;
case SNAT_SESSION_TCP_ESTABLISHED:
- ses1->expire = now + SNAT_TCP_ESTABLISHED_TIMEOUT;
+ ses1->expire = now + sm->tcp_established_timeout;
break;
}
@@ -2011,16 +2011,16 @@ snat_det_in2out_node_fn (vlib_main_t * vm,
switch(ses0->state)
{
case SNAT_SESSION_UDP_ACTIVE:
- ses0->expire = now + SNAT_UDP_TIMEOUT;
+ ses0->expire = now + sm->udp_timeout;
break;
case SNAT_SESSION_TCP_SYN_SENT:
case SNAT_SESSION_TCP_FIN_WAIT:
case SNAT_SESSION_TCP_CLOSE_WAIT:
case SNAT_SESSION_TCP_LAST_ACK:
- ses0->expire = now + SNAT_TCP_TRANSITORY_TIMEOUT;
+ ses0->expire = now + sm->tcp_transitory_timeout;
break;
case SNAT_SESSION_TCP_ESTABLISHED:
- ses0->expire = now + SNAT_TCP_ESTABLISHED_TIMEOUT;
+ ses0->expire = now + sm->tcp_established_timeout;
break;
}
@@ -2218,7 +2218,7 @@ u32 icmp_match_in2out_det(snat_main_t *sm, vlib_node_runtime_t *node,
u32 now = (u32) vlib_time_now (sm->vlib_main);
ses0->state = SNAT_SESSION_ICMP_ACTIVE;
- ses0->expire = now + SNAT_ICMP_TIMEOUT;
+ ses0->expire = now + sm->icmp_timeout;
out:
*p_proto = protocol;