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;
63typedef struct lws_transport_sequencer_ops {
66 int (*tx_chunk)(
struct lws_transport_sequencer *ts, uint64_t offset,
67 const uint8_t *buf,
size_t len);
71 int (*tx_ack)(
struct lws_transport_sequencer *ts, uint64_t offset,
76 int (*on_rx_data)(
struct lws_transport_sequencer *ts, uint64_t offset,
77 const uint8_t *buf,
size_t len);
83 void (*on_state_change)(
struct lws_transport_sequencer *ts,
int state,
int status);
89 void (*on_writeable)(
struct lws_transport_sequencer *ts);
97} lws_transport_sequencer_ops_t;
99typedef struct lws_transport_sequencer_stats {
115} lws_transport_sequencer_stats_t;
117typedef struct lws_transport_sequencer_info {
118 struct lws_context *cx;
119 const lws_transport_sequencer_ops_t *ops;
140} lws_transport_sequencer_info_t;
148lws_transport_sequencer_create(
const lws_transport_sequencer_info_t *i);
156lws_transport_sequencer_destroy(
struct lws_transport_sequencer **pts);
161enum lws_transport_sequencer_write_result {
187lws_transport_sequencer_write(
struct lws_transport_sequencer *ts,
188 const uint8_t *buf,
size_t len);
203lws_transport_sequencer_write_at(
struct lws_transport_sequencer *ts,
204 uint64_t offset,
const uint8_t *buf,
size_t len);
217lws_transport_sequencer_acknowledge(
struct lws_transport_sequencer *ts,
218 uint64_t offset,
size_t len,
int status);
244lws_transport_sequencer_acknowledge_sack(
struct lws_transport_sequencer *ts,
245 uint64_t cumulative_offset,
246 const lws_transport_sequencer_sack_block_t *blocks,
247 size_t num_blocks,
int status);
265lws_transport_sequencer_resend(
struct lws_transport_sequencer *ts);
287lws_transport_sequencer_tx_rebase(
struct lws_transport_sequencer *ts);
290lws_transport_sequencer_get_stats(
struct lws_transport_sequencer *ts);
312lws_transport_sequencer_rx(
struct lws_transport_sequencer *ts,
313 uint64_t offset,
const uint8_t *buf,
size_t len);
328lws_transport_sequencer_rx_reset(
struct lws_transport_sequencer *ts);
340lws_transport_sequencer_get_sack_blocks(
struct lws_transport_sequencer *ts,
341 lws_transport_sequencer_sack_block_t *blocks,
345lws_transport_sequencer_get_info(
struct lws_transport_sequencer *ts);
struct lws_retry_bo lws_retry_bo_t