summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat.h')
-rw-r--r--src/plugins/nat/nat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h
index 58bf8b340ce..15643aaf117 100644
--- a/src/plugins/nat/nat.h
+++ b/src/plugins/nat/nat.h
@@ -652,4 +652,16 @@ nat_send_all_to_node(vlib_main_t *vm, u32 *bi_vector,
}
}
+always_inline void
+user_session_increment(snat_main_t *sm, snat_user_t *u, u8 is_static)
+{
+ if (u->nsessions + u->nstaticsessions < sm->max_translations_per_user)
+ {
+ if (is_static)
+ u->nstaticsessions++;
+ else
+ u->nsessions++;
+ }
+}
+
#endif /* __included_snat_h__ */