libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
libwebsockets.h
Go to the documentation of this file.
1/*
2 * libwebsockets - small server side websockets and web server implementation
3 *
4 * Copyright (C) 2010 - 2019 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
26
27#ifndef LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C
28#define LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C
29
30#ifdef __cplusplus
31#include <cstddef>
32#include <cstdarg>
33
34extern "C" {
35#else
36#include <stdarg.h>
37#endif
38
39#include "lws_config.h"
40
41#if defined(LWS_HAVE_SYS_TYPES_H) && !defined(LWS_PLAT_BAREMETAL)
42#include <sys/types.h>
43#endif
44#if defined(LWS_HAVE_NET_ETHERNET_H)
45#include <net/ethernet.h>
46#endif
47/* NetBSD */
48#if defined(LWS_HAVE_NET_IF_ETHER_H)
49#include <net/if_ether.h>
50#endif
51#if defined(_WIN32) && !defined(ETHER_ADDR_LEN)
52#define ETHER_ADDR_LEN 6
53#endif
54#if defined (__sun)
55 #include <sys/ethernet.h>
56 #if !defined(ETHER_ADDR_LEN) && defined(ETHERADDRL)
57 #define ETHER_ADDR_LEN ETHERADDRL
58 #endif
59#endif
60#define LWS_ETHER_ADDR_LEN ETHER_ADDR_LEN
61
62#include <stddef.h>
63#include <string.h>
64#include <stdlib.h>
65
66
67/* place for one-shot opaque forward references */
68
69typedef struct lws_context * lws_ctx_t;
70struct lws_dsh;
71
72/*
73 * CARE: everything using cmake defines needs to be below here
74 */
75
76#define LWS_US_PER_SEC ((lws_usec_t)1000000)
77#define LWS_MS_PER_SEC ((lws_usec_t)1000)
78#define LWS_US_PER_MS ((lws_usec_t)1000)
79#define LWS_NS_PER_US ((lws_usec_t)1000)
80
81#define LWS_KI (1024)
82#define LWS_MI (LWS_KI * 1024)
83#define LWS_GI (LWS_MI * 1024)
84#define LWS_TI ((uint64_t)LWS_GI * 1024)
85#define LWS_PI ((uint64_t)LWS_TI * 1024)
86
87#define LWS_US_TO_MS(x) ((x + (LWS_US_PER_MS / 2)) / LWS_US_PER_MS)
88
89#define LWS_FOURCC(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | d)
90
91#if defined(LWS_HAS_INTPTR_T)
92#include <stdint.h>
93#define lws_intptr_t intptr_t
94#else
95typedef unsigned long long lws_intptr_t;
96#endif
97
98#if defined(WIN32) || defined(_WIN32)
99#ifndef WIN32_LEAN_AND_MEAN
100#define WIN32_LEAN_AND_MEAN
101#endif
102
103#include <winsock2.h>
104#include <ws2tcpip.h>
105#include <stddef.h>
106#include <basetsd.h>
107#include <io.h>
108#ifndef _WIN32_WCE
109#include <fcntl.h>
110#else
111#define _O_RDONLY 0x0000
112#define O_RDONLY _O_RDONLY
113#endif
114
115typedef unsigned int uid_t;
116typedef unsigned int gid_t;
117typedef unsigned short sa_family_t;
118#if !defined(LWS_HAVE_SUSECONDS_T)
119typedef unsigned int useconds_t;
120typedef int suseconds_t;
121#endif
122
123#define LWS_INLINE __inline
124#define LWS_VISIBLE
125#define LWS_WARN_UNUSED_RESULT
126#define LWS_WARN_DEPRECATED
127#define LWS_FORMAT(string_index)
128
129#if !defined(LWS_EXTERN) && defined(LWS_BUILDING_SHARED)
130#ifdef LWS_DLL
131#ifdef LWS_INTERNAL
132#define LWS_EXTERN extern __declspec(dllexport)
133#else
134#define LWS_EXTERN extern __declspec(dllimport)
135#endif
136#endif
137#endif
138
139#if !defined(LWS_INTERNAL) && !defined(LWS_EXTERN)
140#define LWS_EXTERN
141#define LWS_VISIBLE
142#endif
143
144#if !defined(LWS_EXTERN)
145#define LWS_EXTERN
146#endif
147
148#define LWS_INVALID_FILE INVALID_HANDLE_VALUE
149#define LWS_SOCK_INVALID (INVALID_SOCKET)
150#define LWS_O_RDONLY _O_RDONLY
151#define LWS_O_WRONLY _O_WRONLY
152#define LWS_O_CREAT _O_CREAT
153#define LWS_O_TRUNC _O_TRUNC
154
155#if (__STDC_VERSION__ < 199901L) && !defined(__func__)
156#define __func__ __FUNCTION__
157#endif
158
159#define LWS_POSIX_LENGTH_CAST(x) (unsigned int)(x)
160
161#else /* NOT WIN32 */
162#include <unistd.h>
163
164#define LWS_POSIX_LENGTH_CAST(x) (x)
165
166#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP)
167#include <sys/capability.h>
168#endif
169
170#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__QNX__) || defined(__OpenBSD__) || defined(__NuttX__)
171#include <sys/socket.h>
172#include <netinet/in.h>
173#endif
174
175/* Find ETHER_ADDR_LEN on OpenBSD */
176#if defined(__OpenBSD__)
177#include <net/if_arp.h>
178#include <netinet/if_ether.h>
179#endif
180
181#define LWS_INLINE inline
182#define LWS_O_RDONLY O_RDONLY
183#define LWS_O_WRONLY O_WRONLY
184#define LWS_O_CREAT O_CREAT
185#define LWS_O_TRUNC O_TRUNC
186
187#if !defined(LWS_PLAT_OPTEE) && !defined(OPTEE_TA) && !defined(LWS_PLAT_FREERTOS) && !defined(LWS_PLAT_BAREMETAL)
188#include <poll.h>
189#include <netdb.h>
190#define LWS_INVALID_FILE -1
191#define LWS_SOCK_INVALID (-1)
192#else
193#define getdtablesize() (30)
194#if defined(LWS_PLAT_FREERTOS)
195#define LWS_INVALID_FILE NULL
196#define LWS_SOCK_INVALID (-1)
197#else
198#define LWS_INVALID_FILE NULL
199#define LWS_SOCK_INVALID (-1)
200#endif
201#endif
202
203#if defined(__FreeBSD__)
204#include <sys/signal.h>
205#endif
206#if defined(__GNUC__)
207
208/* warn_unused_result attribute only supported by GCC 3.4 or later */
209#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
210#define LWS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
211#else
212#define LWS_WARN_UNUSED_RESULT
213#endif
214
215#if defined(LWS_BUILDING_SHARED)
216/* this is only set when we're building lws itself shared */
217#define LWS_VISIBLE __attribute__((visibility("default")))
218#define LWS_EXTERN extern
219
220#else /* not shared */
221#if defined(WIN32) || defined(_WIN32) || defined(__MINGW32__)
222#define LWS_VISIBLE
223#define LWS_EXTERN extern
224#else
225/*
226 * If we explicitly say hidden here, symbols exist as T but
227 * cannot be imported at link-time.
228 */
229#define LWS_VISIBLE
230#define LWS_EXTERN
231#endif
232
233#endif /* not shared */
234
235#define LWS_WARN_DEPRECATED __attribute__ ((deprecated))
236#undef printf
237#define LWS_FORMAT(string_index) __attribute__ ((format(printf, string_index, string_index+1)))
238#else /* not GNUC */
239
240#define LWS_VISIBLE
241#define LWS_WARN_UNUSED_RESULT
242#define LWS_WARN_DEPRECATED
243#define LWS_FORMAT(string_index)
244#if !defined(LWS_EXTERN)
245#define LWS_EXTERN extern
246#endif
247#endif
248
249
250#if defined(__ANDROID__)
251#include <netinet/in.h>
252#include <unistd.h>
253#endif
254#endif
255
256#ifdef _WIN32
257#define random rand
258#else
259#if !defined(LWS_PLAT_OPTEE)
260#include <sys/time.h>
261#include <unistd.h>
262#endif
263#endif
264
265#if defined(LWS_WITH_LIBUV_INTERNAL)
266#include <uv.h>
267
268#ifdef LWS_HAVE_UV_VERSION_H
269#include <uv-version.h>
270#endif
271
272#ifdef LWS_HAVE_NEW_UV_VERSION_H
273#include <uv/version.h>
274#endif
275#endif
276
277#if defined(LWS_WITH_TLS)
278
279#ifdef USE_WOLFSSL
280#ifdef USE_OLD_CYASSL
281#ifdef _WIN32
282/*
283 * Include user-controlled settings for windows from
284 * <wolfssl-root>/IDE/WIN/user_settings.h
285 */
286#include <IDE/WIN/user_settings.h>
287#include <cyassl/ctaocrypt/settings.h>
288#else
289#include <cyassl/options.h>
290#endif
291#include <cyassl/openssl/ssl.h>
292#include <cyassl/error-ssl.h>
293
294#else
295#ifdef _WIN32
296/*
297 * Include user-controlled settings for windows from
298 * <wolfssl-root>/IDE/WIN/user_settings.h
299 */
300#include <IDE/WIN/user_settings.h>
301#include <wolfssl/wolfcrypt/settings.h>
302#else
303#include <wolfssl/options.h>
304#endif
305#include <wolfssl/openssl/ssl.h>
306#include <wolfssl/error-ssl.h>
307#endif /* not USE_OLD_CYASSL */
308#else
309#if defined(LWS_WITH_MBEDTLS)
310#if defined(LWS_PLAT_FREERTOS)
311/* this filepath is passed to us but without quotes or <> */
312#if !defined(LWS_AMAZON_RTOS)
313/* AMAZON RTOS has its own setting via MTK_MBEDTLS_CONFIG_FILE */
314#undef MBEDTLS_CONFIG_FILE
315#define MBEDTLS_CONFIG_FILE <mbedtls/esp_config.h>
316#endif
317#endif
318
319#if defined(LWS_WITH_TLS)
320#include <mbedtls/ssl.h>
321#include <mbedtls/entropy.h>
322#include <mbedtls/ctr_drbg.h>
323#include <mbedtls/version.h>
324
325#if !defined(MBEDTLS_PRIVATE)
326#define MBEDTLS_PRIVATE(_q) _q
327#endif
328
329#if (MBEDTLS_VERSION_MAJOR == 3) && (MBEDTLS_VERSION_MINOR == 0)
330#define MBEDTLS_PRIVATE_V30_ONLY(_q) MBEDTLS_PRIVATE(_q)
331#else
332#define MBEDTLS_PRIVATE_V30_ONLY(_q) _q
333#endif
334
335#endif
336#else
337#include <openssl/ssl.h>
338#if !defined(LWS_WITH_MBEDTLS)
339#include <openssl/err.h>
340#endif
341#endif
342#endif /* not USE_WOLFSSL */
343#endif
344
345/*
346 * Helpers for pthread mutex in user code... if lws is built for
347 * multiple service threads, these resolve to pthread mutex
348 * operations. In the case LWS_MAX_SMP is 1 (the default), they
349 * are all NOPs and no pthread type or api is referenced.
350 */
351
352#if LWS_MAX_SMP > 1
353
354#include <pthread.h>
355
356#define lws_pthread_mutex(name) pthread_mutex_t name;
357
358static LWS_INLINE void
359lws_pthread_mutex_init(pthread_mutex_t *lock)
360{
361 pthread_mutex_init(lock, NULL);
362}
363
364static LWS_INLINE void
365lws_pthread_mutex_destroy(pthread_mutex_t *lock)
366{
367 pthread_mutex_destroy(lock);
368}
369
370static LWS_INLINE void
371lws_pthread_mutex_lock(pthread_mutex_t *lock)
372{
373 pthread_mutex_lock(lock);
374}
375
376static LWS_INLINE void
377lws_pthread_mutex_unlock(pthread_mutex_t *lock)
378{
379 pthread_mutex_unlock(lock);
380}
381
382#else
383#define lws_pthread_mutex(name)
384#define lws_pthread_mutex_init(_a)
385#define lws_pthread_mutex_destroy(_a)
386#define lws_pthread_mutex_lock(_a)
387#define lws_pthread_mutex_unlock(_a)
388#endif
389
390
391#define CONTEXT_PORT_NO_LISTEN -1
392#define CONTEXT_PORT_NO_LISTEN_SERVER -2
393
395
396
397#include <stddef.h>
398
399#ifndef lws_container_of
400#define lws_container_of(P,T,M) ((T *)((char *)(P) - offsetof(T, M)))
401#endif
402#define LWS_ALIGN_TO(x, bou) x += ((bou) - ((x) % (bou))) % (bou)
403
404struct lws;
405
406/* api change list for user code to test against */
407
408#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG
409
410/* the struct lws_protocols has the id field present */
411#define LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD
412
413/* you can call lws_get_peer_write_allowance */
414#define LWS_FEATURE_PROTOCOLS_HAS_PEER_WRITE_ALLOWANCE
415
416/* extra parameter introduced in 917f43ab821 */
417#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_LEN
418
419/* File operations stuff exists */
420#define LWS_FEATURE_FOPS
421
422/* Mounts have extra no_cache member */
423#define LWS_FEATURE_MOUNT_NO_CACHE
424
425
426#if defined(_WIN32)
427#if !defined(LWS_WIN32_HANDLE_TYPES)
428typedef SOCKET lws_sockfd_type;
429#if defined(__MINGW32__)
430typedef int lws_filefd_type;
431#else
432typedef HANDLE lws_filefd_type;
433#endif
434#endif
435
436
437#define lws_pollfd pollfd
438#define LWS_POLLHUP (POLLHUP)
439#define LWS_POLLIN (POLLRDNORM | POLLRDBAND)
440#define LWS_POLLOUT (POLLWRNORM)
441
442#else
443
444
445#if defined(LWS_PLAT_FREERTOS)
447#else
448typedef int lws_sockfd_type;
449typedef int lws_filefd_type;
450#endif
451
452#if defined(LWS_PLAT_OPTEE)
453#include <time.h>
454struct timeval {
455 time_t tv_sec;
456 unsigned int tv_usec;
457};
458#if defined(LWS_WITH_NETWORK)
459// #include <poll.h>
460#define lws_pollfd pollfd
461
462struct timezone;
463
464int gettimeofday(struct timeval *tv, struct timezone *tz);
465
466 /* Internet address. */
467 struct in_addr {
468 uint32_t s_addr; /* address in network byte order */
469 };
470
471typedef unsigned short sa_family_t;
472typedef unsigned short in_port_t;
473typedef uint32_t socklen_t;
474
476
477#if !defined(TEE_SE_READER_NAME_MAX)
478 struct addrinfo {
479 int ai_flags;
480 int ai_family;
481 int ai_socktype;
482 int ai_protocol;
483 socklen_t ai_addrlen;
484 struct sockaddr *ai_addr;
485 char *ai_canonname;
486 struct addrinfo *ai_next;
487 };
488#endif
489
490ssize_t recv(int sockfd, void *buf, size_t len, int flags);
491ssize_t send(int sockfd, const void *buf, size_t len, int flags);
492ssize_t read(int fd, void *buf, size_t count);
493int getsockopt(int sockfd, int level, int optname,
494 void *optval, socklen_t *optlen);
495 int setsockopt(int sockfd, int level, int optname,
496 const void *optval, socklen_t optlen);
497int connect(int sockfd, const struct sockaddr *addr,
498 socklen_t addrlen);
499
500extern int errno;
501
502uint16_t ntohs(uint16_t netshort);
503uint16_t htons(uint16_t hostshort);
504
505int bind(int sockfd, const struct sockaddr *addr,
506 socklen_t addrlen);
507
508
509#define MSG_NOSIGNAL 0x4000
510#define EAGAIN 11
511#define EINTR 4
512#define EWOULDBLOCK EAGAIN
513#define EADDRINUSE 98
514#define INADDR_ANY 0
515#define AF_INET 2
516#define SHUT_WR 1
517#define AF_UNSPEC 0
518#define PF_UNSPEC 0
519#define SOCK_STREAM 1
520#define SOCK_DGRAM 2
521# define AI_PASSIVE 0x0001
522#define IPPROTO_UDP 17
523#define SOL_SOCKET 1
524#define SO_SNDBUF 7
525#define EISCONN 106
526#define EALREADY 114
527#define EINPROGRESS 115
528int shutdown(int sockfd, int how);
529int close(int fd);
530int atoi(const char *nptr);
531long long atoll(const char *nptr);
532
533int socket(int domain, int type, int protocol);
534 int getaddrinfo(const char *node, const char *service,
535 const struct addrinfo *hints,
536 struct addrinfo **res);
537
538 void freeaddrinfo(struct addrinfo *res);
539
540#if !defined(TEE_SE_READER_NAME_MAX)
541struct lws_pollfd
542{
543 int fd; /* File descriptor to poll. */
544 short int events; /* Types of events poller cares about. */
545 short int revents; /* Types of events that actually occurred. */
546};
547#endif
548
549int poll(struct pollfd *fds, int nfds, int timeout);
550
551#define LWS_POLLHUP (0x18)
552#define LWS_POLLIN (1)
553#define LWS_POLLOUT (4)
554#else
555struct lws_pollfd;
556struct sockaddr_in;
557#endif
558#else
559#define lws_pollfd pollfd
560#define LWS_POLLHUP (POLLHUP | POLLERR)
561#define LWS_POLLIN (POLLIN)
562#define LWS_POLLOUT (POLLOUT)
563#endif
564#endif
565
566
567#if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__)
568/* ... */
569#define ssize_t SSIZE_T
570#endif
571
572#if defined(WIN32) && defined(LWS_HAVE__STAT32I64)
573#include <sys/types.h>
574#include <sys/stat.h>
575#endif
576
577#if defined(LWS_HAVE_STDINT_H)
578#include <stdint.h>
579#else
580#if defined(WIN32) || defined(_WIN32)
581/* !!! >:-[ */
582typedef __int64 int64_t;
583typedef unsigned __int64 uint64_t;
584typedef __int32 int32_t;
585typedef unsigned __int32 uint32_t;
586typedef __int16 int16_t;
587typedef unsigned __int16 uint16_t;
588typedef unsigned __int8 uint8_t;
589#else
590typedef unsigned int uint32_t;
591typedef unsigned short uint16_t;
592typedef unsigned char uint8_t;
593#endif
594#endif
595
596typedef int64_t lws_usec_t;
597typedef unsigned long long lws_filepos_t;
598typedef long long lws_fileofs_t;
600
601#define lws_concat_temp(_t, _l) (_t + sizeof(_t) - _l)
602#define lws_concat_used(_t, _l) (sizeof(_t) - _l)
603
611
612#if !defined(LWS_SIZEOFPTR)
613#define LWS_SIZEOFPTR ((int)sizeof (void *))
614#endif
615
616#if defined(__x86_64__)
617#define _LWS_PAD_SIZE 16 /* Intel recommended for best performance */
618#else
619#define _LWS_PAD_SIZE LWS_SIZEOFPTR /* Size of a pointer on the target arch */
620#endif
621#define _LWS_PAD(n) (((n) % _LWS_PAD_SIZE) ? \
622 ((n) + (_LWS_PAD_SIZE - ((n) % _LWS_PAD_SIZE))) : (n))
623/* last 2 is for lws-meta */
624#define LWS_PRE _LWS_PAD(4 + 10 + 2)
625/* used prior to 1.7 and retained for backward compatibility */
626#define LWS_SEND_BUFFER_PRE_PADDING LWS_PRE
627#define LWS_SEND_BUFFER_POST_PADDING 0
628
629
630
631struct lws_extension; /* needed even with ws exts disabled for create context */
632struct lws_token_limits;
633struct lws_protocols;
634struct lws_context;
635struct lws_tokens;
636struct lws_vhost;
637struct lws;
638
639/* Generic stateful operation return codes */
640
641typedef enum {
645 LWS_SRET_FATAL = (1 << 18),
649 LWS_SRET_YIELD = (1 << 22), /* return to the event loop and continue */
651
652typedef struct lws_fixed3232 {
653 int32_t whole; /* signed 32-bit int */
654 int32_t frac; /* signed frac proportion from 0 to (100M - 1) */
656
657#define LWS_FX_FRACTION_MSD 100000000
658#define lws_neg(a) (a->whole < 0 || a->frac < 0)
659#define lws_fx_set(a, x, y) { a.whole = x; a.frac = x < 0 ? -y : y; }
660#define lws_fix64(a) (((int64_t)a->whole << 32) + \
661 (((1ll << 32) * (a->frac < 0 ? -a->frac : a->frac)) / LWS_FX_FRACTION_MSD))
662#define lws_fix64_abs(a) \
663 ((((int64_t)(a->whole < 0 ? (-a->whole) : a->whole) << 32) + \
664 (((1ll << 32) * (a->frac < 0 ? -a->frac : a->frac)) / LWS_FX_FRACTION_MSD)))
665
666#define lws_fix3232(a, a64) { a->whole = (int32_t)(a64 >> 32); \
667 a->frac = (int32_t)((100000000 * (a64 & 0xffffffff)) >> 32); }
668
670lws_fx_add(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
671
673lws_fx_sub(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
674
676lws_fx_mul(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
677
679lws_fx_div(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
680
683
685lws_fx_comp(const lws_fx_t *a, const lws_fx_t *b);
686
689
692
693LWS_VISIBLE LWS_EXTERN const char *
694lws_fx_string(const lws_fx_t *a, char *buf, size_t size);
695
698
703#if defined(LWS_WITH_SYS_SMD)
705#endif
708#if defined(LWS_WITH_NETWORK)
712#endif
713
717
718#if defined(LWS_WITH_NETWORK)
722#endif
723
725
727
728#if defined(LWS_WITH_NETWORK)
729#if defined(LWS_WITH_CONMON)
731#endif
732
733#if defined(LWS_ROLE_MQTT)
735#endif
739#endif
743#if defined(LWS_WITH_NETWORK)
747#endif
751#if defined(LWS_WITH_NETWORK)
753#endif
754#if defined(LWS_WITH_FILE_OPS)
756#endif
758
774
776
777#if defined(LWS_WITH_TLS)
778
780
781#if defined(LWS_WITH_MBEDTLS)
782#include <mbedtls/md5.h>
783#include <mbedtls/sha1.h>
784#include <mbedtls/sha256.h>
785#include <mbedtls/sha512.h>
786#endif
787
792
797
798#endif
799
800#if defined(LWS_WITH_NETWORK)
802#endif
805#if defined(LWS_ESP_PLATFORM)
807#endif
824#if defined(LWS_WITH_NETWORK)
826#endif
827
829
830#ifdef __cplusplus
831}
832#endif
833
834#endif
#define lws_pthread_mutex_lock(_a)
uint32_t lws_fop_flags_t
unsigned short uint16_t
#define lws_pollfd
unsigned int uint32_t
#define lws_pthread_mutex_init(_a)
long long lws_fileofs_t
#define LWS_INLINE
LWS_VISIBLE LWS_EXTERN const lws_fx_t * lws_fx_sub(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b)
#define lws_pthread_mutex_destroy(_a)
LWS_VISIBLE LWS_EXTERN int lws_fx_rounddown(const lws_fx_t *a)
#define LWS_EXTERN
LWS_VISIBLE LWS_EXTERN const char * lws_fx_string(const lws_fx_t *a, char *buf, size_t size)
LWS_VISIBLE LWS_EXTERN const lws_fx_t * lws_fx_add(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b)
LWS_VISIBLE LWS_EXTERN const lws_fx_t * lws_fx_sqrt(lws_fx_t *r, const lws_fx_t *a)
LWS_VISIBLE LWS_EXTERN const lws_fx_t * lws_fx_div(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b)
int64_t lws_usec_t
unsigned char uint8_t
struct lws_fixed3232 lws_fx_t
lws_stateful_ret_t
@ LWS_SRET_WANT_OUTPUT
@ LWS_SRET_NO_FURTHER_OUT
@ LWS_SRET_FATAL
@ LWS_SRET_OK
@ LWS_SRET_NO_FURTHER_IN
@ LWS_SRET_YIELD
@ LWS_SRET_WANT_INPUT
@ LWS_SRET_AWAIT_RETRY
struct lws_context * lws_ctx_t
int lws_sockfd_type
#define lws_pthread_mutex_unlock(_a)
#define LWS_VISIBLE
LWS_VISIBLE LWS_EXTERN const lws_fx_t * lws_fx_mul(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b)
LWS_VISIBLE LWS_EXTERN int lws_fx_roundup(const lws_fx_t *a)
unsigned long long lws_intptr_t
unsigned long long lws_filepos_t
lws_sockfd_type fd
LWS_VISIBLE LWS_EXTERN int lws_fx_comp(const lws_fx_t *a, const lws_fx_t *b)
int lws_filefd_type