MIDAS
Loading...
Searching...
No Matches
mongoose616.h File Reference
#include <platform_custom.h>
#include <time.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
Include dependency graph for mongoose616.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cs_md5_ctx
 
struct  cs_sha1_ctx
 
struct  mg_str
 
struct  mbuf
 
struct  cs_base64_ctx
 
struct  mg_iface
 
struct  mg_iface_vtable
 
union  socket_address
 
struct  mg_mgr
 
struct  mg_connection
 
struct  mg_mgr_init_opts
 
struct  mg_add_sock_opts
 
struct  mg_bind_opts
 
struct  mg_connect_opts
 
struct  http_message
 
struct  websocket_message
 
struct  mg_http_multipart_part
 
struct  mg_ssi_call_ctx
 
struct  mg_http_endpoint_opts
 
struct  mg_mqtt_message
 
struct  mg_mqtt_topic_expression
 
struct  mg_send_mqtt_handshake_opts
 
struct  mg_mqtt_proto_data
 
struct  mg_dns_resource_record
 
struct  mg_dns_message
 
struct  mg_resolve_async_opts
 

Macros

#define CS_MONGOOSE_SRC_COMMON_H_
 
#define MG_VERSION   "6.16"
 
#define CS_COMMON_PLATFORM_H_
 
#define CS_P_CUSTOM   0
 
#define CS_P_UNIX   1
 
#define CS_P_WINDOWS   2
 
#define CS_P_ESP32   15
 
#define CS_P_ESP8266   3
 
#define CS_P_CC3100   6
 
#define CS_P_CC3200   4
 
#define CS_P_CC3220   17
 
#define CS_P_MSP432   5
 
#define CS_P_TM4C129   14
 
#define CS_P_MBED   7
 
#define CS_P_WINCE   8
 
#define CS_P_NXP_LPC   13
 
#define CS_P_NXP_KINETIS   9
 
#define CS_P_NRF51   12
 
#define CS_P_NRF52   10
 
#define CS_P_PIC32   11
 
#define CS_P_RS14100   18
 
#define CS_P_STM32   16
 
#define MG_NET_IF_SOCKET   1
 
#define MG_NET_IF_SIMPLELINK   2
 
#define MG_NET_IF_LWIP_LOW_LEVEL   3
 
#define MG_NET_IF_PIC32   4
 
#define MG_NET_IF_NULL   5
 
#define MG_SSL_IF_OPENSSL   1
 
#define MG_SSL_IF_MBEDTLS   2
 
#define MG_SSL_IF_SIMPLELINK   3
 
#define PRINTF_LIKE(f, a)
 
#define WEAK
 
#define NORETURN
 
#define NOINLINE
 
#define WARN_UNUSED_RESULT
 
#define NOINSTR
 
#define DO_NOT_WARN_UNUSED
 
#define ARRAY_SIZE(array)   (sizeof(array) / sizeof(array[0]))
 
#define CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_CC3220_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_MBED_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_
 
#define CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_STM32_H_
 
#define CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_
 
#define MG_LWIP   0
 
#define CS_COMMON_MD5_H_
 
#define CS_DISABLE_MD5   0
 
#define CS_COMMON_SHA1_H_
 
#define CS_DISABLE_SHA1   0
 
#define CS_COMMON_CS_TIME_H_
 
#define CS_COMMON_MG_STR_H_
 
#define MG_MK_STR(str_literal)    { str_literal, sizeof(str_literal) - 1 }
 
#define MG_MK_STR_N(str_literal, len)    { str_literal, len }
 
#define MG_NULL_STR    { NULL, 0 }
 
#define CS_COMMON_MBUF_H_
 
#define MBUF_SIZE_MULTIPLIER   1.5
 
#define MBUF_SIZE_MAX_HEADROOM   1024
 
#define CS_COMMON_CS_BASE64_H_
 
#define DISABLE_BASE64   0
 
#define CS_COMMON_STR_UTIL_H_
 
#define CS_ENABLE_STRDUP   0
 
#define CS_ENABLE_TO64   0
 
#define CS_STRINGIFY_LIT(...)   #__VA_ARGS__
 
#define CS_STRINGIFY_MACRO(x)   CS_STRINGIFY_LIT(x)
 
#define _SYS_QUEUE_H_
 
#define QMD_TRACE_ELEM(elem)
 
#define QMD_TRACE_HEAD(head)
 
#define QMD_SAVELINK(name, link)
 
#define TRACEBUF
 
#define TRACEBUF_INITIALIZER
 
#define TRASHIT(x)
 
#define QUEUE_TYPEOF(type)   struct type
 
#define SLIST_HEAD(name, type)
 
#define SLIST_CLASS_HEAD(name, type)
 
#define SLIST_HEAD_INITIALIZER(head)    { NULL }
 
#define SLIST_ENTRY(type)
 
#define SLIST_CLASS_ENTRY(type)
 
#define SLIST_EMPTY(head)   ((head)->slh_first == NULL)
 
#define SLIST_FIRST(head)   ((head)->slh_first)
 
#define SLIST_FOREACH(var, head, field)
 
#define SLIST_FOREACH_FROM(var, head, field)
 
#define SLIST_FOREACH_SAFE(var, head, field, tvar)
 
#define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define SLIST_FOREACH_PREVPTR(var, varp, head, field)
 
#define SLIST_INIT(head)
 
#define SLIST_INSERT_AFTER(slistelm, elm, field)
 
#define SLIST_INSERT_HEAD(head, elm, field)
 
#define SLIST_NEXT(elm, field)   ((elm)->field.sle_next)
 
#define SLIST_REMOVE(head, elm, type, field)
 
#define SLIST_REMOVE_AFTER(elm, field)
 
#define SLIST_REMOVE_HEAD(head, field)
 
#define SLIST_SWAP(head1, head2, type)
 
#define STAILQ_HEAD(name, type)
 
#define STAILQ_CLASS_HEAD(name, type)
 
#define STAILQ_HEAD_INITIALIZER(head)    { NULL, &(head).stqh_first }
 
#define STAILQ_ENTRY(type)
 
#define STAILQ_CLASS_ENTRY(type)
 
#define STAILQ_CONCAT(head1, head2)
 
#define STAILQ_EMPTY(head)   ((head)->stqh_first == NULL)
 
#define STAILQ_FIRST(head)   ((head)->stqh_first)
 
#define STAILQ_FOREACH(var, head, field)
 
#define STAILQ_FOREACH_FROM(var, head, field)
 
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
 
#define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define STAILQ_INIT(head)
 
#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)
 
#define STAILQ_INSERT_HEAD(head, elm, field)
 
#define STAILQ_INSERT_TAIL(head, elm, field)
 
#define STAILQ_LAST(head, type, field)
 
#define STAILQ_NEXT(elm, field)   ((elm)->field.stqe_next)
 
#define STAILQ_REMOVE(head, elm, type, field)
 
#define STAILQ_REMOVE_AFTER(head, elm, field)
 
#define STAILQ_REMOVE_HEAD(head, field)
 
#define STAILQ_SWAP(head1, head2, type)
 
#define LIST_HEAD(name, type)
 
#define LIST_CLASS_HEAD(name, type)
 
#define LIST_HEAD_INITIALIZER(head)    { NULL }
 
#define LIST_ENTRY(type)
 
#define LIST_CLASS_ENTRY(type)
 
#define QMD_LIST_CHECK_HEAD(head, field)
 
#define QMD_LIST_CHECK_NEXT(elm, field)
 
#define QMD_LIST_CHECK_PREV(elm, field)
 
#define LIST_EMPTY(head)   ((head)->lh_first == NULL)
 
#define LIST_FIRST(head)   ((head)->lh_first)
 
#define LIST_FOREACH(var, head, field)
 
#define LIST_FOREACH_FROM(var, head, field)
 
#define LIST_FOREACH_SAFE(var, head, field, tvar)
 
#define LIST_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define LIST_INIT(head)
 
#define LIST_INSERT_AFTER(listelm, elm, field)
 
#define LIST_INSERT_BEFORE(listelm, elm, field)
 
#define LIST_INSERT_HEAD(head, elm, field)
 
#define LIST_NEXT(elm, field)   ((elm)->field.le_next)
 
#define LIST_PREV(elm, head, type, field)
 
#define LIST_REMOVE(elm, field)
 
#define LIST_SWAP(head1, head2, type, field)
 
#define TAILQ_HEAD(name, type)
 
#define TAILQ_CLASS_HEAD(name, type)
 
#define TAILQ_HEAD_INITIALIZER(head)    { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }
 
#define TAILQ_ENTRY(type)
 
#define TAILQ_CLASS_ENTRY(type)
 
#define QMD_TAILQ_CHECK_HEAD(head, field)
 
#define QMD_TAILQ_CHECK_TAIL(head, headname)
 
#define QMD_TAILQ_CHECK_NEXT(elm, field)
 
#define QMD_TAILQ_CHECK_PREV(elm, field)
 
#define TAILQ_CONCAT(head1, head2, field)
 
#define TAILQ_EMPTY(head)   ((head)->tqh_first == NULL)
 
#define TAILQ_FIRST(head)   ((head)->tqh_first)
 
#define TAILQ_FOREACH(var, head, field)
 
#define TAILQ_FOREACH_FROM(var, head, field)
 
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
 
#define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
 
#define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field)
 
#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)
 
#define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar)
 
#define TAILQ_INIT(head)
 
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
 
#define TAILQ_INSERT_BEFORE(listelm, elm, field)
 
#define TAILQ_INSERT_HEAD(head, elm, field)
 
#define TAILQ_INSERT_TAIL(head, elm, field)
 
#define TAILQ_LAST(head, headname)    (*(((struct headname *)((head)->tqh_last))->tqh_last))
 
#define TAILQ_NEXT(elm, field)   ((elm)->field.tqe_next)
 
#define TAILQ_PREV(elm, headname, field)    (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
 
#define TAILQ_REMOVE(head, elm, field)
 
#define TAILQ_SWAP(head1, head2, type, field)
 
#define CS_MONGOOSE_SRC_FEATURES_H_
 
#define MG_DISABLE_HTTP_DIGEST_AUTH   0
 
#define MG_DISABLE_HTTP_KEEP_ALIVE   0
 
#define MG_DISABLE_PFS   0
 
#define MG_DISABLE_WS_RANDOM_MASK   0
 
#define MG_ENABLE_ASYNC_RESOLVER   1
 
#define MG_ENABLE_BROADCAST   0
 
#define MG_ENABLE_COAP   0
 
#define MG_ENABLE_DEBUG   0
 
#define MG_ENABLE_DIRECTORY_LISTING   0
 
#define MG_ENABLE_DNS   1
 
#define MG_ENABLE_DNS_SERVER   0
 
#define MG_ENABLE_FAKE_DAVLOCK   0
 
#define MG_ENABLE_FILESYSTEM   0
 
#define MG_ENABLE_GETADDRINFO   0
 
#define MG_ENABLE_HEXDUMP   CS_ENABLE_STDIO
 
#define MG_ENABLE_HTTP   1
 
#define MG_ENABLE_HTTP_CGI   0
 
#define MG_ENABLE_HTTP_SSI   MG_ENABLE_FILESYSTEM
 
#define MG_ENABLE_HTTP_SSI_EXEC   0
 
#define MG_ENABLE_HTTP_STREAMING_MULTIPART   0
 
#define MG_ENABLE_HTTP_WEBDAV   0
 
#define MG_ENABLE_HTTP_WEBSOCKET   MG_ENABLE_HTTP
 
#define MG_ENABLE_IPV6   0
 
#define MG_ENABLE_MQTT   1
 
#define MG_ENABLE_SOCKS   0
 
#define MG_ENABLE_MQTT_BROKER   0
 
#define MG_ENABLE_SSL   0
 
#define MG_ENABLE_SYNC_RESOLVER   0
 
#define MG_ENABLE_STDIO   CS_ENABLE_STDIO
 
#define MG_NET_IF   MG_NET_IF_SOCKET
 
#define MG_SSL_IF   MG_SSL_IF_OPENSSL
 
#define MG_ENABLE_THREADS   0
 
#define MG_ENABLE_HTTP_URL_REWRITES    (CS_PLATFORM == CS_P_WINDOWS || CS_PLATFORM == CS_P_UNIX)
 
#define MG_ENABLE_SNTP   0
 
#define MG_ENABLE_EXTRA_ERRORS_DESC   0
 
#define MG_ENABLE_CALLBACK_USERDATA   0
 
#define MG_UD_ARG(ud)
 
#define MG_CB(cb, ud)   cb
 
#define CS_MONGOOSE_SRC_NET_IF_H_
 
#define MG_MAIN_IFACE   0
 
#define CS_MONGOOSE_SRC_SSL_IF_H_
 
#define CS_MONGOOSE_SRC_NET_H_
 
#define MG_VPRINTF_BUFFER_SIZE   100
 
#define MG_RECV_FUNC(s, b, l, f)   recv(s, b, l, f)
 
#define MG_SEND_FUNC(s, b, l, f)   send(s, b, l, f)
 
#define MG_EV_POLL   0 /* Sent to each connection on each mg_mgr_poll() call */
 
#define MG_EV_ACCEPT   1 /* New connection accepted. union socket_address * */
 
#define MG_EV_CONNECT   2 /* connect() succeeded or failed. int * */
 
#define MG_EV_RECV   3 /* Data has been received. int *num_bytes */
 
#define MG_EV_SEND   4 /* Data has been written to a socket. int *num_bytes */
 
#define MG_EV_CLOSE   5 /* Connection is closed. NULL */
 
#define MG_EV_TIMER   6 /* now >= conn->ev_timer_time. double * */
 
#define MG_F_LISTENING   (1 << 0) /* This connection is listening */
 
#define MG_F_UDP   (1 << 1) /* This connection is UDP */
 
#define MG_F_RESOLVING   (1 << 2) /* Waiting for async resolver */
 
#define MG_F_CONNECTING   (1 << 3) /* connect() call in progress */
 
#define MG_F_SSL   (1 << 4) /* SSL is enabled on the connection */
 
#define MG_F_SSL_HANDSHAKE_DONE   (1 << 5) /* SSL hanshake has completed */
 
#define MG_F_WANT_READ   (1 << 6) /* SSL specific */
 
#define MG_F_WANT_WRITE   (1 << 7) /* SSL specific */
 
#define MG_F_IS_WEBSOCKET   (1 << 8) /* Websocket specific */
 
#define MG_F_RECV_AND_CLOSE   (1 << 9) /* Drain rx and close the connection. */
 
#define MG_F_SEND_AND_CLOSE   (1 << 10) /* Push remaining data and close */
 
#define MG_F_CLOSE_IMMEDIATELY   (1 << 11) /* Disconnect */
 
#define MG_F_WEBSOCKET_NO_DEFRAG   (1 << 12) /* Websocket specific */
 
#define MG_F_DELETE_CHUNK   (1 << 13) /* HTTP specific */
 
#define MG_F_ENABLE_BROADCAST   (1 << 14) /* Allow broadcast address usage */
 
#define MG_F_USER_1   (1 << 20) /* Flags left for application */
 
#define MG_F_USER_2   (1 << 21)
 
#define MG_F_USER_3   (1 << 22)
 
#define MG_F_USER_4   (1 << 23)
 
#define MG_F_USER_5   (1 << 24)
 
#define MG_F_USER_6   (1 << 25)
 
#define CS_MONGOOSE_SRC_URI_H_
 
#define CS_MONGOOSE_SRC_UTIL_H_
 
#define MG_MAX_PATH   256
 
#define MG_SOCK_STRINGIFY_IP   1
 
#define MG_SOCK_STRINGIFY_PORT   2
 
#define MG_SOCK_STRINGIFY_REMOTE   4
 
#define MG_URL_ENCODE_F_SPACE_AS_PLUS   (1 << 0)
 
#define MG_URL_ENCODE_F_UPPERCASE_HEX   (1 << 1)
 
#define CS_MONGOOSE_SRC_HTTP_H_
 
#define MG_MAX_HTTP_HEADERS   20
 
#define MG_MAX_HTTP_REQUEST_SIZE   1024
 
#define MG_MAX_HTTP_SEND_MBUF   1024
 
#define MG_CGI_ENVIRONMENT_SIZE   8192
 
#define MG_EV_HTTP_REQUEST   100 /* struct http_message * */
 
#define MG_EV_HTTP_REPLY   101 /* struct http_message * */
 
#define MG_EV_HTTP_CHUNK   102 /* struct http_message * */
 
#define MG_EV_SSI_CALL   105 /* char * */
 
#define MG_EV_SSI_CALL_CTX   106 /* struct mg_ssi_call_ctx * */
 
#define MG_EV_WEBSOCKET_HANDSHAKE_REQUEST   111 /* struct http_message * */
 
#define MG_EV_WEBSOCKET_HANDSHAKE_DONE   112 /* struct http_message * */
 
#define MG_EV_WEBSOCKET_FRAME   113 /* struct websocket_message * */
 
#define MG_EV_WEBSOCKET_CONTROL_FRAME   114 /* struct websocket_message * */
 
#define WEBSOCKET_OP_CONTINUE   0
 
#define WEBSOCKET_OP_TEXT   1
 
#define WEBSOCKET_OP_BINARY   2
 
#define WEBSOCKET_OP_CLOSE   8
 
#define WEBSOCKET_OP_PING   9
 
#define WEBSOCKET_OP_PONG   10
 
#define WEBSOCKET_DONT_FIN   0x100
 
#define MG_AUTH_FLAG_IS_DIRECTORY   (1 << 0)
 
#define MG_AUTH_FLAG_IS_GLOBAL_PASS_FILE   (1 << 1)
 
#define MG_AUTH_FLAG_ALLOW_MISSING_FILE   (1 << 2)
 
#define CS_MONGOOSE_SRC_HTTP_SERVER_H_
 
#define CS_MONGOOSE_SRC_HTTP_CLIENT_H_
 
#define CS_MONGOOSE_SRC_MQTT_H_
 
#define MG_MQTT_CMD_CONNECT   1
 
#define MG_MQTT_CMD_CONNACK   2
 
#define MG_MQTT_CMD_PUBLISH   3
 
#define MG_MQTT_CMD_PUBACK   4
 
