diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-07-07 17:25:00 +0000 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-07-07 17:25:00 +0000 |
commit | d2baf65c86ac164346f25828c54775bab8343841 (patch) | |
tree | e6c02274bbca78a902aa837813f041f749bdb610 /lib/libtle_l4p/tle_tcp.h | |
parent | ace4313dfd1f17eac022e497bb412e8e290c05e3 (diff) |
l4p/tcp: introduce tle_tcp_stream_abort() API
Introduce ability ot perform abnormal connection termination.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Change-Id: I75b5153505348ceface903cd2c8e012707631168
Diffstat (limited to 'lib/libtle_l4p/tle_tcp.h')
-rw-r--r-- | lib/libtle_l4p/tle_tcp.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/libtle_l4p/tle_tcp.h b/lib/libtle_l4p/tle_tcp.h index df50a23..289683f 100644 --- a/lib/libtle_l4p/tle_tcp.h +++ b/lib/libtle_l4p/tle_tcp.h @@ -49,8 +49,11 @@ enum { TLE_TCP_OP_CONNECT = 0x4, TLE_TCP_OP_ESTABLISH = 0x8, TLE_TCP_OP_CLOSE = 0x10, + TLE_TCP_OP_ABORT = 0x20, }; +#define TLE_TCP_OP_CLOSE_ABORT (TLE_TCP_OP_CLOSE | TLE_TCP_OP_ABORT) + /** * termination/error events from remote peer */ @@ -154,7 +157,7 @@ tle_tcp_stream_open(struct tle_ctx *ctx, * - if stream contains unsent data, then actual close will be postponed * till either remaining data will be TX-ed, or timeout will expire. * All packets that belong to that stream and remain in the device - * TX queue will be kept for father transmission. + * TX queue will be kept for further transmission. * @param s * Pointer to the stream to close. * @return @@ -165,6 +168,25 @@ tle_tcp_stream_open(struct tle_ctx *ctx, int tle_tcp_stream_close(struct tle_stream *s); /** + * abnormal stream termination. + * if the stream is in connected state, then: + * - abnormal connection termination would be performed. + * - if stream contains unread data, then it will be wiped out. + * - if stream contains unsent data, then it will be wiped out, + * without further attempt to TX it. + * All packets that belong to that stream and remain in the device + * TX queue will be kept for further transmission. + * @param s + * Pointer to the stream to close. + * @return + * zero on successful completion. + * - -EINVAL - invalid parameter passed to function + * - -EDEADLK - close was already invoked on that stream + */ +int tle_tcp_stream_abort(struct tle_stream *s); + + +/** * close a group of open streams. * if the stream is in connected state, then: * - connection termination would be performed. |