diff options
author | Florin Coras <fcoras@cisco.com> | 2019-08-16 17:48:44 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-08-19 09:22:59 +0000 |
commit | dfb3b8771292e4c863ca266856aa2b5eb7cc7518 (patch) | |
tree | 07d808f098db401d045706cb32994cc2630ea2ed /src/vnet/session/session_node.c | |
parent | 12f6936cd8f69f17820ef749515fcf4d50001c60 (diff) |
session: add explicit reset api
Type: feature
This can be used to forcefully close a session. It's only available to
builtin applications for now. Transports must support the reset api
otherwise normal close is used.
Change-Id: I5e6d681cbc4c8045385e293e0e9d86fa2bf45849
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r-- | src/vnet/session/session_node.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index 5af54a8165a..1d662a20e3c 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -902,6 +902,12 @@ session_event_dispatch (session_worker_t * wrk, vlib_node_runtime_t * node, break; session_transport_close (s); break; + case SESSION_CTRL_EVT_RESET: + s = session_get_from_handle_if_valid (e->session_handle); + if (PREDICT_FALSE (!s)) + break; + session_transport_reset (s); + break; case SESSION_IO_EVT_BUILTIN_RX: s = session_event_get_session (e, thread_index); if (PREDICT_FALSE (!s || s->session_state >= SESSION_STATE_CLOSING)) |