#define MG_MQTT_CMD_PUBREC   5
 
#define MG_MQTT_CMD_PUBREL   6
 
#define MG_MQTT_CMD_PUBCOMP   7
 
#define MG_MQTT_CMD_SUBSCRIBE   8
 
#define MG_MQTT_CMD_SUBACK   9
 
#define MG_MQTT_CMD_UNSUBSCRIBE   10
 
#define MG_MQTT_CMD_UNSUBACK   11
 
#define MG_MQTT_CMD_PINGREQ   12
 
#define MG_MQTT_CMD_PINGRESP   13
 
#define MG_MQTT_CMD_DISCONNECT   14
 
#define MG_MQTT_EVENT_BASE   200
 
#define MG_EV_MQTT_CONNECT   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_CONNECT)
 
#define MG_EV_MQTT_CONNACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_CONNACK)
 
#define MG_EV_MQTT_PUBLISH   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBLISH)
 
#define MG_EV_MQTT_PUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBACK)
 
#define MG_EV_MQTT_PUBREC   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBREC)
 
#define MG_EV_MQTT_PUBREL   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBREL)
 
#define MG_EV_MQTT_PUBCOMP   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBCOMP)
 
#define MG_EV_MQTT_SUBSCRIBE   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_SUBSCRIBE)
 
#define MG_EV_MQTT_SUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_SUBACK)
 
#define MG_EV_MQTT_UNSUBSCRIBE   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_UNSUBSCRIBE)
 
#define MG_EV_MQTT_UNSUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_UNSUBACK)
 
#define MG_EV_MQTT_PINGREQ   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PINGREQ)
 
#define MG_EV_MQTT_PINGRESP   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PINGRESP)
 
#define MG_EV_MQTT_DISCONNECT   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_DISCONNECT)
 
#define MG_MQTT_RETAIN   0x1
 
#define MG_MQTT_DUP   0x4
 
#define MG_MQTT_QOS(qos)   ((qos) << 1)
 
#define MG_MQTT_GET_QOS(flags)   (((flags) &0x6) >> 1)
 
#define MG_MQTT_SET_QOS(flags, qos)   (flags) = ((flags) & ~0x6) | ((qos) << 1)
 
#define MG_MQTT_CLEAN_SESSION   0x02
 
#define MG_MQTT_HAS_WILL   0x04
 
#define MG_MQTT_WILL_RETAIN   0x20
 
#define MG_MQTT_HAS_PASSWORD   0x40
 
#define MG_MQTT_HAS_USER_NAME   0x80
 
#define MG_MQTT_GET_WILL_QOS(flags)   (((flags) &0x18) >> 3)
 
#define MG_MQTT_SET_WILL_QOS(flags, qos)    (flags) = ((flags) & ~0x18) | ((qos) << 3)
 
#define MG_EV_MQTT_CONNACK_ACCEPTED   0
 
#define MG_EV_MQTT_CONNACK_UNACCEPTABLE_VERSION   1
 
#define MG_EV_MQTT_CONNACK_IDENTIFIER_REJECTED   2
 
#define MG_EV_MQTT_CONNACK_SERVER_UNAVAILABLE   3
 
#define MG_EV_MQTT_CONNACK_BAD_AUTH   4
 
#define MG_EV_MQTT_CONNACK_NOT_AUTHORIZED   5
 
#define CS_MONGOOSE_SRC_MQTT_BROKER_H_
 
#define CS_MONGOOSE_SRC_DNS_H_
 
#define MG_DNS_A_RECORD   0x01 /* Lookup IP address */
 
#define MG_DNS_CNAME_RECORD   0x05 /* Lookup CNAME */
 
#define MG_DNS_PTR_RECORD   0x0c /* Lookup PTR */
 
#define MG_DNS_TXT_RECORD   0x10 /* Lookup TXT */
 
#define MG_DNS_AAAA_RECORD   0x1c /* Lookup IPv6 address */
 
#define MG_DNS_SRV_RECORD   0x21 /* Lookup SRV */
 
#define MG_DNS_MX_RECORD   0x0f /* Lookup mail server for domain */
 
#define MG_DNS_ANY_RECORD   0xff
 
#define MG_DNS_NSEC_RECORD   0x2f
 
#define MG_MAX_DNS_QUESTIONS   32
 
#define MG_MAX_DNS_ANSWERS   32
 
#define MG_DNS_MESSAGE   100 /* High-level DNS message event */
 
#define CS_MONGOOSE_SRC_DNS_SERVER_H_
 
#define CS_MONGOOSE_SRC_RESOLV_H_
 
#define CS_MONGOOSE_SRC_COAP_H_
 
#define CS_MONGOOSE_SRC_SNTP_H_
 
#define CS_MONGOOSE_SRC_SOCKS_H_
 

Typedefs

typedef void(* cs_base64_putc_t) (char, void *)
 
typedef void(* mg_event_handler_t) (struct mg_connection *nc, int ev, void *ev_data MG_UD_ARG(void *user_data))
 
typedef void(* mg_resolve_callback_t) (struct mg_dns_message *dns_message, void *user_data, enum mg_resolve_err)
 

Enumerations

enum  mg_dns_resource_record_kind { MG_DNS_INVALID_RECORD = 0 , MG_DNS_QUESTION , MG_DNS_ANSWER }
 
enum  mg_resolve_err { MG_RESOLVE_OK = 0 , MG_RESOLVE_NO_ANSWERS = 1 , MG_RESOLVE_EXCEEDED_RETRY_COUNT = 2 , MG_RESOLVE_TIMEOUT = 3 }
 

Functions

void cs_md5_init (cs_md5_ctx *c)
 
void cs_md5_update (cs_md5_ctx *c, const unsigned char *data, size_t len)
 
void cs_md5_final (unsigned char *md, cs_md5_ctx *c)
 
void cs_sha1_init (cs_sha1_ctx *)
 
void cs_sha1_update (cs_sha1_ctx *, const unsigned char *data, uint32_t len)
 
void cs_sha1_final (unsigned char digest[20], cs_sha1_ctx *)
 
void cs_hmac_sha1 (const unsigned char *key, size_t key_len, const unsigned char *text, size_t text_len, unsigned char out[20])
 
double cs_time (void)
 
double cs_timegm (const struct tm *tm)
 
struct mg_str mg_mk_str (const char *s)
 
struct mg_str mg_mk_str_n (const char *s, size_t len)
 
int mg_vcmp (const struct mg_str *str2, const char *str1)
 
int mg_vcasecmp (const struct mg_str *str2, const char *str1)
 
struct mg_str mg_strdup (const struct mg_str s)
 
struct mg_str mg_strdup_nul (const struct mg_str s)
 
const charmg_strchr (const struct mg_str s, int c)
 
int mg_strcmp (const struct mg_str str1, const struct mg_str str2)
 
int mg_strncmp (const struct mg_str str1, const struct mg_str str2, size_t n)
 
void mg_strfree (struct mg_str *s)
 
const charmg_strstr (const struct mg_str haystack, const struct mg_str needle)
 
struct mg_str mg_strstrip (struct mg_str s)
 
int mg_str_starts_with (struct mg_str s, struct mg_str prefix)
 
void mbuf_init (struct mbuf *, size_t initial_capacity)
 
void mbuf_free (struct mbuf *)
 
size_t mbuf_append (struct mbuf *, const void *data, size_t data_size)
 
size_t mbuf_append_and_free (struct mbuf *, void *data, size_t data_size)
 
size_t mbuf_insert (struct mbuf *, size_t, const void *, size_t)
 
void mbuf_remove (struct mbuf *, size_t data_size)
 
void mbuf_resize (struct mbuf *, size_t new_size)
 
void mbuf_move (struct mbuf *from, struct mbuf *to)
 
void mbuf_clear (struct mbuf *)
 
void mbuf_trim (struct mbuf *)
 
void cs_base64_init (struct cs_base64_ctx *ctx, cs_base64_putc_t putc, void *user_data)
 
void cs_base64_update (struct cs_base64_ctx *ctx, const char *str, size_t len)
 
void cs_base64_finish (struct cs_base64_ctx *ctx)
 
void cs_base64_encode (const unsigned char *src, int src_len, char *dst)
 
void cs_fprint_base64 (FILE *f, const unsigned char *src, int src_len)
 
int cs_base64_decode (const unsigned char *s, int len, char *dst, int *dec_len)
 
size_t c_strnlen (const char *s, size_t maxlen)
 
