diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-08-03 16:17:10 +0000 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-08-03 16:17:10 +0000 |
commit | 5a82ac6d6a3c245a468e6dc2c63a8f5fe6179aca (patch) | |
tree | 8d12f21e0a1be073ae184e435d9a14a16d901f79 /lib/libtle_l4p/tle_tcp.h | |
parent | 22243dd16173721c7a8ec9298ae7f72b4bece1f5 (diff) |
l4p/tcp: introduce tle_tcp_stream_shutdown() API
Introduce ability ot perform half-close for TCP connection.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Change-Id: I468ed84b5f42ae1e5c35f08871f7dd775e3d888a
Diffstat (limited to 'lib/libtle_l4p/tle_tcp.h')
-rw-r--r-- | lib/libtle_l4p/tle_tcp.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/libtle_l4p/tle_tcp.h b/lib/libtle_l4p/tle_tcp.h index 289683f..8a42f75 100644 --- a/lib/libtle_l4p/tle_tcp.h +++ b/lib/libtle_l4p/tle_tcp.h @@ -48,8 +48,9 @@ enum { TLE_TCP_OP_ACCEPT = 0x2, TLE_TCP_OP_CONNECT = 0x4, TLE_TCP_OP_ESTABLISH = 0x8, - TLE_TCP_OP_CLOSE = 0x10, - TLE_TCP_OP_ABORT = 0x20, + TLE_TCP_OP_SHUTDOWN = 0x10, + TLE_TCP_OP_CLOSE = 0x20, + TLE_TCP_OP_ABORT = 0x40, }; #define TLE_TCP_OP_CLOSE_ABORT (TLE_TCP_OP_CLOSE | TLE_TCP_OP_ABORT) @@ -168,6 +169,21 @@ tle_tcp_stream_open(struct tle_ctx *ctx, int tle_tcp_stream_close(struct tle_stream *s); /** + * half-close for open stream. + * if the stream is in connected or close-wait state, then: + * - FIN packet will be generated and stream state will be changed accordingly. + * Note that stream will remain open till user will call actual close() + * for that stream (even if actual connection was already terminated). + * @param s + * Pointer to the stream to close. + * @return + * zero on successful completion. + * - -EINVAL - invalid parameter passed to function + * - -EDEADLK - shutdown/close was already invoked on that stream + */ +int tle_tcp_stream_shutdown(struct tle_stream *s); + +/** * abnormal stream termination. * if the stream is in connected state, then: * - abnormal connection termination would be performed. |