188 #define LWS_SS_MTU 1540
190 struct lws_ss_handle;
191 typedef uint32_t lws_ss_tx_ordinal_t;
201 LWSSSCS_CREATING = 1,
202 LWSSSCS_DISCONNECTED,
210 LWSSSCS_ALL_RETRIES_FAILED,
211 LWSSSCS_QOS_ACK_REMOTE,
212 LWSSSCS_QOS_NACK_REMOTE,
213 LWSSSCS_QOS_ACK_LOCAL,
214 LWSSSCS_QOS_NACK_LOCAL,
218 LWSSSCS_SERVER_UPGRADE,
220 LWSSSCS_EVENT_WAIT_CANCELLED,
222 LWSSSCS_UPSTREAM_LINK_RETRY,
234 LWSSSCS_USER_BASE = 1000
238 LWSSS_FLAG_SOM = (1 << 0),
240 LWSSS_FLAG_EOM = (1 << 1),
242 LWSSS_FLAG_POLL = (1 << 2),
244 LWSSS_FLAG_RELATED_START = (1 << 3),
247 LWSSS_FLAG_RELATED_END = (1 << 4),
250 LWSSS_FLAG_RIDESHARE = (1 << 5),
253 LWSSS_FLAG_PERF_JSON = (1 << 6),
269 LWSSS_SER_RXPRE_RX_PAYLOAD = 0x55,
270 LWSSS_SER_RXPRE_CREATE_RESULT,
271 LWSSS_SER_RXPRE_CONNSTATE,
272 LWSSS_SER_RXPRE_TXCR_UPDATE,
273 LWSSS_SER_RXPRE_METADATA,
274 LWSSS_SER_RXPRE_TLSNEG_ENCLAVE_SIGN,
275 LWSSS_SER_RXPRE_PERF,
279 LWSSS_SER_TXPRE_STREAMTYPE = 0xaa,
280 LWSSS_SER_TXPRE_ONWARD_CONNECT,
281 LWSSS_SER_TXPRE_DESTROYING,
282 LWSSS_SER_TXPRE_TX_PAYLOAD,
283 LWSSS_SER_TXPRE_METADATA,
284 LWSSS_SER_TXPRE_TXCR_UPDATE,
285 LWSSS_SER_TXPRE_TIMEOUT_UPDATE,
286 LWSSS_SER_TXPRE_PAYLOAD_LENGTH_HINT,
287 LWSSS_SER_TXPRE_TLSNEG_ENCLAVE_SIGNED,
291 LPCSPROX_WAIT_INITIAL_TX = 1,
292 LPCSPROX_REPORTING_FAIL,
293 LPCSPROX_REPORTING_OK,
294 LPCSPROX_OPERATIONAL,
297 LPCSCLI_SENDING_INITIAL_TX,
298 LPCSCLI_WAITING_CREATE_RESULT,
299 LPCSCLI_LOCAL_CONNECTED,
300 LPCSCLI_ONWARD_CONNECT,
303 } lws_ss_conn_states_t;
310 typedef enum lws_ss_state_return {
311 LWSSSSRET_TX_DONT_SEND = 1,
314 LWSSSSRET_DISCONNECT_ME = -1,
315 LWSSSSRET_DESTROY_ME = -2,
316 } lws_ss_state_return_t;
347 typedef lws_ss_state_return_t (*lws_sscb_rx)(
void *userobj,
const uint8_t *buf,
348 size_t len,
int flags);
349 typedef lws_ss_state_return_t (*lws_sscb_tx)(
void *userobj,
350 lws_ss_tx_ordinal_t ord,
351 uint8_t *buf,
size_t *len,
353 typedef lws_ss_state_return_t (*lws_sscb_state)(
void *userobj,
void *h_src,
354 lws_ss_constate_t state,
355 lws_ss_tx_ordinal_t ack);
357 #if defined(LWS_WITH_SECURE_STREAMS_BUFFER_DUMP)
358 typedef void (*lws_ss_buffer_dump_cb)(
void *userobj,
const uint8_t *buf,
359 size_t len,
int done);
373 #if defined(LWS_WITH_SECURE_STREAMS_CPP)
379 #if defined(LWS_WITH_SYS_FAULT_INJECTION)
394 #if defined(LWS_WITH_SECURE_STREAMS_BUFFER_DUMP)
395 lws_ss_buffer_dump_cb dump;
457 LWS_VISIBLE LWS_EXTERN
int LWS_WARN_UNUSED_RESULT
459 void *opaque_user_data,
struct lws_ss_handle **ppss,
460 struct lws_sequencer *seq_owner,
const char **ppayload_fmt);
469 LWS_VISIBLE LWS_EXTERN
void
483 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t LWS_WARN_UNUSED_RESULT
499 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t LWS_WARN_UNUSED_RESULT
515 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t LWS_WARN_UNUSED_RESULT
528 LWS_VISIBLE LWS_EXTERN
struct lws_sequencer *
547 LWS_VISIBLE LWS_EXTERN
int
557 LWS_VISIBLE LWS_EXTERN
const char *
568 LWS_VISIBLE LWS_EXTERN
struct lws_context *
571 #define LWSSS_TIMEOUT_FROM_POLICY 0
588 LWS_VISIBLE LWS_EXTERN
void
598 LWS_VISIBLE LWS_EXTERN
void
610 LWS_VISIBLE LWS_EXTERN
void *
626 LWS_VISIBLE LWS_EXTERN
const char *
655 LWS_VISIBLE LWS_EXTERN
int LWS_WARN_UNUSED_RESULT
657 const void *value,
size_t len);
671 LWS_VISIBLE LWS_EXTERN
int LWS_WARN_UNUSED_RESULT
673 const void *value,
size_t len);
702 LWS_VISIBLE LWS_EXTERN
int
704 const void **value,
size_t *len);
725 LWS_VISIBLE LWS_EXTERN
void
728 typedef void (*lws_sssfec_cb)(
struct lws_ss_handle *h,
void *arg);
742 LWS_VISIBLE LWS_EXTERN
void
771 LWS_VISIBLE LWS_EXTERN
void
773 lws_sscb_state state);
784 LWS_VISIBLE LWS_EXTERN
int
797 LWS_VISIBLE LWS_EXTERN
int
800 LWS_VISIBLE LWS_EXTERN
const char *
801 lws_ss_tag(
struct lws_ss_handle *h);
804 #if defined(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4)
818 LWS_VISIBLE LWS_EXTERN
int
819 lws_ss_sigv4_set_aws_key(
struct lws_context* context, uint8_t idx,
820 const char * keyid,
const char * key);
838 LWS_VISIBLE LWS_EXTERN
int
839 lws_aws_filesystem_credentials_helper(
const char *path,
const char *kid,
840 const char *ak,
char **aws_keyid,
LWS_VISIBLE LWS_EXTERN void lws_ss_destroy(struct lws_ss_handle **ppss)
LWS_VISIBLE LWS_EXTERN void lws_ss_change_handlers(struct lws_ss_handle *h, lws_sscb_rx rx, lws_sscb_tx tx, lws_sscb_state state)
LWS_VISIBLE LWS_EXTERN int lws_ss_add_peer_tx_credit(struct lws_ss_handle *h, int32_t add)
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t LWS_WARN_UNUSED_RESULT lws_ss_request_tx_len(struct lws_ss_handle *pss, unsigned long len)
LWS_VISIBLE LWS_EXTERN int lws_ss_proxy_create(struct lws_context *context, const char *bind, int port)
LWS_VISIBLE LWS_EXTERN void lws_ss_start_timeout(struct lws_ss_handle *h, unsigned int timeout_ms)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi, void *opaque_user_data, struct lws_ss_handle **ppss, struct lws_sequencer *seq_owner, const char **ppayload_fmt)
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t LWS_WARN_UNUSED_RESULT lws_ss_client_connect(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t LWS_WARN_UNUSED_RESULT lws_ss_request_tx(struct lws_ss_handle *pss)
LWS_VISIBLE LWS_EXTERN void * lws_ss_to_user_object(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ss_alloc_set_metadata(struct lws_ss_handle *h, const char *name, const void *value, size_t len)
LWS_VISIBLE LWS_EXTERN void lws_ss_cancel_timeout(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ss_set_metadata(struct lws_ss_handle *h, const char *name, const void *value, size_t len)
LWS_VISIBLE LWS_EXTERN void lws_ss_server_foreach_client(struct lws_ss_handle *h, lws_sssfec_cb cb, void *arg)
LWS_VISIBLE LWS_EXTERN const char * lws_ss_rideshare(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN struct lws_context * lws_ss_get_context(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN int lws_ss_get_est_peer_tx_credit(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN struct lws_sequencer * lws_ss_get_sequencer(struct lws_ss_handle *h)
LWS_VISIBLE LWS_EXTERN const char * lws_ss_state_name(int state)
LWS_VISIBLE LWS_EXTERN void lws_ss_server_ack(struct lws_ss_handle *h, int nack)
LWS_VISIBLE LWS_EXTERN int lws_ss_get_metadata(struct lws_ss_handle *h, const char *name, const void **value, size_t *len)
@ LWSSSINFLAGS_REGISTER_SINK
Definition: lws-secure-streams.h:327
@ LWSSSINFLAGS_SERVER
Definition: lws-secure-streams.h:338
@ LWSSSINFLAGS_ACCEPTED
Definition: lws-secure-streams.h:342
@ LWSSSINFLAGS_PROXIED
Definition: lws-secure-streams.h:336
Definition: lws-secure-streams.h:364
lws_sscb_state state
Definition: lws-secure-streams.h:390
uint32_t client_pid
Definition: lws-secure-streams.h:406
size_t handle_offset
Definition: lws-secure-streams.h:367
lws_sscb_tx tx
Definition: lws-secure-streams.h:387
uint8_t sss_protocol_version
Definition: lws-secure-streams.h:411
size_t user_alloc
Definition: lws-secure-streams.h:366
const char * streamtype
Definition: lws-secure-streams.h:365
int manual_initial_tx_credit
Definition: lws-secure-streams.h:398
lws_sscb_rx rx
Definition: lws-secure-streams.h:385
size_t opaque_user_data_offset
Definition: lws-secure-streams.h:369
Definition: lws-secure-streams-policy.h:249
uint32_t flags
Definition: lws-secure-streams-policy.h:377