int c_snprintf (char *buf, size_t buf_size, const char *format,...) PRINTF_LIKE(3
 
int int c_vsnprintf (char *buf, size_t buf_size, const char *format, va_list ap)
 
const charc_strnstr (const char *s, const char *find, size_t slen)
 
void cs_to_hex (char *to, const unsigned char *p, size_t len)
 
void cs_from_hex (char *to, const char *p, size_t len)
 
int mg_ncasecmp (const char *s1, const char *s2, size_t len)
 
int mg_casecmp (const char *s1, const char *s2)
 
int mg_asprintf (char **buf, size_t size, const char *fmt,...) PRINTF_LIKE(3
 
int int mg_avprintf (char **buf, size_t size, const char *fmt, va_list ap)
 
const charmg_next_comma_list_entry (const char *list, struct mg_str *val, struct mg_str *eq_val)
 
struct mg_str mg_next_comma_list_entry_n (struct mg_str list, struct mg_str *val, struct mg_str *eq_val)
 
size_t mg_match_prefix (const char *pattern, int pattern_len, const char *str)
 
size_t mg_match_prefix_n (const struct mg_str pattern, const struct mg_str str)
 
struct mg_ifacemg_if_create_iface (const struct mg_iface_vtable *vtable, struct mg_mgr *mgr)
 
struct mg_ifacemg_find_iface (struct mg_mgr *mgr, const struct mg_iface_vtable *vtable, struct mg_iface *from)
 
struct mg_connectionmg_if_accept_new_conn (struct mg_connection *lc)
 
void mg_if_accept_tcp_cb (struct mg_connection *nc, union socket_address *sa, size_t sa_len)
 
void mg_if_connect_cb (struct mg_connection *nc, int err)
 
void mg_if_can_recv_cb (struct mg_connection *nc)
 
void mg_if_can_send_cb (struct mg_connection *nc)
 
void mg_if_recv_udp_cb (struct mg_connection *nc, void *buf, int len, union socket_address *sa, size_t sa_len)
 
int mg_if_poll (struct mg_connection *nc, double now)
 
double mg_mgr_min_timer (const struct mg_mgr *mgr)
 
void mg_mgr_init (struct mg_mgr *mgr, void *user_data)
 
void mg_mgr_init_opt (struct mg_mgr *mgr, void *user_data, struct mg_mgr_init_opts opts)
 
void mg_mgr_free (struct mg_mgr *mgr)
 
int mg_mgr_poll (struct mg_mgr *mgr, int milli)
 
struct mg_connectionmg_next (struct mg_mgr *mgr, struct mg_connection *c)
 
struct mg_connectionmg_add_sock (struct mg_mgr *mgr, sock_t sock, MG_CB(mg_event_handler_t handler, void *user_data))
 
struct mg_connectionmg_add_sock_opt (struct mg_mgr *mgr, sock_t sock, MG_CB(mg_event_handler_t handler, void *user_data), struct mg_add_sock_opts opts)
 
struct mg_connectionmg_bind (struct mg_mgr *mgr, const char *address, MG_CB(mg_event_handler_t handler, void *user_data))
 
struct mg_connectionmg_bind_opt (struct mg_mgr *mgr, const char *address, MG_CB(mg_event_handler_t handler, void *user_data), struct mg_bind_opts opts)
 
struct mg_connectionmg_connect (struct mg_mgr *mgr, const char *address, MG_CB(mg_event_handler_t handler, void *user_data))
 
struct mg_connectionmg_connect_opt (struct mg_mgr *mgr, const char *address, MG_CB(mg_event_handler_t handler, void *user_data), struct mg_connect_opts opts)
 
void mg_send (struct mg_connection *, const void *buf, int len)
 
int mg_printf (struct mg_connection *, const char *fmt,...)
 
int mg_vprintf (struct mg_connection *, const char *fmt, va_list ap)
 
int mg_socketpair (sock_t[2], int sock_type)
 
int mg_check_ip_acl (const char *acl, uint32_t remote_ip)
 
double mg_set_timer (struct mg_connection *c, double timestamp)
 
double mg_time (void)
 
int mg_parse_uri (const struct mg_str uri, struct mg_str *scheme, struct mg_str *user_info, struct mg_str *host, unsigned int *port, struct mg_str *path, struct mg_str *query, struct mg_str *fragment)
 
int mg_assemble_uri (const struct mg_str *scheme, const struct mg_str *user_info, const struct mg_str *host, unsigned int port, const struct mg_str *path, const struct mg_str *query, const struct mg_str *fragment, int normalize_path, struct mg_str *uri)
 
int mg_normalize_uri_path (const struct mg_str *in, struct mg_str *out)
 
const charmg_skip (const char *s, const char *end_string, const char *delimiters, struct mg_str *v)
 
int mg_base64_decode (const unsigned char *s, int len, char *dst)
 
void mg_base64_encode (const unsigned char *src, int src_len, char *dst)
 
void mg_set_close_on_exec (sock_t)
 
int mg_conn_addr_to_str (struct mg_connection *c, char *buf, size_t len, int flags)
 
void mg_sock_to_str (sock_t sock, char *buf, size_t len, int flags)
 
int mg_sock_addr_to_str (const union socket_address *sa, char *buf, size_t len, int flags)
 
int mg_is_big_endian (void)
 
void mg_mbuf_append_base64_putc (char ch, void *user_data)
 
void mg_mbuf_append_base64 (struct mbuf *mbuf, const void *data, size_t len)
 
void mg_basic_auth_header (const struct mg_str user, const struct mg_str pass, struct mbuf *buf)
 
struct mg_str mg_url_encode_opt (const struct mg_str src, const struct mg_str safe, unsigned int flags)
 
struct mg_str mg_url_encode (const struct mg_str src)
 
void mg_set_protocol_http_websocket (struct mg_connection *nc)
 
void mg_send_websocket_handshake (struct mg_connection *nc, const char *uri, const char *extra_headers)
 
void mg_send_websocket_handshake2 (struct mg_connection *nc, const char *path, const char *host, const char *protocol, const char *extra_headers)
 
void mg_send_websocket_handshake3 (struct mg_connection *nc, const char *path, const char *host, const char *protocol, const char *extra_headers, const char *user, const char *pass)
 
void mg_send_websocket_handshake3v (struct mg_connection *nc, const struct mg_str path, const struct mg_str host, const struct mg_str protocol, const struct mg_str extra_headers, const struct mg_str user, const struct mg_str pass)
 
struct mg_connectionmg_connect_ws (struct mg_mgr *mgr, MG_CB(mg_event_handler_t event_handler, void *user_data), const char *url, const char *protocol, const char *extra_headers)
 
struct mg_connectionmg_connect_ws_opt (struct mg_mgr *mgr, MG_CB(mg_event_handler_t ev_handler, void *user_data), struct mg_connect_opts opts, const char *url, const char *protocol, const char *extra_headers)
 
void mg_send_websocket_frame (struct mg_connection *nc, int op_and_flags, const void *data, size_t data_len)
 
void mg_send_websocket_framev (struct mg_connection *nc, int op_and_flags, const struct mg_str *strings, int num_strings)
 
void mg_printf_websocket_frame (struct mg_connection *nc, int op_and_flags, const char *fmt,...)
 
int mg_url_decode (const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded)
 
void mg_hash_md5_v (size_t num_msgs, const uint8_t *msgs[], const size_t *msg_lens, uint8_t *digest)
 
void mg_hash_sha1_v (size_t num_msgs, const uint8_t *msgs[], const size_t *msg_lens, uint8_t *digest)
 
int mg_http_is_authorized (struct http_message *hm, struct mg_str path, const char *domain, const char *passwords_file, int flags)
 
void mg_http_send_digest_auth_request (struct mg_connection *c, const char *domain)
 
int mg_parse_http (const char *s, int n, struct http_message *hm, int is_req)
 
struct mg_strmg_get_http_header (struct http_message *hm, const char *name)
 
int mg_http_parse_header2 (struct mg_str *hdr, const char *var_name, char **buf, size_t buf_size)
 
int mg_http_parse_header (struct mg_str *hdr, const char *var_name, char *buf, size_t buf_size)
 
int mg_get_http_basic_auth (struct http_message *hm, char *user, size_t user_len, char *pass, size_t pass_len)
 
int mg_parse_http_basic_auth (struct mg_str *hdr, char *user, size_t user_len, char *pass, size_t pass_len)
 
size_t mg_parse_multipart (const char *buf, size_t buf_len, char *var_name, size_t var_name_len, char *file_name, size_t file_name_len, const char **chunk, size_t *chunk_len)
 
int mg_get_http_var (const struct mg_str *buf, const char *name, char *dst, size_t dst_len)
 
void mg_register_http_endpoint (struct mg_connection *nc, const char *uri_path, MG_CB(mg_event_handler_t handler, void *user_data))
 
void mg_register_http_endpoint_opt (struct mg_connection *nc, const char *uri_path, mg_event_handler_t handler, struct mg_http_endpoint_opts opts)
 
int mg_http_check_digest_auth (struct http_message *hm, const char *auth_domain, FILE *fp)
 
int mg_check_digest_auth (struct mg_str method, struct mg_str uri, struct mg_str username, struct mg_str cnonce, struct mg_str response, struct mg_str qop, struct mg_str nc, struct mg_str nonce, struct mg_str auth_domain, FILE *fp)
 
void mg_send_http_chunk (struct mg_connection *nc, const char *buf, size_t len)
 
void mg_printf_http_chunk (struct mg_connection *nc, const char *fmt,...)
 
void mg_send_response_line (struct mg_connection *nc, int status_code, const char *extra_headers)
 
void mg_http_send_error (struct mg_connection *nc, int code, const char *reason)
 
void mg_http_send_redirect (struct mg_connection *nc, int status_code, const struct mg_str location, const struct mg_str extra_headers)
 
void mg_send_head (struct mg_connection *n, int status_code, int64_t content_length, const char *extra_headers)
 
void mg_printf_html_escape (struct mg_connection *nc, const char *fmt,...)
 
struct mg_connectionmg_connect_http (struct mg_mgr *mgr, MG_CB(mg_event_handler_t event_handler, void *user_data), const char *url, const char *extra_headers, const char *post_data)
 
struct mg_connectionmg_connect_http_opt (struct mg_mgr *mgr, MG_CB(mg_event_handler_t ev_handler, void *user_data), struct mg_connect_opts opts, const char *url, const char *extra_headers, const char *post_data)
 
int mg_http_create_digest_auth_header (char *buf, size_t buf_len, const char *method, const char *uri, const char *auth_domain, const char *user, const char *passwd, const char *nonce)
 
void mg_set_protocol_mqtt (struct mg_connection *nc)
 
void mg_send_mqtt_handshake (struct mg_connection *nc, const char *client_id)
 
void mg_send_mqtt_handshake_opt (struct mg_connection *nc, const char *client_id, struct mg_send_mqtt_handshake_opts)
 
void mg_mqtt_publish (struct mg_connection *nc, const char *topic, uint16_t message_id, int flags, const void *data, size_t len)
 
void mg_mqtt_subscribe (struct mg_connection *nc, const struct mg_mqtt_topic_expression *topics, size_t topics_len, uint16_t message_id)
 
void mg_mqtt_unsubscribe (struct mg_connection *nc, char **topics, size_t topics_len, uint16_t message_id)
 
void mg_mqtt_disconnect (struct mg_connection *nc)
 
void mg_mqtt_connack (struct mg_connection *nc, uint8_t return_code)
 
void mg_mqtt_puback (struct mg_connection *nc, uint16_t message_id)
 
void mg_mqtt_pubrec (struct mg_connection *nc, uint16_t message_id)
 
void mg_mqtt_pubrel (struct mg_connection *nc, uint16_t message_id)
 
void mg_mqtt_pubcomp (struct mg_connection *nc, uint16_t message_id)
 
void mg_mqtt_suback (struct mg_connection *nc, uint8_t *qoss, size_t qoss_len, uint16_t message_id)
 
void mg_mqtt_unsuback (struct mg_connection *nc, uint16_t message_id)
 
void mg_mqtt_ping (struct mg_connection *nc)
 
void mg_mqtt_pong (struct mg_connection *nc)
 
int mg_mqtt_next_subscribe_topic (struct mg_mqtt_message *msg, struct mg_str *topic, uint8_t *qos, int pos)
 
int mg_mqtt_match_topic_expression (struct mg_str exp, struct mg_str topic)
 
int mg_mqtt_vmatch_topic_expression (const char *exp, struct mg_str topic)
 
struct mg_dns_resource_recordmg_dns_next_record (struct mg_dns_message *msg, int query, struct mg_dns_resource_record *prev)
 
int mg_dns_parse_record_data (struct mg_dns_message *msg, struct mg_dns_resource_record *rr, void *data, size_t data_len)
 
void mg_send_dns_query (struct mg_connection *nc, const char *name, int query_type)
 
int mg_dns_insert_header (struct mbuf *io, size_t pos, struct mg_dns_message *msg)
 
int mg_dns_copy_questions (struct mbuf *io, struct mg_dns_message *msg)
 
int mg_dns_encode_record (struct mbuf *io, struct mg_dns_resource_record *rr, const char *name, size_t nlen, const void *rdata, size_t rlen)
 
int mg_dns_encode_name (struct mbuf *io, const char *name, size_t len)
 
int mg_parse_dns (const char *buf, int len, struct mg_dns_message *msg)
 
size_t mg_dns_uncompress_name (struct mg_dns_message *msg, struct mg_str *name, char *dst, int dst_len)
 
void mg_set_protocol_dns (struct mg_connection *nc)
 
int mg_resolve_async (struct mg_mgr *mgr, const char *name, int query, mg_resolve_callback_t cb, void *data)
 
void mg_set_nameserver (struct mg_mgr *mgr, const char *nameserver)
 
int mg_resolve_async_opt (struct mg_mgr *mgr, const char *name, int query, mg_resolve_callback_t cb, void *data, struct mg_resolve_async_opts opts)
 
int mg_resolve_from_hosts_file (const char *host, union socket_address *usa)
 

Variables

const struct mg_iface_vtablemg_ifaces []
 
int mg_num_ifaces
 

Macro Definition Documentation

◆ _SYS_QUEUE_H_

#define _SYS_QUEUE_H_

Definition at line 2796 of file mongoose616.h.

◆ ARRAY_SIZE

#define ARRAY_SIZE (   array)    (sizeof(array) / sizeof(array[0]))

Definition at line 172 of file mongoose616.h.

◆ CS_COMMON_CS_BASE64_H_

#define CS_COMMON_CS_BASE64_H_

Definition at line 2510 of file mongoose616.h.

◆ CS_COMMON_CS_TIME_H_

#define CS_COMMON_CS_TIME_H_

Definition at line 2240 of file mongoose616.h.

◆ CS_COMMON_MBUF_H_

#define CS_COMMON_MBUF_H_

Definition at line 2403 of file mongoose616.h.

◆ CS_COMMON_MD5_H_

#define CS_COMMON_MD5_H_

Definition at line 2138 of file mongoose616.h.

◆ CS_COMMON_MG_STR_H_

#define CS_COMMON_MG_STR_H_

Definition at line 2285 of file mongoose616.h.

◆ CS_COMMON_PLATFORM_H_

#define CS_COMMON_PLATFORM_H_

Definition at line 38 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_

#define CS_COMMON_PLATFORMS_LWIP_MG_LWIP_H_

Definition at line 2055 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_

#define CS_COMMON_PLATFORMS_PLATFORM_CC3100_H_

Definition at line 661 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_

#define CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_

Definition at line 722 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_CC3220_H_

#define CS_COMMON_PLATFORMS_PLATFORM_CC3220_H_

Definition at line 859 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_

#define CS_COMMON_PLATFORMS_PLATFORM_ESP32_H_

Definition at line 531 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_

#define CS_COMMON_PLATFORMS_PLATFORM_ESP8266_H_

Definition at line 588 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_MBED_H_

#define CS_COMMON_PLATFORMS_PLATFORM_MBED_H_

Definition at line 1175 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_

#define CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_

Definition at line 983 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_

#define CS_COMMON_PLATFORMS_PLATFORM_NRF51_H_

Definition at line 1270 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_

#define CS_COMMON_PLATFORMS_PLATFORM_NRF52_H_

Definition at line 1327 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_

#define CS_COMMON_PLATFORMS_PLATFORM_NXP_KINETIS_H_

Definition at line 1839 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_

#define CS_COMMON_PLATFORMS_PLATFORM_NXP_LPC_H_

Definition at line 1771 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_

#define CS_COMMON_PLATFORMS_PLATFORM_PIC32_H_

Definition at line 1885 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_

#define CS_COMMON_PLATFORMS_PLATFORM_RS14100_H_

Definition at line 1937 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_STM32_H_

#define CS_COMMON_PLATFORMS_PLATFORM_STM32_H_

Definition at line 2001 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_

#define CS_COMMON_PLATFORMS_PLATFORM_TM4C129_H_

Definition at line 1103 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_

#define CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_

Definition at line 366 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_

#define CS_COMMON_PLATFORMS_PLATFORM_WINCE_H_

Definition at line 1550 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_

#define CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_

Definition at line 180 of file mongoose616.h.

◆ CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_

#define CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_

Definition at line 1388 of file mongoose616.h.

◆ CS_COMMON_SHA1_H_

#define CS_COMMON_SHA1_H_

Definition at line 2186 of file mongoose616.h.

◆ CS_COMMON_STR_UTIL_H_

#define CS_COMMON_STR_UTIL_H_

Definition at line 2579 of file mongoose616.h.

◆ CS_DISABLE_MD5

#define CS_DISABLE_MD5   0

Definition at line 2143 of file mongoose616.h.

◆ CS_DISABLE_SHA1

#define CS_DISABLE_SHA1   0

Definition at line 2189 of file mongoose616.h.

◆ CS_ENABLE_STRDUP

#define CS_ENABLE_STRDUP   0

Definition at line 2588 of file mongoose616.h.

◆ CS_ENABLE_TO64

#define CS_ENABLE_TO64   0

Definition at line 2592 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_COAP_H_

#define CS_MONGOOSE_SRC_COAP_H_

Definition at line 6496 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_COMMON_H_

#define CS_MONGOOSE_SRC_COMMON_H_

Definition at line 24 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_DNS_H_

#define CS_MONGOOSE_SRC_DNS_H_

Definition at line 6126 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_DNS_SERVER_H_

#define CS_MONGOOSE_SRC_DNS_SERVER_H_

Definition at line 6295 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_FEATURES_H_

#define CS_MONGOOSE_SRC_FEATURES_H_

Definition at line 3523 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_HTTP_CLIENT_H_

#define CS_MONGOOSE_SRC_HTTP_CLIENT_H_

Definition at line 5718 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_HTTP_H_

#define CS_MONGOOSE_SRC_HTTP_H_

Definition at line 4782 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_HTTP_SERVER_H_

#define CS_MONGOOSE_SRC_HTTP_SERVER_H_

Definition at line 5154 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_MQTT_BROKER_H_

#define CS_MONGOOSE_SRC_MQTT_BROKER_H_

Definition at line 6031 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_MQTT_H_

#define CS_MONGOOSE_SRC_MQTT_H_

Definition at line 5800 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_NET_H_

#define CS_MONGOOSE_SRC_NET_H_

Definition at line 3916 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_NET_IF_H_

#define CS_MONGOOSE_SRC_NET_IF_H_

Definition at line 3702 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_RESOLV_H_

#define CS_MONGOOSE_SRC_RESOLV_H_

Definition at line 6390 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_SNTP_H_

#define CS_MONGOOSE_SRC_SNTP_H_

Definition at line 6638 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_SOCKS_H_

#define CS_MONGOOSE_SRC_SOCKS_H_

Definition at line 6695 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_SSL_IF_H_

#define CS_MONGOOSE_SRC_SSL_IF_H_

Definition at line 3836 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_URI_H_

#define CS_MONGOOSE_SRC_URI_H_

Definition at line 4494 of file mongoose616.h.

◆ CS_MONGOOSE_SRC_UTIL_H_

#define CS_MONGOOSE_SRC_UTIL_H_

Definition at line 4564 of file mongoose616.h.

◆ CS_P_CC3100

#define CS_P_CC3100   6

Definition at line 49 of file mongoose616.h.

◆ CS_P_CC3200

#define CS_P_CC3200   4

Definition at line 50 of file mongoose616.h.

◆ CS_P_CC3220

#define CS_P_CC3220   17

Definition at line 51 of file mongoose616.h.

◆ CS_P_CUSTOM

#define CS_P_CUSTOM   0

Definition at line 44 of file mongoose616.h.

◆ CS_P_ESP32

#define CS_P_ESP32   15

Definition at line 47 of file mongoose616.h.

◆ CS_P_ESP8266

#define CS_P_ESP8266   3

Definition at line 48 of file mongoose616.h.

◆ CS_P_MBED

#define CS_P_MBED   7

Definition at line 54 of file mongoose616.h.

◆ CS_P_MSP432

#define CS_P_MSP432   5

Definition at line 52 of file mongoose616.h.

◆ CS_P_NRF51

#define CS_P_NRF51   12

Definition at line 58 of file mongoose616.h.

◆ CS_P_NRF52

#define CS_P_NRF52   10

Definition at line 59 of file mongoose616.h.

◆ CS_P_NXP_KINETIS

#define CS_P_NXP_KINETIS   9

Definition at line 57 of file mongoose616.h.

◆ CS_P_NXP_LPC

#define CS_P_NXP_LPC   13

Definition at line 56 of file mongoose616.h.

◆ CS_P_PIC32

#define CS_P_PIC32   11

Definition at line 60 of file mongoose616.h.

◆ CS_P_RS14100

#define CS_P_RS14100   18

Definition at line 61 of file mongoose616.h.

◆ CS_P_STM32

#define CS_P_STM32   16

Definition at line 62 of file mongoose616.h.

◆ CS_P_TM4C129

#define CS_P_TM4C129   14

Definition at line 53 of file mongoose616.h.

◆ CS_P_UNIX

#define CS_P_UNIX   1

Definition at line 45 of file mongoose616.h.

◆ CS_P_WINCE

#define CS_P_WINCE   8

Definition at line 55 of file mongoose616.h.

◆ CS_P_WINDOWS

#define CS_P_WINDOWS   2

Definition at line 46 of file mongoose616.h.

◆ CS_STRINGIFY_LIT

#define CS_STRINGIFY_LIT (   ...)    #__VA_ARGS__

Definition at line 2600 of file mongoose616.h.

◆ CS_STRINGIFY_MACRO

#define CS_STRINGIFY_MACRO (   x)    CS_STRINGIFY_LIT(x)

Definition at line 2614 of file mongoose616.h.

◆ DISABLE_BASE64

#define DISABLE_BASE64   0

Definition at line 2513 of file mongoose616.h.

◆ DO_NOT_WARN_UNUSED

#define DO_NOT_WARN_UNUSED

Definition at line 168 of file mongoose616.h.

◆ LIST_CLASS_ENTRY

#define LIST_CLASS_ENTRY (   type)
Value:
struct { \
class type *le_next; /* next element */ \
class type **le_prev; /* address of previous next element */ \
}
INT type
Definition mana.cxx:269
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24

Definition at line 3175 of file mongoose616.h.

3176 { \
3177 class type *le_next; /* next element */ \
3178 class type **le_prev; /* address of previous next element */ \
3179}

◆ LIST_CLASS_HEAD

#define LIST_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *lh_first; /* first element */ \
}
#define name(x)
Definition midas_macro.h:24

Definition at line 3161 of file mongoose616.h.

3162 { \
3163 class type *lh_first; /* first element */ \
3164}

◆ LIST_EMPTY

#define LIST_EMPTY (   head)    ((head)->lh_first == NULL)

Definition at line 3210 of file mongoose616.h.

◆ LIST_ENTRY

#define LIST_ENTRY (   type)
Value:
struct { \
struct type *le_next; /* next element */ \
struct type **le_prev; /* address of previous next element */ \
}

Definition at line 3169 of file mongoose616.h.

3170 { \
3171 struct type *le_next; /* next element */ \
3172 struct type **le_prev; /* address of previous next element */ \
3173}

◆ LIST_FIRST

#define LIST_FIRST (   head)    ((head)->lh_first)

Definition at line 3212 of file mongoose616.h.

◆ LIST_FOREACH

#define LIST_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = LIST_FIRST((head)); \
(var); \
#define LIST_FIRST(head)
#define LIST_NEXT(elm, field)

Definition at line 3214 of file mongoose616.h.

◆ LIST_FOREACH_FROM

#define LIST_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
(var); \

Definition at line 3219 of file mongoose616.h.

3220 : LIST_FIRST((head))); \
3221 (var); \
3222 (var) = LIST_NEXT((var), field))

◆ LIST_FOREACH_FROM_SAFE

#define LIST_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 3229 of file mongoose616.h.

3230 : LIST_FIRST((head))); \
3231 (var) && ((tvar) = LIST_NEXT((var), field), 1); \
3232 (var) = (tvar))

◆ LIST_FOREACH_SAFE

#define LIST_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = LIST_FIRST((head)); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 3224 of file mongoose616.h.

◆ LIST_HEAD

#define LIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *lh_first; /* first element */ \
}

Definition at line 3156 of file mongoose616.h.

3157 { \
3158 struct type *lh_first; /* first element */ \
3159}

◆ LIST_HEAD_INITIALIZER

#define LIST_HEAD_INITIALIZER (   head)     { NULL }

Definition at line 3166 of file mongoose616.h.

3167 { NULL }

◆ LIST_INIT

#define LIST_INIT (   head)
Value:
do { \
} while (0)

Definition at line 3234 of file mongoose616.h.

3234 { \
3235 LIST_FIRST((head)) = NULL; \
3236} while (0)

◆ LIST_INSERT_AFTER

#define LIST_INSERT_AFTER (   listelm,
  elm,
  field 
)
Value:
do { \
LIST_NEXT((listelm), field)->field.le_prev = \
(elm)->field.le_prev = &LIST_NEXT((listelm), field); \
} while (0)

Definition at line 3238 of file mongoose616.h.

3238 { \
3241 LIST_NEXT((listelm), field)->field.le_prev = \
3242 &LIST_NEXT((elm), field); \
3243 LIST_NEXT((listelm), field) = (elm); \
3244 (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
3245} while (0)

◆ LIST_INSERT_BEFORE

#define LIST_INSERT_BEFORE (   listelm,
  elm,
  field 
)
Value:
do { \
(elm)->field.le_prev = (listelm)->field.le_prev; \
*(listelm)->field.le_prev = (elm); \
(listelm)->field.le_prev = &LIST_NEXT((elm), field); \
} while (0)

Definition at line 3247 of file mongoose616.h.

3247 { \
3249 (elm)->field.le_prev = (listelm)->field.le_prev; \
3250 LIST_NEXT((elm), field) = (listelm); \
3251 *(listelm)->field.le_prev = (elm); \
3252 (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
3253} while (0)

◆ LIST_INSERT_HEAD

#define LIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
LIST_FIRST((head)) = (elm); \
(elm)->field.le_prev = &LIST_FIRST((head)); \
} while (0)

Definition at line 3255 of file mongoose616.h.

3255 { \
3257 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
3258 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
3259 LIST_FIRST((head)) = (elm); \
3260 (elm)->field.le_prev = &LIST_FIRST((head)); \
3261} while (0)

◆ LIST_NEXT

#define LIST_NEXT (   elm,
  field 
)    ((elm)->field.le_next)

Definition at line 3263 of file mongoose616.h.

◆ LIST_PREV

#define LIST_PREV (   elm,
  head,
  type,
  field 
)
Value:
((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \
#define QUEUE_TYPEOF(type)

Definition at line 3265 of file mongoose616.h.

3266 : \
3267 __containerof((elm)->field.le_prev, \
3268 QUEUE_TYPEOF(type), field.le_next))

◆ LIST_REMOVE

#define LIST_REMOVE (   elm,
  field 
)
Value:
do { \
LIST_NEXT((elm), field)->field.le_prev = \
(elm)->field.le_prev; \
*(elm)->field.le_prev = LIST_NEXT((elm), field); \
} while (0)

