libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lws_flow |
struct | lws_wifi_scan |
struct | lws_humanize_unit |
struct | lws_fsmount |
Macros | |
#define | lws_ptr_diff(head, tail) ((int)((char *)(head) - (char *)(tail))) |
#define | lws_ptr_diff_size_t(head, tail) ((size_t)(ssize_t)((char *)(head) - (char *)(tail))) |
#define | lws_strnncpy(dest, src, size1, destsize) |
#define | lws_assert_fourcc(_a, _b) do { } while (0); |
#define | LWS_MINILEX_FAIL -1 |
#define | LWS_MINILEX_CONTINUE 0 |
#define | LWS_MINILEX_MATCH 1 |
Typedefs | |
typedef struct lws_flow | lws_flow_t |
typedef struct lws_humanize_unit | lws_humanize_unit_t |
Enumerations | |
enum | { LWSDLOFLOW_STATE_READ , LWSDLOFLOW_STATE_READ_COMPLETED , LWSDLOFLOW_STATE_READ_FAILED } |
enum | { LWS_RXFLOW_REASON_USER_BOOL = (1 << 0) , LWS_RXFLOW_REASON_HTTP_RXBUFFER = (1 << 6) , LWS_RXFLOW_REASON_H2_PPS_PENDING = (1 << 7) , LWS_RXFLOW_REASON_APPLIES = (1 << 14) , LWS_RXFLOW_REASON_APPLIES_ENABLE_BIT = (1 << 13) , LWS_RXFLOW_REASON_APPLIES_ENABLE , LWS_RXFLOW_REASON_APPLIES_DISABLE = LWS_RXFLOW_REASON_APPLIES , LWS_RXFLOW_REASON_FLAG_PROCESS_NOW = (1 << 12) } |
Variables | |
LWS_VISIBLE const lws_humanize_unit_t | humanize_schema_si [7] |
LWS_VISIBLE const lws_humanize_unit_t | humanize_schema_si_bytes [7] |
LWS_VISIBLE const lws_humanize_unit_t | humanize_schema_us [8] |
struct lws_fsmount |
Definition at line 1148 of file lws-misc.h.
Data Fields | ||
---|---|---|
const char * | layers_path | |
const char * | overlay_path | |
char | mp[256] | |
char | ovname[64] | |
char | distro[64] |
#define LWS_MINILEX_FAIL -1 |
Definition at line 1212 of file lws-misc.h.
#define LWS_MINILEX_CONTINUE 0 |
Definition at line 1213 of file lws-misc.h.
#define LWS_MINILEX_MATCH 1 |
Definition at line 1214 of file lws-misc.h.
LWS_VISIBLE LWS_EXTERN int lws_fsmount_mount | ( | struct lws_fsmount * | fsm | ) |
lws_fsmount_mount() - Mounts an overlayfs stack of layers
fsm:
struct lws_fsmount specifying the mount layout
This api is able to assemble up to 4 layer directories on to a mountpoint using overlayfs mount (Linux only).
Set fsm.layers_path to the base dir where the layers themselves live, the entries in fsm.layers[] specifies the relative path to the layer, comprising fsm.layers_path/fsm.distro/fsm.layers[], with [0] being the deepest, earliest layer and the rest being progressively on top of [0]; NULL indicates the layer is unused.
fsm.overlay_path is the base path of the overlayfs instantiations... empty dirs must exist at
fsm.overlay_path/overlays/fsm.ovname/work fsm.overlay_path/overlays/fsm.ovname/session
Set fsm.mp to the path of an already-existing empty dir that will be the mountpoint, this can be whereever you like.
Overlayfs merges the union of all the contributing layers at the mountpoint, the mount is writeable but the layer themselves are immutable, all additions and changes are stored in
fsm.overlay_path/overlays/fsm.ovname/session
Returns 0 if mounted OK, nonzero if errors.
Retain fsm for use with unmounting.
LWS_VISIBLE LWS_EXTERN int lws_fsmount_unmount | ( | struct lws_fsmount * | fsm | ) |
lws_fsmount_unmount() - Unmounts an overlayfs dir
fsm:
struct lws_fsmount specifying the mount layout
Unmounts the mountpoint in fsm.mp.
Delete fsm.overlay_path/overlays/fsm.ovname/session to permanently eradicate all changes from the time the mountpoint was in use.
Returns 0 if unmounted OK.
LWS_VISIBLE LWS_EXTERN int lws_minilex_parse | ( | const uint8_t * | lex, |
int16_t * | ps, | ||
const uint8_t | c, | ||
int * | match | ||
) |
lws_minilex_parse() - stateful matching vs lws minilex tables
lex:
the start of the precomputed minilex table ps:
pointer to the int16_t that holds the parsing state (init to 0) c:
the next incoming character to parse match:
pointer to take the match
Returns either
In cases where the match is ambiguous, eg, we saw "right" and the possible matches are "right" or "right-on", LWS_MINILEX_CONTINUE is returned. To allow it to match on the complete-but-ambiguous token, if the caller sees a delimiter it can call lws_minilex_parse() again with c == 0. This will either return LWS_MINILEX_MATCH and set *match to the smaller ambiguous match, or return LWS_MINILEX_FAIL.
LWS_VISIBLE LWS_EXTERN unsigned int lws_sigbits | ( | uintptr_t | u | ) |
LWS_VISIBLE LWS_EXTERN int lws_wol | ( | struct lws_context * | ctx, |
const char * | ip_or_NULL, | ||
uint8_t * | mac_6_bytes | ||
) |
lws_wol() - broadcast a magic WOL packet to MAC, optionally binding to if IP
ctx:
The lws context ip_or_NULL:
The IP address to bind to at the client side, to send the magic packet on. If NULL, the system chooses, probably the interface with the default route. mac_6_bytes:
Points to a 6-byte MAC address to direct the magic packet to