X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fsession.c;h=9d531240f2746761849c52847674a6fc7921d9d8;hb=e759bb543c38a682dc31492a3a0a58669a811538;hp=37c5d915008ce97274756d27e4bedd0e759c15b1;hpb=8324c55f95dd5ddbf1f5f9c47907204a12e152ef;p=vpp.git 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 @@ -1084,6 +1084,36 @@ session_stream_accept (transport_connection_t * tc, u32 listener_index, return 0; } +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) {