Definition at line 3270 of file mongoose616.h.

3270 { \
3271 QMD_SAVELINK(oldnext, (elm)->field.le_next); \
3272 QMD_SAVELINK(oldprev, (elm)->field.le_prev); \
3275 if (LIST_NEXT((elm), field) != NULL) \
3276 LIST_NEXT((elm), field)->field.le_prev = \
3277 (elm)->field.le_prev; \
3278 *(elm)->field.le_prev = LIST_NEXT((elm), field); \
3280 TRASHIT(*oldprev); \
3281} while (0)

◆ LIST_SWAP

#define LIST_SWAP (   head1,
  head2,
  type,
  field 
)
Value:
do { \
swap_tmp->field.le_prev = &LIST_FIRST((head1)); \
swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
} while (0)

Definition at line 3283 of file mongoose616.h.

3283 { \
3287 if ((swap_tmp = LIST_FIRST((head1))) != NULL) \
3288 swap_tmp->field.le_prev = &LIST_FIRST((head1)); \
3289 if ((swap_tmp = LIST_FIRST((head2))) != NULL) \
3290 swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
3291} while (0)

◆ MBUF_SIZE_MAX_HEADROOM

#define MBUF_SIZE_MAX_HEADROOM   1024

Definition at line 2420 of file mongoose616.h.

◆ MBUF_SIZE_MULTIPLIER

#define MBUF_SIZE_MULTIPLIER   1.5

Definition at line 2413 of file mongoose616.h.

◆ MG_AUTH_FLAG_ALLOW_MISSING_FILE

#define MG_AUTH_FLAG_ALLOW_MISSING_FILE   (1 << 2)

Definition at line 5120 of file mongoose616.h.

◆ MG_AUTH_FLAG_IS_DIRECTORY

#define MG_AUTH_FLAG_IS_DIRECTORY   (1 << 0)

Definition at line 5118 of file mongoose616.h.

◆ MG_AUTH_FLAG_IS_GLOBAL_PASS_FILE

#define MG_AUTH_FLAG_IS_GLOBAL_PASS_FILE   (1 << 1)

Definition at line 5119 of file mongoose616.h.

◆ MG_CB

#define MG_CB (   cb,
  ud 
)    cb

Definition at line 3689 of file mongoose616.h.

◆ MG_CGI_ENVIRONMENT_SIZE

#define MG_CGI_ENVIRONMENT_SIZE   8192

Definition at line 4806 of file mongoose616.h.

◆ MG_DISABLE_HTTP_DIGEST_AUTH

#define MG_DISABLE_HTTP_DIGEST_AUTH   0

Definition at line 3526 of file mongoose616.h.

◆ MG_DISABLE_HTTP_KEEP_ALIVE

#define MG_DISABLE_HTTP_KEEP_ALIVE   0

Definition at line 3530 of file mongoose616.h.

◆ MG_DISABLE_PFS

#define MG_DISABLE_PFS   0

Definition at line 3534 of file mongoose616.h.

◆ MG_DISABLE_WS_RANDOM_MASK

#define MG_DISABLE_WS_RANDOM_MASK   0

Definition at line 3538 of file mongoose616.h.

◆ MG_DNS_A_RECORD

#define MG_DNS_A_RECORD   0x01 /* Lookup IP address */

Definition at line 6134 of file mongoose616.h.

◆ MG_DNS_AAAA_RECORD

#define MG_DNS_AAAA_RECORD   0x1c /* Lookup IPv6 address */

Definition at line 6138 of file mongoose616.h.

◆ MG_DNS_ANY_RECORD

#define MG_DNS_ANY_RECORD   0xff

Definition at line 6141 of file mongoose616.h.

◆ MG_DNS_CNAME_RECORD

#define MG_DNS_CNAME_RECORD   0x05 /* Lookup CNAME */

Definition at line 6135 of file mongoose616.h.

◆ MG_DNS_MESSAGE

#define MG_DNS_MESSAGE   100 /* High-level DNS message event */

Definition at line 6147 of file mongoose616.h.

◆ MG_DNS_MX_RECORD

#define MG_DNS_MX_RECORD   0x0f /* Lookup mail server for domain */

Definition at line 6140 of file mongoose616.h.

◆ MG_DNS_NSEC_RECORD

#define MG_DNS_NSEC_RECORD   0x2f

Definition at line 6142 of file mongoose616.h.

◆ MG_DNS_PTR_RECORD

#define MG_DNS_PTR_RECORD   0x0c /* Lookup PTR */

Definition at line 6136 of file mongoose616.h.

◆ MG_DNS_SRV_RECORD

#define MG_DNS_SRV_RECORD   0x21 /* Lookup SRV */

Definition at line 6139 of file mongoose616.h.

◆ MG_DNS_TXT_RECORD

#define MG_DNS_TXT_RECORD   0x10 /* Lookup TXT */

Definition at line 6137 of file mongoose616.h.

◆ MG_ENABLE_ASYNC_RESOLVER

#define MG_ENABLE_ASYNC_RESOLVER   1

Definition at line 3542 of file mongoose616.h.

◆ MG_ENABLE_BROADCAST

#define MG_ENABLE_BROADCAST   0

Definition at line 3546 of file mongoose616.h.

◆ MG_ENABLE_CALLBACK_USERDATA

#define MG_ENABLE_CALLBACK_USERDATA   0

Definition at line 3681 of file mongoose616.h.

◆ MG_ENABLE_COAP

#define MG_ENABLE_COAP   0

Definition at line 3550 of file mongoose616.h.

◆ MG_ENABLE_DEBUG

#define MG_ENABLE_DEBUG   0

Definition at line 3554 of file mongoose616.h.

◆ MG_ENABLE_DIRECTORY_LISTING

#define MG_ENABLE_DIRECTORY_LISTING   0

Definition at line 3558 of file mongoose616.h.

◆ MG_ENABLE_DNS

#define MG_ENABLE_DNS   1

Definition at line 3562 of file mongoose616.h.

◆ MG_ENABLE_DNS_SERVER

#define MG_ENABLE_DNS_SERVER   0

Definition at line 3566 of file mongoose616.h.

◆ MG_ENABLE_EXTRA_ERRORS_DESC

#define MG_ENABLE_EXTRA_ERRORS_DESC   0

Definition at line 3677 of file mongoose616.h.

◆ MG_ENABLE_FAKE_DAVLOCK

#define MG_ENABLE_FAKE_DAVLOCK   0

Definition at line 3570 of file mongoose616.h.

◆ MG_ENABLE_FILESYSTEM

#define MG_ENABLE_FILESYSTEM   0

Definition at line 3574 of file mongoose616.h.

◆ MG_ENABLE_GETADDRINFO

#define MG_ENABLE_GETADDRINFO   0

Definition at line 3578 of file mongoose616.h.

◆ MG_ENABLE_HEXDUMP

#define MG_ENABLE_HEXDUMP   CS_ENABLE_STDIO

Definition at line 3582 of file mongoose616.h.

◆ MG_ENABLE_HTTP

#define MG_ENABLE_HTTP   1

Definition at line 3586 of file mongoose616.h.

◆ MG_ENABLE_HTTP_CGI

#define MG_ENABLE_HTTP_CGI   0

Definition at line 3590 of file mongoose616.h.

◆ MG_ENABLE_HTTP_SSI

#define MG_ENABLE_HTTP_SSI   MG_ENABLE_FILESYSTEM

Definition at line 3594 of file mongoose616.h.

◆ MG_ENABLE_HTTP_SSI_EXEC

#define MG_ENABLE_HTTP_SSI_EXEC   0

Definition at line 3598 of file mongoose616.h.

◆ MG_ENABLE_HTTP_STREAMING_MULTIPART

#define MG_ENABLE_HTTP_STREAMING_MULTIPART   0

Definition at line 3602 of file mongoose616.h.

◆ MG_ENABLE_HTTP_URL_REWRITES

#define MG_ENABLE_HTTP_URL_REWRITES    (CS_PLATFORM == CS_P_WINDOWS || CS_PLATFORM == CS_P_UNIX)

Definition at line 3668 of file mongoose616.h.

◆ MG_ENABLE_HTTP_WEBDAV

#define MG_ENABLE_HTTP_WEBDAV   0

Definition at line 3606 of file mongoose616.h.

◆ MG_ENABLE_HTTP_WEBSOCKET

#define MG_ENABLE_HTTP_WEBSOCKET   MG_ENABLE_HTTP

Definition at line 3610 of file mongoose616.h.

◆ MG_ENABLE_IPV6

#define MG_ENABLE_IPV6   0

Definition at line 3614 of file mongoose616.h.

◆ MG_ENABLE_MQTT

#define MG_ENABLE_MQTT   1

Definition at line 3618 of file mongoose616.h.

◆ MG_ENABLE_MQTT_BROKER

#define MG_ENABLE_MQTT_BROKER   0

Definition at line 3626 of file mongoose616.h.

◆ MG_ENABLE_SNTP

#define MG_ENABLE_SNTP   0

Definition at line 3673 of file mongoose616.h.

◆ MG_ENABLE_SOCKS

#define MG_ENABLE_SOCKS   0

Definition at line 3622 of file mongoose616.h.

◆ MG_ENABLE_SSL

#define MG_ENABLE_SSL   0

Definition at line 3630 of file mongoose616.h.

◆ MG_ENABLE_STDIO

#define MG_ENABLE_STDIO   CS_ENABLE_STDIO

Definition at line 3638 of file mongoose616.h.

◆ MG_ENABLE_SYNC_RESOLVER

#define MG_ENABLE_SYNC_RESOLVER   0

Definition at line 3634 of file mongoose616.h.

◆ MG_ENABLE_THREADS

#define MG_ENABLE_THREADS   0

Definition at line 3653 of file mongoose616.h.

◆ MG_EV_ACCEPT

#define MG_EV_ACCEPT   1 /* New connection accepted. union socket_address * */

Definition at line 3959 of file mongoose616.h.

◆ MG_EV_CLOSE

#define MG_EV_CLOSE   5 /* Connection is closed. NULL */

Definition at line 3963 of file mongoose616.h.

◆ MG_EV_CONNECT

#define MG_EV_CONNECT   2 /* connect() succeeded or failed. int * */

Definition at line 3960 of file mongoose616.h.

◆ MG_EV_HTTP_CHUNK

#define MG_EV_HTTP_CHUNK   102 /* struct http_message * */

Definition at line 4874 of file mongoose616.h.

◆ MG_EV_HTTP_REPLY

#define MG_EV_HTTP_REPLY   101 /* struct http_message * */

Definition at line 4873 of file mongoose616.h.

◆ MG_EV_HTTP_REQUEST

#define MG_EV_HTTP_REQUEST   100 /* struct http_message * */

Definition at line 4872 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK

#define MG_EV_MQTT_CONNACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_CONNACK)

Definition at line 5865 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK_ACCEPTED

#define MG_EV_MQTT_CONNACK_ACCEPTED   0

Definition at line 5897 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK_BAD_AUTH

#define MG_EV_MQTT_CONNACK_BAD_AUTH   4

Definition at line 5901 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK_IDENTIFIER_REJECTED

#define MG_EV_MQTT_CONNACK_IDENTIFIER_REJECTED   2

Definition at line 5899 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK_NOT_AUTHORIZED

#define MG_EV_MQTT_CONNACK_NOT_AUTHORIZED   5

Definition at line 5902 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK_SERVER_UNAVAILABLE

#define MG_EV_MQTT_CONNACK_SERVER_UNAVAILABLE   3

Definition at line 5900 of file mongoose616.h.

◆ MG_EV_MQTT_CONNACK_UNACCEPTABLE_VERSION

#define MG_EV_MQTT_CONNACK_UNACCEPTABLE_VERSION   1

Definition at line 5898 of file mongoose616.h.

◆ MG_EV_MQTT_CONNECT

#define MG_EV_MQTT_CONNECT   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_CONNECT)

Definition at line 5864 of file mongoose616.h.

◆ MG_EV_MQTT_DISCONNECT

#define MG_EV_MQTT_DISCONNECT   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_DISCONNECT)

Definition at line 5877 of file mongoose616.h.

◆ MG_EV_MQTT_PINGREQ

#define MG_EV_MQTT_PINGREQ   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PINGREQ)

Definition at line 5875 of file mongoose616.h.

◆ MG_EV_MQTT_PINGRESP

#define MG_EV_MQTT_PINGRESP   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PINGRESP)

Definition at line 5876 of file mongoose616.h.

◆ MG_EV_MQTT_PUBACK

#define MG_EV_MQTT_PUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBACK)

Definition at line 5867 of file mongoose616.h.

◆ MG_EV_MQTT_PUBCOMP

#define MG_EV_MQTT_PUBCOMP   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBCOMP)

Definition at line 5870 of file mongoose616.h.

◆ MG_EV_MQTT_PUBLISH

#define MG_EV_MQTT_PUBLISH   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBLISH)

Definition at line 5866 of file mongoose616.h.

◆ MG_EV_MQTT_PUBREC

#define MG_EV_MQTT_PUBREC   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBREC)

Definition at line 5868 of file mongoose616.h.

◆ MG_EV_MQTT_PUBREL

#define MG_EV_MQTT_PUBREL   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBREL)

Definition at line 5869 of file mongoose616.h.

◆ MG_EV_MQTT_SUBACK

#define MG_EV_MQTT_SUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_SUBACK)

Definition at line 5872 of file mongoose616.h.

◆ MG_EV_MQTT_SUBSCRIBE

#define MG_EV_MQTT_SUBSCRIBE   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_SUBSCRIBE)

Definition at line 5871 of file mongoose616.h.

◆ MG_EV_MQTT_UNSUBACK

#define MG_EV_MQTT_UNSUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_UNSUBACK)

Definition at line 5874 of file mongoose616.h.

◆ MG_EV_MQTT_UNSUBSCRIBE

#define MG_EV_MQTT_UNSUBSCRIBE   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_UNSUBSCRIBE)

Definition at line 5873 of file mongoose616.h.

◆ MG_EV_POLL

#define MG_EV_POLL   0 /* Sent to each connection on each mg_mgr_poll() call */

Definition at line 3958 of file mongoose616.h.

◆ MG_EV_RECV

#define MG_EV_RECV   3 /* Data has been received. int *num_bytes */

Definition at line 3961 of file mongoose616.h.

◆ MG_EV_SEND

#define MG_EV_SEND   4 /* Data has been written to a socket. int *num_bytes */

Definition at line 3962 of file mongoose616.h.

◆ MG_EV_SSI_CALL

#define MG_EV_SSI_CALL   105 /* char * */

Definition at line 4875 of file mongoose616.h.

◆ MG_EV_SSI_CALL_CTX

#define MG_EV_SSI_CALL_CTX   106 /* struct mg_ssi_call_ctx * */

Definition at line 4876 of file mongoose616.h.

◆ MG_EV_TIMER

#define MG_EV_TIMER   6 /* now >= conn->ev_timer_time. double * */

Definition at line 3964 of file mongoose616.h.

◆ MG_EV_WEBSOCKET_CONTROL_FRAME

#define MG_EV_WEBSOCKET_CONTROL_FRAME   114 /* struct websocket_message * */

Definition at line 4882 of file mongoose616.h.

◆ MG_EV_WEBSOCKET_FRAME

#define MG_EV_WEBSOCKET_FRAME   113 /* struct websocket_message * */

Definition at line 4881 of file mongoose616.h.

◆ MG_EV_WEBSOCKET_HANDSHAKE_DONE

#define MG_EV_WEBSOCKET_HANDSHAKE_DONE   112 /* struct http_message * */

Definition at line 4880 of file mongoose616.h.

◆ MG_EV_WEBSOCKET_HANDSHAKE_REQUEST

#define MG_EV_WEBSOCKET_HANDSHAKE_REQUEST   111 /* struct http_message * */

Definition at line 4879 of file mongoose616.h.

◆ MG_F_CLOSE_IMMEDIATELY

#define MG_F_CLOSE_IMMEDIATELY   (1 << 11) /* Disconnect */

Definition at line 4034 of file mongoose616.h.

◆ MG_F_CONNECTING

#define MG_F_CONNECTING   (1 << 3) /* connect() call in progress */

Definition at line 4024 of file mongoose616.h.

◆ MG_F_DELETE_CHUNK

#define MG_F_DELETE_CHUNK   (1 << 13) /* HTTP specific */

Definition at line 4036 of file mongoose616.h.

◆ MG_F_ENABLE_BROADCAST

#define MG_F_ENABLE_BROADCAST   (1 << 14) /* Allow broadcast address usage */

Definition at line 4037 of file mongoose616.h.

◆ MG_F_IS_WEBSOCKET

#define MG_F_IS_WEBSOCKET   (1 << 8) /* Websocket specific */

Definition at line 4029 of file mongoose616.h.

◆ MG_F_LISTENING

#define MG_F_LISTENING   (1 << 0) /* This connection is listening */

Definition at line 4021 of file mongoose616.h.

◆ MG_F_RECV_AND_CLOSE

#define MG_F_RECV_AND_CLOSE   (1 << 9) /* Drain rx and close the connection. */

Definition at line 4030 of file mongoose616.h.

◆ MG_F_RESOLVING

#define MG_F_RESOLVING   (1 << 2) /* Waiting for async resolver */

Definition at line 4023 of file mongoose616.h.

◆ MG_F_SEND_AND_CLOSE

#define MG_F_SEND_AND_CLOSE   (1 << 10) /* Push remaining data and close */

Definition at line 4033 of file mongoose616.h.

◆ MG_F_SSL

#define MG_F_SSL   (1 << 4) /* SSL is enabled on the connection */

Definition at line 4025 of file mongoose616.h.

◆ MG_F_SSL_HANDSHAKE_DONE

#define MG_F_SSL_HANDSHAKE_DONE   (1 << 5) /* SSL hanshake has completed */

Definition at line 4026 of file mongoose616.h.

◆ MG_F_UDP

