libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-misc.h
Go to the documentation of this file.
1/*
2 * libwebsockets - small server side websockets and web server implementation
3 *
4 * Copyright (C) 2010 - 2021 Andy Green <andy@warmcat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 */
24
25#if defined(LWS_WITH_SPAWN)
26
27#if defined(WIN32) || defined(_WIN32)
28#else
29#include <sys/wait.h>
30#include <sys/times.h>
31#endif
32#endif
33
34#if defined(__OpenBSD__)
35#include <sys/siginfo.h>
36#endif
37
44
45struct lws_buflist;
46
58lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf,
59 size_t len);
71lws_buflist_next_segment_len(struct lws_buflist **head, uint8_t **buf);
72
89lws_buflist_use_segment(struct lws_buflist **head, size_t len);
90
99lws_buflist_total_len(struct lws_buflist **head);
100
113lws_buflist_linear_copy(struct lws_buflist **head, size_t ofs, uint8_t *buf,
114 size_t len);
115
133lws_buflist_linear_use(struct lws_buflist **head, uint8_t *buf, size_t len);
134
154lws_buflist_fragment_use(struct lws_buflist **head, uint8_t *buf,
155 size_t len, char *frag_first, char *frag_fin);
156
166lws_buflist_destroy_all_segments(struct lws_buflist **head);
167
179lws_buflist_describe(struct lws_buflist **head, void *id, const char *reason);
180
181
182/*
183 * Optional helpers for closely-managed stream flow control. These are useful
184 * when there is no memory for large rx buffers and instead tx credit is being
185 * used to regulate the server sending data.
186 *
187 * When combined with stateful consumption-on-demand, this can be very effective
188 * at managing data flows through restricted circumstances. These helpers
189 * implement a golden implementation that can be bound to a stream in its priv
190 * data.
191 *
192 * The helper is sophisticated enough to contain a buflist to manage overflows
193 * on heap and preferentially drain it. RX goes through heap to guarantee the
194 * consumer can exit cleanly at any time.
195 */
196
197enum {
198 LWSDLOFLOW_STATE_READ, /* default, we want input */
199 LWSDLOFLOW_STATE_READ_COMPLETED, /* we do not need further rx, every-
200 * thing is locally buffered or used */
201 LWSDLOFLOW_STATE_READ_FAILED, /* operation has fatal error */
202};
203
204struct lws_ss_handle;
205
206typedef struct lws_flow {
208
209 struct lws_ss_handle *h;
210 struct lws_buflist *bl;
211
212 const uint8_t *data;
213 size_t len; /* bytes left in data */
214 uint32_t blseglen; /* bytes issued */
215 int32_t window;
216
217 uint8_t state;
219
229
240
250#define lws_ptr_diff(head, tail) \
251 ((int)((char *)(head) - (char *)(tail)))
252
253#define lws_ptr_diff_size_t(head, tail) \
254 ((size_t)(ssize_t)((char *)(head) - (char *)(tail)))
255
268lws_snprintf(char *str, size_t size, const char *format, ...) LWS_FORMAT(3);
269
281lws_strncpy(char *dest, const char *src, size_t size);
282
283/*
284 * Variation where we want to use the smaller of two lengths, useful when the
285 * source string is not NUL terminated
286 */
287#define lws_strnncpy(dest, src, size1, destsize) \
288 lws_strncpy(dest, src, (size_t)(size1 + 1) < (size_t)(destsize) ? \
289 (size_t)(size1 + 1) : (size_t)(destsize))
290
304LWS_VISIBLE LWS_EXTERN const char *
305lws_nstrstr(const char *buf, size_t len, const char *name, size_t nl);
306
329LWS_VISIBLE LWS_EXTERN const char *
330lws_json_simple_find(const char *buf, size_t len, const char *name, size_t *alen);
331
350lws_json_simple_strcmp(const char *buf, size_t len, const char *name, const char *comp);
351
370lws_hex_len_to_byte_array(const char *h, size_t hlen, uint8_t *dest, int max);
371
389lws_hex_to_byte_array(const char *h, uint8_t *dest, int max);
390
403lws_hex_from_byte_array(const uint8_t *src, size_t slen, char *dest, size_t len);
404
419lws_hex_random(struct lws_context *context, char *dest, size_t len);
420
421/*
422 * lws_timingsafe_bcmp(): constant time memcmp
423 *
424 * \param a: first buffer
425 * \param b: second buffer
426 * \param len: count of bytes to compare
427 *
428 * Return 0 if the two buffers are the same, else nonzero.
429 *
430 * Always compares all of the buffer before returning, so it can't be used as
431 * a timing oracle.
432 */
433
435lws_timingsafe_bcmp(const void *a, const void *b, uint32_t len);
436
448lws_get_random(struct lws_context *context, void *buf, size_t len);
457lws_daemonize(const char *_lock_path);
465
473lws_wsi_user(struct lws *wsi);
474
482lws_wsi_tsi(struct lws *wsi);
483
495lws_set_wsi_user(struct lws *wsi, void *user);
496
520lws_parse_uri(char *p, const char **prot, const char **ads, int *port,
521 const char **path);
539LWS_VISIBLE LWS_EXTERN const char *
540lws_cmdline_option(int argc, const char **argv, const char *val);
541
555lws_cmdline_option_handle_builtin(int argc, const char **argv,
556 struct lws_context_creation_info *info);
557
561LWS_VISIBLE LWS_EXTERN unsigned long
563
569
580lws_get_context(const struct lws *wsi);
581
592lws_get_vhost_listen_port(struct lws_vhost *vhost);
593
604lws_get_count_threads(struct lws_context *context);
605
614lws_get_parent(const struct lws *wsi);
615
623lws_get_child(const struct lws *wsi);
624
638lws_get_effective_uid_gid(struct lws_context *context, uid_t *uid, gid_t *gid);
639
647LWS_VISIBLE LWS_EXTERN const struct lws_udp * LWS_WARN_UNUSED_RESULT
648lws_get_udp(const struct lws *wsi);
649
651lws_get_opaque_parent_data(const struct lws *wsi);
652
654lws_set_opaque_parent_data(struct lws *wsi, void *data);
655
657lws_get_opaque_user_data(const struct lws *wsi);
658
660lws_set_opaque_user_data(struct lws *wsi, void *data);
661
664
667
669lws_get_close_length(struct lws *wsi);
670
671LWS_VISIBLE LWS_EXTERN unsigned char *
672lws_get_close_payload(struct lws *wsi);
673
685struct lws *lws_get_network_wsi(struct lws *wsi);
686
695lws_set_allocator(void *(*realloc)(void *ptr, size_t size, const char *reason));
696
697enum {
698 /*
699 * Flags for enable and disable rxflow with reason bitmap and with
700 * backwards-compatible single bool
701 */
705
712
713};
714
735lws_rx_flow_control(struct lws *wsi, int enable);
736
747lws_rx_flow_allow_all_protocol(const struct lws_context *context,
748 const struct lws_protocols *protocol);
749
773
774#if defined(LWS_WITH_DIR)
775
776typedef enum {
777 LDOT_UNKNOWN,
778 LDOT_FILE,
779 LDOT_DIR,
780 LDOT_LINK,
781 LDOT_FIFO,
782 LDOTT_SOCKET,
783 LDOT_CHAR,
784 LDOT_BLOCK
785} lws_dir_obj_type_t;
786
787struct lws_dir_entry {
788 const char *name;
789 lws_dir_obj_type_t type;
790};
791
792typedef int
793lws_dir_callback_function(const char *dirpath, void *user,
794 struct lws_dir_entry *lde);
795
809lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb);
810
823lws_dir_rm_rf_cb(const char *dirpath, void *user, struct lws_dir_entry *lde);
824
825
831
832typedef struct lws_dir_du {
833 uint64_t size_in_bytes;
834 uint32_t count_files;
835} lws_dir_du_t;
836
850lws_dir_du_cb(const char *dirpath, void *user, struct lws_dir_entry *lde);
851
852
853/*
854 * We pass every file in the base dir through a filter, and call back on the
855 * ones that match. Directories are ignored.
856 *
857 * The original path filter string may look like, eg, "sai-*.deb" or "*.txt"
858 */
859
860typedef int (*lws_dir_glob_cb_t)(void *data, const char *path);
861
862typedef struct lws_dir_glob {
863 const char *filter;
864 lws_dir_glob_cb_t cb;
865 void *user;
866} lws_dir_glob_t;
867
883lws_dir_glob_cb(const char *dirpath, void *user, struct lws_dir_entry *lde);
884
885#endif
886
903
911lws_get_tsi(struct lws *wsi);
912
920lws_is_ssl(struct lws *wsi);
927lws_is_cgi(struct lws *wsi);
928
944lws_tls_jit_trust_blob_queury_skid(const void *_blob, size_t blen,
945 const uint8_t *skid, size_t skid_len,
946 const uint8_t **prpder, size_t *prder_len);
947
959lws_open(const char *__file, int __oflag, ...);
960
961struct lws_wifi_scan { /* generic wlan scan item */
963 char ssid[32];
964 int32_t rssi; /* divide by .count to get db */
965 uint8_t bssid[6];
966 uint8_t count;
967 uint8_t channel;
968 uint8_t authmode;
969};
970
971#if defined(LWS_WITH_TLS) && !defined(LWS_WITH_MBEDTLS)
979lws_get_ssl(struct lws *wsi);
980#endif
981
983lws_explicit_bzero(void *p, size_t len);
984
985typedef struct lws_humanize_unit {
986 const char *name; /* array ends with NULL name */
987 uint64_t factor;
989
993
994#if defined(_DEBUG)
995void
996lws_assert_fourcc(uint32_t fourcc, uint32_t expected);
997#else
998#define lws_assert_fourcc(_a, _b) do { } while (0);
999#endif
1000
1021
1023lws_humanize(char *buf, size_t len, uint64_t value,
1024 const lws_humanize_unit_t *schema);
1025
1027lws_ser_wu16be(uint8_t *b, uint16_t u);
1028
1030lws_ser_wu32be(uint8_t *b, uint32_t u32);
1031
1033lws_ser_wu64be(uint8_t *b, uint64_t u64);
1034
1035LWS_VISIBLE LWS_EXTERN uint16_t
1036lws_ser_ru16be(const uint8_t *b);
1037
1038LWS_VISIBLE LWS_EXTERN uint32_t
1039lws_ser_ru32be(const uint8_t *b);
1040
1041LWS_VISIBLE LWS_EXTERN uint64_t
1042lws_ser_ru64be(const uint8_t *b);
1043
1045lws_vbi_encode(uint64_t value, void *buf);
1046
1048lws_vbi_decode(const void *buf, uint64_t *value, size_t len);
1049
1051
1052#if defined(LWS_WITH_SPAWN)
1053
1054/* opaque internal struct */
1055struct lws_spawn_piped;
1056
1057#if defined(WIN32)
1058struct _lws_siginfo_t {
1059 int retcode;
1060};
1061typedef struct _lws_siginfo_t siginfo_t;
1062#endif
1063
1070typedef struct lws_spawn_resource_us {
1071 uint64_t us_cpu_user;
1072 uint64_t us_cpu_sys;
1073
1074 uint64_t peak_mem_rss;
1075 uint64_t peak_mem_virt;
1076} lws_spawn_resource_us_t;
1077
1078typedef void (*lsp_cb_t)(void *opaque, const lws_spawn_resource_us_t *res,
1079 siginfo_t *si, int we_killed_him);
1080
1081
1101struct lws_spawn_piped_info {
1102 struct lws_dll2_owner *owner;
1103 struct lws_vhost *vh;
1104 struct lws *opt_parent;
1105
1106 const char * const *exec_array;
1107 const char **env_array;
1108 const char *protocol_name;
1109 const char *chroot_path;
1110 const char *wd;
1111
1112 struct lws_spawn_piped **plsp;
1113
1114 void *opaque;
1115
1116 lsp_cb_t reap_cb;
1117
1118 lws_spawn_resource_us_t *res;
1119
1120 lws_usec_t timeout_us;
1121 int max_log_lines;
1122 int tsi;
1123
1124 const struct lws_role_ops *ops; /* NULL is raw file */
1125
1126 uint8_t disable_ctrlc;
1127
1128 const char *cgroup_name_suffix;
1129 int *p_cgroup_ret;
1130};
1131
1153LWS_VISIBLE LWS_EXTERN struct lws_spawn_piped *
1154lws_spawn_piped(const struct lws_spawn_piped_info *lspi);
1155
1156/*
1157 * lws_spawn_piped_kill_child_process() - attempt to kill child process
1158 *
1159 * \p lsp: child object to kill
1160 *
1161 * Attempts to signal the child process in \p lsp to terminate.
1162 */
1164lws_spawn_piped_kill_child_process(struct lws_spawn_piped *lsp);
1165
1180lws_spawn_stdwsi_closed(struct lws_spawn_piped *lsp, struct lws *wsi);
1181
1193lws_spawn_get_stdfd(struct lws *wsi);
1194
1205lws_spawn_get_fd_stdxxx(struct lws_spawn_piped *lsp, int std_idx);
1206
1225lws_spawn_prepare_self_cgroup(const char *user, const char *group);
1226
1239lws_spawn_get_self_cgroup(char *cgroup, size_t max);
1240
1241#endif
1242
1244 const char *layers_path; /* where layers live */
1245 const char *overlay_path; /* where overlay instantiations live */
1246
1247 char mp[256]; /* mountpoint path */
1248 char ovname[64]; /* unique name for mount instance */
1249 char distro[64]; /* unique name for layer source */
1250
1251#if defined(__linux__)
1252 const char *layers[4]; /* distro layers, like "base", "env" */
1253#endif
1254};
1255
1291
1306
1307#define LWS_MINILEX_FAIL -1
1308#define LWS_MINILEX_CONTINUE 0
1309#define LWS_MINILEX_MATCH 1
1310
1338lws_minilex_parse(const uint8_t *lex, int16_t *ps, const uint8_t c,
1339 int *match);
1340
1341/*
1342 * Reports the number of significant bits (from the left) that is needed to
1343 * represent u. So if u is 0x80, result is 8.
1344 */
1345
1346LWS_VISIBLE LWS_EXTERN unsigned int
1347lws_sigbits(uintptr_t u);
1348
1359lws_wol(struct lws_context *ctx, const char *ip_or_NULL, uint8_t *mac_6_bytes);
struct lws_dll2 lws_dll2_t
uint32_t blseglen
Definition lws-misc.h:214
uint64_t factor
Definition lws-misc.h:987
const uint8_t * data
Definition lws-misc.h:212
char ssid[32]
Definition lws-misc.h:963
size_t len
Definition lws-misc.h:213
struct lws_ss_handle * h
Definition lws-misc.h:209
uint8_t state
Definition lws-misc.h:217
struct lws_buflist * bl
Definition lws-misc.h:210
uint8_t channel
Definition lws-misc.h:967
int32_t window
Definition lws-misc.h:215
uint8_t authmode
Definition lws-misc.h:968
uint8_t count
Definition lws-misc.h:966
struct lws_wifi_scan * next
Definition lws-misc.h:962
lws_dll2_t list
Definition lws-misc.h:207
const char * name
Definition lws-misc.h:986
uint8_t bssid[6]
Definition lws-misc.h:965
int32_t rssi
Definition lws-misc.h:964
LWS_VISIBLE LWS_EXTERN void lws_cmdline_option_handle_builtin(int argc, const char **argv, struct lws_context_creation_info *info)
LWS_VISIBLE LWS_EXTERN int lws_hex_to_byte_array(const char *h, uint8_t *dest, int max)
LWS_VISIBLE const lws_humanize_unit_t humanize_schema_si_bytes[7]
LWS_VISIBLE LWS_EXTERN void lws_buflist_describe(struct lws_buflist **head, void *id, const char *reason)
LWS_VISIBLE LWS_EXTERN int lws_open(const char *__file, int __oflag,...)
LWS_VISIBLE LWS_EXTERN int lws_wsi_tsi(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN uint16_t lws_ser_ru16be(const uint8_t *b)
LWS_VISIBLE LWS_EXTERN lws_usec_t lws_now_usecs(void)
LWS_VISIBLE LWS_EXTERN void lws_explicit_bzero(void *p, size_t len)
LWS_VISIBLE LWS_EXTERN const struct lws_udp *LWS_WARN_UNUSED_RESULT lws_get_udp(const struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_parse_uri(char *p, const char **prot, const char **ads, int *port, const char **path)
LWS_VISIBLE LWS_EXTERN struct lws * lws_get_network_wsi(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_snprintf(char *str, size_t size, const char *format,...) LWS_FORMAT(3)
LWS_VISIBLE LWS_EXTERN void lws_get_effective_uid_gid(struct lws_context *context, uid_t *uid, gid_t *gid)
LWS_VISIBLE LWS_EXTERN int lws_is_ssl(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN const char * lws_cmdline_option(int argc, const char **argv, const char *val)
LWS_VISIBLE LWS_EXTERN void lws_clear_child_pending_on_writable(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN unsigned long lws_now_secs(void)
LWS_VISIBLE LWS_EXTERN size_t lws_get_random(struct lws_context *context, void *buf, size_t len)
LWS_VISIBLE LWS_EXTERN int lws_buflist_linear_copy(struct lws_buflist **head, size_t ofs, uint8_t *buf, size_t len)
LWS_VISIBLE LWS_EXTERN int lws_is_cgi(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN unsigned char * lws_get_close_payload(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_hex_len_to_byte_array(const char *h, size_t hlen, uint8_t *dest, int max)
LWS_VISIBLE LWS_EXTERN const char * lws_json_simple_find(const char *buf, size_t len, const char *name, size_t *alen)
LWS_VISIBLE LWS_EXTERN void lws_rx_flow_allow_all_protocol(const struct lws_context *context, const struct lws_protocols *protocol)
LWS_VISIBLE LWS_EXTERN size_t lws_buflist_next_segment_len(struct lws_buflist **head, uint8_t **buf)
size_t lws_get_allocated_heap(void)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_get_count_threads(struct lws_context *context)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_get_vhost_listen_port(struct lws_vhost *vhost)
LWS_VISIBLE LWS_EXTERN struct lws_context *LWS_WARN_UNUSED_RESULT lws_get_context(const struct lws *wsi)
LWS_VISIBLE LWS_EXTERN size_t lws_remaining_packet_payload(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_humanize(char *buf, size_t len, uint64_t value, const lws_humanize_unit_t *schema)
LWS_VISIBLE LWS_EXTERN void lws_set_opaque_user_data(struct lws *wsi, void *data)
#define lws_assert_fourcc(_a, _b)
Definition lws-misc.h:998
LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_get_child(const struct lws *wsi)
LWS_VISIBLE LWS_EXTERN uint32_t lws_ser_ru32be(const uint8_t *b)
LWS_VISIBLE LWS_EXTERN size_t lws_buflist_total_len(struct lws_buflist **head)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_flow_feed(lws_flow_t *flow)
LWS_VISIBLE LWS_EXTERN void lws_ser_wu16be(uint8_t *b, uint16_t u)
LWS_VISIBLE LWS_EXTERN void lws_set_wsi_user(struct lws *wsi, void *user)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_flow_req(lws_flow_t *flow)
LWS_VISIBLE LWS_EXTERN size_t lws_buflist_use_segment(struct lws_buflist **head, size_t len)
struct lws_flow lws_flow_t
LWS_VISIBLE const lws_humanize_unit_t humanize_schema_us[8]
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf, size_t len)
LWS_VISIBLE const lws_humanize_unit_t humanize_schema_si[7]
LWS_VISIBLE LWS_EXTERN const char * lws_nstrstr(const char *buf, size_t len, const char *name, size_t nl)
LWS_VISIBLE LWS_EXTERN int lws_get_child_pending_on_writable(const struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_get_close_length(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_tls_jit_trust_blob_queury_skid(const void *_blob, size_t blen, const uint8_t *skid, size_t skid_len, const uint8_t **prpder, size_t *prder_len)
LWS_VISIBLE LWS_EXTERN void lws_set_opaque_parent_data(struct lws *wsi, void *data)
LWS_VISIBLE LWS_EXTERN int lws_json_simple_strcmp(const char *buf, size_t len, const char *name, const char *comp)
LWS_VISIBLE LWS_EXTERN const char *LWS_WARN_UNUSED_RESULT lws_get_library_version(void)
LWS_VISIBLE LWS_EXTERN int lws_vbi_encode(uint64_t value, void *buf)
LWS_VISIBLE LWS_EXTERN uint64_t lws_ser_ru64be(const uint8_t *b)
LWS_VISIBLE LWS_EXTERN int lws_get_tsi(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN int lws_buflist_linear_use(struct lws_buflist **head, uint8_t *buf, size_t len)
LWS_VISIBLE LWS_EXTERN int lws_vbi_decode(const void *buf, uint64_t *value, size_t len)
LWS_VISIBLE LWS_EXTERN void lws_ser_wu64be(uint8_t *b, uint64_t u64)
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_daemonize(const char *_lock_path)
LWS_VISIBLE LWS_EXTERN void lws_hex_from_byte_array(const uint8_t *src, size_t slen, char *dest, size_t len)
LWS_VISIBLE LWS_EXTERN void lws_ser_wu32be(uint8_t *b, uint32_t u32)
LWS_VISIBLE LWS_EXTERN void * lws_get_opaque_parent_data(const struct lws *wsi)
LWS_VISIBLE LWS_EXTERN void lws_set_allocator(void *(*realloc)(void *ptr, size_t size, const char *reason))
LWS_VISIBLE LWS_EXTERN int lws_buflist_fragment_use(struct lws_buflist **head, uint8_t *buf, size_t len, char *frag_first, char *frag_fin)
LWS_VISIBLE LWS_EXTERN int lws_rx_flow_control(struct lws *wsi, int enable)
LWS_VISIBLE LWS_EXTERN int lws_timingsafe_bcmp(const void *a, const void *b, uint32_t len)
LWS_VISIBLE LWS_EXTERN void * lws_get_opaque_user_data(const struct lws *wsi)
LWS_VISIBLE LWS_EXTERN void * lws_wsi_user(struct lws *wsi)
LWS_VISIBLE LWS_EXTERN char * lws_strncpy(char *dest, const char *src, size_t size)
struct lws_humanize_unit lws_humanize_unit_t
LWS_VISIBLE LWS_EXTERN int lws_hex_random(struct lws_context *context, char *dest, size_t len)
LWS_VISIBLE LWS_EXTERN void lws_buflist_destroy_all_segments(struct lws_buflist **head)
LWS_VISIBLE LWS_EXTERN struct lws *LWS_WARN_UNUSED_RESULT lws_get_parent(const struct lws *wsi)
@ LWS_RXFLOW_REASON_APPLIES_DISABLE
Definition lws-misc.h:710
@ LWS_RXFLOW_REASON_APPLIES
Definition lws-misc.h:706
@ LWS_RXFLOW_REASON_USER_BOOL
Definition lws-misc.h:702
@ LWS_RXFLOW_REASON_APPLIES_ENABLE_BIT
Definition lws-misc.h:707
@ LWS_RXFLOW_REASON_APPLIES_ENABLE
Definition lws-misc.h:708
@ LWS_RXFLOW_REASON_FLAG_PROCESS_NOW
Definition lws-misc.h:711
@ LWS_RXFLOW_REASON_HTTP_RXBUFFER
Definition lws-misc.h:703
@ LWS_RXFLOW_REASON_H2_PPS_PENDING
Definition lws-misc.h:704
@ LWSDLOFLOW_STATE_READ
Definition lws-misc.h:198
@ LWSDLOFLOW_STATE_READ_COMPLETED
Definition lws-misc.h:199
@ LWSDLOFLOW_STATE_READ_FAILED
Definition lws-misc.h:201
#define LWS_FORMAT(string_index)
#define LWS_EXTERN
int64_t lws_usec_t
lws_stateful_ret_t
#define LWS_WARN_UNUSED_RESULT
#define LWS_VISIBLE
LWS_VISIBLE LWS_EXTERN int lws_fsmount_mount(struct lws_fsmount *fsm)
char mp[256]
Definition lws-misc.h:1247
LWS_VISIBLE LWS_EXTERN int lws_fsmount_unmount(struct lws_fsmount *fsm)
char ovname[64]
Definition lws-misc.h:1248
char distro[64]
Definition lws-misc.h:1249
LWS_VISIBLE LWS_EXTERN unsigned int lws_sigbits(uintptr_t u)
LWS_VISIBLE LWS_EXTERN int lws_minilex_parse(const uint8_t *lex, int16_t *ps, const uint8_t c, int *match)
const char * overlay_path
Definition lws-misc.h:1245
const char * layers_path
Definition lws-misc.h:1244
LWS_VISIBLE LWS_EXTERN int lws_wol(struct lws_context *ctx, const char *ip_or_NULL, uint8_t *mac_6_bytes)