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