#define MG_F_UDP   (1 << 1) /* This connection is UDP */

Definition at line 4022 of file mongoose616.h.

◆ MG_F_USER_1

#define MG_F_USER_1   (1 << 20) /* Flags left for application */

Definition at line 4039 of file mongoose616.h.

◆ MG_F_USER_2

#define MG_F_USER_2   (1 << 21)

Definition at line 4040 of file mongoose616.h.

◆ MG_F_USER_3

#define MG_F_USER_3   (1 << 22)

Definition at line 4041 of file mongoose616.h.

◆ MG_F_USER_4

#define MG_F_USER_4   (1 << 23)

Definition at line 4042 of file mongoose616.h.

◆ MG_F_USER_5

#define MG_F_USER_5   (1 << 24)

Definition at line 4043 of file mongoose616.h.

◆ MG_F_USER_6

#define MG_F_USER_6   (1 << 25)

Definition at line 4044 of file mongoose616.h.

◆ MG_F_WANT_READ

#define MG_F_WANT_READ   (1 << 6) /* SSL specific */

Definition at line 4027 of file mongoose616.h.

◆ MG_F_WANT_WRITE

#define MG_F_WANT_WRITE   (1 << 7) /* SSL specific */

Definition at line 4028 of file mongoose616.h.

◆ MG_F_WEBSOCKET_NO_DEFRAG

#define MG_F_WEBSOCKET_NO_DEFRAG   (1 << 12) /* Websocket specific */

Definition at line 4035 of file mongoose616.h.

◆ MG_LWIP

#define MG_LWIP   0

Definition at line 2058 of file mongoose616.h.

◆ MG_MAIN_IFACE

#define MG_MAIN_IFACE   0

Definition at line 3720 of file mongoose616.h.

◆ MG_MAX_DNS_ANSWERS

#define MG_MAX_DNS_ANSWERS   32

Definition at line 6145 of file mongoose616.h.

◆ MG_MAX_DNS_QUESTIONS

#define MG_MAX_DNS_QUESTIONS   32

Definition at line 6144 of file mongoose616.h.

◆ MG_MAX_HTTP_HEADERS

#define MG_MAX_HTTP_HEADERS   20

Definition at line 4794 of file mongoose616.h.

◆ MG_MAX_HTTP_REQUEST_SIZE

#define MG_MAX_HTTP_REQUEST_SIZE   1024

Definition at line 4798 of file mongoose616.h.

◆ MG_MAX_HTTP_SEND_MBUF

#define MG_MAX_HTTP_SEND_MBUF   1024

Definition at line 4802 of file mongoose616.h.

◆ MG_MAX_PATH

#define MG_MAX_PATH   256

Definition at line 4579 of file mongoose616.h.

◆ MG_MK_STR

#define MG_MK_STR (   str_literal)     { str_literal, sizeof(str_literal) - 1 }

Definition at line 2311 of file mongoose616.h.

2312 { str_literal, sizeof(str_literal) - 1 }

◆ MG_MK_STR_N

#define MG_MK_STR_N (   str_literal,
  len 
)     { str_literal, len }

Definition at line 2313 of file mongoose616.h.

2314 { str_literal, len }

◆ MG_MQTT_CLEAN_SESSION

#define MG_MQTT_CLEAN_SESSION   0x02

Definition at line 5887 of file mongoose616.h.

◆ MG_MQTT_CMD_CONNACK

#define MG_MQTT_CMD_CONNACK   2

Definition at line 5848 of file mongoose616.h.

◆ MG_MQTT_CMD_CONNECT

#define MG_MQTT_CMD_CONNECT   1

Definition at line 5847 of file mongoose616.h.

◆ MG_MQTT_CMD_DISCONNECT

#define MG_MQTT_CMD_DISCONNECT   14

Definition at line 5860 of file mongoose616.h.

◆ MG_MQTT_CMD_PINGREQ

#define MG_MQTT_CMD_PINGREQ   12

Definition at line 5858 of file mongoose616.h.

◆ MG_MQTT_CMD_PINGRESP

#define MG_MQTT_CMD_PINGRESP   13

Definition at line 5859 of file mongoose616.h.

◆ MG_MQTT_CMD_PUBACK

#define MG_MQTT_CMD_PUBACK   4

Definition at line 5850 of file mongoose616.h.

◆ MG_MQTT_CMD_PUBCOMP

#define MG_MQTT_CMD_PUBCOMP   7

Definition at line 5853 of file mongoose616.h.

◆ MG_MQTT_CMD_PUBLISH

#define MG_MQTT_CMD_PUBLISH   3

Definition at line 5849 of file mongoose616.h.

◆ MG_MQTT_CMD_PUBREC

#define MG_MQTT_CMD_PUBREC   5

Definition at line 5851 of file mongoose616.h.

◆ MG_MQTT_CMD_PUBREL

#define MG_MQTT_CMD_PUBREL   6

Definition at line 5852 of file mongoose616.h.

◆ MG_MQTT_CMD_SUBACK

#define MG_MQTT_CMD_SUBACK   9

Definition at line 5855 of file mongoose616.h.

◆ MG_MQTT_CMD_SUBSCRIBE

#define MG_MQTT_CMD_SUBSCRIBE   8

Definition at line 5854 of file mongoose616.h.

◆ MG_MQTT_CMD_UNSUBACK

#define MG_MQTT_CMD_UNSUBACK   11

Definition at line 5857 of file mongoose616.h.

◆ MG_MQTT_CMD_UNSUBSCRIBE

#define MG_MQTT_CMD_UNSUBSCRIBE   10

Definition at line 5856 of file mongoose616.h.

◆ MG_MQTT_DUP

#define MG_MQTT_DUP   0x4

Definition at line 5881 of file mongoose616.h.

◆ MG_MQTT_EVENT_BASE

#define MG_MQTT_EVENT_BASE   200

Definition at line 5863 of file mongoose616.h.

◆ MG_MQTT_GET_QOS

#define MG_MQTT_GET_QOS (   flags)    (((flags) &0x6) >> 1)

Definition at line 5883 of file mongoose616.h.

◆ MG_MQTT_GET_WILL_QOS

#define MG_MQTT_GET_WILL_QOS (   flags)    (((flags) &0x18) >> 3)

Definition at line 5892 of file mongoose616.h.

◆ MG_MQTT_HAS_PASSWORD

#define MG_MQTT_HAS_PASSWORD   0x40

Definition at line 5890 of file mongoose616.h.

◆ MG_MQTT_HAS_USER_NAME

#define MG_MQTT_HAS_USER_NAME   0x80

Definition at line 5891 of file mongoose616.h.

◆ MG_MQTT_HAS_WILL

#define MG_MQTT_HAS_WILL   0x04

Definition at line 5888 of file mongoose616.h.

◆ MG_MQTT_QOS

#define MG_MQTT_QOS (   qos)    ((qos) << 1)

Definition at line 5882 of file mongoose616.h.

◆ MG_MQTT_RETAIN

#define MG_MQTT_RETAIN   0x1

Definition at line 5880 of file mongoose616.h.

◆ MG_MQTT_SET_QOS

#define MG_MQTT_SET_QOS (   flags,
  qos 
)    (flags) = ((flags) & ~0x6) | ((qos) << 1)

Definition at line 5884 of file mongoose616.h.

◆ MG_MQTT_SET_WILL_QOS

#define MG_MQTT_SET_WILL_QOS (   flags,
  qos 
)     (flags) = ((flags) & ~0x18) | ((qos) << 3)

Definition at line 5893 of file mongoose616.h.

◆ MG_MQTT_WILL_RETAIN

#define MG_MQTT_WILL_RETAIN   0x20

Definition at line 5889 of file mongoose616.h.

◆ MG_NET_IF

#define MG_NET_IF   MG_NET_IF_SOCKET

Definition at line 3642 of file mongoose616.h.

◆ MG_NET_IF_LWIP_LOW_LEVEL

#define MG_NET_IF_LWIP_LOW_LEVEL   3

Definition at line 109 of file mongoose616.h.

◆ MG_NET_IF_NULL

#define MG_NET_IF_NULL   5

Definition at line 111 of file mongoose616.h.

◆ MG_NET_IF_PIC32

#define MG_NET_IF_PIC32   4

Definition at line 110 of file mongoose616.h.

◆ MG_NET_IF_SIMPLELINK

#define MG_NET_IF_SIMPLELINK   2

Definition at line 108 of file mongoose616.h.

◆ MG_NET_IF_SOCKET

#define MG_NET_IF_SOCKET   1

Definition at line 107 of file mongoose616.h.

◆ MG_NULL_STR

#define MG_NULL_STR    { NULL, 0 }

Definition at line 2315 of file mongoose616.h.

2316 { NULL, 0 }

◆ MG_RECV_FUNC

#define MG_RECV_FUNC (   s,
  b,
  l,
 
)    recv(s, b, l, f)

Definition at line 3930 of file mongoose616.h.

◆ MG_SEND_FUNC

#define MG_SEND_FUNC (   s,
  b,
  l,
 
)    send(s, b, l, f)

Definition at line 3931 of file mongoose616.h.

◆ MG_SOCK_STRINGIFY_IP

#define MG_SOCK_STRINGIFY_IP   1

Definition at line 4670 of file mongoose616.h.

◆ MG_SOCK_STRINGIFY_PORT

#define MG_SOCK_STRINGIFY_PORT   2

Definition at line 4671 of file mongoose616.h.

◆ MG_SOCK_STRINGIFY_REMOTE

#define MG_SOCK_STRINGIFY_REMOTE   4

Definition at line 4672 of file mongoose616.h.

◆ MG_SSL_IF

#define MG_SSL_IF   MG_SSL_IF_OPENSSL

Definition at line 3646 of file mongoose616.h.

◆ MG_SSL_IF_MBEDTLS

#define MG_SSL_IF_MBEDTLS   2

Definition at line 114 of file mongoose616.h.

◆ MG_SSL_IF_OPENSSL

#define MG_SSL_IF_OPENSSL   1

Definition at line 113 of file mongoose616.h.

◆ MG_SSL_IF_SIMPLELINK

#define MG_SSL_IF_SIMPLELINK   3

Definition at line 115 of file mongoose616.h.

◆ MG_UD_ARG

#define MG_UD_ARG (   ud)

Definition at line 3688 of file mongoose616.h.

◆ MG_URL_ENCODE_F_SPACE_AS_PLUS

#define MG_URL_ENCODE_F_SPACE_AS_PLUS   (1 << 0)

Definition at line 4757 of file mongoose616.h.

◆ MG_URL_ENCODE_F_UPPERCASE_HEX

#define MG_URL_ENCODE_F_UPPERCASE_HEX   (1 << 1)

Definition at line 4758 of file mongoose616.h.

◆ MG_VERSION

#define MG_VERSION   "6.16"

Definition at line 26 of file mongoose616.h.

◆ MG_VPRINTF_BUFFER_SIZE

#define MG_VPRINTF_BUFFER_SIZE   100

Definition at line 3923 of file mongoose616.h.

◆ NOINLINE

#define NOINLINE

Definition at line 165 of file mongoose616.h.

◆ NOINSTR

#define NOINSTR

Definition at line 167 of file mongoose616.h.

◆ NORETURN

#define NORETURN

Definition at line 164 of file mongoose616.h.

◆ PRINTF_LIKE

#define PRINTF_LIKE (   f,
 
)

Definition at line 143 of file mongoose616.h.

◆ QMD_LIST_CHECK_HEAD

#define QMD_LIST_CHECK_HEAD (   head,
  field 
)

Definition at line 3205 of file mongoose616.h.

◆ QMD_LIST_CHECK_NEXT

#define QMD_LIST_CHECK_NEXT (   elm,
  field 
)

Definition at line 3206 of file mongoose616.h.

◆ QMD_LIST_CHECK_PREV

#define QMD_LIST_CHECK_PREV (   elm,
  field 
)

Definition at line 3207 of file mongoose616.h.

◆ QMD_SAVELINK

#define QMD_SAVELINK (   name,
  link 
)

Definition at line 2902 of file mongoose616.h.

◆ QMD_TAILQ_CHECK_HEAD

#define QMD_TAILQ_CHECK_HEAD (   head,
  field 
)

Definition at line 3355 of file mongoose616.h.

◆ QMD_TAILQ_CHECK_NEXT

#define QMD_TAILQ_CHECK_NEXT (   elm,
  field 
)

Definition at line 3357 of file mongoose616.h.

◆ QMD_TAILQ_CHECK_PREV

#define QMD_TAILQ_CHECK_PREV (   elm,
  field 
)

Definition at line 3358 of file mongoose616.h.

◆ QMD_TAILQ_CHECK_TAIL

#define QMD_TAILQ_CHECK_TAIL (   head,
  headname 
)

Definition at line 3356 of file mongoose616.h.

◆ QMD_TRACE_ELEM

#define QMD_TRACE_ELEM (   elem)

Definition at line 2900 of file mongoose616.h.

◆ QMD_TRACE_HEAD

#define QMD_TRACE_HEAD (   head)

Definition at line 2901 of file mongoose616.h.

◆ QUEUE_TYPEOF

#define QUEUE_TYPEOF (   type)    struct type

Definition at line 2914 of file mongoose616.h.

◆ SLIST_CLASS_ENTRY

#define SLIST_CLASS_ENTRY (   type)
Value:
struct { \
class type *sle_next; /* next element */ \
}

Definition at line 2938 of file mongoose616.h.

2939 { \
2940 class type *sle_next; /* next element */ \
2941}

◆ SLIST_CLASS_HEAD

#define SLIST_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *slh_first; /* first element */ \
}

Definition at line 2925 of file mongoose616.h.

2926 { \
2927 class type *slh_first; /* first element */ \
2928}

◆ SLIST_EMPTY

#define SLIST_EMPTY (   head)    ((head)->slh_first == NULL)

Definition at line 2946 of file mongoose616.h.

◆ SLIST_ENTRY

#define SLIST_ENTRY (   type)
Value:
struct { \
struct type *sle_next; /* next element */ \
}

Definition at line 2933 of file mongoose616.h.

2934 { \
2935 struct type *sle_next; /* next element */ \
2936}

◆ SLIST_FIRST

#define SLIST_FIRST (   head)    ((head)->slh_first)

Definition at line 2948 of file mongoose616.h.

◆ SLIST_FOREACH

#define SLIST_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = SLIST_FIRST((head)); \
(var); \
#define SLIST_NEXT(elm, field)
#define SLIST_FIRST(head)

Definition at line 2950 of file mongoose616.h.

◆ SLIST_FOREACH_FROM

#define SLIST_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
(var); \

Definition at line 2955 of file mongoose616.h.

2956 : SLIST_FIRST((head))); \
2957 (var); \
2958 (var) = SLIST_NEXT((var), field))

◆ SLIST_FOREACH_FROM_SAFE

#define SLIST_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 2965 of file mongoose616.h.

2966 : SLIST_FIRST((head))); \
2967 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
2968 (var) = (tvar))

◆ SLIST_FOREACH_PREVPTR

#define SLIST_FOREACH_PREVPTR (   var,
  varp,
  head,
  field 
)
Value:
for ((varp) = &SLIST_FIRST((head)); \
((var) = *(varp)) != NULL; \

Definition at line 2970 of file mongoose616.h.

◆ SLIST_FOREACH_SAFE

#define SLIST_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = SLIST_FIRST((head)); \
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 2960 of file mongoose616.h.

◆ SLIST_HEAD

#define SLIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *slh_first; /* first element */ \
}

Definition at line 2920 of file mongoose616.h.

2921 { \
2922 struct type *slh_first; /* first element */ \
2923}

◆ SLIST_HEAD_INITIALIZER

#define SLIST_HEAD_INITIALIZER (   head)     { NULL }

Definition at line 2930 of file mongoose616.h.

2931 { NULL }

◆ SLIST_INIT

#define SLIST_INIT (   head)
Value:
do { \
} while (0)

Definition at line 2975 of file mongoose616.h.

2975 { \
2976 SLIST_FIRST((head)) = NULL; \
2977} while (0)

◆ SLIST_INSERT_AFTER

#define SLIST_INSERT_AFTER (   slistelm,
  elm,
  field 
)
Value:
do { \
} while (0)

Definition at line 2979 of file mongoose616.h.

2979 { \
2981 SLIST_NEXT((slistelm), field) = (elm); \
2982} while (0)

◆ SLIST_INSERT_HEAD

#define SLIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
} while (0)

Definition at line 2984 of file mongoose616.h.

2984 { \
2986 SLIST_FIRST((head)) = (elm); \
2987} while (0)

◆ SLIST_NEXT

#define SLIST_NEXT (   elm,
  field 
)    ((elm)->field.sle_next)

Definition at line 2989 of file mongoose616.h.

◆ SLIST_REMOVE

#define SLIST_REMOVE (   head,
  elm,
  type,
  field 
)
Value:

Definition at line 2991 of file mongoose616.h.

2991 { \
2992 QMD_SAVELINK(oldnext, (elm)->field.sle_next); \
2993 if (SLIST_FIRST((head)) == (elm)) { \
2995 } \
2996 else { \
2998 while (SLIST_NEXT(curelm, field) != (elm)) \
3001 } \
3002 TRASHIT(*oldnext); \
3003} while (0)

◆ SLIST_REMOVE_AFTER

#define SLIST_REMOVE_AFTER (   elm,
  field 
)
Value:
do { \
} while (0)

Definition at line 3005 of file mongoose616.h.

3005 { \
3008} while (0)

◆ SLIST_REMOVE_HEAD

#define SLIST_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
} while (0)

Definition at line 3010 of file mongoose616.h.

3010 { \
3012} while (0)

◆ SLIST_SWAP

#define SLIST_SWAP (   head1,
  head2,
  type 
)

◆ STAILQ_CLASS_ENTRY

#define STAILQ_CLASS_ENTRY (   type)
Value:
struct { \
class type *stqe_next; /* next element */ \
}

Definition at line 3043 of file mongoose616.h.

3044 { \
3045 class type *stqe_next; /* next element */ \
3046}

◆ STAILQ_CLASS_HEAD

#define STAILQ_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *stqh_first; /* first element */ \
class type **stqh_last; /* addr of last next element */ \
}

