libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lws_system_ops |
Macros | |
#define | LWSSYSGAUTH_HEX (1 << 0) |
Typedefs | |
typedef struct lws_system_blob | lws_system_blob_t |
typedef void(* | lws_attach_cb_t) (struct lws_context *context, int tsi, void *opaque) |
typedef struct lws_system_ops | lws_system_ops_t |
#define LWSSYSGAUTH_HEX (1 << 0) |
Definition at line 240 of file lws-system.h.
typedef struct lws_system_blob lws_system_blob_t |
Definition at line 1 of file lws-system.h.
typedef void(* lws_attach_cb_t) (struct lws_context *context, int tsi, void *opaque) |
Definition at line 163 of file lws-system.h.
typedef struct lws_system_ops lws_system_ops_t |
Definition at line 33 of file lws-system.h.
enum lws_system_states_t |
Definition at line 105 of file lws-system.h.
enum lws_cpd_result_t |
Enumerator | |
---|---|
LWS_CPD_UNKNOWN | |
LWS_CPD_INTERNET_OK | |
LWS_CPD_CAPTIVE_PORTAL | |
LWS_CPD_NO_INTERNET |
Definition at line 155 of file lws-system.h.
anonymous enum |
Definition at line 305 of file lws-system.h.
LWS_EXTERN LWS_VISIBLE void lws_system_blob_direct_set | ( | lws_system_blob_t * | b, |
const uint8_t * | ptr, | ||
size_t | len | ||
) |
LWS_EXTERN LWS_VISIBLE void lws_system_blob_heap_empty | ( | lws_system_blob_t * | b | ) |
LWS_EXTERN LWS_VISIBLE int lws_system_blob_heap_append | ( | lws_system_blob_t * | b, |
const uint8_t * | ptr, | ||
size_t | len | ||
) |
LWS_EXTERN LWS_VISIBLE size_t lws_system_blob_get_size | ( | lws_system_blob_t * | b | ) |
LWS_EXTERN LWS_VISIBLE int lws_system_blob_get_single_ptr | ( | lws_system_blob_t * | b, |
const uint8_t ** | ptr | ||
) |
LWS_EXTERN LWS_VISIBLE int lws_system_blob_get | ( | lws_system_blob_t * | b, |
uint8_t * | ptr, | ||
size_t * | len, | ||
size_t | ofs | ||
) |
LWS_EXTERN LWS_VISIBLE void lws_system_blob_destroy | ( | lws_system_blob_t * | b | ) |
LWS_EXTERN LWS_VISIBLE lws_system_blob_t* lws_system_get_blob | ( | struct lws_context * | context, |
lws_system_blob_item_t | type, | ||
int | idx | ||
) |
LWS_EXTERN LWS_VISIBLE int lws_tls_jit_trust_got_cert_cb | ( | struct lws_context * | cx, |
void * | got_opaque, | ||
const uint8_t * | skid, | ||
size_t | skid_len, | ||
const uint8_t * | der, | ||
size_t | der_len | ||
) |
LWS_EXTERN LWS_VISIBLE const lws_system_ops_t* lws_system_get_ops | ( | struct lws_context * | context | ) |
lws_system_get_ops() - get ahold of the system ops struct from the context
context | the lws_context |
Returns the system ops struct. It may return NULL and if not, anything in there may be NULL.
LWS_EXTERN LWS_VISIBLE int __lws_system_attach | ( | struct lws_context * | context, |
int | tsi, | ||
lws_attach_cb_t | cb, | ||
lws_system_states_t | state, | ||
void * | opaque, | ||
struct lws_attach_item ** | get | ||
) |
__lws_system_attach() - get and set items on context attach list
context | context to get or set attach items to |
tsi | thread service index (normally 0) |
cb | callback to call from context event loop thread |
state | the lws_system state we have to be in or have passed through |
opaque | optional pointer to user specific info given to callback |
get | NULL, or pointer to pointer to take detached tail item on exit |
This allows other threads to enqueue callback requests to happen from a pt's event loop thread safely. The callback gets the context pointer and a user opaque pointer that can be optionally given when the item is added to the attach list.
This api is the no-locking core function for getting and setting items on the pt's attach list. The lws_system operation (*attach) is the actual api that user and internal code calls for this feature, it should perform system-specific locking, call this helper, release the locking and then return the result. This api is public only so it can be used in the locked implementation of (*attach).
If get is NULL, then the call adds to the head of the pt attach list using cb, state, and opaque; if get is non-NULL, then *get is set to the first waiting attached item that meets the state criteria and that item is removed from the list.
This is a non-threadsafe helper only designed to be called from implementations of struct lws_system's (*attach) operation where system- specific locking has been applied around it, making it threadsafe.