summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-08 01:55:39 +0000
committerFlorin Coras <fcoras@cisco.com>2020-04-08 22:24:41 +0000
commite759bb543c38a682dc31492a3a0a58669a811538 (patch)
treeb3fa09028b32fb3e50f60d2e6de0ccbaf29b35ad /src/vnet/session/session.c
parent8324c55f95dd5ddbf1f5f9c47907204a12e152ef (diff)
udp: cleanup input node
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida9daefc20a161b36d6f36c56267123c7f2efc01
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 37c5d915008..9d531240f27 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1085,6 +1085,36 @@ session_stream_accept (transport_connection_t * tc, u32 listener_index,
}
int
+session_dgram_accept (transport_connection_t * tc, u32 listener_index,
+ u32 thread_index)
+{
+ app_worker_t *app_wrk;
+ session_t *s;
+ int rv;
+
+ s = session_alloc_for_connection (tc);
+ s->listener_handle = ((u64) thread_index << 32) | (u64) listener_index;
+
+ if ((rv = app_worker_init_accepted (s)))
+ {
+ session_free (s);
+ return rv;
+ }
+
+ app_wrk = app_worker_get (s->app_wrk_index);
+ if ((rv = app_worker_accept_notify (app_wrk, s)))
+ {
+ session_free_w_fifos (s);
+ return rv;
+ }
+
+ s->session_state = SESSION_STATE_READY;
+ session_lookup_add_connection (tc, session_handle (s));
+
+ return 0;
+}
+
+int
session_open_cl (u32 app_wrk_index, session_endpoint_t * rmt, u32 opaque)
{
transport_connection_t *tc;