aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-08-14 11:25:25 -0700
committerDave Barach <openvpp@barachs.net>2017-08-15 12:33:31 +0000
commitab0289a85c45699878d203b4a0d2e5b38c36cc55 (patch)
tree320d8d5f267e4ec11670ded214c7f3f2a3670cd2 /src/vnet/session
parent8ddd518f9a65af77dc3294f1965452aa72cb0eb2 (diff)
tcp: state machine improvements
- Add SYN_RCVD timeout - Fix FIN_WAIT_1 to CLOSING transition Change-Id: I42ca7fc087f6fdfae15bd7a6175dd3226ed341c7 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application.c2
-rw-r--r--src/vnet/session/application.h2
-rw-r--r--src/vnet/session/session.c10
-rw-r--r--src/vnet/session/stream_session.h3
4 files changed, 8 insertions, 9 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 78c41b938cf..bc837bb2939 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -329,7 +329,7 @@ application_open_session (application_t * app, session_type_t sst,
return rv;
/* Store api_context for when the reply comes. Not the nicest thing
- * but better allocating a separate half-open pool. */
+ * but better than allocating a separate half-open pool. */
tc->s_index = api_context;
return 0;
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h
index 29d37a06b18..45bc00131f5 100644
--- a/src/vnet/session/application.h
+++ b/src/vnet/session/application.h
@@ -37,7 +37,7 @@ typedef struct _stream_session_cb_vft
int (*session_accept_callback) (stream_session_t * new_session);
/* Connection request callback */
- int (*session_connected_callback) (u32 app_index, u32 api_context,
+ int (*session_connected_callback) (u32 app_index, u32 opaque,
stream_session_t * s, u8 code);
/** Notify app that session is closing */
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 3a3e4dfe588..843d474fa19 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -373,7 +373,7 @@ stream_session_connect_notify (transport_connection_t * tc, u8 is_fail)
application_t *app;
stream_session_t *new_s = 0;
u64 handle;
- u32 api_context = 0;
+ u32 opaque = 0;
int error = 0;
handle = stream_session_half_open_lookup_handle (&tc->lcl_ip, &tc->rmt_ip,
@@ -385,9 +385,11 @@ stream_session_connect_notify (transport_connection_t * tc, u8 is_fail)
return -1;
}
- /* Get the app's index from the handle we stored when opening connection */
+ /* Get the app's index from the handle we stored when opening connection
+ * and the opaque (api_context for external apps) from transport session
+ * index*/
app = application_get (handle >> 32);
- api_context = tc->s_index;
+ opaque = tc->s_index;
if (!is_fail)
{
@@ -406,7 +408,7 @@ stream_session_connect_notify (transport_connection_t * tc, u8 is_fail)
}
/* Notify client application */
- if (app->cb_fns.session_connected_callback (app->index, api_context, new_s,
+ if (app->cb_fns.session_connected_callback (app->index, opaque, new_s,
is_fail))
{
clib_warning ("failed to notify app");
diff --git a/src/vnet/session/stream_session.h b/src/vnet/session/stream_session.h
index 4c26321194d..39bf846aca7 100644
--- a/src/vnet/session/stream_session.h
+++ b/src/vnet/session/stream_session.h
@@ -83,9 +83,6 @@ typedef struct _stream_session_t
u32 opaque2;
- /** connected (server) session handle */
- u64 server_session_handle;
-
/** Opaque, pad to a 64-octet boundary */
u64 opaque[1];
} stream_session_t;