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,
227 LWSSSCS_USER_BASE = 1000
231 LWSSS_FLAG_SOM = (1 << 0),
233 LWSSS_FLAG_EOM = (1 << 1),
235 LWSSS_FLAG_POLL = (1 << 2),
237 LWSSS_FLAG_RELATED_START = (1 << 3),
240 LWSSS_FLAG_RELATED_END = (1 << 4),
243 LWSSS_FLAG_RIDESHARE = (1 << 5),
246 LWSSS_FLAG_PERF_JSON = (1 << 6),
262 LWSSS_SER_RXPRE_RX_PAYLOAD = 0x55,
263 LWSSS_SER_RXPRE_CREATE_RESULT,
264 LWSSS_SER_RXPRE_CONNSTATE,
265 LWSSS_SER_RXPRE_TXCR_UPDATE,
266 LWSSS_SER_RXPRE_METADATA,
267 LWSSS_SER_RXPRE_TLSNEG_ENCLAVE_SIGN,
268 LWSSS_SER_RXPRE_PERF,
272 LWSSS_SER_TXPRE_STREAMTYPE = 0xaa,
273 LWSSS_SER_TXPRE_ONWARD_CONNECT,
274 LWSSS_SER_TXPRE_DESTROYING,
275 LWSSS_SER_TXPRE_TX_PAYLOAD,
276 LWSSS_SER_TXPRE_METADATA,
277 LWSSS_SER_TXPRE_TXCR_UPDATE,
278 LWSSS_SER_TXPRE_TIMEOUT_UPDATE,
279 LWSSS_SER_TXPRE_PAYLOAD_LENGTH_HINT,
280 LWSSS_SER_TXPRE_TLSNEG_ENCLAVE_SIGNED,
284 LPCSPROX_WAIT_INITIAL_TX = 1,
285 LPCSPROX_REPORTING_FAIL,
286 LPCSPROX_REPORTING_OK,
287 LPCSPROX_OPERATIONAL,
290 LPCSCLI_SENDING_INITIAL_TX,
291 LPCSCLI_WAITING_CREATE_RESULT,
292 LPCSCLI_LOCAL_CONNECTED,
293 LPCSCLI_ONWARD_CONNECT,
296 } lws_ss_conn_states_t;
303 typedef enum lws_ss_state_return {
304 LWSSSSRET_TX_DONT_SEND = 1,
307 LWSSSSRET_DISCONNECT_ME = -1,
308 LWSSSSRET_DESTROY_ME = -2,
309 } lws_ss_state_return_t;
340 typedef lws_ss_state_return_t (*lws_sscb_rx)(
void *userobj,
const uint8_t *buf,
341 size_t len,
int flags);
342 typedef lws_ss_state_return_t (*lws_sscb_tx)(
void *userobj,
343 lws_ss_tx_ordinal_t ord,
344 uint8_t *buf,
size_t *len,
346 typedef lws_ss_state_return_t (*lws_sscb_state)(
void *userobj,
void *h_src,
347 lws_ss_constate_t state,
348 lws_ss_tx_ordinal_t ack);
350 #if defined(LWS_WITH_SECURE_STREAMS_BUFFER_DUMP)
351 typedef void (*lws_ss_buffer_dump_cb)(
void *userobj,
const uint8_t *buf,
352 size_t len,
int done);
366 #if defined(LWS_WITH_SECURE_STREAMS_CPP)
372 #if defined(LWS_WITH_SYS_FAULT_INJECTION)
387 #if defined(LWS_WITH_SECURE_STREAMS_BUFFER_DUMP)
388 lws_ss_buffer_dump_cb dump;
450 LWS_VISIBLE LWS_EXTERN
int
452 void *opaque_user_data,
struct lws_ss_handle **ppss,
453 struct lws_sequencer *seq_owner,
const char **ppayload_fmt);
462 LWS_VISIBLE LWS_EXTERN
void
476 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t
492 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t
508 LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t
521 LWS_VISIBLE LWS_EXTERN
struct lws_sequencer *
540 LWS_VISIBLE LWS_EXTERN
int
550 LWS_VISIBLE LWS_EXTERN
const char *
561 LWS_VISIBLE LWS_EXTERN
struct lws_context *
564 #define LWSSS_TIMEOUT_FROM_POLICY 0
581 LWS_VISIBLE LWS_EXTERN
void
591 LWS_VISIBLE LWS_EXTERN
void
603 LWS_VISIBLE LWS_EXTERN
void *
619 LWS_VISIBLE LWS_EXTERN
const char *
648 LWS_VISIBLE LWS_EXTERN
int LWS_WARN_UNUSED_RESULT
650 const void *value,
size_t len);
664 LWS_VISIBLE LWS_EXTERN
int LWS_WARN_UNUSED_RESULT
666 const void *value,
size_t len);
695 LWS_VISIBLE LWS_EXTERN
int
697 const void **value,
size_t *len);
718 LWS_VISIBLE LWS_EXTERN
void
721 typedef void (*lws_sssfec_cb)(
struct lws_ss_handle *h,
void *arg);
735 LWS_VISIBLE LWS_EXTERN
void
764 LWS_VISIBLE LWS_EXTERN
void
766 lws_sscb_state state);
777 LWS_VISIBLE LWS_EXTERN
int
790 LWS_VISIBLE LWS_EXTERN
int
793 LWS_VISIBLE LWS_EXTERN
const char *
794 lws_ss_tag(
struct lws_ss_handle *h);
797 #if defined(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4)
811 LWS_VISIBLE LWS_EXTERN
int
812 lws_ss_sigv4_set_aws_key(
struct lws_context* context, uint8_t idx,
813 const char * keyid,
const char * key);
831 LWS_VISIBLE LWS_EXTERN
int
832 lws_aws_filesystem_credentials_helper(
const char *path,
const char *kid,
833 const char *ak,
char **aws_keyid,
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t lws_ss_request_tx(struct lws_ss_handle *pss)
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 int 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_ss_client_connect(struct lws_ss_handle *h)
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 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 lws_ss_state_return_t lws_ss_request_tx_len(struct lws_ss_handle *pss, unsigned long len)
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:320
@ LWSSSINFLAGS_SERVER
Definition: lws-secure-streams.h:331
@ LWSSSINFLAGS_ACCEPTED
Definition: lws-secure-streams.h:335
@ LWSSSINFLAGS_PROXIED
Definition: lws-secure-streams.h:329
Definition: lws-secure-streams.h:357
lws_sscb_state state
Definition: lws-secure-streams.h:383
uint32_t client_pid
Definition: lws-secure-streams.h:399
size_t handle_offset
Definition: lws-secure-streams.h:360
lws_sscb_tx tx
Definition: lws-secure-streams.h:380
uint8_t sss_protocol_version
Definition: lws-secure-streams.h:404
size_t user_alloc
Definition: lws-secure-streams.h:359
const char * streamtype
Definition: lws-secure-streams.h:358
int manual_initial_tx_credit
Definition: lws-secure-streams.h:391
lws_sscb_rx rx
Definition: lws-secure-streams.h:378
size_t opaque_user_data_offset
Definition: lws-secure-streams.h:362
Definition: lws-secure-streams-policy.h:247
uint32_t flags
Definition: lws-secure-streams-policy.h:369