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