libwebsockets
Lightweight C library for HTML5 websockets
|
Data Fields | |
int(* | reboot )(void) |
int(* | set_clock )(lws_usec_t us) |
int(* | attach )(struct lws_context *context, int tsi, lws_attach_cb_t cb, lws_system_states_t state, void *opaque, struct lws_attach_item **get) |
int(* | captive_portal_detect_request )(struct lws_context *context) |
int(* | metric_report )(lws_metric_pub_t *mdata) |
int(* | jit_trust_query )(struct lws_context *cx, const uint8_t *skid, size_t skid_len, void *got_opaque) |
uint32_t | wake_latency_us |
int(* lws_system_ops::attach) (struct lws_context *context, int tsi, lws_attach_cb_t cb, lws_system_states_t state, void *opaque, struct lws_attach_item **get) |
if get
is NULL, add an attach callback request to the pt for cb
with arg opaque
, that should be called when we're at or past system state state
.
If get
is non-NULL, look for the first listed item on the pt whose state situation is ready, and set *get to point to it. If no items, or none where the system state is right, set *get to NULL.
It's done like this so (*attach) can perform system-specific locking outside of lws core, for both getting and adding items the same so it is thread-safe. A non-threadsafe helper __lws_system_attach() is provided to do the actual work inside the system-specific locking.
int(* lws_system_ops::captive_portal_detect_request) (struct lws_context *context) |
Check if we can go out on the internet cleanly, or if we are being redirected or intercepted by a captive portal. Start the check that proceeds asynchronously, and report the results by calling lws_captive_portal_detect_result() api
int(* lws_system_ops::jit_trust_query) (struct lws_context *cx, const uint8_t *skid, size_t skid_len, void *got_opaque) |
user defined trust store search, if we do trust a cert with SKID matching skid / skid_len, then it should get hold of the DER for the matching root CA and call lws_tls_jit_trust_got_cert_cb(..., got_opaque) before cleaning up and returning. The DER should be destroyed if in heap before returning.
int(* lws_system_ops::metric_report) (lws_metric_pub_t *mdata) |
metric item
is reporting an event of kind rpt
, held in mdata
... return 0 to leave the metric object as it is, or nonzero to reset it.
uint32_t lws_system_ops::wake_latency_us |
time taken for this device to wake from suspend, in us