libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lws_context_standalone |
Macros | |
#define | lwsl_sspc(_h, _fil, ...) |
#define | lwsl_hexdump_sspc(_h, _fil, _buf, _len) |
#define | lwsl_sspc_err(_w, ...) do {} while(0) |
#define | lwsl_sspc_warn(_w, ...) do {} while(0) |
#define | lwsl_sspc_notice(_w, ...) do {} while(0) |
#define | lwsl_sspc_info(_w, ...) do {} while(0) |
#define | lwsl_sspc_debug(_w, ...) do {} while(0) |
#define | lwsl_sspc_parser(_w, ...) do {} while(0) |
#define | lwsl_sspc_header(_w, ...) do {} while(0) |
#define | lwsl_sspc_ext(_w, ...) do {} while(0) |
#define | lwsl_sspc_client(_w, ...) do {} while(0) |
#define | lwsl_sspc_latency(_w, ...) do {} while(0) |
#define | lwsl_sspc_thread(_w, ...) do {} while(0) |
#define | lwsl_sspc_user(_w, ...) do {} while(0) |
#define | lwsl_hexdump_sspc_err(_v, ...) lwsl_hexdump_sspc(_v, LLL_ERR, __VA_ARGS__) |
#define | lwsl_hexdump_sspc_warn(_v, ...) lwsl_hexdump_sspc(_v, LLL_WARN, __VA_ARGS__) |
#define | lwsl_hexdump_sspc_notice(_v, ...) lwsl_hexdump_sspc(_v, LLL_NOTICE, __VA_ARGS__) |
#define | lwsl_hexdump_sspc_info(_v, ...) lwsl_hexdump_sspc(_v, LLL_INFO, __VA_ARGS__) |
#define | lwsl_hexdump_sspc_debug(_v, ...) lwsl_hexdump_sspc(_v, LLL_DEBUG, __VA_ARGS__) |
Functions | |
LWS_VISIBLE LWS_EXTERN void | lws_log_prepend_sspc (struct lws_log_cx *cx, void *obj, char **p, char *e) |
LWS_VISIBLE LWS_EXTERN struct lws_log_cx * | lwsl_sspc_get_cx (struct lws_sspc_handle *ss) |
LWS_VISIBLE LWS_EXTERN int | lws_sspc_create (struct lws_context *context, int tsi, const lws_ss_info_t *ssi, void *opaque_user_data, struct lws_sspc_handle **ppss, void *reserved, const char **ppayload_fmt) |
LWS_VISIBLE LWS_EXTERN void | lws_sspc_destroy (struct lws_sspc_handle **ppss) |
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t | lws_sspc_request_tx (struct lws_sspc_handle *pss) |
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t | lws_sspc_request_tx_len (struct lws_sspc_handle *h, unsigned long len) |
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t | lws_sspc_client_connect (struct lws_sspc_handle *h) |
LWS_VISIBLE LWS_EXTERN int | lws_sspc_proxy_create (struct lws_context *context) |
LWS_VISIBLE LWS_EXTERN struct lws_context * | lws_sspc_get_context (struct lws_sspc_handle *h) |
LWS_VISIBLE LWS_EXTERN const char * | lws_sspc_rideshare (struct lws_sspc_handle *h) |
: metadata name from the policy | |
lws_sspc_set_metadata() - allow user to bind external data to defined ss metadata \h: secure streams handle \value: pointer to user-managed data to bind to name \len: length of the user-managed data in value Binds user-managed data to the named metadata item from the ss policy. If present, the metadata item is handled in a protocol-specific way using the associated policy information. For example, in the policy "\"metadata\":" "[" "{\"uptag\":" "\"X-Upload-Tag:\"}," "{\"ctype\":" "\"Content-Type:\"}," "{\"xctype\":" "\"X-Content-Type:\"}" "]," when the policy is using h1 is interpreted to add h1 headers of the given name with the value of the metadata on the left. Return 0 if OK, or nonzero if failed. | |
LWS_VISIBLE LWS_EXTERN int | lws_sspc_set_metadata (struct lws_sspc_handle *h, const char *name, const void *value, size_t len) |
LWS_VISIBLE LWS_EXTERN int | lws_sspc_get_metadata (struct lws_sspc_handle *h, const char *name, const void **value, size_t *len) |
LWS_VISIBLE LWS_EXTERN int | lws_sspc_add_peer_tx_credit (struct lws_sspc_handle *h, int32_t add) |
LWS_VISIBLE LWS_EXTERN int | lws_sspc_get_est_peer_tx_credit (struct lws_sspc_handle *h) |
LWS_VISIBLE LWS_EXTERN void | lws_sspc_start_timeout (struct lws_sspc_handle *h, unsigned int timeout_ms) |
LWS_VISIBLE LWS_EXTERN void | lws_sspc_cancel_timeout (struct lws_sspc_handle *h) |
LWS_VISIBLE LWS_EXTERN void * | lws_sspc_to_user_object (struct lws_sspc_handle *h) |
LWS_VISIBLE LWS_EXTERN void | lws_sspc_change_handlers (struct lws_sspc_handle *h, lws_sscb_rx rx, lws_sscb_tx tx, lws_sscb_state state) |
LWS_VISIBLE LWS_EXTERN void | lws_sspc_server_ack (struct lws_sspc_handle *h, int nack) |
LWS_VISIBLE LWS_EXTERN const char * | lws_sspc_tag (struct lws_sspc_handle *h) |
struct lws_context_standalone |
Definition at line 190 of file lws-secure-streams-client.h.
Data Fields | ||
---|---|---|
lws_txp_path_client_t | txp_cpath | |
lws_dll2_owner_t | ss_client_owner | |
uint32_t | ssidx |
#define lwsl_sspc | ( | _h, | |
_fil, | |||
... | |||
) |
Definition at line 87 of file lws-secure-streams-client.h.
#define lwsl_hexdump_sspc | ( | _h, | |
_fil, | |||
_buf, | |||
_len | |||
) |
Definition at line 91 of file lws-secure-streams-client.h.
#define lwsl_sspc_err | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 103 of file lws-secure-streams-client.h.
#define lwsl_sspc_warn | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 109 of file lws-secure-streams-client.h.
#define lwsl_sspc_notice | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 115 of file lws-secure-streams-client.h.
#define lwsl_sspc_info | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 121 of file lws-secure-streams-client.h.
#define lwsl_sspc_debug | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 127 of file lws-secure-streams-client.h.
#define lwsl_sspc_parser | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 133 of file lws-secure-streams-client.h.
#define lwsl_sspc_header | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 139 of file lws-secure-streams-client.h.
#define lwsl_sspc_ext | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 145 of file lws-secure-streams-client.h.
#define lwsl_sspc_client | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 151 of file lws-secure-streams-client.h.
#define lwsl_sspc_latency | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 157 of file lws-secure-streams-client.h.
#define lwsl_sspc_thread | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 163 of file lws-secure-streams-client.h.
#define lwsl_sspc_user | ( | _w, | |
... | |||
) | do {} while(0) |
Definition at line 169 of file lws-secure-streams-client.h.
#define lwsl_hexdump_sspc_err | ( | _v, | |
... | |||
) | lwsl_hexdump_sspc(_v, LLL_ERR, __VA_ARGS__) |
Definition at line 172 of file lws-secure-streams-client.h.
#define lwsl_hexdump_sspc_warn | ( | _v, | |
... | |||
) | lwsl_hexdump_sspc(_v, LLL_WARN, __VA_ARGS__) |
Definition at line 173 of file lws-secure-streams-client.h.
#define lwsl_hexdump_sspc_notice | ( | _v, | |
... | |||
) | lwsl_hexdump_sspc(_v, LLL_NOTICE, __VA_ARGS__) |
Definition at line 174 of file lws-secure-streams-client.h.
#define lwsl_hexdump_sspc_info | ( | _v, | |
... | |||
) | lwsl_hexdump_sspc(_v, LLL_INFO, __VA_ARGS__) |
Definition at line 175 of file lws-secure-streams-client.h.
#define lwsl_hexdump_sspc_debug | ( | _v, | |
... | |||
) | lwsl_hexdump_sspc(_v, LLL_DEBUG, __VA_ARGS__) |
Definition at line 176 of file lws-secure-streams-client.h.
LWS_VISIBLE LWS_EXTERN void lws_log_prepend_sspc | ( | struct lws_log_cx * | cx, |
void * | obj, | ||
char ** | p, | ||
char * | e | ||
) |
LWS_VISIBLE LWS_EXTERN struct lws_log_cx* lwsl_sspc_get_cx | ( | struct lws_sspc_handle * | ss | ) |
LWS_VISIBLE LWS_EXTERN int lws_sspc_create | ( | struct lws_context * | context, |
int | tsi, | ||
const lws_ss_info_t * | ssi, | ||
void * | opaque_user_data, | ||
struct lws_sspc_handle ** | ppss, | ||
void * | reserved, | ||
const char ** | ppayload_fmt | ||
) |
LWS_VISIBLE LWS_EXTERN void lws_sspc_destroy | ( | struct lws_sspc_handle ** | ppss | ) |
lws_sspc_destroy() - Destroy secure stream
ppss | pointer to lws_ss_t pointer to be destroyed |
Destroys the lws_ss_t pointed to by *ppss, and sets *ppss to NULL.
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t lws_sspc_request_tx | ( | struct lws_sspc_handle * | pss | ) |
lws_sspc_request_tx() - Schedule stream for tx
pss | pointer to lws_ss_t representing stream that wants to transmit |
Schedules a write on the stream represented by pss
. When it's possible to write on this stream, the *tx callback will occur with an empty buffer for the stream owner to fill in.
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t lws_sspc_request_tx_len | ( | struct lws_sspc_handle * | h, |
unsigned long | len | ||
) |
lws_sspc_request_tx_len() - Schedule stream for tx with length hint
h | pointer to handle representing stream that wants to transmit |
len | the length of the write in bytes |
Schedules a write on the stream represented by pss
. When it's possible to write on this stream, the *tx callback will occur with an empty buffer for the stream owner to fill in.
This api variant should be used when it's possible the payload will go out over h1 with x-web-form-urlencoded or similar Content-Type.
The serialized, sspc type api actually serializes and forwards the length hint to its upstream proxy, where it's available for use to produce the internet-capable protocol framing.
LWS_VISIBLE LWS_EXTERN lws_ss_state_return_t lws_sspc_client_connect | ( | struct lws_sspc_handle * | h | ) |
lws_sspc_client_connect() - Attempt the client connect
h | secure streams handle |
Starts the connection process for the secure stream. Returns 0.
LWS_VISIBLE LWS_EXTERN int lws_sspc_proxy_create | ( | struct lws_context * | context | ) |
lws_sspc_proxy_create() - Start a unix domain socket proxy for Secure Streams
context | lws_context |
Creates a vhost that listens on an abstract namespace unix domain socket at address "proxy.ss.lws". Client connections to this proxy to Secure Streams
LWS_VISIBLE LWS_EXTERN struct lws_context* lws_sspc_get_context | ( | struct lws_sspc_handle * | h | ) |
lws_ss_get_context() - convenience helper to recover the lws context
\h: secure streams handle
Returns the lws context. Dispenses with the need to pass a copy of it into your secure streams handler.
LWS_VISIBLE LWS_EXTERN const char* lws_sspc_rideshare | ( | struct lws_sspc_handle * | h | ) |
LWS_VISIBLE LWS_EXTERN int lws_sspc_set_metadata | ( | struct lws_sspc_handle * | h, |
const char * | name, | ||
const void * | value, | ||
size_t | len | ||
) |
LWS_VISIBLE LWS_EXTERN int lws_sspc_get_metadata | ( | struct lws_sspc_handle * | h, |
const char * | name, | ||
const void ** | value, | ||
size_t * | len | ||
) |
LWS_VISIBLE LWS_EXTERN int lws_sspc_add_peer_tx_credit | ( | struct lws_sspc_handle * | h, |
int32_t | add | ||
) |
LWS_VISIBLE LWS_EXTERN int lws_sspc_get_est_peer_tx_credit | ( | struct lws_sspc_handle * | h | ) |
LWS_VISIBLE LWS_EXTERN void lws_sspc_start_timeout | ( | struct lws_sspc_handle * | h, |
unsigned int | timeout_ms | ||
) |
LWS_VISIBLE LWS_EXTERN void lws_sspc_cancel_timeout | ( | struct lws_sspc_handle * | h | ) |
LWS_VISIBLE LWS_EXTERN void* lws_sspc_to_user_object | ( | struct lws_sspc_handle * | h | ) |
LWS_VISIBLE LWS_EXTERN void lws_sspc_change_handlers | ( | struct lws_sspc_handle * | h, |
lws_sscb_rx | rx, | ||
lws_sscb_tx | tx, | ||
lws_sscb_state | state | ||
) |
LWS_VISIBLE LWS_EXTERN void lws_sspc_server_ack | ( | struct lws_sspc_handle * | h, |
int | nack | ||
) |
LWS_VISIBLE LWS_EXTERN const char* lws_sspc_tag | ( | struct lws_sspc_handle * | h | ) |
lws_sspc_tag() - get the sspc log tag
h | the sspc handle |
Returns the sspc log tag, to assist in logging traceability