Definition at line 3029 of file mongoose616.h.

3030 { \
3031 class type *stqh_first; /* first element */ \
3032 class type **stqh_last; /* addr of last next element */ \
3033}

◆ STAILQ_CONCAT

#define STAILQ_CONCAT (   head1,
  head2 
)
Value:
do { \
*(head1)->stqh_last = (head2)->stqh_first; \
(head1)->stqh_last = (head2)->stqh_last; \
} \
} while (0)
#define STAILQ_EMPTY(head)

Definition at line 3051 of file mongoose616.h.

3051 { \
3052 if (!STAILQ_EMPTY((head2))) { \
3053 *(head1)->stqh_last = (head2)->stqh_first; \
3054 (head1)->stqh_last = (head2)->stqh_last; \
3055 STAILQ_INIT((head2)); \
3056 } \
3057} while (0)

◆ STAILQ_EMPTY

#define STAILQ_EMPTY (   head)    ((head)->stqh_first == NULL)

Definition at line 3059 of file mongoose616.h.

◆ STAILQ_ENTRY

#define STAILQ_ENTRY (   type)
Value:
struct { \
struct type *stqe_next; /* next element */ \
}

Definition at line 3038 of file mongoose616.h.

3039 { \
3040 struct type *stqe_next; /* next element */ \
3041}

◆ STAILQ_FIRST

#define STAILQ_FIRST (   head)    ((head)->stqh_first)

Definition at line 3061 of file mongoose616.h.

◆ STAILQ_FOREACH

#define STAILQ_FOREACH (   var,
  head,
  field 
)
Value:
for((var) = STAILQ_FIRST((head)); \
(var); \
#define STAILQ_FIRST(head)
#define STAILQ_NEXT(elm, field)

Definition at line 3063 of file mongoose616.h.

◆ STAILQ_FOREACH_FROM

#define STAILQ_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
(var); \

Definition at line 3068 of file mongoose616.h.

3069 : STAILQ_FIRST((head))); \
3070 (var); \
3071 (var) = STAILQ_NEXT((var), field))

◆ STAILQ_FOREACH_FROM_SAFE

#define STAILQ_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 3078 of file mongoose616.h.

3079 : STAILQ_FIRST((head))); \
3080 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
3081 (var) = (tvar))

◆ STAILQ_FOREACH_SAFE

#define STAILQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = STAILQ_FIRST((head)); \
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 3073 of file mongoose616.h.

◆ STAILQ_HEAD

#define STAILQ_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *stqh_first;/* first element */ \
struct type **stqh_last;/* addr of last next element */ \
}

Definition at line 3023 of file mongoose616.h.

3024 { \
3025 struct type *stqh_first;/* first element */ \
3026 struct type **stqh_last;/* addr of last next element */ \
3027}

◆ STAILQ_HEAD_INITIALIZER

#define STAILQ_HEAD_INITIALIZER (   head)     { NULL, &(head).stqh_first }

Definition at line 3035 of file mongoose616.h.

3036 { NULL, &(head).stqh_first }

◆ STAILQ_INIT

#define STAILQ_INIT (   head)
Value:
do { \
} while (0)

Definition at line 3083 of file mongoose616.h.

3083 { \
3084 STAILQ_FIRST((head)) = NULL; \
3085 (head)->stqh_last = &STAILQ_FIRST((head)); \
3086} while (0)

◆ STAILQ_INSERT_AFTER

#define STAILQ_INSERT_AFTER (   head,
  tqelm,
  elm,
  field 
)
Value:
do { \
} while (0)

Definition at line 3088 of file mongoose616.h.

3088 { \
3090 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
3091 STAILQ_NEXT((tqelm), field) = (elm); \
3092} while (0)

◆ STAILQ_INSERT_HEAD

#define STAILQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
} while (0)

Definition at line 3094 of file mongoose616.h.

3094 { \
3095 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
3096 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
3097 STAILQ_FIRST((head)) = (elm); \
3098} while (0)

◆ STAILQ_INSERT_TAIL

#define STAILQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
do { \
*(head)->stqh_last = (elm); \
} while (0)

Definition at line 3100 of file mongoose616.h.

3100 { \
3101 STAILQ_NEXT((elm), field) = NULL; \
3102 *(head)->stqh_last = (elm); \
3103 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
3104} while (0)

◆ STAILQ_LAST

#define STAILQ_LAST (   head,
  type,
  field 
)
Value:

Definition at line 3106 of file mongoose616.h.

3107 : \
3109 QUEUE_TYPEOF(type), field.stqe_next))

◆ STAILQ_NEXT

#define STAILQ_NEXT (   elm,
  field 
)    ((elm)->field.stqe_next)

Definition at line 3111 of file mongoose616.h.

◆ STAILQ_REMOVE

#define STAILQ_REMOVE (   head,
  elm,
  type,
  field 
)
Value:

Definition at line 3113 of file mongoose616.h.

3113 { \
3114 QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \
3115 if (STAILQ_FIRST((head)) == (elm)) { \
3117 } \
3118 else { \
3123 } \
3124 TRASHIT(*oldnext); \
3125} while (0)

◆ STAILQ_REMOVE_AFTER

#define STAILQ_REMOVE_AFTER (   head,
  elm,
  field 
)
Value:
do { \
} while (0)

Definition at line 3127 of file mongoose616.h.

3127 { \
3128 if ((STAILQ_NEXT(elm, field) = \
3130 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
3131} while (0)

◆ STAILQ_REMOVE_HEAD

#define STAILQ_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
} while (0)

Definition at line 3133 of file mongoose616.h.

3133 { \
3134 if ((STAILQ_FIRST((head)) = \
3136 (head)->stqh_last = &STAILQ_FIRST((head)); \
3137} while (0)

◆ STAILQ_SWAP

◆ TAILQ_CLASS_ENTRY

#define TAILQ_CLASS_ENTRY (   type)
Value:
struct { \
class type *tqe_next; /* next element */ \
class type **tqe_prev; /* address of previous next element */ \
}
#define TRACEBUF

Definition at line 3320 of file mongoose616.h.

3321 { \
3322 class type *tqe_next; /* next element */ \
3323 class type **tqe_prev; /* address of previous next element */ \
3324 TRACEBUF \
3325}

◆ TAILQ_CLASS_HEAD

#define TAILQ_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *tqh_first; /* first element */ \
class type **tqh_last; /* addr of last next element */ \
}
#define TRACEBUF

Definition at line 3303 of file mongoose616.h.

3304 { \
3305 class type *tqh_first; /* first element */ \
3306 class type **tqh_last; /* addr of last next element */ \
3307 TRACEBUF \
3308}

◆ TAILQ_CONCAT

#define TAILQ_CONCAT (   head1,
  head2,
  field 
)
Value:
do { \
*(head1)->tqh_last = (head2)->tqh_first; \
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
(head1)->tqh_last = (head2)->tqh_last; \
} \
} while (0)
#define TAILQ_EMPTY(head)

Definition at line 3361 of file mongoose616.h.

3361 { \
3362 if (!TAILQ_EMPTY(head2)) { \
3363 *(head1)->tqh_last = (head2)->tqh_first; \
3364 (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
3365 (head1)->tqh_last = (head2)->tqh_last; \
3369 } \
3370} while (0)

◆ TAILQ_EMPTY

#define TAILQ_EMPTY (   head)    ((head)->tqh_first == NULL)

Definition at line 3372 of file mongoose616.h.

◆ TAILQ_ENTRY

#define TAILQ_ENTRY (   type)
Value:
struct { \
struct type *tqe_next; /* next element */ \
struct type **tqe_prev; /* address of previous next element */ \
}

Definition at line 3313 of file mongoose616.h.

3314 { \
3315 struct type *tqe_next; /* next element */ \
3316 struct type **tqe_prev; /* address of previous next element */ \
3317 TRACEBUF \
3318}

◆ TAILQ_FIRST

#define TAILQ_FIRST (   head)    ((head)->tqh_first)

Definition at line 3374 of file mongoose616.h.

◆ TAILQ_FOREACH

#define TAILQ_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = TAILQ_FIRST((head)); \
(var); \
#define TAILQ_FIRST(head)
#define TAILQ_NEXT(elm, field)

Definition at line 3376 of file mongoose616.h.

◆ TAILQ_FOREACH_FROM

#define TAILQ_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
(var); \

Definition at line 3381 of file mongoose616.h.

3382 : TAILQ_FIRST((head))); \
3383 (var); \
3384 (var) = TAILQ_NEXT((var), field))

◆ TAILQ_FOREACH_FROM_SAFE

#define TAILQ_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 3391 of file mongoose616.h.

3392 : TAILQ_FIRST((head))); \
3393 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
3394 (var) = (tvar))

◆ TAILQ_FOREACH_REVERSE

#define TAILQ_FOREACH_REVERSE (   var,
  head,
  headname,
  field 
)
Value:
for ((var) = TAILQ_LAST((head), headname); \
(var); \
#define TAILQ_PREV(elm, headname, field)
#define TAILQ_LAST(head, headname)

Definition at line 3396 of file mongoose616.h.

◆ TAILQ_FOREACH_REVERSE_FROM

#define TAILQ_FOREACH_REVERSE_FROM (   var,
  head,
  headname,
  field 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
(var); \

Definition at line 3401 of file mongoose616.h.

3402 : TAILQ_LAST((head), headname)); \
3403 (var); \
3404 (var) = TAILQ_PREV((var), headname, field))

◆ TAILQ_FOREACH_REVERSE_FROM_SAFE

#define TAILQ_FOREACH_REVERSE_FROM_SAFE (   var,
  head,
  headname,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
(var) = (tvar))

Definition at line 3411 of file mongoose616.h.

3412 : TAILQ_LAST((head), headname)); \
3413 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
3414 (var) = (tvar))

◆ TAILQ_FOREACH_REVERSE_SAFE

#define TAILQ_FOREACH_REVERSE_SAFE (   var,
  head,
  headname,
  field,
  tvar 
)
Value:
for ((var) = TAILQ_LAST((head), headname); \
(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
(var) = (tvar))

Definition at line 3406 of file mongoose616.h.

◆ TAILQ_FOREACH_SAFE

#define TAILQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = TAILQ_FIRST((head)); \
(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
(var) = (tvar))

Definition at line 3386 of file mongoose616.h.

◆ TAILQ_HEAD

#define TAILQ_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *tqh_first; /* first element */ \
struct type **tqh_last; /* addr of last next element */ \
}

Definition at line 3296 of file mongoose616.h.

3297 { \
3298 struct type *tqh_first; /* first element */ \
3299 struct type **tqh_last; /* addr of last next element */ \
3300 TRACEBUF \
3301}

◆ TAILQ_HEAD_INITIALIZER

#define TAILQ_HEAD_INITIALIZER (   head)     { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }

Definition at line 3310 of file mongoose616.h.

#define TRACEBUF_INITIALIZER

◆ TAILQ_INIT

#define TAILQ_INIT (   head)
Value:
do { \
} while (0)

Definition at line 3416 of file mongoose616.h.

3416 { \
3417 TAILQ_FIRST((head)) = NULL; \
3418 (head)->tqh_last = &TAILQ_FIRST((head)); \
3420} while (0)

◆ TAILQ_INSERT_AFTER

#define TAILQ_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)
Value:

Definition at line 3422 of file mongoose616.h.

3422 { \
3425 TAILQ_NEXT((elm), field)->field.tqe_prev = \
3426 &TAILQ_NEXT((elm), field); \
3427 else { \
3428 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
3430 } \
3431 TAILQ_NEXT((listelm), field) = (elm); \
3432 (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
3435} while (0)

◆ TAILQ_INSERT_BEFORE

#define TAILQ_INSERT_BEFORE (   listelm,
  elm,
  field 
)
Value:
do { \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
*(listelm)->field.tqe_prev = (elm); \
(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
} while (0)

Definition at line 3437 of file mongoose616.h.

3437 { \
3439 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
3440 TAILQ_NEXT((elm), field) = (listelm); \
3441 *(listelm)->field.tqe_prev = (elm); \
3442 (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
3445} while (0)

◆ TAILQ_INSERT_HEAD

#define TAILQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
TAILQ_FIRST((head))->field.tqe_prev = \
else \
(elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
} while (0)

Definition at line 3447 of file mongoose616.h.

3447 { \
3449 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
3450 TAILQ_FIRST((head))->field.tqe_prev = \
3451 &TAILQ_NEXT((elm), field); \
3452 else \
3453 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
3454 TAILQ_FIRST((head)) = (elm); \
3455 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
3458} while (0)

◆ TAILQ_INSERT_TAIL

#define TAILQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
do { \
(elm)->field.tqe_prev = (head)->tqh_last; \
*(head)->tqh_last = (elm); \
} while (0)

Definition at line 3460 of file mongoose616.h.

3460 { \
3462 TAILQ_NEXT((elm), field) = NULL; \
3463 (elm)->field.tqe_prev = (head)->tqh_last; \
3464 *(head)->tqh_last = (elm); \
3465 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
3468} while (0)

◆ TAILQ_LAST

#define TAILQ_LAST (   head,
  headname 
)     (*(((struct headname *)((head)->tqh_last))->tqh_last))

Definition at line 3470 of file mongoose616.h.

◆ TAILQ_NEXT

#define TAILQ_NEXT (   elm,
  field 
)    ((elm)->field.tqe_next)

Definition at line 3473 of file mongoose616.h.

◆ TAILQ_PREV

#define TAILQ_PREV (   elm,
  headname,
  field 
)     (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))

Definition at line 3475 of file mongoose616.h.

◆ TAILQ_REMOVE

#define TAILQ_REMOVE (   head,
  elm,
  field 
)
Value:
do { \
TAILQ_NEXT((elm), field)->field.tqe_prev = \
(elm)->field.tqe_prev; \
else { \
(head)->tqh_last = (elm)->field.tqe_prev; \
} \
*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
} while (0)

Definition at line 3478 of file mongoose616.h.

3478 { \
3479 QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \
3480 QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \
3483 if ((TAILQ_NEXT((elm), field)) != NULL) \
3484 TAILQ_NEXT((elm), field)->field.tqe_prev = \
3485 (elm)->field.tqe_prev; \
3486 else { \
3487 (head)->tqh_last = (elm)->field.tqe_prev; \
3489 } \
3490 *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
3494} while (0)

◆ TAILQ_SWAP

#define TAILQ_SWAP (   head1,
  head2,
  type,
  field 
)
Value:
do { \
(head1)->tqh_first = (head2)->tqh_first; \
(head1)->tqh_last = (head2)->tqh_last; \
swap_first->field.tqe_prev = &(head1)->tqh_first; \
else \
(head1)->tqh_last = &(head1)->tqh_first; \
swap_first->field.tqe_prev = &(head2)->tqh_first; \
else \
(head2)->tqh_last = &(head2)->tqh_first; \
} while (0)

Definition at line 3496 of file mongoose616.h.

3496 { \
3499 (head1)->tqh_first = (head2)->tqh_first; \
3500 (head1)->tqh_last = (head2)->tqh_last; \
3501 (head2)->tqh_first = swap_first; \
3503 if ((swap_first = (head1)->tqh_first) != NULL) \
3504 swap_first->field.tqe_prev = &(head1)->tqh_first; \
3505 else \
3506 (head1)->tqh_last = &(head1)->tqh_first; \
3507 if ((swap_first = (head2)->tqh_first) != NULL) \
3508 swap_first->field.tqe_prev = &(head2)->tqh_first; \
3509 else \
3510 (head2)->tqh_last = &(head2)->tqh_first; \
3511} while (0)

◆ TRACEBUF

#define TRACEBUF

Definition at line 2903 of file mongoose616.h.

◆ TRACEBUF_INITIALIZER

#define TRACEBUF_INITIALIZER

Definition at line 2904 of file mongoose616.h.

◆ TRASHIT

#define TRASHIT (   x)

Definition at line 2905 of file mongoose616.h.

◆ WARN_UNUSED_RESULT

#define WARN_UNUSED_RESULT

Definition at line 166 of file mongoose616.h.

◆ WEAK

#define WEAK

Definition at line 153 of file mongoose616.h.

◆ WEBSOCKET_DONT_FIN

#define WEBSOCKET_DONT_FIN   0x100

Definition at line 5092 of file mongoose616.h.

◆ WEBSOCKET_OP_BINARY

#define WEBSOCKET_OP_BINARY   2

Definition at line 5075 of file mongoose616.h.

◆ WEBSOCKET_OP_CLOSE

#define WEBSOCKET_OP_CLOSE   8

Definition at line 5076 of file mongoose616.h.

◆ WEBSOCKET_OP_CONTINUE

#define WEBSOCKET_OP_CONTINUE   0

Definition at line 5073 of file mongoose616.h.

◆ WEBSOCKET_OP_PING

#define WEBSOCKET_OP_PING   9

Definition at line 5077 of file mongoose616.h.

◆ WEBSOCKET_OP_PONG

#define WEBSOCKET_OP_PONG   10

Definition at line 5078 of file mongoose616.h.

◆ WEBSOCKET_OP_TEXT

#define WEBSOCKET_OP_TEXT   1

Definition at line 5074 of file mongoose616.h.

Typedef Documentation

◆ cs_base64_putc_t

typedef void(* cs_base64_putc_t) (char, void *)

Definition at line 2524 of file mongoose616.h.

◆ mg_event_handler_t

typedef void(* mg_event_handler_t) (struct mg_connection *nc, int ev, void *ev_data MG_UD_ARG(void *user_data))

Definition at line 3954 of file mongoose616.h.

◆ mg_resolve_callback_t

typedef void(* mg_resolve_callback_t) (struct mg_dns_message *dns_message, void *user_data, enum mg_resolve_err)

Definition at line 6405 of file mongoose616.h.

Enumeration Type Documentation

◆ mg_dns_resource_record_kind

Enumerator
MG_DNS_INVALID_RECORD 
MG_DNS_QUESTION 
MG_DNS_ANSWER 

Definition at line 6149 of file mongoose616.h.

6149 {
6153};
@ MG_DNS_INVALID_RECORD
@ MG_DNS_ANSWER
@ MG_DNS_QUESTION

◆ mg_resolve_err

