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#if defined(LWS_WITH_SCHANNEL)
280#include <wincrypt.h>
281typedef struct lws_tls_schannel_conn SSL;
282typedef struct lws_tls_schannel_ctx SSL_CTX;
283typedef struct lws_tls_schannel_bio BIO;
284typedef struct lws_tls_schannel_x509 X509;
285
286/*
287 * These are needed for lws-gen* and other headers that assume OpenSSL types
288 * when LWS_WITH_TLS is defined. SChannel implementation of these APIs
289 * will need to map these to Windows CryptoAPI/CNG types internally,
290 * or we can just treat them as opaque handles here.
291 */
292typedef void EVP_PKEY_CTX;
293typedef void EVP_MD;
294typedef void EVP_MD_CTX;
295typedef void HMAC_CTX;
296typedef void EVP_CIPHER_CTX;
297typedef void EVP_CIPHER;
298typedef void ENGINE;
299typedef void RSA;
300typedef void BIGNUM;
301typedef void EC_KEY;
302typedef void EC_POINT;
303typedef void EC_GROUP;
304typedef void X509_STORE_CTX;
305typedef void X509_VERIFY_PARAM;
306
307#else
308
309#ifdef USE_WOLFSSL
310#ifdef USE_OLD_CYASSL
311#ifdef _WIN32
312/*
313 * Include user-controlled settings for windows from
314 * <wolfssl-root>/IDE/WIN/user_settings.h
315 */
316#include <IDE/WIN/user_settings.h>
317#include <cyassl/ctaocrypt/settings.h>
318#else
319#include <cyassl/options.h>
320#endif
321#include <cyassl/openssl/ssl.h>
322#include <cyassl/error-ssl.h>
323
324#else
325#ifdef _WIN32
326/*
327 * Include user-controlled settings for windows from
328 * <wolfssl-root>/IDE/WIN/user_settings.h
329 */
330#include <IDE/WIN/user_settings.h>
331#include <wolfssl/wolfcrypt/settings.h>
332#else
333#include <wolfssl/options.h>
334#endif
335#include <wolfssl/openssl/ssl.h>
336#include <wolfssl/error-ssl.h>
337#endif /* not USE_OLD_CYASSL */
338#else
339#if defined(LWS_WITH_MBEDTLS)
340#if defined(LWS_PLAT_FREERTOS)
341/* this filepath is passed to us but without quotes or <> */
342#if !defined(LWS_AMAZON_RTOS)
343/* AMAZON RTOS has its own setting via MTK_MBEDTLS_CONFIG_FILE */
344#undef MBEDTLS_CONFIG_FILE
345#define MBEDTLS_CONFIG_FILE <mbedtls/esp_config.h>
346#endif
347#endif
348
349#if defined(LWS_WITH_TLS)
350#include <mbedtls/ssl.h>
351#include <mbedtls/entropy.h>
352#include <mbedtls/ctr_drbg.h>
353#include <mbedtls/version.h>
354
355#if !defined(MBEDTLS_PRIVATE)
356#define MBEDTLS_PRIVATE(_q) _q
357#endif
358
359#if (MBEDTLS_VERSION_MAJOR == 3) && (MBEDTLS_VERSION_MINOR == 0)
360#define MBEDTLS_PRIVATE_V30_ONLY(_q) MBEDTLS_PRIVATE(_q)
361#else
362#define MBEDTLS_PRIVATE_V30_ONLY(_q) _q
363#endif
364
365#endif
366#else
367#include <openssl/ssl.h>
368#if !defined(LWS_WITH_MBEDTLS)
369#include <openssl/err.h>
370#endif
371#endif
372#endif /* not USE_WOLFSSL */
373#endif /* not SCHANNEL */
374#endif
375
376/*
377 * Helpers for pthread mutex in user code... if lws is built for
378 * multiple service threads, these resolve to pthread mutex
379 * operations. In the case LWS_MAX_SMP is 1 (the default), they
380 * are all NOPs and no pthread type or api is referenced.
381 */
382
383#if LWS_MAX_SMP > 1
384
385#include <pthread.h>
386
387#define lws_pthread_mutex(name) pthread_mutex_t name;
388
389static LWS_INLINE void
390lws_pthread_mutex_init(pthread_mutex_t *lock)
391{
392 pthread_mutex_init(lock, NULL);
393}
394
395static LWS_INLINE void
396lws_pthread_mutex_destroy(pthread_mutex_t *lock)
397{
398 pthread_mutex_destroy(lock);
399}
400
401static LWS_INLINE void
402lws_pthread_mutex_lock(pthread_mutex_t *lock)
403{
404 pthread_mutex_lock(lock);
405}
406
407static LWS_INLINE void
408lws_pthread_mutex_unlock(pthread_mutex_t *lock)
409{
410 pthread_mutex_unlock(lock);
411}
412
413#else
414#define lws_pthread_mutex(name)
415#define lws_pthread_mutex_init(_a)
416#define lws_pthread_mutex_destroy(_a)
417#define lws_pthread_mutex_lock(_a)
418#define lws_pthread_mutex_unlock(_a)
419#endif
420
421
422#define CONTEXT_PORT_NO_LISTEN -1
423#define CONTEXT_PORT_NO_LISTEN_SERVER -2
424
426
427
428#include <stddef.h>
429
430#ifndef lws_container_of
431#define lws_container_of(P,T,M) ((T *)((char *)(P) - offsetof(T, M)))
432#endif
433#define LWS_ALIGN_TO(x, bou) x += ((bou) - ((x) % (bou))) % (bou)
434
435struct lws;
436
437/* api change list for user code to test against */
438
439#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG
440
441/* the struct lws_protocols has the id field present */
442#define LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD
443
444/* you can call lws_get_peer_write_allowance */
445#define LWS_FEATURE_PROTOCOLS_HAS_PEER_WRITE_ALLOWANCE
446
447/* extra parameter introduced in 917f43ab821 */
448#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_LEN
449
450/* File operations stuff exists */
451#define LWS_FEATURE_FOPS
452
453/* Mounts have extra no_cache member */
454#define LWS_FEATURE_MOUNT_NO_CACHE
455
456
457#if defined(_WIN32)
458#if !defined(LWS_WIN32_HANDLE_TYPES)
459typedef SOCKET lws_sockfd_type;
460#if defined(__MINGW32__)
461typedef int lws_filefd_type;
462#else
463typedef HANDLE lws_filefd_type;
464#endif
465#endif
466
467
468#define lws_pollfd pollfd
469#define LWS_POLLHUP (POLLHUP)
470#define LWS_POLLIN (POLLRDNORM | POLLRDBAND)
471#define LWS_POLLOUT (POLLWRNORM)
472
473#else
474
475
476#if defined(LWS_PLAT_FREERTOS)
478#else
479typedef int lws_sockfd_type;
480typedef int lws_filefd_type;
481#endif
482
483#if defined(LWS_PLAT_OPTEE)
484#include <time.h>
485struct timeval {
486 time_t tv_sec;
487 unsigned int tv_usec;
488};
489#if defined(LWS_WITH_NETWORK)
490// #include <poll.h>
491#define lws_pollfd pollfd
492
493struct timezone;
494
495int gettimeofday(struct timeval *tv, struct timezone *tz);
496
497 /* Internet address. */
498 struct in_addr {
499 uint32_t s_addr; /* address in network byte order */
500 };
501
502typedef unsigned short sa_family_t;
503typedef unsigned short in_port_t;
504typedef uint32_t socklen_t;
505
507
508#if !defined(TEE_SE_READER_NAME_MAX)
509 struct addrinfo {
510 int ai_flags;
511 int ai_family;
512 int ai_socktype;
513 int ai_protocol;
514 socklen_t ai_addrlen;
515 struct sockaddr *ai_addr;
516 char *ai_canonname;
517 struct addrinfo *ai_next;
518 };
519#endif
520
521ssize_t recv(int sockfd, void *buf, size_t len, int flags);
522ssize_t send(int sockfd, const void *buf, size_t len, int flags);
523ssize_t read(int fd, void *buf, size_t count);
524int getsockopt(int sockfd, int level, int optname,
525 void *optval, socklen_t *optlen);
526 int setsockopt(int sockfd, int level, int optname,
527 const void *optval, socklen_t optlen);
528int connect(int sockfd, const struct sockaddr *addr,
529 socklen_t addrlen);
530
531extern int errno;
532
533uint16_t ntohs(uint16_t netshort);
534uint16_t htons(uint16_t hostshort);
535
536int bind(int sockfd, const struct sockaddr *addr,
537 socklen_t addrlen);
538
539
540#define MSG_NOSIGNAL 0x4000
541#define EAGAIN 11
542#define EINTR 4
543#define EWOULDBLOCK EAGAIN
544#define EADDRINUSE 98
545#define INADDR_ANY 0
546#define AF_INET 2
547#define SHUT_WR 1
548#define AF_UNSPEC 0
549#define PF_UNSPEC 0
550#define SOCK_STREAM 1
551#define SOCK_DGRAM 2
552# define AI_PASSIVE 0x0001
553#define IPPROTO_UDP 17
554#define SOL_SOCKET 1
555#define SO_SNDBUF 7
556#define EISCONN 106
557#define EALREADY 114
558#define EINPROGRESS 115
559int shutdown(int sockfd, int how);
560int close(int fd);
561int atoi(const char *nptr);
562long long atoll(const char *nptr);
563
564int socket(int domain, int type, int protocol);
565 int getaddrinfo(const char *node, const char *service,
566 const struct addrinfo *hints,
567 struct addrinfo **res);
568
569 void freeaddrinfo(struct addrinfo *res);
570
571#if !defined(TEE_SE_READER_NAME_MAX)
572struct lws_pollfd
573{
574 int fd; /* File descriptor to poll. */
575 short int events; /* Types of events poller cares about. */
576 short int revents; /* Types of events that actually occurred. */
577};
578#endif
579
580int poll(struct pollfd *fds, int nfds, int timeout);
581
582#define LWS_POLLHUP (0x18)
583#define LWS_POLLIN (1)
584#define LWS_POLLOUT (4)
585#else
586struct lws_pollfd;
587struct sockaddr_in;
588#endif
589#else
590#define lws_pollfd pollfd
591#define LWS_POLLHUP (POLLHUP | POLLERR)
592#define LWS_POLLIN (POLLIN)
593#define LWS_POLLOUT (POLLOUT)
594#endif
595#endif
596
597
598#if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__)
599/* ... */
600#define ssize_t SSIZE_T
601#endif
602
603#if defined(WIN32) && defined(LWS_HAVE__STAT32I64)
604#include <sys/types.h>
605#include <sys/stat.h>
606#endif
607
608#if defined(LWS_HAVE_STDINT_H)
609#include <stdint.h>
610#else
611#if defined(WIN32) || defined(_WIN32)
612/* !!! >:-[ */
613typedef __int64 int64_t;
614typedef unsigned __int64 uint64_t;
615typedef __int32 int32_t;
616typedef unsigned __int32 uint32_t;
617typedef __int16 int16_t;
618typedef unsigned __int16 uint16_t;
619typedef unsigned __int8 uint8_t;
620#else
621typedef unsigned int uint32_t;
622typedef unsigned short uint16_t;
623typedef unsigned char uint8_t;
624#endif
625#endif
626
627typedef int64_t lws_usec_t;
628typedef unsigned long long lws_filepos_t;
629typedef long long lws_fileofs_t;
631
632#define lws_concat_temp(_t, _l) (_t + sizeof(_t) - _l)
633#define lws_concat_used(_t, _l) (sizeof(_t) - _l)
634
642
643#if !defined(LWS_SIZEOFPTR)
644#define LWS_SIZEOFPTR ((int)sizeof (void *))
645#endif
646
647#if defined(__x86_64__)
648#define _LWS_PAD_SIZE 16 /* Intel recommended for best performance */
649#else
650#define _LWS_PAD_SIZE LWS_SIZEOFPTR /* Size of a pointer on the target arch */
651#endif
652#define _LWS_PAD(n) (((n) % _LWS_PAD_SIZE) ? \
653 ((n) + (_LWS_PAD_SIZE - ((n) % _LWS_PAD_SIZE))) : (n))
654/* last 2 is for lws-meta */
655#define LWS_PRE _LWS_PAD(4 + 10 + 2)
656/* used prior to 1.7 and retained for backward compatibility */
657#define LWS_SEND_BUFFER_PRE_PADDING LWS_PRE
658#define LWS_SEND_BUFFER_POST_PADDING 0
659
660
661
662struct lws_extension; /* needed even with ws exts disabled for create context */
663struct lws_token_limits;
664struct lws_protocols;
665struct lws_context;
666struct lws_tokens;
667struct lws_vhost;
668struct lws;
669
670/* Generic stateful operation return codes */
671
672typedef enum {
676 LWS_SRET_FATAL = (1 << 18),
680 LWS_SRET_YIELD = (1 << 22), /* return to the event loop and continue */
682
683typedef struct lws_fixed3232 {
684 int32_t whole; /* signed 32-bit int */
685 int32_t frac; /* signed frac proportion from 0 to (100M - 1) */
687
688#define LWS_FX_FRACTION_MSD 100000000
689#define lws_neg(a) (a->whole < 0 || a->frac < 0)
690#define lws_fx_set(a, x, y) { a.whole = x; a.frac = x < 0 ? -y : y; }
691#define lws_fix64(a) (((int64_t)a->whole << 32) + \
692 (((1ll << 32) * (a->frac < 0 ? -a->frac : a->frac)) / LWS_FX_FRACTION_MSD))
693#define lws_fix64_abs(a) \
694 ((((int64_t)(a->whole < 0 ? (-a->whole) : a->whole) << 32) + \
695 (((1ll << 32) * (a->frac < 0 ? -a->frac : a->frac)) / LWS_FX_FRACTION_MSD)))
696
697#define lws_fix3232(a, a64) { a->whole = (int32_t)(a64 >> 32); \
698 a->frac = (int32_t)((100000000 * (a64 & 0xffffffff)) >> 32); }
699
701lws_fx_add(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
702
704lws_fx_sub(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
705
707lws_fx_mul(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
708
710lws_fx_div(lws_fx_t *r, const lws_fx_t *a, const lws_fx_t *b);
711
714
716lws_fx_comp(const lws_fx_t *a, const lws_fx_t *b);
717
720
723
724LWS_VISIBLE LWS_EXTERN const char *
725lws_fx_string(const lws_fx_t *a, char *buf, size_t size);
726
729
734#if defined(LWS_WITH_SYS_SMD)
736#endif
739#if defined(LWS_WITH_NETWORK)
743#endif
744
748
749#if defined(LWS_WITH_NETWORK)
753#endif
754
756
758
759#if defined(LWS_WITH_NETWORK)
760#if defined(LWS_WITH_CONMON)
762#endif
763
764#if defined(LWS_ROLE_MQTT)
766#endif
770#endif
774#if defined(LWS_WITH_NETWORK)
778#endif
782#if defined(LWS_WITH_NETWORK)
784#endif
785#if defined(LWS_WITH_FILE_OPS)
787#endif
789
805
807
808#if defined(LWS_WITH_TLS)
809
811
812#if defined(LWS_WITH_MBEDTLS)
813#include <mbedtls/md5.h>
814#include <mbedtls/sha1.h>
815#include <mbedtls/sha256.h>
816#include <mbedtls/sha512.h>
817#endif
818
823
828
829#endif
830
831#if defined(LWS_WITH_NETWORK)
833#endif
836#if defined(LWS_ESP_PLATFORM)
838#endif
855#if defined(LWS_WITH_NETWORK)
857#endif
858
860
861#ifdef __cplusplus
862}
863#endif
864
865#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