24#if !defined(__LWS_TRANSPORT_SEQUENCER_H__)
25#define __LWS_TRANSPORT_SEQUENCER_H__
30#if defined(LWS_WITH_TRANSPORT_SEQUENCER)
42struct lws_transport_sequencer;
44typedef int (*lws_transport_sequencer_cb_t)(
struct lws_transport_sequencer *ts,
48typedef struct lws_transport_sequencer_sack_block {
51} lws_transport_sequencer_sack_block_t;
53typedef struct lws_transport_sequencer_ops {
56 int (*tx_chunk)(
struct lws_transport_sequencer *ts, uint64_t offset,
57 const uint8_t *buf,
size_t len);
61 int (*tx_ack)(
struct lws_transport_sequencer *ts, uint64_t offset,
65 int (*on_rx_data)(
struct lws_transport_sequencer *ts, uint64_t offset,
66 const uint8_t *buf,
size_t len);
69 void (*on_state_change)(
struct lws_transport_sequencer *ts,
int state,
int status);
74} lws_transport_sequencer_ops_t;
76typedef struct lws_transport_sequencer_stats {
84} lws_transport_sequencer_stats_t;
86typedef struct lws_transport_sequencer_info {
87 struct lws_context *cx;
88 const lws_transport_sequencer_ops_t *ops;
94} lws_transport_sequencer_info_t;
102lws_transport_sequencer_create(
const lws_transport_sequencer_info_t *i);
110lws_transport_sequencer_destroy(
struct lws_transport_sequencer **pts);
120lws_transport_sequencer_write(
struct lws_transport_sequencer *ts,
121 const uint8_t *buf,
size_t len);
134lws_transport_sequencer_write_at(
struct lws_transport_sequencer *ts,
135 uint64_t offset,
const uint8_t *buf,
size_t len);
145lws_transport_sequencer_acknowledge(
struct lws_transport_sequencer *ts,
146 uint64_t offset,
size_t len,
int status);
158lws_transport_sequencer_acknowledge_sack(
struct lws_transport_sequencer *ts,
159 uint64_t cumulative_offset,
160 const lws_transport_sequencer_sack_block_t *blocks,
161 size_t num_blocks,
int status);
164lws_transport_sequencer_get_stats(
struct lws_transport_sequencer *ts);
175lws_transport_sequencer_rx(
struct lws_transport_sequencer *ts,
176 uint64_t offset,
const uint8_t *buf,
size_t len);
188lws_transport_sequencer_get_sack_blocks(
struct lws_transport_sequencer *ts,
189 lws_transport_sequencer_sack_block_t *blocks,
193lws_transport_sequencer_get_info(
struct lws_transport_sequencer *ts);
struct lws_retry_bo lws_retry_bo_t