Enumerator
MG_RESOLVE_OK 
MG_RESOLVE_NO_ANSWERS 
MG_RESOLVE_EXCEEDED_RETRY_COUNT 
MG_RESOLVE_TIMEOUT 

Definition at line 6398 of file mongoose616.h.

6398 {
6399 MG_RESOLVE_OK = 0,
6403};
@ MG_RESOLVE_TIMEOUT
@ MG_RESOLVE_EXCEEDED_RETRY_COUNT
@ MG_RESOLVE_OK
@ MG_RESOLVE_NO_ANSWERS

Function Documentation

◆ cs_base64_decode()

int cs_base64_decode ( const unsigned char s,
int  len,
char dst,
int dec_len 
)

Definition at line 410 of file mongoose614.cxx.

410 {
411 unsigned char a, b, c, d;
412 int orig_len = len;
413 char *orig_dst = dst;
414 while (len >= 4 && (a = from_b64(s[0])) != 255 &&
415 (b = from_b64(s[1])) != 255 && (c = from_b64(s[2])) != 255 &&
416 (d = from_b64(s[3])) != 255) {
417 s += 4;
418 len -= 4;
419 if (a == 200 || b == 200) break; /* '=' can't be there */
420 *dst++ = a << 2 | b >> 4;
421 if (c == 200) break;
422 *dst++ = b << 4 | c >> 2;
423 if (d == 200) break;
424 *dst++ = c << 6 | d;
425 }
426 *dst = 0;
427 if (dec_len != NULL) *dec_len = (dst - orig_dst);
428 return orig_len - len;
429}
static unsigned char from_b64(unsigned char ch)
double d
Definition system.cxx:1311
char c
Definition system.cxx:1310
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cs_from_hex()

void cs_from_hex ( char to,
const char p,
size_t  len 
)

Definition at line 2154 of file mongoose614.cxx.

2154 {
2155 size_t i;
2156
2157 for (i = 0; i < len; i += 2) {
2158 *to++ = (fourbit(p[i]) << 4) + fourbit(p[i + 1]);
2159 }
2160 *to = '\0';
2161}
INT i
Definition mdump.cxx:32
static int fourbit(int ch)
Here is the call graph for this function:

◆ cs_md5_final()

void cs_md5_final ( unsigned char md,
cs_md5_ctx c 
)

◆ cs_md5_init()

void cs_md5_init ( cs_md5_ctx c)

Definition at line 1094 of file mongoose614.cxx.

1094 {
1095 ctx->buf[0] = 0x67452301;
1096 ctx->buf[1] = 0xefcdab89;
1097 ctx->buf[2] = 0x98badcfe;
1098 ctx->buf[3] = 0x10325476;
1099
1100 ctx->bits[0] = 0;
1101 ctx->bits[1] = 0;
1102}

◆ cs_md5_update()

void cs_md5_update ( cs_md5_ctx c,
const unsigned char data,
size_t  len 
)

Definition at line 1186 of file mongoose614.cxx.

1186 {
1187 uint32_t t;
1188
1189 t = ctx->bits[0];
1190 if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) ctx->bits[1]++;
1191 ctx->bits[1] += (uint32_t) len >> 29;
1192
1193 t = (t >> 3) & 0x3f;
1194
1195 if (t) {
1196 unsigned char *p = (unsigned char *) ctx->in + t;
1197
1198 t = 64 - t;
1199 if (len < t) {
1200 memcpy(p, buf, len);
1201 return;
1202 }
1203 memcpy(p, buf, t);
1204 byteReverse(ctx->in, 16);
1205 cs_md5_transform(ctx->buf, (uint32_t *) ctx->in);
1206 buf += t;
1207 len -= t;
1208 }
1209
1210 while (len >= 64) {
1211 memcpy(ctx->in, buf, 64);
1212 byteReverse(ctx->in, 16);
1213 cs_md5_transform(ctx->buf, (uint32_t *) ctx->in);
1214 buf += 64;
1215 len -= 64;
1216 }
1217
1218 memcpy(ctx->in, buf, len);
1219}
static void cs_md5_transform(uint32_t buf[4], uint32_t const in[16])
static void byteReverse(unsigned char *buf, unsigned longs)
Here is the call graph for this function:

◆ cs_timegm()

double cs_timegm ( const struct tm tm)

Definition at line 958 of file mongoose614.cxx.

958 {
959 /* Month-to-day offset for non-leap-years. */
960 static const int month_day[12] = {0, 31, 59, 90, 120, 151,
961 181, 212, 243, 273, 304, 334};
962
963 /* Most of the calculation is easy; leap years are the main difficulty. */
964 int month = tm->tm_mon % 12;
965 int year = tm->tm_year + tm->tm_mon / 12;
966 int year_for_leap;
967 int64_t rt;
968
969 if (month < 0) { /* Negative values % 12 are still negative. */
970 month += 12;
971 --year;
972 }
973
974 /* This is the number of Februaries since 1900. */
975 year_for_leap = (month > 1) ? year + 1 : year;
976
977 rt =
978 tm->tm_sec /* Seconds */
979 +
980 60 *
981 (tm->tm_min /* Minute = 60 seconds */
982 +
983 60 * (tm->tm_hour /* Hour = 60 minutes */
984 +
985 24 * (month_day[month] + tm->tm_mday - 1 /* Day = 24 hours */
986 + 365 * (year - 70) /* Year = 365 days */
987 + (year_for_leap - 69) / 4 /* Every 4 years is leap... */
988 - (year_for_leap - 1) / 100 /* Except centuries... */
989 + (year_for_leap + 299) / 400))); /* Except 400s. */
990 return rt < 0 ? -1 : (double) rt;
991}
MUTEX_T * tm
Definition odbedit.cxx:39
Here is the call graph for this function:

◆ mbuf_append_and_free()

size_t mbuf_append_and_free ( struct mbuf a,
void data,
size_t  data_size 
)

Definition at line 1628 of file mongoose614.cxx.

1628 {
1629 size_t ret;
1630 /* Optimization: if the buffer is currently empty,
1631 * take over the user-provided buffer. */
1632 if (a->len == 0) {
1633 if (a->buf != NULL) free(a->buf);
1634 a->buf = (char *) data;
1635 a->len = a->size = len;
1636 return len;
1637 }
1638 ret = mbuf_insert(a, a->len, data, len);
1639 free(data);
1640 return ret;
1641}
size_t mbuf_insert(struct mbuf *a, size_t off, const void *buf, size_t) WEAK
size_t len
Definition mongoose6.h:835
char * buf
Definition mongoose6.h:834
size_t size
Definition mongoose6.h:836
void * data
Definition mana.cxx:268
Here is the call graph for this function:

◆ mbuf_clear()

void mbuf_clear ( struct mbuf mb)

Definition at line 1652 of file mongoose614.cxx.

1652 {
1653 mb->len = 0;
1654}
Here is the call graph for this function:

◆ mbuf_move()

void mbuf_move ( struct mbuf from,
struct mbuf to 
)

Definition at line 1657 of file mongoose614.cxx.

1657 {
1658 memcpy(to, from, sizeof(*to));
1659 memset(from, 0, sizeof(*from));
1660}
Here is the call graph for this function:

◆ mg_add_sock()

struct mg_connection * mg_add_sock ( struct mg_mgr mgr,
sock_t  sock,
MG_CB(mg_event_handler_t handler, void *user_data)   
)

◆ mg_add_sock_opt()

struct mg_connection * mg_add_sock_opt ( struct mg_mgr mgr,
sock_t  sock,
MG_CB(mg_event_handler_t handler, void *user_data)  ,
struct mg_add_sock_opts  opts 
)

◆ mg_asprintf()

int mg_asprintf ( char **  buf,
size_t  size,
const char fmt,
  ... 
)

◆ mg_assemble_uri()

int mg_assemble_uri ( const struct mg_str scheme,
const struct mg_str user_info,
const struct mg_str host,
unsigned int  port,
const struct mg_str path,
const struct mg_str query,
const struct mg_str fragment,
int  normalize_path,
struct mg_str uri 
)

Definition at line 5751 of file mongoose614.cxx.

5755 {
5756 int result = -1;
5757 struct mbuf out;
5758 mbuf_init(&out, 0);
5759
5760 if (scheme != NULL && scheme->len > 0) {
5761 mbuf_append(&out, scheme->p, scheme->len);
5762 mbuf_append(&out, "://", 3);
5763 }
5764
5765 if (user_info != NULL && user_info->len > 0) {
5766 mbuf_append(&out, user_info->p, user_info->len);
5767 mbuf_append(&out, "@", 1);
5768 }
5769
5770 if (host != NULL && host->len > 0) {
5771 mbuf_append(&out, host->p, host->len);
5772 }
5773
5774 if (port != 0) {
5775 char port_str[20];
5776 int port_str_len = sprintf(port_str, ":%u", port);
5778 }
5779
5780 if (path != NULL && path->len > 0) {
5781 if (normalize_path) {
5782 struct mg_str npath = mg_strdup(*path);
5783 if (npath.len != path->len) goto out;
5784 if (!mg_normalize_uri_path(path, &npath)) {
5785 free((void *) npath.p);
5786 goto out;
5787 }
5788 mbuf_append(&out, npath.p, npath.len);
5789 free((void *) npath.p);
5790 } else {
5791 mbuf_append(&out, path->p, path->len);
5792 }
5793 } else if (normalize_path) {
5794 mbuf_append(&out, "/", 1);
5795 }
5796
5797 if (query != NULL && query->len > 0) {
5798 mbuf_append(&out, "?", 1);
5799 mbuf_append(&out, query->p, query->len);
5800 }
5801
5802 if (fragment != NULL && fragment->len > 0) {
5803 mbuf_append(&out, "#", 1);
5804 mbuf_append(&out, fragment->p, fragment->len);
5805 }
5806
5807 result = 0;
5808
5809out:
5810 if (result == 0) {
5811 uri->p = out.buf;
5812 uri->len = out.len;
5813 } else {
5814 mbuf_free(&out);
5815 uri->p = NULL;
5816 uri->len = 0;
5817 }
5818 return result;
5819}
int mg_normalize_uri_path(const struct mg_str *in, struct mg_str *out)
void mbuf_free(struct mbuf *mbuf) WEAK
size_t len
Definition mongoose6.h:1207
void mbuf_init(struct mbuf *mbuf, size_t initial_size) WEAK
size_t mbuf_append(struct mbuf *a, const void *buf, size_t len) WEAK
const char * p
Definition mongoose6.h:1206
struct mg_str mg_strdup(const struct mg_str s) WEAK
Here is the call graph for this function:

◆ mg_basic_auth_header()

void mg_basic_auth_header ( const struct mg_str  user,
const struct mg_str  pass,
struct mbuf buf 
)

Definition at line 10750 of file mongoose614.cxx.

10751 {
10752 const char *header_prefix = "Authorization: Basic ";
10753 const char *header_suffix = "\r\n";
10754
10755 struct cs_base64_ctx ctx;
10757
10759
10760 cs_base64_update(&ctx, user.p, user.len);
10761 if (pass.len > 0) {
10762 cs_base64_update(&ctx, ":", 1);
10763 cs_base64_update(&ctx, pass.p, pass.len);
10764 }
10765 cs_base64_finish(&ctx);
10767}
void cs_base64_update(struct cs_base64_ctx *ctx, const char *str, size_t len)
void cs_base64_finish(struct cs_base64_ctx *ctx)
void cs_base64_init(struct cs_base64_ctx *ctx, cs_base64_putc_t b64_putc, void *user_data)
void mg_mbuf_append_base64_putc(char ch, void *user_data)
Here is the call graph for this function:

◆ mg_bind()

struct mg_connection * mg_bind ( struct mg_mgr mgr,
const char address,
MG_CB(mg_event_handler_t handler, void *user_data)   
)

◆ mg_bind_opt()

struct mg_connection * mg_bind_opt ( struct mg_mgr mgr,
const char address,
MG_CB(mg_event_handler_t handler, void *user_data)  ,
struct mg_bind_opts  opts 
)

◆ mg_check_digest_auth()

int mg_check_digest_auth ( struct mg_str  method,
struct mg_str  uri,
struct mg_str  username,
struct mg_str  cnonce,
struct mg_str  response,
struct mg_str  qop,
struct mg_str  nc,
struct mg_str  nonce,
struct mg_str  auth_domain,
FILE fp 
)

◆ mg_connect()

struct mg_connection * mg_connect ( struct mg_mgr mgr,
const char address,
MG_CB(mg_event_handler_t handler, void *user_data)   
)

◆ mg_connect_http()

struct mg_connection * mg_connect_http ( struct mg_mgr mgr,
MG_CB(mg_event_handler_t event_handler, void *user_data)  ,
const char url,
const char extra_headers,
const char post_data 
)

◆ mg_connect_http_opt()

struct mg_connection * mg_connect_http_opt ( struct mg_mgr mgr,
MG_CB(mg_event_handler_t ev_handler, void *user_data)  ,
struct mg_connect_opts  opts,
const char url,
const char extra_headers,
const char post_data 
)

◆ mg_connect_opt()

struct mg_connection * mg_connect_opt ( struct mg_mgr mgr,
const char address,
MG_CB(mg_event_handler_t handler, void *user_data)  ,
struct mg_connect_opts  opts 
)

◆ mg_connect_ws()

struct mg_connection * mg_connect_ws ( struct mg_mgr mgr,
MG_CB(mg_event_handler_t event_handler, void *user_data)  ,
const char url,
const char protocol,
const char extra_headers 
)

◆ mg_connect_ws_opt()

struct mg_connection * mg_connect_ws_opt ( struct mg_mgr mgr,
MG_CB(mg_event_handler_t ev_handler, void *user_data)  ,
struct mg_connect_opts  opts,
const char url,
const char protocol,
const char extra_headers 
)

◆ mg_dns_copy_questions()

int mg_dns_copy_questions ( struct mbuf io,
struct mg_dns_message msg 
)

◆ mg_dns_encode_name()

int mg_dns_encode_name ( struct mbuf io,
const char name,
size_t  len 
)

◆ mg_find_iface()

struct mg_iface * mg_find_iface ( struct mg_mgr mgr,
const struct mg_iface_vtable vtable,
struct mg_iface from 
)

Definition at line 3643 of file mongoose614.cxx.

3645 {
3646 int i = 0;
3647 if (from != NULL) {
3648 for (i = 0; i < mgr->num_ifaces; i++) {
3649 if (mgr->ifaces[i] == from) {
3650 i++;
3651 break;
3652 }
3653 }
3654 }
3655
3656 for (; i < mgr->num_ifaces; i++) {
3657 if (mgr->ifaces[i]->vtable == vtable) {
3658 return mgr->ifaces[i];
3659 }
3660 }
3661 return NULL;
3662}
const struct mg_iface_vtable * vtable
int num_ifaces
struct mg_iface ** ifaces
Here is the call graph for this function:

◆ mg_get_http_basic_auth()

int mg_get_http_basic_auth ( struct http_message hm,
char user,
size_t  user_len,
char pass,
size_t  pass_len 
)

◆ mg_hash_md5_v()

void mg_hash_md5_v ( size_t  num_msgs,
const uint8_t msgs[],
const size_t msg_lens,
uint8_t digest 
)
extern

◆ mg_hash_sha1_v()

void mg_hash_sha1_v ( size_t  num_msgs,
const uint8_t msgs[],
const size_t msg_lens,
uint8_t digest 
)
extern

◆ mg_http_check_digest_auth()

int mg_http_check_digest_auth ( struct http_message hm,
const char auth_domain,
FILE fp 
)

◆ mg_http_create_digest_auth_header()

int mg_http_create_digest_auth_header ( char buf,
size_t  buf_len,
const char method,
const char uri,
const char auth_domain,
const char user,
const char passwd,
const char nonce 
)

◆ mg_http_is_authorized()

int mg_http_is_authorized ( struct http_message hm,
struct mg_str  path,
const char domain,
const char passwords_file,
int  flags 
)

◆ mg_http_parse_header2()

int mg_http_parse_header2 ( struct mg_str hdr,
const char var_name,
char **  buf,
size_t  buf_size 
)

◆ mg_http_send_digest_auth_request()

void mg_http_send_digest_auth_request ( struct mg_connection c,
const char domain 
)

◆ mg_http_send_error()

void mg_http_send_error ( struct mg_connection nc,
int  code,
const char reason 
)

◆ mg_http_send_redirect()

void mg_http_send_redirect ( struct mg_connection nc,
int  status_code,
const struct mg_str  location,
const struct mg_str  extra_headers 
)

◆ mg_if_can_recv_cb()

void mg_if_can_recv_cb ( struct mg_connection nc)

Definition at line 2968 of file mongoose614.cxx.

