summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.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/application.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/application.c')
-rw-r--r--src/vnet/session/application.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index a561e7d17f0..a542eebe43f 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -154,6 +154,15 @@ application_get (u32 index)
return pool_elt_at_index (app_pool, index);
}
+application_t *
+application_get_if_valid (u32 index)
+{
+ if (pool_is_free_index (app_pool, index))
+ return 0;
+
+ return pool_elt_at_index (app_pool, index);
+}
+
u32
application_get_index (application_t * app)
{
@@ -209,7 +218,7 @@ format_application_server (u8 * s, va_list * args)
regp = vl_api_client_index_to_registration (srv->api_client_index);
if (!regp)
- server_name = format (0, "%s%c", regp->name, 0);
+ server_name = format (0, "builtin-%d%c", srv->index, 0);
else
server_name = regp->name;
@@ -269,11 +278,17 @@ static clib_error_t *
show_app_command_fn (vlib_main_t * vm, unformat_input_t * input,
vlib_cli_command_t * cmd)
{
+ session_manager_main_t *smm = &session_manager_main;
application_t *app;
int do_server = 0;
int do_client = 0;
int verbose = 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, "server"))
@@ -323,16 +338,20 @@ show_app_command_fn (vlib_main_t * vm, unformat_input_t * input,
/* *INDENT-ON* */
}
else
- vlib_cli_output (vm, "No active server bindings");
+ vlib_cli_output (vm, "No active client bindings");
}
return 0;
}
+/* *INDENT-OFF* */
VLIB_CLI_COMMAND (show_app_command, static) =
{
-.path = "show app",.short_help =
- "show app [server|client] [verbose]",.function = show_app_command_fn,};
+ .path = "show app",
+ .short_help = "show app [server|client] [verbose]",
+ .function = show_app_command_fn,
+};
+/* *INDENT-ON* */
/*
* fd.io coding-style-patch-verification: ON