diff options
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session.c | 30 | ||||
-rw-r--r-- | src/vnet/session/session.h | 2 |
2 files changed, 32 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; diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index 5e6e4060e55..956bff068b4 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -466,6 +466,8 @@ void session_transport_closed_notify (transport_connection_t * tc); void session_transport_reset_notify (transport_connection_t * tc); int session_stream_accept (transport_connection_t * tc, u32 listener_index, u32 thread_index, u8 notify); +int session_dgram_accept (transport_connection_t * tc, u32 listener_index, + u32 thread_index); /** * Initialize session layer for given transport proto and ip version * |