2968 {
2969 mg_do_recv(nc);
2970}
static int mg_do_recv(struct mg_connection *nc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_if_can_send_cb()

void mg_if_can_send_cb ( struct mg_connection nc)

Definition at line 3091 of file mongoose614.cxx.

3091 {
3092 int n = 0;
3093 const char *buf = nc->send_mbuf.buf;
3094 size_t len = nc->send_mbuf.len;
3095
3097 return;
3098 }
3099 if (!(nc->flags & MG_F_UDP)) {
3100 if (nc->flags & MG_F_LISTENING) return;
3101 if (len > MG_TCP_IO_SIZE) len = MG_TCP_IO_SIZE;
3102 }
3103#if MG_ENABLE_SSL
3104 if (nc->flags & MG_F_SSL) {
3105 if (nc->flags & MG_F_SSL_HANDSHAKE_DONE) {
3106 if (len > 0) {
3107 n = mg_ssl_if_write(nc, buf, len);
3108 DBG(("%p -> %d bytes (SSL)", nc, n));
3109 }
3110 if (n < 0) {
3111 if (n == MG_SSL_WANT_WRITE) {
3112 nc->flags |= MG_F_WANT_WRITE;
3113 n = 0;
3114 } else {
3116 }
3117 } else {
3118 nc->flags &= ~MG_F_WANT_WRITE;
3119 }
3120 } else {
3121 mg_ssl_handshake(nc);
3122 }
3123 } else
3124#endif
3125 if (len > 0) {
3126 if (nc->flags & MG_F_UDP) {
3127 n = nc->iface->vtable->udp_send(nc, buf, len);
3128 } else {
3129 n = nc->iface->vtable->tcp_send(nc, buf, len);
3130 }
3131 DBG(("%p -> %d bytes", nc, n));
3132 }
3133
3134#if !defined(NO_LIBC) && MG_ENABLE_HEXDUMP
3135 if (n > 0 && nc->mgr && nc->mgr->hexdump_file != NULL) {
3137 }
3138#endif
3139 if (n < 0) {
3141 } else if (n > 0) {
3142 nc->last_io_time = (time_t) mg_time();
3143 mbuf_remove(&nc->send_mbuf, n);
3144 mbuf_trim(&nc->send_mbuf);
3145 }
3146 if (n != 0) mg_call(nc, NULL, nc->user_data, MG_EV_SEND, &n);
3147}
const char * hexdump_file
Definition mongoose6.h:1232
void * user_data
Definition mongoose6.h:1265
#define MG_F_CLOSE_IMMEDIATELY
Definition mongoose6.h:1289
void mbuf_remove(struct mbuf *mb, size_t n) WEAK
#define MG_F_LISTENING
Definition mongoose6.h:1278
void mg_hexdump_connection(struct mg_connection *nc, const char *path, const void *buf, int num_bytes, int ev)
struct mbuf send_mbuf
Definition mongoose6.h:1256
#define MG_F_UDP
Definition mongoose6.h:1279
double mg_time(void)
#define MG_EV_SEND
Definition mongoose6.h:1223
unsigned long flags
Definition mongoose6.h:1276
time_t last_io_time
Definition mongoose6.h:1259
struct mg_mgr * mgr
Definition mongoose6.h:1249
#define MG_F_SSL_HANDSHAKE_DONE
Definition mongoose6.h:1282
void mbuf_trim(struct mbuf *mbuf) WEAK
#define MG_F_WANT_WRITE
Definition mongoose6.h:1284
#define MG_F_CONNECTING
Definition mongoose6.h:1281
DWORD n[4]
Definition mana.cxx:247
#define DBG(x)
#define MG_TCP_IO_SIZE
MG_INTERNAL void mg_call(struct mg_connection *nc, mg_event_handler_t ev_handler, void *user_data, int ev, void *ev_data)
#define MG_F_SSL
struct mg_iface * iface
int(* udp_send)(struct mg_connection *nc, const void *buf, size_t len)
int(* tcp_send)(struct mg_connection *nc, const void *buf, size_t len)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_if_create_iface()

struct mg_iface * mg_if_create_iface ( const struct mg_iface_vtable vtable,
struct mg_mgr mgr 
)

Definition at line 3634 of file mongoose614.cxx.

3635 {
3636 struct mg_iface *iface = (struct mg_iface *) MG_CALLOC(1, sizeof(*iface));
3637 iface->mgr = mgr;
3638 iface->data = NULL;
3639 iface->vtable = vtable;
3640 return iface;
3641}
#define MG_CALLOC
struct mg_mgr * mgr
void * data
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_if_poll()

int mg_if_poll ( struct mg_connection nc,
double  now 
)

Definition at line 2494 of file mongoose614.cxx.

2494 {
2495 if (nc->flags & MG_F_CLOSE_IMMEDIATELY) {
2496 mg_close_conn(nc);
2497 return 0;
2498 } else if (nc->flags & MG_F_SEND_AND_CLOSE) {
2499 if (nc->send_mbuf.len == 0) {
2501 mg_close_conn(nc);
2502 return 0;
2503 }
2504 } else if (nc->flags & MG_F_RECV_AND_CLOSE) {
2505 mg_close_conn(nc);
2506 return 0;
2507 }
2508#if MG_ENABLE_SSL
2509 if ((nc->flags & (MG_F_SSL | MG_F_LISTENING | MG_F_CONNECTING)) == MG_F_SSL) {
2510 /* SSL library may have data to be delivered to the app in its buffers,
2511 * drain them. */
2512 int recved = 0;
2513 do {
2514 if (nc->flags & (MG_F_WANT_READ | MG_F_WANT_WRITE)) break;
2515 if (recv_avail_size(nc, MG_TCP_IO_SIZE) <= 0) break;
2516 recved = mg_do_recv(nc);
2517 } while (recved > 0);
2518 }
2519#endif /* MG_ENABLE_SSL */
2520 mg_timer(nc, now);
2521 {
2522 time_t now_t = (time_t) now;
2523 mg_call(nc, NULL, nc->user_data, MG_EV_POLL, &now_t);
2524 }
2525 return 1;
2526}
#define MG_F_WANT_READ
Definition mongoose6.h:1283
#define MG_EV_POLL
Definition mongoose6.h:1219
MG_INTERNAL void mg_close_conn(struct mg_connection *conn)
#define MG_F_SEND_AND_CLOSE
Definition mongoose6.h:1288
MG_INTERNAL size_t recv_avail_size(struct mg_connection *conn, size_t max)
MG_INTERNAL void mg_timer(struct mg_connection *c, double now)
#define MG_F_RECV_AND_CLOSE
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_mbuf_append_base64()

void mg_mbuf_append_base64 ( struct mbuf mbuf,
const void data,
size_t  len 
)

Definition at line 10743 of file mongoose614.cxx.

10743 {
10744 struct cs_base64_ctx ctx;
10746 cs_base64_update(&ctx, (const char *) data, len);
10747 cs_base64_finish(&ctx);
10748}
Here is the call graph for this function:

◆ mg_mbuf_append_base64_putc()

void mg_mbuf_append_base64_putc ( char  ch,
void user_data 
)

Definition at line 10738 of file mongoose614.cxx.

10738 {
10739 struct mbuf *mbuf = (struct mbuf *) user_data;
10740 mbuf_append(mbuf, &ch, sizeof(ch));
10741}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_mgr_init_opt()

void mg_mgr_init_opt ( struct mg_mgr mgr,
void user_data,
struct mg_mgr_init_opts  opts 
)

Definition at line 2576 of file mongoose614.cxx.

2577 {
2578 memset(m, 0, sizeof(*m));
2579#if MG_ENABLE_BROADCAST
2580 m->ctl[0] = m->ctl[1] = INVALID_SOCKET;
2581#endif
2582 m->user_data = user_data;
2583
2584#ifdef _WIN32
2585 {
2586 WSADATA data;
2587 WSAStartup(MAKEWORD(2, 2), &data);
2588 }
2589#elif defined(__unix__)
2590 /* Ignore SIGPIPE signal, so if client cancels the request, it
2591 * won't kill the whole process. */
2593#endif
2594
2595 {
2596 int i;
2597 if (opts.num_ifaces == 0) {
2598 opts.num_ifaces = mg_num_ifaces;
2599 opts.ifaces = mg_ifaces;
2600 }
2601 if (opts.main_iface != NULL) {
2602 opts.ifaces[MG_MAIN_IFACE] = opts.main_iface;
2603 }
2604 m->num_ifaces = opts.num_ifaces;
2605 m->ifaces =
2606 (struct mg_iface **) MG_MALLOC(sizeof(*m->ifaces) * opts.num_ifaces);
2607 for (i = 0; i < opts.num_ifaces; i++) {
2608 m->ifaces[i] = mg_if_create_iface(opts.ifaces[i], m);
2609 m->ifaces[i]->vtable->init(m->ifaces[i]);
2610 }
2611 }
2612 if (opts.nameserver != NULL) {
2613 m->nameserver = strdup(opts.nameserver);
2614 }
2615 DBG(("=================================="));
2616 DBG(("init mgr=%p", m));
2617#if MG_ENABLE_SSL
2618 {
2619 static int init_done;
2620 if (!init_done) {
2622 init_done++;
2623 }
2624 }
2625#endif
2626}
#define INVALID_SOCKET
#define MG_MALLOC
const struct mg_iface_vtable * mg_ifaces[]
int mg_num_ifaces
struct mg_iface * mg_if_create_iface(const struct mg_iface_vtable *vtable, struct mg_mgr *mgr)
#define MG_MAIN_IFACE
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_mgr_min_timer()

double mg_mgr_min_timer ( const struct mg_mgr mgr)

Definition at line 3664 of file mongoose614.cxx.

3664 {
3665 double min_timer = 0;
3666 struct mg_connection *nc;
3667 for (nc = mgr->active_connections; nc != NULL; nc = nc->next) {
3668 if (nc->ev_timer_time <= 0) continue;
3669 if (min_timer == 0 || nc->ev_timer_time < min_timer) {
3671 }
3672 }
3673 return min_timer;
3674}
struct mg_connection * active_connections
Definition mongoose6.h:1231
struct mg_connection * next
Definition mongoose6.h:1247
double ev_timer_time
Definition mongoose6.h:1260
Here is the call graph for this function:

◆ mg_mk_str_n()

struct mg_str mg_mk_str_n ( const char s,
size_t  len 
)

Definition at line 1701 of file mongoose614.cxx.

1701 {
1702 struct mg_str ret = {s, len};
1703 return ret;
1704}
Here is the caller graph for this function:

◆ mg_mqtt_match_topic_expression()

int mg_mqtt_match_topic_expression ( struct mg_str  exp,
struct mg_str  topic 
)

◆ mg_mqtt_vmatch_topic_expression()

int mg_mqtt_vmatch_topic_expression ( const char exp,
struct mg_str  topic 
)

◆ mg_next_comma_list_entry_n()

struct mg_str mg_next_comma_list_entry_n ( struct mg_str  list,
struct mg_str val,
struct mg_str eq_val 
)

Definition at line 2271 of file mongoose614.cxx.

2272 {
2273 if (list.len == 0) {
2274 /* End of the list */
2275 list = mg_mk_str(NULL);
2276 } else {
2277 const char *chr = NULL;
2278 *val = list;
2279
2280 if ((chr = mg_strchr(*val, ',')) != NULL) {
2281 /* Comma found. Store length and shift the list ptr */
2282 val->len = chr - val->p;
2283 chr++;
2284 list.len -= (chr - list.p);
2285 list.p = chr;
2286 } else {
2287 /* This value is the last one */
2288 list = mg_mk_str_n(list.p + list.len, 0);
2289 }
2290
2291 if (eq_val != NULL) {
2292 /* Value has form "x=y", adjust pointers and lengths */
2293 /* so that val points to "x", and eq_val points to "y". */
2294 eq_val->len = 0;
2295 eq_val->p = (const char *) memchr(val->p, '=', val->len);
2296 if (eq_val->p != NULL) {
2297 eq_val->p++; /* Skip over '=' character */
2298 eq_val->len = val->p + val->len - eq_val->p;
2299 val->len = (eq_val->p - val->p) - 1;
2300 }
2301 }
2302 }
2303
2304 return list;
2305}
struct mg_str mg_mk_str(const char *s) WEAK
const char * mg_strchr(const struct mg_str s, int c) WEAK
struct mg_str mg_mk_str_n(const char *s, size_t len) WEAK
static te_expr * list(state *s)
Definition tinyexpr.c:567
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_parse_http_basic_auth()

int mg_parse_http_basic_auth ( struct mg_str hdr,
char user,
size_t  user_len,
char pass,
size_t  pass_len 
)

◆ mg_register_http_endpoint()

void mg_register_http_endpoint ( struct mg_connection nc,
const char uri_path,
MG_CB(mg_event_handler_t handler, void *user_data)   
)

◆ mg_register_http_endpoint_opt()

void mg_register_http_endpoint_opt ( struct mg_connection nc,
const char uri_path,
mg_event_handler_t  handler,
struct mg_http_endpoint_opts  opts 
)

◆ mg_send_websocket_handshake3()

void mg_send_websocket_handshake3 ( struct mg_connection nc,
const char path,
const char host,
const char protocol,
const char extra_headers,
const char user,
const char pass 
)

◆ mg_send_websocket_handshake3v()

void mg_send_websocket_handshake3v ( struct mg_connection nc,
const struct mg_str  path,
const struct mg_str  host,
const struct mg_str  protocol,
const struct mg_str  extra_headers,
const struct mg_str  user,
const struct mg_str  pass 
)

◆ mg_set_nameserver()

void mg_set_nameserver ( struct mg_mgr mgr,
const char nameserver 
)

◆ mg_str_starts_with()

int mg_str_starts_with ( struct mg_str  s,
struct mg_str  prefix 
)

Definition at line 1822 of file mongoose614.cxx.

1822 {
1823 const struct mg_str sp = MG_MK_STR_N(s.p, prefix.len);
1824 if (s.len < prefix.len) return 0;
1825 return (mg_strcmp(sp, prefix) == 0);
1826}
int mg_strcmp(const struct mg_str str1, const struct mg_str str2) WEAK
#define MG_MK_STR_N(str_literal, len)
Here is the call graph for this function:

◆ mg_strchr()

const char * mg_strchr ( const struct mg_str  s,
int  c 
)

Definition at line 1752 of file mongoose614.cxx.

1752 {
1753 size_t i;
1754 for (i = 0; i < s.len; i++) {
1755 if (s.p[i] == c) return &s.p[i];
1756 }
1757 return NULL;
1758}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strcmp()

int mg_strcmp ( const struct mg_str  str1,
const struct mg_str  str2 
)

Definition at line 1761 of file mongoose614.cxx.

1761 {
1762 size_t i = 0;
1763 while (i < str1.len && i < str2.len) {
1764 if (str1.p[i] < str2.p[i]) return -1;
1765 if (str1.p[i] > str2.p[i]) return 1;
1766 i++;
1767 }
1768 if (i < str1.len) return 1;
1769 if (i < str2.len) return -1;
1770 return 0;
1771}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strdup()

struct mg_str mg_strdup ( const struct mg_str  s)

Definition at line 1742 of file mongoose614.cxx.

1742 {
1743 return mg_strdup_common(s, 0 /* NUL-terminate */);
1744}
static struct mg_str mg_strdup_common(const struct mg_str s, int nul_terminate)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strdup_nul()

struct mg_str mg_strdup_nul ( const struct mg_str  s)

Definition at line 1747 of file mongoose614.cxx.

1747 {
1748 return mg_strdup_common(s, 1 /* NUL-terminate */);
1749}
Here is the call graph for this function:

◆ mg_strfree()

void mg_strfree ( struct mg_str s)

Definition at line 1788 of file mongoose614.cxx.

1788 {
1789 char *sp = (char *) s->p;
1790 s->p = NULL;
1791 s->len = 0;
1792 if (sp != NULL) free(sp);
1793}
Here is the call graph for this function:

◆ mg_strncmp()

int mg_strncmp ( const struct mg_str  str1,
const struct mg_str  str2,
size_t  n 
)

Definition at line 1774 of file mongoose614.cxx.

1774 {
1775 struct mg_str s1 = str1;
1776 struct mg_str s2 = str2;
1777
1778 if (s1.len > n) {
1779 s1.len = n;
1780 }
1781 if (s2.len > n) {
1782 s2.len = n;
1783 }
1784 return mg_strcmp(s1, s2);
1785}
Here is the call graph for this function:

◆ mg_strstr()

const char * mg_strstr ( const struct mg_str  haystack,
const struct mg_str  needle 
)

Definition at line 1797 of file mongoose614.cxx.

1798 {
1799 size_t i;
1800 if (needle.len > haystack.len) return NULL;
1801 for (i = 0; i <= haystack.len - needle.len; i++) {
1802 if (memcmp(haystack.p + i, needle.p, needle.len) == 0) {
1803 return haystack.p + i;
1804 }
1805 }
1806 return NULL;
1807}
Here is the call graph for this function:

◆ mg_strstrip()

struct mg_str mg_strstrip ( struct mg_str  s)

Definition at line 1810 of file mongoose614.cxx.

1810 {
1811 while (s.len > 0 && isspace((int) *s.p)) {
1812 s.p++;
1813 s.len--;
1814 }
1815 while (s.len > 0 && isspace((int) *(s.p + s.len - 1))) {
1816 s.len--;
1817 }
1818 return s;
1819}
Here is the call graph for this function:

◆ mg_url_encode()

struct mg_str mg_url_encode ( const struct mg_str  src)

Definition at line 10795 of file mongoose614.cxx.

10795 {
10796 return mg_url_encode_opt(src, mg_mk_str("._-$,;~()/"), 0);
10797}
struct mg_str mg_url_encode_opt(const struct mg_str src, const struct mg_str safe, unsigned int flags)
Here is the call graph for this function:

◆ mg_url_encode_opt()

struct mg_str mg_url_encode_opt ( const struct mg_str  src,
const struct mg_str  safe,
unsigned int  flags 
)

Definition at line 10769 of file mongoose614.cxx.

10770 {
10771 const char *hex =
10772 (flags & MG_URL_ENCODE_F_UPPERCASE_HEX ? "0123456789ABCDEF"
10773 : "0123456789abcdef");
10774 size_t i = 0;
10775 struct mbuf mb;
10776 mbuf_init(&mb, src.len);
10777
10778 for (i = 0; i < src.len; i++) {
10779 const unsigned char c = *((const unsigned char *) src.p + i);
10780 if (isalnum(c) || mg_strchr(safe, c) != NULL) {
10781 mbuf_append(&mb, &c, 1);
10782 } else if (c == ' ' && (flags & MG_URL_ENCODE_F_SPACE_AS_PLUS)) {
10783 mbuf_append(&mb, "+", 1);
10784 } else {
10785 mbuf_append(&mb, "%", 1);
10786 mbuf_append(&mb, &hex[c >> 4], 1);
10787 mbuf_append(&mb, &hex[c & 15], 1);
10788 }
10789 }
10790 mbuf_append(&mb, "", 1);
10791 mbuf_trim(&mb);
10792 return mg_mk_str_n(mb.buf, mb.len - 1);
10793}
#define MG_URL_ENCODE_F_UPPERCASE_HEX
#define MG_URL_ENCODE_F_SPACE_AS_PLUS
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ mg_ifaces

const struct mg_iface_vtable* mg_ifaces[]
extern

Definition at line 3628 of file mongoose614.cxx.

3628 {
3630};
const struct mg_iface_vtable mg_default_iface_vtable

◆ mg_num_ifaces

int mg_num_ifaces
extern

Definition at line 3632 of file mongoose614.cxx.