aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/tle_tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libtle_l4p/tle_tcp.h')
-rw-r--r--lib/libtle_l4p/tle_tcp.h24
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.