aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_cli.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-03-01 08:17:34 -0800
committerDave Barach <openvpp@barachs.net>2017-03-04 01:22:36 +0000
commite04c29942af6a130591059679531c9ffa3d7237a (patch)
tree3dd68c33cb346820d098390a088d733e02e779e4 /src/vnet/session/session_cli.c
parentfb38095d1c9d1b84850f345f0344f82b9ae2c375 (diff)
Cleanup URI code and TCP bugfixing
- Add CLI/API to enable session layer, by default it's disabled - Improve rcv wnd computation - Improvements to tx path - URI code cleanup - Builtin test tcp server - Improve src port allocation Change-Id: I2ace498e76a0771d4c31a8075cc14fe33d7dfa38 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_cli.c')
-rw-r--r--src/vnet/session/session_cli.c63
1 files changed, 54 insertions, 9 deletions
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index b2943a1ccc5..b029ee6549a 100644
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -60,7 +60,7 @@ format_stream_session (u8 * s, va_list * args)
}
else
{
- clib_warning ("Session in unknown state!");
+ clib_warning ("Session in state: %d!", ss->session_state);
}
vec_free (str);
@@ -78,6 +78,11 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
stream_session_t *s;
u8 *str = 0;
+ if (!smm->is_enabled)
+ {
+ clib_error_return (0, "session layer is not enabled");
+ }
+
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "verbose"))
@@ -126,11 +131,14 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
return 0;
}
-VLIB_CLI_COMMAND (show_uri_command, static) =
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (show_session_command, static) =
{
-.path = "show session",.short_help = "show session [verbose]",.function =
- show_session_command_fn,};
-
+ .path = "show session",
+ .short_help = "show session [verbose]",
+ .function = show_session_command_fn,
+};
+/* *INDENT-ON* */
static clib_error_t *
clear_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
@@ -142,6 +150,11 @@ clear_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
stream_session_t *pool, *session;
application_t *server;
+ if (!smm->is_enabled)
+ {
+ clib_error_return (0, "session layer is not enabled");
+ }
+
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "thread %d", &thread_index))
@@ -174,11 +187,43 @@ clear_session_command_fn (vlib_main_t * vm, unformat_input_t * input,
return 0;
}
-VLIB_CLI_COMMAND (clear_uri_session_command, static) =
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (clear_session_command, static) =
+{
+ .path = "clear session",
+ .short_help = "clear session thread <thread> session <index>",
+ .function = clear_session_command_fn,
+};
+/* *INDENT-ON* */
+
+static clib_error_t *
+session_enable_disable_fn (vlib_main_t * vm, unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ u8 is_en = 1;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "enable"))
+ is_en = 1;
+ else if (unformat (input, "disable"))
+ is_en = 0;
+ else
+ return clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, input);
+ }
+
+ return vnet_session_enable_disable (vm, is_en);
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (session_enable_disable_command, static) =
{
-.path = "clear session",.short_help =
- "clear session thread <thread> session <index>",.function =
- clear_session_command_fn,};
+ .path = "session",
+ .short_help = "session [enable|disable]",
+ .function = session_enable_disable_fn,
+};
+/* *INDENT-ON* */
/*
* fd.io coding-style-patch-verification: ON