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