diff options
author | Florin Coras <fcoras@cisco.com> | 2019-08-16 17:48:44 -0700 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2019-09-20 21:36:26 +0000 |
commit | a267cba29c449b5b06c18670280b899da7dd2511 (patch) | |
tree | 058b9b0a4b48b26e894f63e100f786f230c79cdf /src/vnet/session/session_node.c | |
parent | 7fe501a4b585f87bb095a2b023c381cd8baa2abe (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>
(cherry picked from commit dfb3b8771292e4c863ca266856aa2b5eb7cc7518)
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)) |