Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mongoose.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+ Include dependency graph for mongoose.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mbuf
 
struct  cs_sha1_ctx
 
struct  MD5Context
 
struct  cs_base64_ctx
 
struct  json_token
 
union  socket_address
 
struct  mg_str
 
struct  mg_mgr
 
struct  mg_connection
 
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_serve_http_opts
 
struct  mg_rpc_request
 
struct  mg_rpc_reply
 
struct  mg_rpc_error
 
struct  mg_mqtt_message
 
struct  mg_mqtt_topic_expression
 
struct  mg_send_mqtt_handshake_opts
 
struct  mg_dns_resource_record
 
struct  mg_dns_message
 
struct  mg_resolve_async_opts
 

Macros

#define MG_VERSION   "6.4"
 
#define CS_COMMON_PLATFORM_H_
 
#define CS_P_CUSTOM   0
 
#define CS_P_UNIX   1
 
#define CS_P_WINDOWS   2
 
#define CS_P_ESP_LWIP   3
 
#define CS_P_CC3200   4
 
#define CS_P_MSP432   5
 
#define NORETURN
 
#define NOINLINE
 
#define WARN_UNUSED_RESULT
 
#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_ESP_LWIP_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_
 
#define CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_
 
#define CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_
 
#define CS_COMMON_CS_DBG_H_
 
#define LOG(l, x)
 
#define DBG(x)
 
#define CS_COMMON_CS_TIME_H_
 
#define CS_COMMON_MBUF_H_
 
#define MBUF_SIZE_MULTIPLIER   1.5
 
#define CS_COMMON_SHA1_H_
 
#define CS_COMMON_MD5_H_
 
#define CS_COMMON_BASE64_H_
 
#define CS_COMMON_STR_UTIL_H_
 
#define CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_
 
#define JSON_STRING_INVALID   -1
 
#define JSON_STRING_INCOMPLETE   -2
 
#define JSON_TOKEN_ARRAY_TOO_SMALL   -3
 
#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 benn 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_HANDSHAKE_DONE   (1 << 4) /* SSL specific */
 
#define MG_F_WANT_READ   (1 << 5) /* SSL specific */
 
#define MG_F_WANT_WRITE   (1 << 6) /* SSL specific */
 
#define MG_F_IS_WEBSOCKET   (1 << 7) /* Websocket specific */
 
#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_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_NET_IF_H_
 
#define CS_MONGOOSE_SRC_URI_H_
 
#define CS_MONGOOSE_SRC_UTIL_H_
 
#define MAX_PATH_SIZE   500
 
#define MG_SOCK_STRINGIFY_IP   1
 
#define MG_SOCK_STRINGIFY_PORT   2
 
#define MG_SOCK_STRINGIFY_REMOTE   4
 
#define MG_MK_STR(str_literal)   { str_literal, sizeof(str_literal) - 1 }
 
#define CS_MONGOOSE_SRC_HTTP_H_
 
#define MG_MAX_HTTP_HEADERS   20
 
#define MG_MAX_HTTP_REQUEST_SIZE   1024
 
#define MG_MAX_PATH   256
 
#define MG_MAX_HTTP_SEND_MBUF   1024
 
#define MG_WEBSOCKET_PING_INTERVAL_SECONDS   5
 
#define MG_CGI_ENVIRONMENT_SIZE   8192
 
#define MG_MAX_CGI_ENVIR_VARS   64
 
#define MG_ENV_EXPORT_TO_CGI   "MONGOOSE_CGI"
 
#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_WEBSOCKET_HANDSHAKE_REQUEST   111 /* NULL */
 
#define MG_EV_WEBSOCKET_HANDSHAKE_DONE   112 /* NULL */
 
#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 CS_MONGOOSE_SRC_JSON_RPC_H_
 
#define JSON_RPC_PARSE_ERROR   (-32700)
 
#define JSON_RPC_INVALID_REQUEST_ERROR   (-32600)
 
#define JSON_RPC_METHOD_NOT_FOUND_ERROR   (-32601)
 
#define JSON_RPC_INVALID_PARAMS_ERROR   (-32602)
 
#define JSON_RPC_INTERNAL_ERROR   (-32603)
 
#define JSON_RPC_SERVER_ERROR   (-32000)
 
#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_AAAA_RECORD   0x1c /* Lookup IPv6 address */
 
#define MG_DNS_MX_RECORD   0x0f /* Lookup mail server for domain */
 
#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_
 

Typedefs

typedef struct MD5Context MD5_CTX
 
typedef void(* cs_base64_putc_t )(char, void *)
 
typedef void * SSL
 
typedef void * SSL_CTX
 
typedef void(* mg_event_handler_t )(struct mg_connection *, int ev, void *)
 
typedef int(* mg_rpc_handler_t )(char *buf, int len, struct mg_rpc_request *req)
 
typedef void(* mg_resolve_callback_t )(struct mg_dns_message *dns_message, void *user_data, enum mg_resolve_err)
 

Enumerations

enum  cs_log_level {
  LL_NONE = -1, LL_ERROR = 0, LL_WARN = 1, LL_INFO = 2,
  LL_DEBUG = 3, LL_VERBOSE_DEBUG = 4, _LL_MIN = -2, _LL_MAX = 5
}
 
enum  json_type {
  JSON_TYPE_EOF = 0, JSON_TYPE_STRING = 1, JSON_TYPE_NUMBER = 2, JSON_TYPE_OBJECT = 3,
  JSON_TYPE_TRUE = 4, JSON_TYPE_FALSE = 5, JSON_TYPE_NULL = 6, JSON_TYPE_ARRAY = 7
}
 
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_log_set_level (enum cs_log_level level)
 
void cs_log_set_file (FILE *file)
 
void cs_log_print_prefix (const char *func)
 
void cs_log_printf (const char *fmt,...)
 
double cs_time ()
 
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_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_trim (struct mbuf *)
 
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])
 
void MD5_Init (MD5_CTX *c)
 
void MD5_Update (MD5_CTX *c, const unsigned char *data, size_t len)
 
void MD5_Final (unsigned char *md, MD5_CTX *c)
 
char * cs_md5 (char buf[33],...)
 
void cs_to_hex (char *to, const unsigned char *p, size_t len)
 
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)
 
size_t c_strnlen (const char *s, size_t maxlen)
 
int c_snprintf (char *buf, size_t buf_size, const char *format,...)
 
int c_vsnprintf (char *buf, size_t buf_size, const char *format, va_list ap)
 
const char * c_strnstr (const char *s, const char *find, size_t slen)
 
int parse_json (const char *json_string, int json_string_length, struct json_token *tokens_array, int size_of_tokens_array)
 
struct json_tokenparse_json2 (const char *json_string, int string_length)
 
struct json_tokenfind_json_token (struct json_token *toks, const char *path)
 
int json_emit_long (char *buf, int buf_len, long value)
 
int json_emit_double (char *buf, int buf_len, double value)
 
int json_emit_quoted_str (char *buf, int buf_len, const char *str, int len)
 
int json_emit_unquoted_str (char *buf, int buf_len, const char *str, int len)
 
int json_emit (char *buf, int buf_len, const char *fmt,...)
 
int json_emit_va (char *buf, int buf_len, const char *fmt, va_list)
 
void mg_mgr_init (struct mg_mgr *mgr, void *user_data)
 
void mg_mgr_free (struct mg_mgr *)
 
time_t mg_mgr_poll (struct mg_mgr *, int milli)
 
void mg_broadcast (struct mg_mgr *, mg_event_handler_t func, void *, size_t)
 
struct mg_connectionmg_next (struct mg_mgr *, struct mg_connection *)
 
struct mg_connectionmg_add_sock (struct mg_mgr *, sock_t, mg_event_handler_t)
 
struct mg_connectionmg_add_sock_opt (struct mg_mgr *, sock_t, mg_event_handler_t, struct mg_add_sock_opts)
 
struct mg_connectionmg_bind (struct mg_mgr *, const char *, mg_event_handler_t)
 
struct mg_connectionmg_bind_opt (struct mg_mgr *mgr, const char *address, mg_event_handler_t handler, struct mg_bind_opts opts)
 
struct mg_connectionmg_connect (struct mg_mgr *mgr, const char *address, mg_event_handler_t handler)
 
struct mg_connectionmg_connect_opt (struct mg_mgr *mgr, const char *address, mg_event_handler_t handler, struct mg_connect_opts opts)
 
const char * mg_set_ssl (struct mg_connection *nc, const char *cert, const char *ca_cert)
 
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_resolve (const char *domain_name, char *ip_addr_buf, size_t buf_len)
 
int mg_check_ip_acl (const char *acl, uint32_t remote_ip)
 
void mg_enable_multithreading (struct mg_connection *nc)
 
double mg_set_timer (struct mg_connection *c, double timestamp)
 
double mg_time ()
 
void mg_if_connect_tcp (struct mg_connection *nc, const union socket_address *sa)
 
void mg_if_connect_udp (struct mg_connection *nc)
 
void mg_if_connect_cb (struct mg_connection *nc, int err)
 
int mg_if_listen_tcp (struct mg_connection *nc, union socket_address *sa)
 
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)
 
int mg_if_listen_udp (struct mg_connection *nc, union socket_address *sa)
 
void mg_if_tcp_send (struct mg_connection *nc, const void *buf, size_t len)
 
void mg_if_udp_send (struct mg_connection *nc, const void *buf, size_t len)
 
void mg_if_sent_cb (struct mg_connection *nc, int num_sent)
 
void mg_if_recv_tcp_cb (struct mg_connection *nc, void *buf, int len)
 
void mg_if_recv_udp_cb (struct mg_connection *nc, void *buf, int len, union socket_address *sa, size_t sa_len)
 
void mg_if_recved (struct mg_connection *nc, size_t len)
 
void mg_if_poll (struct mg_connection *nc, time_t now)
 
void mg_if_timer (struct mg_connection *c, double now)
 
int mg_if_create_conn (struct mg_connection *nc)
 
void mg_if_destroy_conn (struct mg_connection *nc)
 
void mg_close_conn (struct mg_connection *nc)
 
void mg_if_get_conn_addr (struct mg_connection *nc, int remote, union socket_address *sa)
 
void mg_sock_set (struct mg_connection *nc, sock_t sock)
 
int mg_parse_uri (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_normalize_uri_path (const struct mg_str *in, struct mg_str *out)
 
const char * mg_skip (const char *s, const char *end_string, const char *delimiters, struct mg_str *v)
 
int mg_ncasecmp (const char *s1, const char *s2, size_t len)
 
int mg_casecmp (const char *s1, const char *s2)
 
int mg_vcmp (const struct mg_str *str2, const char *str1)
 
int mg_vcasecmp (const struct mg_str *str2, const char *str1)
 
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)
 
int mg_stat (const char *path, cs_stat_t *st)
 
FILE * mg_fopen (const char *path, const char *mode)
 
int mg_open (const char *path, int flag, int mode)
 
void mg_set_close_on_exec (sock_t)
 
void mg_conn_addr_to_str (struct mg_connection *nc, char *buf, size_t len, int flags)
 
void mg_sock_to_str (sock_t sock, char *buf, size_t len, int flags)
 
void mg_sock_addr_to_str (const union socket_address *sa, char *buf, size_t len, int flags)
 
int mg_hexdump (const void *buf, int len, char *dst, int dst_len)
 
void mg_hexdump_connection (struct mg_connection *nc, const char *path, const void *buf, int num_bytes, int ev)
 
int mg_avprintf (char **buf, size_t size, const char *fmt, va_list ap)
 
int mg_is_big_endian (void)
 
const char * mg_next_comma_list_entry (const char *list, struct mg_str *val, struct mg_str *eq_val)
 
int mg_match_prefix (const char *pattern, int pattern_len, const char *str)
 
int mg_match_prefix_n (const struct mg_str pattern, const struct mg_str str)
 
struct mg_str mg_mk_str (const char *s)
 
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)
 
struct mg_connectionmg_connect_ws (struct mg_mgr *mgr, mg_event_handler_t event_handler, const char *url, const char *protocol, const char *extra_headers)
 
struct mg_connectionmg_connect_ws_opt (struct mg_mgr *mgr, mg_event_handler_t ev_handler, 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,...)
 
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 *c, int status_code, const char *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,...)
 
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_header (struct mg_str *hdr, const char *var_name, char *buf, size_t buf_size)
 
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)
 
int mg_url_decode (const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded)
 
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)
 
struct mg_connectionmg_connect_http (struct mg_mgr *mgr, mg_event_handler_t event_handler, const char *url, const char *extra_headers, const char *post_data)
 
struct mg_connectionmg_connect_http_opt (struct mg_mgr *mgr, mg_event_handler_t ev_handler, struct mg_connect_opts opts, const char *url, const char *extra_headers, const char *post_data)
 
void mg_serve_http (struct mg_connection *nc, struct http_message *hm, struct mg_serve_http_opts opts)
 
void mg_register_http_endpoint (struct mg_connection *nc, const char *uri_path, mg_event_handler_t handler)
 
int mg_http_check_digest_auth (struct http_message *hm, const char *auth_domain, FILE *fp)
 
int mg_rpc_parse_reply (const char *buf, int len, struct json_token *toks, int max_toks, struct mg_rpc_reply *, struct mg_rpc_error *)
 
int mg_rpc_create_request (char *buf, int len, const char *method, const char *id, const char *params_fmt,...)
 
int mg_rpc_create_reply (char *buf, int len, const struct mg_rpc_request *req, const char *result_fmt,...)
 
int mg_rpc_create_error (char *buf, int len, struct mg_rpc_request *req, int code, const char *message, const char *fmt,...)
 
int mg_rpc_create_std_error (char *buf, int len, struct mg_rpc_request *req, int code)
 
int mg_rpc_dispatch (const char *buf, int, char *dst, int dst_len, const char **methods, mg_rpc_handler_t *handlers)
 
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)
 
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_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)
 
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

enum cs_log_level cs_log_level
 

Macro Definition Documentation

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

Definition at line 114 of file mongoose.h.

View newest version in sPHENIX GitHub at line 114 of file mongoose.h

Referenced by mg_addenv(), mg_fopen(), mg_get_month_index(), mg_http_parse_headers(), mg_is_dav_request(), mg_open(), mg_parse_dns(), and mg_stat().

#define CS_COMMON_BASE64_H_

Definition at line 1000 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1000 of file mongoose.h

#define CS_COMMON_CS_DBG_H_

Definition at line 753 of file mongoose.h.

View newest version in sPHENIX GitHub at line 753 of file mongoose.h

#define CS_COMMON_CS_TIME_H_

Definition at line 823 of file mongoose.h.

View newest version in sPHENIX GitHub at line 823 of file mongoose.h

#define CS_COMMON_MBUF_H_

Definition at line 852 of file mongoose.h.

View newest version in sPHENIX GitHub at line 852 of file mongoose.h

#define CS_COMMON_MD5_H_

Definition at line 955 of file mongoose.h.

View newest version in sPHENIX GitHub at line 955 of file mongoose.h

#define CS_COMMON_PLATFORM_H_

Definition at line 67 of file mongoose.h.

View newest version in sPHENIX GitHub at line 67 of file mongoose.h

#define CS_COMMON_PLATFORMS_PLATFORM_CC3200_H_

Definition at line 406 of file mongoose.h.

View newest version in sPHENIX GitHub at line 406 of file mongoose.h

#define CS_COMMON_PLATFORMS_PLATFORM_ESP_LWIP_H_

Definition at line 350 of file mongoose.h.

View newest version in sPHENIX GitHub at line 350 of file mongoose.h

#define CS_COMMON_PLATFORMS_PLATFORM_MSP432_H_

Definition at line 534 of file mongoose.h.

View newest version in sPHENIX GitHub at line 534 of file mongoose.h

#define CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_

Definition at line 252 of file mongoose.h.

View newest version in sPHENIX GitHub at line 252 of file mongoose.h

#define CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_

Definition at line 119 of file mongoose.h.

View newest version in sPHENIX GitHub at line 119 of file mongoose.h

#define CS_COMMON_PLATFORMS_SIMPLELINK_CS_SIMPLELINK_H_

Definition at line 636 of file mongoose.h.

View newest version in sPHENIX GitHub at line 636 of file mongoose.h

#define CS_COMMON_SHA1_H_

Definition at line 921 of file mongoose.h.

View newest version in sPHENIX GitHub at line 921 of file mongoose.h

#define CS_COMMON_STR_UTIL_H_

Definition at line 1042 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1042 of file mongoose.h

#define CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_

Definition at line 1085 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1085 of file mongoose.h

#define CS_MONGOOSE_SRC_COAP_H_

Definition at line 3517 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3517 of file mongoose.h

#define CS_MONGOOSE_SRC_DNS_H_

Definition at line 3172 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3172 of file mongoose.h

#define CS_MONGOOSE_SRC_DNS_SERVER_H_

Definition at line 3327 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3327 of file mongoose.h

#define CS_MONGOOSE_SRC_HTTP_H_

Definition at line 2032 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2032 of file mongoose.h

#define CS_MONGOOSE_SRC_JSON_RPC_H_

Definition at line 2739 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2739 of file mongoose.h

#define CS_MONGOOSE_SRC_MQTT_BROKER_H_

Definition at line 3084 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3084 of file mongoose.h

#define CS_MONGOOSE_SRC_MQTT_H_

Definition at line 2889 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2889 of file mongoose.h

#define CS_MONGOOSE_SRC_NET_H_

Definition at line 1161 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1161 of file mongoose.h

#define CS_MONGOOSE_SRC_NET_IF_H_

Definition at line 1660 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1660 of file mongoose.h

#define CS_MONGOOSE_SRC_RESOLV_H_

Definition at line 3418 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3418 of file mongoose.h

#define CS_MONGOOSE_SRC_URI_H_

Definition at line 1752 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1752 of file mongoose.h

#define CS_MONGOOSE_SRC_UTIL_H_

Definition at line 1803 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1803 of file mongoose.h

#define CS_P_CC3200   4

Definition at line 77 of file mongoose.h.

View newest version in sPHENIX GitHub at line 77 of file mongoose.h

#define CS_P_CUSTOM   0

Definition at line 73 of file mongoose.h.

View newest version in sPHENIX GitHub at line 73 of file mongoose.h

#define CS_P_ESP_LWIP   3

Definition at line 76 of file mongoose.h.

View newest version in sPHENIX GitHub at line 76 of file mongoose.h

#define CS_P_MSP432   5

Definition at line 78 of file mongoose.h.

View newest version in sPHENIX GitHub at line 78 of file mongoose.h

#define CS_P_UNIX   1

Definition at line 74 of file mongoose.h.

View newest version in sPHENIX GitHub at line 74 of file mongoose.h

#define CS_P_WINDOWS   2

Definition at line 75 of file mongoose.h.

View newest version in sPHENIX GitHub at line 75 of file mongoose.h

#define JSON_RPC_INTERNAL_ERROR   (-32603)

Definition at line 2826 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2826 of file mongoose.h

#define JSON_RPC_INVALID_PARAMS_ERROR   (-32602)

Definition at line 2825 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2825 of file mongoose.h

Referenced by mg_rpc_create_std_error().

#define JSON_RPC_INVALID_REQUEST_ERROR   (-32600)

Definition at line 2823 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2823 of file mongoose.h

Referenced by mg_rpc_create_std_error(), and mg_rpc_dispatch().

#define JSON_RPC_METHOD_NOT_FOUND_ERROR   (-32601)

Definition at line 2824 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2824 of file mongoose.h

Referenced by mg_rpc_create_std_error(), and mg_rpc_dispatch().

#define JSON_RPC_PARSE_ERROR   (-32700)

Definition at line 2822 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2822 of file mongoose.h

Referenced by mg_rpc_create_std_error(), and mg_rpc_dispatch().

#define JSON_RPC_SERVER_ERROR   (-32000)

Definition at line 2827 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2827 of file mongoose.h

Referenced by mg_rpc_create_std_error(), and mg_rpc_dispatch().

#define JSON_STRING_INCOMPLETE   -2

Definition at line 1113 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1113 of file mongoose.h

Referenced by doit(), expect(), get_escape_len(), parse_key(), parse_number(), parse_string(), parse_value(), test_and_skip(), and test_no_skip().

#define JSON_STRING_INVALID   -1

Definition at line 1112 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1112 of file mongoose.h

Referenced by capture_len(), doit(), expect(), get_escape_len(), mg_rpc_dispatch(), parse_identifier(), parse_key(), parse_number(), parse_string(), parse_value(), test_and_skip(), and test_no_skip().

#define JSON_TOKEN_ARRAY_TOO_SMALL   -3

Definition at line 1114 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1114 of file mongoose.h

Referenced by capture_ptr().

#define LOG (   l,
  x 
)
Value:
if (cs_log_level >= l) { \
cs_log_print_prefix(__func__); \
cs_log_printf x; \
}

Definition at line 785 of file mongoose.h.

View newest version in sPHENIX GitHub at line 785 of file mongoose.h

#define MAX_PATH_SIZE   500
#define MBUF_SIZE_MULTIPLIER   1.5

Definition at line 861 of file mongoose.h.

View newest version in sPHENIX GitHub at line 861 of file mongoose.h

Referenced by mbuf_insert().

#define MG_CGI_ENVIRONMENT_SIZE   8192

Definition at line 2064 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2064 of file mongoose.h

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

Definition at line 3179 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3179 of file mongoose.h

Referenced by mg_connect_opt(), mg_dns_parse_record_data(), and resolve_cb().

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

Definition at line 3181 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3181 of file mongoose.h

Referenced by mg_dns_parse_record_data().

#define MG_DNS_CNAME_RECORD   0x05 /* Lookup CNAME */

Definition at line 3180 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3180 of file mongoose.h

Referenced by mg_dns_encode_record(), and mg_dns_parse_record_data().

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

Definition at line 3187 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3187 of file mongoose.h

Referenced by dns_handler().

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

Definition at line 3182 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3182 of file mongoose.h

#define MG_ENV_EXPORT_TO_CGI   "MONGOOSE_CGI"

Definition at line 2072 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2072 of file mongoose.h

Referenced by mg_prepare_cgi_environment().

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

Definition at line 1221 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1221 of file mongoose.h

Referenced by mg_hexdump_connection(), mg_if_accept_tcp_cb(), and mg_if_recv_udp_cb().

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

Definition at line 1225 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1225 of file mongoose.h

Referenced by ev_handler(), mg_cgi_ev_handler(), mg_close_conn(), mg_http_handler(), mg_resolve_async_eh(), and resolve_cb().

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

Definition at line 1222 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1222 of file mongoose.h

Referenced by mg_hexdump_connection(), mg_if_connect_cb(), mg_resolve_async_eh(), and resolve_cb().

#define MG_EV_HTTP_CHUNK   102 /* struct http_message * */

Definition at line 2125 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2125 of file mongoose.h

Referenced by mg_handle_chunked().

#define MG_EV_HTTP_REPLY   101 /* struct http_message * */

Definition at line 2124 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2124 of file mongoose.h

Referenced by mg_http_handler().

#define MG_EV_HTTP_REQUEST   100 /* struct http_message * */

Definition at line 2123 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2123 of file mongoose.h

Referenced by ev_handler(), mg_http_call_endpoint_handler(), and mg_http_handler().

#define MG_EV_MQTT_CONNACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_CONNACK)

Definition at line 2934 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2934 of file mongoose.h

#define MG_EV_MQTT_CONNACK_ACCEPTED   0

Definition at line 2966 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2966 of file mongoose.h

#define MG_EV_MQTT_CONNACK_BAD_AUTH   4

Definition at line 2970 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2970 of file mongoose.h

#define MG_EV_MQTT_CONNACK_IDENTIFIER_REJECTED   2

Definition at line 2968 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2968 of file mongoose.h

#define MG_EV_MQTT_CONNACK_NOT_AUTHORIZED   5

Definition at line 2971 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2971 of file mongoose.h

#define MG_EV_MQTT_CONNACK_SERVER_UNAVAILABLE   3

Definition at line 2969 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2969 of file mongoose.h

#define MG_EV_MQTT_CONNACK_UNACCEPTABLE_VERSION   1

Definition at line 2967 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2967 of file mongoose.h

#define MG_EV_MQTT_CONNECT   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_CONNECT)

Definition at line 2933 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2933 of file mongoose.h

#define MG_EV_MQTT_DISCONNECT   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_DISCONNECT)

Definition at line 2946 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2946 of file mongoose.h

#define MG_EV_MQTT_PINGREQ   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PINGREQ)

Definition at line 2944 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2944 of file mongoose.h

#define MG_EV_MQTT_PINGRESP   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PINGRESP)

Definition at line 2945 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2945 of file mongoose.h

#define MG_EV_MQTT_PUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBACK)

Definition at line 2936 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2936 of file mongoose.h

#define MG_EV_MQTT_PUBCOMP   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBCOMP)

Definition at line 2939 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2939 of file mongoose.h

#define MG_EV_MQTT_PUBLISH   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBLISH)

Definition at line 2935 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2935 of file mongoose.h

#define MG_EV_MQTT_PUBREC   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBREC)

Definition at line 2937 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2937 of file mongoose.h

#define MG_EV_MQTT_PUBREL   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_PUBREL)

Definition at line 2938 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2938 of file mongoose.h

#define MG_EV_MQTT_SUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_SUBACK)

Definition at line 2941 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2941 of file mongoose.h

#define MG_EV_MQTT_SUBSCRIBE   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_SUBSCRIBE)

Definition at line 2940 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2940 of file mongoose.h

#define MG_EV_MQTT_UNSUBACK   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_UNSUBACK)

Definition at line 2943 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2943 of file mongoose.h

#define MG_EV_MQTT_UNSUBSCRIBE   (MG_MQTT_EVENT_BASE + MG_MQTT_CMD_UNSUBSCRIBE)

Definition at line 2942 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2942 of file mongoose.h

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

Definition at line 1220 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1220 of file mongoose.h

Referenced by mg_call(), mg_if_poll(), mg_mgr_handle_ctl_sock(), mg_resolve_async_eh(), and mg_websocket_handler().

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

Definition at line 1223 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1223 of file mongoose.h

Referenced by dns_handler(), mg_call(), mg_cgi_ev_handler(), mg_hexdump_connection(), mg_http_handler(), mg_recv_common(), mg_resolve_async_eh(), mg_websocket_handler(), and mqtt_handler().

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

Definition at line 1224 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1224 of file mongoose.h

Referenced by mg_call(), mg_hexdump_connection(), mg_if_sent_cb(), mg_resolve_async_eh(), and mg_send().

#define MG_EV_SSI_CALL   105 /* char * */

Definition at line 2126 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2126 of file mongoose.h

Referenced by mg_do_ssi_call().

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

Definition at line 1226 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1226 of file mongoose.h

Referenced by mg_if_timer(), mg_resolve_async_eh(), and resolve_cb().

#define MG_EV_WEBSOCKET_CONTROL_FRAME   114 /* struct websocket_message * */

Definition at line 2131 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2131 of file mongoose.h

Referenced by mg_handle_incoming_websocket_frame().

#define MG_EV_WEBSOCKET_FRAME   113 /* struct websocket_message * */

Definition at line 2130 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2130 of file mongoose.h

Referenced by ev_handler(), and mg_handle_incoming_websocket_frame().

#define MG_EV_WEBSOCKET_HANDSHAKE_DONE   112 /* NULL */

Definition at line 2129 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2129 of file mongoose.h

Referenced by ev_handler(), and mg_http_handler().

#define MG_EV_WEBSOCKET_HANDSHAKE_REQUEST   111 /* NULL */

Definition at line 2128 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2128 of file mongoose.h

Referenced by mg_http_handler().

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

Definition at line 1282 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1282 of file mongoose.h

Referenced by mg_do_connect(), mg_if_connect_cb(), mg_mgr_handle_conn(), and mg_mgr_poll().

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

Definition at line 1292 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1292 of file mongoose.h

Referenced by mg_handle_chunked().

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

Definition at line 1286 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1286 of file mongoose.h

Referenced by mg_http_handler(), and mg_websocket_handler().

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

Definition at line 1279 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1279 of file mongoose.h

Referenced by mg_bind_opt(), mg_if_recv_udp_cb(), and mg_mgr_handle_conn().

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

Definition at line 1281 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1281 of file mongoose.h

Referenced by mg_connect_opt(), mg_set_timer(), and resolve_cb().

#define MG_F_SSL_HANDSHAKE_DONE   (1 << 4) /* SSL specific */

Definition at line 1283 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1283 of file mongoose.h

Referenced by mg_if_poll(), mg_read_from_socket(), and mg_write_to_socket().

#define MG_F_UDP   (1 << 1) /* This connection is UDP */
#define MG_F_USER_1   (1 << 20) /* Flags left for application */

Definition at line 1294 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1294 of file mongoose.h

Referenced by ev_handler(), mg_cgi_ev_handler(), and mg_handle_cgi().

#define MG_F_USER_2   (1 << 21)

Definition at line 1295 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1295 of file mongoose.h

#define MG_F_USER_3   (1 << 22)

Definition at line 1296 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1296 of file mongoose.h

#define MG_F_USER_4   (1 << 23)

Definition at line 1297 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1297 of file mongoose.h

#define MG_F_USER_5   (1 << 24)

Definition at line 1298 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1298 of file mongoose.h

#define MG_F_USER_6   (1 << 25)

Definition at line 1299 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1299 of file mongoose.h

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

Definition at line 1284 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1284 of file mongoose.h

Referenced by mg_mgr_poll(), and mg_write_to_socket().

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

Definition at line 1285 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1285 of file mongoose.h

Referenced by mg_mgr_poll(), and mg_write_to_socket().

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

Definition at line 1291 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1291 of file mongoose.h

Referenced by mg_deliver_websocket_data().

#define MG_MAX_CGI_ENVIR_VARS   64

Definition at line 2068 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2068 of file mongoose.h

#define MG_MAX_DNS_ANSWERS   32

Definition at line 3185 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3185 of file mongoose.h

#define MG_MAX_DNS_QUESTIONS   32

Definition at line 3184 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3184 of file mongoose.h

#define MG_MAX_HTTP_HEADERS   20

Definition at line 2040 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2040 of file mongoose.h

#define MG_MAX_HTTP_REQUEST_SIZE   1024

Definition at line 2044 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2044 of file mongoose.h

Referenced by mg_cgi_ev_handler(), and mg_http_handler().

#define MG_MAX_HTTP_SEND_MBUF   1024

Definition at line 2056 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2056 of file mongoose.h

Referenced by mg_http_transfer_file_data().

#define MG_MAX_PATH   256

Definition at line 2051 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2051 of file mongoose.h

Referenced by mg_is_authorized(), and mg_uri_to_local_path().

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

Definition at line 2015 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2015 of file mongoose.h

Referenced by mg_send_ssi_file().

#define MG_MQTT_CLEAN_SESSION   0x02

Definition at line 2956 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2956 of file mongoose.h

#define MG_MQTT_CMD_CONNACK   2

Definition at line 2917 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2917 of file mongoose.h

Referenced by mg_mqtt_connack(), and parse_mqtt().

#define MG_MQTT_CMD_CONNECT   1

Definition at line 2916 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2916 of file mongoose.h

Referenced by mg_send_mqtt_handshake_opt(), and parse_mqtt().

#define MG_MQTT_CMD_DISCONNECT   14

Definition at line 2929 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2929 of file mongoose.h

Referenced by mg_mqtt_disconnect().

#define MG_MQTT_CMD_PINGREQ   12

Definition at line 2927 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2927 of file mongoose.h

Referenced by mg_mqtt_ping().

#define MG_MQTT_CMD_PINGRESP   13

Definition at line 2928 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2928 of file mongoose.h

Referenced by mg_mqtt_pong().

#define MG_MQTT_CMD_PUBACK   4

Definition at line 2919 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2919 of file mongoose.h

Referenced by mg_mqtt_puback(), and parse_mqtt().

#define MG_MQTT_CMD_PUBCOMP   7

Definition at line 2922 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2922 of file mongoose.h

Referenced by mg_mqtt_pubcomp(), and parse_mqtt().

#define MG_MQTT_CMD_PUBLISH   3

Definition at line 2918 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2918 of file mongoose.h

Referenced by mg_mqtt_publish(), and parse_mqtt().

#define MG_MQTT_CMD_PUBREC   5

Definition at line 2920 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2920 of file mongoose.h

Referenced by mg_mqtt_pubrec(), and parse_mqtt().

#define MG_MQTT_CMD_PUBREL   6

Definition at line 2921 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2921 of file mongoose.h

Referenced by mg_mqtt_pubrel(), and parse_mqtt().

#define MG_MQTT_CMD_SUBACK   9

Definition at line 2924 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2924 of file mongoose.h

Referenced by mg_mqtt_suback(), and parse_mqtt().

#define MG_MQTT_CMD_SUBSCRIBE   8

Definition at line 2923 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2923 of file mongoose.h

Referenced by mg_mqtt_subscribe(), and parse_mqtt().

#define MG_MQTT_CMD_UNSUBACK   11

Definition at line 2926 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2926 of file mongoose.h

Referenced by mg_mqtt_unsuback().

#define MG_MQTT_CMD_UNSUBSCRIBE   10

Definition at line 2925 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2925 of file mongoose.h

Referenced by mg_mqtt_unsubscribe().

#define MG_MQTT_DUP   0x4

Definition at line 2950 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2950 of file mongoose.h

#define MG_MQTT_EVENT_BASE   200

Definition at line 2932 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2932 of file mongoose.h

Referenced by mqtt_handler().

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

Definition at line 2952 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2952 of file mongoose.h

Referenced by mg_mqtt_publish(), and parse_mqtt().

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

Definition at line 2961 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2961 of file mongoose.h

#define MG_MQTT_HAS_PASSWORD   0x40

Definition at line 2959 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2959 of file mongoose.h

Referenced by mg_send_mqtt_handshake_opt().

#define MG_MQTT_HAS_USER_NAME   0x80

Definition at line 2960 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2960 of file mongoose.h

Referenced by mg_send_mqtt_handshake_opt().

#define MG_MQTT_HAS_WILL   0x04

Definition at line 2957 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2957 of file mongoose.h

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

Definition at line 2951 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2951 of file mongoose.h

Referenced by mg_mqtt_suback(), mg_mqtt_subscribe(), mg_mqtt_unsubscribe(), and mg_send_mqtt_short_command().

#define MG_MQTT_RETAIN   0x1

Definition at line 2949 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2949 of file mongoose.h

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

Definition at line 2953 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2953 of file mongoose.h

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

Definition at line 2962 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2962 of file mongoose.h

#define MG_MQTT_WILL_RETAIN   0x20

Definition at line 2958 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2958 of file mongoose.h

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

Definition at line 1187 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1187 of file mongoose.h

Referenced by mg_broadcast(), mg_mgr_handle_ctl_sock(), and mg_read_from_socket().

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

Definition at line 1188 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1188 of file mongoose.h

Referenced by mg_broadcast(), mg_mgr_handle_ctl_sock(), and mg_write_to_socket().

#define MG_SOCK_STRINGIFY_IP   1

Definition at line 1913 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1913 of file mongoose.h

Referenced by mg_hexdump_connection(), mg_prepare_cgi_environment(), and mg_sock_addr_to_str().

#define MG_SOCK_STRINGIFY_PORT   2

Definition at line 1914 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1914 of file mongoose.h

Referenced by mg_hexdump_connection(), mg_http_send_port_based_redirect(), mg_prepare_cgi_environment(), and mg_sock_addr_to_str().

#define MG_SOCK_STRINGIFY_REMOTE   4

Definition at line 1915 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1915 of file mongoose.h

Referenced by mg_conn_addr_to_str(), mg_hexdump_connection(), mg_prepare_cgi_environment(), and mg_sock_to_str().

#define MG_VERSION   "6.4"

Definition at line 23 of file mongoose.h.

View newest version in sPHENIX GitHub at line 23 of file mongoose.h

Referenced by mg_prepare_cgi_environment().

#define MG_VPRINTF_BUFFER_SIZE   100

Definition at line 1180 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1180 of file mongoose.h

Referenced by mg_printf_html_escape(), mg_printf_http_chunk(), mg_printf_websocket_frame(), mg_vprintf(), and mg_ws_handshake().

#define MG_WEBSOCKET_PING_INTERVAL_SECONDS   5

Definition at line 2060 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2060 of file mongoose.h

Referenced by mg_websocket_handler().

#define NOINLINE

Definition at line 109 of file mongoose.h.

View newest version in sPHENIX GitHub at line 109 of file mongoose.h

#define NORETURN

Definition at line 108 of file mongoose.h.

View newest version in sPHENIX GitHub at line 108 of file mongoose.h

#define WARN_UNUSED_RESULT

Definition at line 110 of file mongoose.h.

View newest version in sPHENIX GitHub at line 110 of file mongoose.h

#define WEBSOCKET_DONT_FIN   0x100

Definition at line 2374 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2374 of file mongoose.h

Referenced by mg_send_ws_header().

#define WEBSOCKET_OP_BINARY   2

Definition at line 2357 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2357 of file mongoose.h

#define WEBSOCKET_OP_CLOSE   8

Definition at line 2358 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2358 of file mongoose.h

Referenced by mg_deliver_websocket_data(), mg_send_websocket_frame(), and mg_send_websocket_framev().

#define WEBSOCKET_OP_CONTINUE   0

Definition at line 2355 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2355 of file mongoose.h

#define WEBSOCKET_OP_PING   9

Definition at line 2359 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2359 of file mongoose.h

Referenced by mg_websocket_handler().

#define WEBSOCKET_OP_PONG   10

Definition at line 2360 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2360 of file mongoose.h

#define WEBSOCKET_OP_TEXT   1

Definition at line 2356 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2356 of file mongoose.h

Referenced by broadcast(), and initial_ws_update().

Typedef Documentation

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

Definition at line 1010 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1010 of file mongoose.h

typedef struct MD5Context MD5_CTX
typedef void(* mg_event_handler_t)(struct mg_connection *, int ev, void *)

Definition at line 1217 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1217 of file mongoose.h

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

Definition at line 3432 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3432 of file mongoose.h

typedef int(* mg_rpc_handler_t)(char *buf, int len, struct mg_rpc_request *req)

Definition at line 2846 of file mongoose.h.

View newest version in sPHENIX GitHub at line 2846 of file mongoose.h

typedef void* SSL

Definition at line 1175 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1175 of file mongoose.h

typedef void* SSL_CTX

Definition at line 1176 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1176 of file mongoose.h

Enumeration Type Documentation

Enumerator:
LL_NONE 
LL_ERROR 
LL_WARN 
LL_INFO 
LL_DEBUG 
LL_VERBOSE_DEBUG 
_LL_MIN 
_LL_MAX 

Definition at line 763 of file mongoose.h.

View newest version in sPHENIX GitHub at line 763 of file mongoose.h

enum json_type
Enumerator:
JSON_TYPE_EOF 
JSON_TYPE_STRING 
JSON_TYPE_NUMBER 
JSON_TYPE_OBJECT 
JSON_TYPE_TRUE 
JSON_TYPE_FALSE 
JSON_TYPE_NULL 
JSON_TYPE_ARRAY 

Definition at line 1093 of file mongoose.h.

View newest version in sPHENIX GitHub at line 1093 of file mongoose.h

Enumerator:
MG_DNS_INVALID_RECORD 
MG_DNS_QUESTION 
MG_DNS_ANSWER 

Definition at line 3189 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3189 of file mongoose.h

Enumerator:
MG_RESOLVE_OK 
MG_RESOLVE_NO_ANSWERS 
MG_RESOLVE_EXCEEDED_RETRY_COUNT 
MG_RESOLVE_TIMEOUT 

Definition at line 3425 of file mongoose.h.

View newest version in sPHENIX GitHub at line 3425 of file mongoose.h

Function Documentation

int c_snprintf ( char *  buf,
size_t  buf_size,
const char *  format,
  ... 
)

Definition at line 2018 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2018 of file mongoose.cc

References c_vsnprintf().

+ Here is the call graph for this function:

size_t c_strnlen ( const char *  s,
size_t  maxlen 
)

Definition at line 1820 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1820 of file mongoose.cc

References char64long16::l.

Referenced by c_vsnprintf().

+ Here is the caller graph for this function:

const char* c_strnstr ( const char *  s,
const char *  find,
size_t  slen 
)

Definition at line 2058 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2058 of file mongoose.cc

References i.

int c_vsnprintf ( char *  buf,
size_t  buf_size,
const char *  format,
va_list  ap 
)

Definition at line 1881 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1881 of file mongoose.cc

References c_itoa(), C_SNPRINTF_APPEND_CHAR, C_SNPRINTF_FLAG_ZERO, c_strnlen(), i, j, precision, and physmon_simulation::s.

Referenced by c_snprintf().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 305 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 305 of file mongoose.cc

References KFPMath::a, KFPMath::b, Acts::PhysicalConstants::c, and from_b64().

Referenced by mg_base64_decode().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cs_base64_encode ( const unsigned char *  src,
int  src_len,
char *  dst 
)

Definition at line 241 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 241 of file mongoose.cc

References BASE64_ENCODE_BODY.

Referenced by mg_base64_encode().

+ Here is the caller graph for this function:

void cs_base64_finish ( struct cs_base64_ctx ctx)

Definition at line 195 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 195 of file mongoose.cc

References cs_base64_ctx::b64_putc, cs_base64_ctx::chunk, cs_base64_ctx::chunk_size, cs_base64_emit_chunk(), i, and cs_base64_ctx::user_data.

+ Here is the call graph for this function:

void cs_base64_init ( struct cs_base64_ctx ctx,
cs_base64_putc_t  putc,
void *  user_data 
)

Definition at line 176 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 176 of file mongoose.cc

References cs_base64_ctx::b64_putc, cs_base64_ctx::chunk_size, and cs_base64_ctx::user_data.

void cs_base64_update ( struct cs_base64_ctx ctx,
const char *  str,
size_t  len 
)

Definition at line 183 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 183 of file mongoose.cc

References cs_base64_ctx::chunk, cs_base64_ctx::chunk_size, cs_base64_emit_chunk(), and i.

+ Here is the call graph for this function:

void cs_fprint_base64 ( FILE *  f,
const unsigned char *  src,
int  src_len 
)

Definition at line 257 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 257 of file mongoose.cc

References BASE64_ENCODE_BODY.

void cs_hmac_sha1 ( const unsigned char *  key,
size_t  key_len,
const unsigned char *  text,
size_t  text_len,
unsigned char  out[20] 
)

Definition at line 1771 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1771 of file mongoose.cc

References cs_sha1_final(), cs_sha1_init(), cs_sha1_update(), and i.

+ Here is the call graph for this function:

void cs_log_print_prefix ( const char *  func)

Definition at line 355 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 355 of file mongoose.cc

References cs_log_file, cs_time(), and fprintf().

+ Here is the call graph for this function:

void cs_log_printf ( const char *  fmt,
  ... 
)

Definition at line 367 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 367 of file mongoose.cc

References cs_log_file.

void cs_log_set_file ( FILE *  file)

Definition at line 376 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 376 of file mongoose.cc

References cs_log_file, and file.

void cs_log_set_level ( enum cs_log_level  level)

Definition at line 382 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 382 of file mongoose.cc

References cs_time(), and physmon_simulation::level.

+ Here is the call graph for this function:

char* cs_md5 ( char  buf[33],
  ... 
)

Definition at line 1434 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1434 of file mongoose.cc

References cs_to_hex(), json_token::len, MD5_Final(), MD5_Init(), MD5_Update(), and merge_hashes::p.

Referenced by mg_http_create_digest_auth_header(), and mg_mkmd5resp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cs_sha1_final ( unsigned char  digest[20],
cs_sha1_ctx  
)

Definition at line 1747 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1747 of file mongoose.cc

References Acts::PhysicalConstants::c, cs_sha1_ctx::count, cs_sha1_update(), i, and cs_sha1_ctx::state.

Referenced by cs_hmac_sha1(), and mg_ws_handshake().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cs_sha1_init ( cs_sha1_ctx )

Definition at line 1718 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1718 of file mongoose.cc

References cs_sha1_ctx::count, and cs_sha1_ctx::state.

Referenced by cs_hmac_sha1(), and mg_ws_handshake().

+ Here is the caller graph for this function:

void cs_sha1_update ( cs_sha1_ctx ,
const unsigned char *  data,
uint32_t  len 
)

Definition at line 1727 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1727 of file mongoose.cc

References cs_sha1_ctx::buffer, cs_sha1_ctx::count, cs_sha1_transform(), i, j, and cs_sha1_ctx::state.

Referenced by cs_hmac_sha1(), cs_sha1_final(), and mg_ws_handshake().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double cs_time ( )

Definition at line 601 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 601 of file mongoose.cc

References double().

Referenced by cs_log_print_prefix(), cs_log_set_level(), and mg_time().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void cs_to_hex ( char *  to,
const unsigned char *  p,
size_t  len 
)

Definition at line 1424 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1424 of file mongoose.cc

Referenced by cs_md5().

+ Here is the caller graph for this function:

struct json_token* find_json_token ( struct json_token toks,
const char *  path 
)
read

Definition at line 1015 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1015 of file mongoose.cc

References compare(), i, is_digit(), JSON_TYPE_ARRAY, JSON_TYPE_OBJECT, JSON_TYPE_STRING, json_token::len, n, json_token::num_desc, path_part_len(), json_token::ptr, Acts::Test::skip, parse_cmake_options::type, and json_token::type.

Referenced by mg_rpc_dispatch(), and mg_rpc_parse_reply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int json_emit ( char *  buf,
int  buf_len,
const char *  fmt,
  ... 
)

Definition at line 1199 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1199 of file mongoose.cc

References json_emit_va(), and json_token::len.

Referenced by mg_rpc_create_error(), mg_rpc_create_reply(), and mg_rpc_create_request().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int json_emit_double ( char *  buf,
int  buf_len,
double  value 
)

Definition at line 1059 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1059 of file mongoose.cc

References n, and Acts::Test::tmp().

Referenced by json_emit_va().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int json_emit_long ( char *  buf,
int  buf_len,
long  value 
)
int json_emit_quoted_str ( char *  buf,
int  buf_len,
const char *  str,
int  len 
)

Definition at line 1066 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1066 of file mongoose.cc

References parse_cmake_options::begin, EMIT, end, json_token::len, and physmon_simulation::s.

Referenced by json_emit_va(), and mg_rpc_create_reply().

+ Here is the caller graph for this function:

int json_emit_unquoted_str ( char *  buf,
int  buf_len,
const char *  str,
int  len 
)

Definition at line 1120 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1120 of file mongoose.cc

References json_token::len, and n.

Referenced by json_emit_va(), and mg_rpc_create_reply().

+ Here is the caller graph for this function:

int json_emit_va ( char *  buf,
int  buf_len,
const char *  fmt,
va_list   
)

Definition at line 1131 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1131 of file mongoose.cc

References end, json_emit_double(), json_emit_long(), json_emit_quoted_str(), json_emit_unquoted_str(), json_token::len, physmon_simulation::s, and str.

Referenced by json_emit(), mg_rpc_create_error(), mg_rpc_create_reply(), and mg_rpc_create_request().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t mbuf_append ( struct mbuf ,
const void *  data,
size_t  data_size 
)

Definition at line 1541 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1541 of file mongoose.cc

References mbuf::len, and mbuf_insert().

Referenced by mg_dns_copy_questions(), mg_dns_encode_name(), mg_dns_encode_record(), mg_if_tcp_send(), mg_if_udp_send(), and mg_recv_common().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mbuf_free ( struct mbuf )

Definition at line 1484 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1484 of file mongoose.cc

References mbuf::buf, MBUF_FREE, and mbuf_init().

Referenced by mg_destroy_conn(), mg_recv_common(), and mg_send_dns_query().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mbuf_init ( struct mbuf ,
size_t  initial_capacity 
)

Definition at line 1478 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1478 of file mongoose.cc

References mbuf::buf, mbuf::len, mbuf_resize(), and mbuf::size.

Referenced by mbuf_free(), and mg_send_dns_query().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t mbuf_insert ( struct mbuf ,
size_t  ,
const void *  ,
size_t   
)

Definition at line 1509 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1509 of file mongoose.cc

References assert, mbuf::buf, mbuf::len, json_token::len, MBUF_REALLOC, MBUF_SIZE_MULTIPLIER, merge_hashes::p, size, and mbuf::size.

Referenced by dns_handler(), mbuf_append(), mg_dns_insert_header(), mg_mqtt_prepend_header(), and mg_send_dns_query().

+ Here is the caller graph for this function:

void mbuf_remove ( struct mbuf ,
size_t  data_size 
)

Definition at line 1545 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1545 of file mongoose.cc

References mbuf::buf, mbuf::len, json_token::len, and n.

Referenced by dns_handler(), mg_deliver_websocket_data(), mg_forward(), mg_handle_cgi(), mg_handle_put(), mg_http_handler(), mg_http_transfer_file_data(), mg_resolve_async_eh(), mg_write_to_socket(), mqtt_handler(), and parse_mqtt().

+ Here is the caller graph for this function:

void mbuf_resize ( struct mbuf ,
size_t  new_size 
)

Definition at line 1491 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1491 of file mongoose.cc

References mbuf::buf, mbuf::len, MBUF_REALLOC, size, and mbuf::size.

Referenced by mbuf_init(), mbuf_trim(), and mg_deliver_websocket_data().

+ Here is the caller graph for this function:

void mbuf_trim ( struct mbuf )

Definition at line 1505 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1505 of file mongoose.cc

References mbuf::len, and mbuf_resize().

+ Here is the call graph for this function:

void MD5_Final ( unsigned char *  md,
MD5_CTX c 
)
void MD5_Init ( MD5_CTX c)

Definition at line 1261 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1261 of file mongoose.cc

References MD5Context::bits, and MD5Context::buf.

Referenced by cs_md5().

+ Here is the caller graph for this function:

void MD5_Update ( MD5_CTX c,
const unsigned char *  data,
size_t  len 
)

Definition at line 1353 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 1353 of file mongoose.cc

References MD5Context::bits, MD5Context::buf, byteReverse(), if(), MD5Context::in, MD5Transform(), merge_hashes::p, and t.

Referenced by cs_md5().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_connection* mg_add_sock ( struct mg_mgr ,
sock_t  ,
mg_event_handler_t   
)
read

Definition at line 3107 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3107 of file mongoose.cc

References mg_add_sock_opt().

Referenced by mg_handle_cgi().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_connection* mg_add_sock_opt ( struct mg_mgr ,
sock_t  ,
mg_event_handler_t  ,
struct mg_add_sock_opts   
)
read

Definition at line 3096 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3096 of file mongoose.cc

References mg_add_conn(), mg_create_connection_base(), mg_sock_set(), and mg_connection::mgr.

Referenced by mg_add_sock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_avprintf ( char **  buf,
size_t  size,
const char *  fmt,
va_list  ap 
)

Definition at line 8058 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8058 of file mongoose.cc

References MG_FREE, and MG_MALLOC.

Referenced by mg_printf_html_escape(), mg_printf_http_chunk(), mg_printf_websocket_frame(), and mg_vprintf().

+ Here is the caller graph for this function:

int mg_base64_decode ( const unsigned char *  s,
int  len,
char *  dst 
)

Definition at line 7942 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7942 of file mongoose.cc

References cs_base64_decode().

+ Here is the call graph for this function:

void mg_base64_encode ( const unsigned char *  src,
int  src_len,
char *  dst 
)

Definition at line 7938 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7938 of file mongoose.cc

References cs_base64_encode().

Referenced by mg_send_websocket_handshake2(), and mg_ws_handshake().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_connection* mg_bind ( struct mg_mgr ,
const char *  ,
mg_event_handler_t   
)
read

Definition at line 2943 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2943 of file mongoose.cc

References mg_bind_opt().

Referenced by mg_server().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2950 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2950 of file mongoose.cc

References DBG, check_license::err(), mg_bind_opts::error_string, mg_connection::flags, mg_add_conn(), MG_COPY_COMMON_CONNECTION_OPTIONS, mg_create_connection(), mg_destroy_conn(), MG_F_LISTENING, MG_F_UDP, mg_if_listen_tcp(), mg_if_listen_udp(), MG_MAX_HOST_LEN, mg_parse_address(), MG_SET_PTRPTR, mg_set_ssl(), mg_connection::mgr, and mg_connection::sa.

Referenced by mg_bind().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_broadcast ( struct mg_mgr ,
mg_event_handler_t  func,
void *  ,
size_t   
)

Definition at line 3005 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3005 of file mongoose.cc

References ctl_msg::callback, Acts::Test::cb, mg_mgr::ctl, dummy, ctl_msg::message, gtest_output_test::message, MG_RECV_FUNC, and MG_SEND_FUNC.

int mg_casecmp ( const char *  s1,
const char *  s2 
)

Definition at line 7882 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7882 of file mongoose.cc

References mg_ncasecmp().

Referenced by mg_get_mime_type(), and mg_http_check_digest_auth().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_check_ip_acl ( const char *  acl,
uint32_t  remote_ip 
)

Definition at line 3050 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3050 of file mongoose.cc

References DBG, mask, mg_next_comma_list_entry(), mg_str::p, and parse_net().

Referenced by mg_serve_http().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_close_conn ( struct mg_connection nc)

Definition at line 2228 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2228 of file mongoose.cc

References DBG, mg_connection::flags, mg_call(), mg_destroy_conn(), MG_EV_CLOSE, and mg_remove_conn().

Referenced by mg_accept_conn(), mg_mgr_free(), and mg_mgr_poll().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_conn_addr_to_str ( struct mg_connection nc,
char *  buf,
size_t  len,
int  flags 
)

Definition at line 8026 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8026 of file mongoose.cc

References mg_if_get_conn_addr(), mg_sock_addr_to_str(), and MG_SOCK_STRINGIFY_REMOTE.

Referenced by mg_hexdump_connection(), mg_http_send_port_based_redirect(), and mg_prepare_cgi_environment().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_connection* mg_connect ( struct mg_mgr mgr,
const char *  address,
mg_event_handler_t  handler 
)
read

Definition at line 2859 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2859 of file mongoose.cc

References mg_connect_opt().

Referenced by mg_resolve_async_opt().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 7756 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7756 of file mongoose.cc

References mg_connect_http_opt().

+ Here is the call graph for this function:

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

Definition at line 7730 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7730 of file mongoose.cc

References mg_connect_http_base(), MG_FREE, and mg_printf().

Referenced by mg_connect_http().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2866 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2866 of file mongoose.cc

References _MG_ALLOWED_CONNECT_FLAGS_MASK, mg_resolve_async_opts::dns_conn, check_license::err(), mg_connect_opts::error_string, mg_connection::flags, mg_connect_opts::flags, MG_COPY_COMMON_CONNECTION_OPTIONS, mg_create_connection(), mg_destroy_conn(), MG_DNS_A_RECORD, mg_do_connect(), MG_F_RESOLVING, MG_F_UDP, MG_MAX_HOST_LEN, mg_parse_address(), mg_resolve_async_opt(), MG_SET_PTRPTR, mg_set_ssl(), mg_connection::mgr, mg_connection::priv_2, resolve_cb(), mg_connection::sa, mg_connection::ssl_ctx, mg_connection::user_data, and mg_connect_opts::user_data.

Referenced by mg_connect(), and mg_connect_http_base().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 7787 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7787 of file mongoose.cc

References mg_connect_ws_opt().

+ Here is the call graph for this function:

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

Definition at line 7767 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7767 of file mongoose.cc

References mg_connect_http_base(), MG_FREE, and mg_send_websocket_handshake2().

Referenced by mg_connect_ws().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_dns_copy_questions ( struct mbuf io,
struct mg_dns_message msg 
)

Definition at line 8968 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8968 of file mongoose.cc

References parse_cmake_options::begin, end, mg_str::len, mbuf_append(), mg_dns_resource_record::name, mg_dns_message::num_questions, mg_str::p, mg_dns_message::pkt, and mg_dns_message::questions.

+ Here is the call graph for this function:

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 
)

Definition at line 9007 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9007 of file mongoose.cc

References mbuf::buf, mg_dns_resource_record::kind, mbuf::len, mbuf_append(), MG_DNS_ANSWER, MG_DNS_CNAME_RECORD, mg_dns_encode_name(), MG_DNS_INVALID_RECORD, Acts::Test::pos, mg_dns_resource_record::rclass, mg_dns_resource_record::rtype, and mg_dns_resource_record::ttl.

Referenced by mg_send_dns_query().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_dns_insert_header ( struct mbuf io,
size_t  pos,
struct mg_dns_message msg 
)

Definition at line 8955 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8955 of file mongoose.cc

References mg_dns_message::flags, mg_dns_header::flags, mbuf_insert(), mg_dns_message::num_answers, mg_dns_header::num_answers, mg_dns_message::num_questions, mg_dns_header::num_questions, mg_dns_message::transaction_id, and mg_dns_header::transaction_id.

Referenced by dns_handler(), and mg_send_dns_query().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_dns_resource_record* mg_dns_next_record ( struct mg_dns_message msg,
int  query,
struct mg_dns_resource_record prev 
)
read

Definition at line 8912 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8912 of file mongoose.cc

References mg_dns_message::answers, mg_dns_message::num_answers, and mg_dns_resource_record::rtype.

int mg_dns_parse_record_data ( struct mg_dns_message msg,
struct mg_dns_resource_record rr,
void *  data,
size_t  data_len 
)

Definition at line 8926 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8926 of file mongoose.cc

References mg_str::len, MG_DNS_A_RECORD, MG_DNS_AAAA_RECORD, MG_DNS_CNAME_RECORD, mg_dns_uncompress_name(), mg_str::p, mg_dns_message::pkt, mg_dns_resource_record::rdata, and mg_dns_resource_record::rtype.

Referenced by resolve_cb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t mg_dns_uncompress_name ( struct mg_dns_message msg,
struct mg_str name,
char *  dst,
int  dst_len 
)

Definition at line 9175 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9175 of file mongoose.cc

References end, mg_str::len, mg_str::p, and mg_dns_message::pkt.

Referenced by mg_dns_parse_record_data().

+ Here is the caller graph for this function:

void mg_enable_multithreading ( struct mg_connection nc)
FILE* mg_fopen ( const char *  path,
const char *  mode 
)

Definition at line 7916 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7916 of file mongoose.cc

References ARRAY_SIZE, and MAX_PATH_SIZE.

struct mg_str* mg_get_http_header ( struct http_message hm,
const char *  name 
)
read

Definition at line 4528 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 4528 of file mongoose.cc

References h, http_message::header_names, http_message::header_values, i, mg_str::len, mg_ncasecmp(), mg_str::p, and testSigmaEff::v.

Referenced by mg_cgi_ev_handler(), mg_handle_move(), mg_handle_propfind(), mg_handle_put(), mg_http_check_digest_auth(), mg_http_handler(), mg_http_send_file2(), mg_is_not_modified(), mg_prepare_cgi_environment(), mg_serve_http(), and mg_uri_to_local_path().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_get_http_var ( const struct mg_str buf,
const char *  name,
char *  dst,
size_t  dst_len 
)

Definition at line 6050 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6050 of file mongoose.cc

References Acts::UnitConstants::e, mg_str::len, mg_ncasecmp(), mg_url_decode(), merge_hashes::p, mg_str::p, and physmon_simulation::s.

+ Here is the call graph for this function:

int mg_hexdump ( const void *  buf,
int  len,
char *  dst,
int  dst_len 
)

Definition at line 8035 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8035 of file mongoose.cc

References i, ambiguity_solver_full_chain::idx, and n.

Referenced by mg_hexdump_connection().

+ Here is the caller graph for this function:

void mg_hexdump_connection ( struct mg_connection nc,
const char *  path,
const void *  buf,
int  num_bytes,
int  ev 
)

Definition at line 8095 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8095 of file mongoose.cc

References fclose(), fprintf(), mg_conn_addr_to_str(), MG_EV_ACCEPT, MG_EV_CONNECT, MG_EV_RECV, MG_EV_SEND, MG_FREE, mg_hexdump(), MG_MALLOC, MG_SOCK_STRINGIFY_IP, MG_SOCK_STRINGIFY_PORT, MG_SOCK_STRINGIFY_REMOTE, conf::stdout, and Acts::Test::time.

Referenced by mg_call(), and mg_send().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 6250 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6250 of file mongoose.cc

References mg_str::len, http_message::method, mg_casecmp(), mg_check_nonce(), mg_get_http_header(), mg_http_parse_header(), mg_mkmd5resp(), mg_str::p, http_message::query_string, and http_message::uri.

Referenced by mg_is_authorized().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

Definition at line 6216 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6216 of file mongoose.cc

References cs_md5(), mg_mkmd5resp(), and Acts::Test::time.

+ Here is the call graph for this function:

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

Definition at line 6144 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6144 of file mongoose.cc

References end, mg_str::len, n, merge_hashes::p, mg_str::p, and physmon_simulation::s.

Referenced by mg_http_check_digest_auth(), and mg_parse_multipart().

+ Here is the caller graph for this function:

struct mg_connection* mg_if_accept_new_conn ( struct mg_connection lc)
read

Definition at line 2664 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2664 of file mongoose.cc

References DBG, mg_connection::flags, mg_connection::handler, mg_connection::listener, mg_add_conn(), mg_create_connection(), mg_connection::mgr, mg_connection::proto_handler, mg_connection::recv_mbuf_limit, mg_connection::sock, mg_connection::ssl, mg_connection::ssl_ctx, and mg_connection::user_data.

Referenced by mg_accept_conn().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_accept_tcp_cb ( struct mg_connection nc,
union socket_address sa,
size_t  sa_len 
)

Definition at line 2680 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2680 of file mongoose.cc

References mg_call(), MG_EV_ACCEPT, and mg_connection::sa.

Referenced by mg_accept_conn().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_connect_cb ( struct mg_connection nc,
int  err 
)

Definition at line 2803 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2803 of file mongoose.cc

References DBG, mg_connection::flags, mg_call(), MG_EV_CONNECT, MG_F_CLOSE_IMMEDIATELY, and MG_F_CONNECTING.

Referenced by mg_mgr_handle_conn().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_connect_tcp ( struct mg_connection nc,
const union socket_address sa 
)

Definition at line 3170 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3170 of file mongoose.cc

References DBG, mg_connection::err, mg_is_error(), mg_set_non_blocking_mode(), socket_address::sa, socket_address::sin, and mg_connection::sock.

Referenced by mg_do_connect().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_connect_udp ( struct mg_connection nc)

Definition at line 3186 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3186 of file mongoose.cc

References mg_connection::err, and mg_connection::sock.

Referenced by mg_do_connect().

+ Here is the caller graph for this function:

int mg_if_create_conn ( struct mg_connection nc)

Definition at line 3224 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3224 of file mongoose.cc

Referenced by mg_create_connection().

+ Here is the caller graph for this function:

void mg_if_destroy_conn ( struct mg_connection nc)

Definition at line 3229 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3229 of file mongoose.cc

References mg_connection::flags, mg_connection::listener, MG_F_UDP, and mg_connection::sock.

Referenced by mg_destroy_conn().

+ Here is the caller graph for this function:

void mg_if_get_conn_addr ( struct mg_connection nc,
int  remote,
union socket_address sa 
)

Definition at line 3836 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3836 of file mongoose.cc

References mg_sock_get_addr(), mg_connection::sa, and mg_connection::sock.

Referenced by mg_conn_addr_to_str().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_if_listen_tcp ( struct mg_connection nc,
union socket_address sa 
)

Definition at line 3195 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3195 of file mongoose.cc

References mg_open_listening_socket(), and mg_sock_set().

Referenced by mg_bind_opt().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_if_listen_udp ( struct mg_connection nc,
union socket_address sa 
)

Definition at line 3204 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3204 of file mongoose.cc

References mg_open_listening_socket(), and mg_sock_set().

Referenced by mg_bind_opt().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_poll ( struct mg_connection nc,
time_t  now 
)

Definition at line 2206 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2206 of file mongoose.cc

References mg_connection::flags, mg_call(), MG_EV_POLL, MG_F_SSL_HANDSHAKE_DONE, and mg_connection::ssl.

Referenced by mg_mgr_handle_conn().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_recv_tcp_cb ( struct mg_connection nc,
void *  buf,
int  len 
)

Definition at line 2732 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2732 of file mongoose.cc

References mg_recv_common().

Referenced by mg_read_from_socket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_recv_udp_cb ( struct mg_connection nc,
void *  buf,
int  len,
union socket_address sa,
size_t  sa_len 
)

Definition at line 2736 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2736 of file mongoose.cc

References assert, DBG, mg_connection::flags, mg_connection::handler, mg_connection::listener, mg_add_conn(), mg_call(), mg_create_connection_base(), MG_EV_ACCEPT, MG_F_LISTENING, MG_F_UDP, MG_FREE, mg_if_recved(), mg_next(), mg_recv_common(), mg_connection::mgr, mg_connection::proto_handler, mg_connection::recv_mbuf_limit, socket_address::sa, mg_connection::sa, mg_connection::sock, and mg_connection::user_data.

Referenced by mg_handle_udp_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_recved ( struct mg_connection nc,
size_t  len 
)

Definition at line 3219 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3219 of file mongoose.cc

Referenced by mg_call(), and mg_if_recv_udp_cb().

+ Here is the caller graph for this function:

void mg_if_sent_cb ( struct mg_connection nc,
int  num_sent 
)

Definition at line 2701 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2701 of file mongoose.cc

References mg_connection::flags, mg_call(), MG_EV_SEND, and MG_F_CLOSE_IMMEDIATELY.

Referenced by mg_write_to_socket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_tcp_send ( struct mg_connection nc,
const void *  buf,
size_t  len 
)

Definition at line 3211 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3211 of file mongoose.cc

References mbuf_append(), and mg_connection::send_mbuf.

Referenced by mg_send().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_timer ( struct mg_connection c,
double  now 
)

Definition at line 2192 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2192 of file mongoose.cc

References mg_connection::ev_timer_time, mg_call(), and MG_EV_TIMER.

Referenced by mg_mgr_handle_conn().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_if_udp_send ( struct mg_connection nc,
const void *  buf,
size_t  len 
)

Definition at line 3215 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3215 of file mongoose.cc

References mbuf_append(), and mg_connection::send_mbuf.

Referenced by mg_send().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_is_big_endian ( void  )

Definition at line 8136 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8136 of file mongoose.cc

int mg_match_prefix ( const char *  pattern,
int  pattern_len,
const char *  str 
)

Definition at line 8221 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8221 of file mongoose.cc

References mg_match_prefix_n(), and mg_mk_str().

Referenced by mg_do_ssi_include(), mg_http_send_file2(), mg_is_file_hidden(), and mg_send_http_file().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_match_prefix_n ( const struct mg_str  pattern,
const struct mg_str  str 
)

Definition at line 8175 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8175 of file mongoose.cc

References i, j, mg_str::len, lowercase(), mg_match_prefix_n(), and mg_str::p.

Referenced by mg_http_get_endpoint_handler(), mg_match_prefix(), mg_match_prefix_n(), and mg_uri_to_local_path().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_mgr_free ( struct mg_mgr )

Definition at line 2294 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2294 of file mongoose.cc

References mg_mgr::active_connections, mg_mgr::ctl, DBG, mg_close_conn(), mg_ev_mgr_free(), mg_mgr_poll(), and mg_connection::next.

+ Here is the call graph for this function:

void mg_mgr_init ( struct mg_mgr mgr,
void *  user_data 
)

Definition at line 2235 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2235 of file mongoose.cc

References mg_mgr::ctl, configureMap::data, DBG, init_done, mg_ev_mgr_init(), signal(), and mg_mgr::user_data.

Referenced by mg_server().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

time_t mg_mgr_poll ( struct mg_mgr ,
int  milli 
)

Definition at line 3643 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3643 of file mongoose.cc

References _MG_F_FD_CAN_READ, _MG_F_FD_CAN_WRITE, _MG_F_FD_ERROR, mg_mgr::active_connections, mg_mgr::ctl, DBG, mg_connection::ev_timer_time, mg_connection::flags, mbuf::len, mg_connection::listener, mg_add_to_set(), mg_close_conn(), MG_F_CLOSE_IMMEDIATELY, MG_F_CONNECTING, MG_F_SEND_AND_CLOSE, MG_F_UDP, MG_F_WANT_READ, MG_F_WANT_WRITE, mg_mgr_handle_conn(), mg_mgr_handle_ctl_sock(), mg_time(), mg_connection::next, mg_connection::recv_mbuf, mg_connection::recv_mbuf_limit, mg_connection::send_mbuf, mg_connection::sock, and Acts::Test::tmp().

Referenced by mg_mgr_free(), and mg_server().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_str mg_mk_str ( const char *  s)
read

Definition at line 8226 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8226 of file mongoose.cc

References mg_str::len, and physmon_simulation::s.

Referenced by mg_match_prefix().

+ Here is the caller graph for this function:

void mg_mqtt_connack ( struct mg_connection nc,
uint8_t  return_code 
)

Definition at line 8652 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8652 of file mongoose.cc

References MG_MQTT_CMD_CONNACK, mg_mqtt_prepend_header(), and mg_send().

+ Here is the call graph for this function:

void mg_mqtt_disconnect ( struct mg_connection nc)

Definition at line 8710 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8710 of file mongoose.cc

References MG_MQTT_CMD_DISCONNECT, and mg_mqtt_prepend_header().

+ Here is the call graph for this function:

int mg_mqtt_next_subscribe_topic ( struct mg_mqtt_message msg,
struct mg_str topic,
uint8_t *  qos,
int  pos 
)

Definition at line 8621 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8621 of file mongoose.cc

References if(), mg_str::len, mg_str::p, and mg_mqtt_message::payload.

+ Here is the call graph for this function:

void mg_mqtt_ping ( struct mg_connection nc)

Definition at line 8702 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8702 of file mongoose.cc

References MG_MQTT_CMD_PINGREQ, and mg_mqtt_prepend_header().

+ Here is the call graph for this function:

void mg_mqtt_pong ( struct mg_connection nc)

Definition at line 8706 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8706 of file mongoose.cc

References MG_MQTT_CMD_PINGRESP, and mg_mqtt_prepend_header().

+ Here is the call graph for this function:

void mg_mqtt_puback ( struct mg_connection nc,
uint16_t  message_id 
)

Definition at line 8671 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8671 of file mongoose.cc

References MG_MQTT_CMD_PUBACK, and mg_send_mqtt_short_command().

+ Here is the call graph for this function:

void mg_mqtt_pubcomp ( struct mg_connection nc,
uint16_t  message_id 
)

Definition at line 8683 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8683 of file mongoose.cc

References MG_MQTT_CMD_PUBCOMP, and mg_send_mqtt_short_command().

+ Here is the call graph for this function:

void mg_mqtt_publish ( struct mg_connection nc,
const char *  topic,
uint16_t  message_id,
int  flags,
const void *  data,
size_t  len 
)

Definition at line 8582 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8582 of file mongoose.cc

References mbuf::len, MG_MQTT_CMD_PUBLISH, MG_MQTT_GET_QOS, mg_mqtt_prepend_header(), mg_send(), and mg_connection::send_mbuf.

+ Here is the call graph for this function:

void mg_mqtt_pubrec ( struct mg_connection nc,
uint16_t  message_id 
)

Definition at line 8675 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8675 of file mongoose.cc

References MG_MQTT_CMD_PUBREC, and mg_send_mqtt_short_command().

+ Here is the call graph for this function:

void mg_mqtt_pubrel ( struct mg_connection nc,
uint16_t  message_id 
)

Definition at line 8679 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8679 of file mongoose.cc

References MG_MQTT_CMD_PUBREL, and mg_send_mqtt_short_command().

+ Here is the call graph for this function:

void mg_mqtt_suback ( struct mg_connection nc,
uint8_t *  qoss,
size_t  qoss_len,
uint16_t  message_id 
)

Definition at line 8687 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8687 of file mongoose.cc

References i, MG_MQTT_CMD_SUBACK, mg_mqtt_prepend_header(), MG_MQTT_QOS, and mg_send().

+ Here is the call graph for this function:

void mg_mqtt_subscribe ( struct mg_connection nc,
const struct mg_mqtt_topic_expression topics,
size_t  topics_len,
uint16_t  message_id 
)

Definition at line 8601 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8601 of file mongoose.cc

References i, mbuf::len, MG_MQTT_CMD_SUBSCRIBE, mg_mqtt_prepend_header(), MG_MQTT_QOS, mg_send(), and mg_connection::send_mbuf.

+ Here is the call graph for this function:

void mg_mqtt_unsuback ( struct mg_connection nc,
uint16_t  message_id 
)

Definition at line 8698 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8698 of file mongoose.cc

References MG_MQTT_CMD_UNSUBACK, and mg_send_mqtt_short_command().

+ Here is the call graph for this function:

void mg_mqtt_unsubscribe ( struct mg_connection nc,
char **  topics,
size_t  topics_len,
uint16_t  message_id 
)

Definition at line 8634 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8634 of file mongoose.cc

References i, mbuf::len, MG_MQTT_CMD_UNSUBSCRIBE, mg_mqtt_prepend_header(), MG_MQTT_QOS, mg_send(), and mg_connection::send_mbuf.

+ Here is the call graph for this function:

int mg_ncasecmp ( const char *  s1,
const char *  s2,
size_t  len 
)

Definition at line 7872 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7872 of file mongoose.cc

References lowercase().

Referenced by mg_casecmp(), mg_get_http_header(), mg_get_http_var(), mg_http_parse_headers(), mg_parse_multipart(), mg_uri_to_local_path(), and mg_vcasecmp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct mg_connection* mg_next ( struct mg_mgr ,
struct mg_connection  
)
read

Definition at line 3000 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3000 of file mongoose.cc

References mg_mgr::active_connections, and mg_connection::next.

Referenced by broadcast(), mg_if_recv_udp_cb(), and mg_mgr_handle_ctl_sock().

+ Here is the caller graph for this function:

const char* mg_next_comma_list_entry ( const char *  list,
struct mg_str val,
struct mg_str eq_val 
)

Definition at line 8142 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8142 of file mongoose.cc

References mg_str::len, and mg_str::p.

Referenced by mg_check_ip_acl(), mg_find_index_file(), mg_get_mime_type(), mg_http_send_port_based_redirect(), and mg_uri_to_local_path().

+ Here is the caller graph for this function:

int mg_normalize_uri_path ( const struct mg_str in,
struct mg_str out 
)

Definition at line 4100 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 4100 of file mongoose.cc

References if(), mg_str::len, mg_vcmp(), next, mg_str::p, parse_uri_component(), and physmon_simulation::s.

Referenced by mg_serve_http().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_open ( const char *  path,
int  flag,
int  mode 
)

Definition at line 7927 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7927 of file mongoose.cc

References ARRAY_SIZE, MAX_PATH_SIZE, and Acts::open.

int mg_parse_dns ( const char *  buf,
int  len,
struct mg_dns_message msg 
)

Definition at line 9139 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9139 of file mongoose.cc

References mg_dns_message::answers, ARRAY_SIZE, end, mg_dns_message::flags, mg_dns_header::flags, i, mg_str::len, mg_parse_dns_resource_record(), mg_dns_message::num_answers, mg_dns_header::num_answers, mg_dns_message::num_questions, mg_dns_header::num_questions, mg_str::p, mg_dns_message::pkt, mg_dns_message::questions, mg_dns_message::transaction_id, and mg_dns_header::transaction_id.

Referenced by dns_handler(), and mg_resolve_async_eh().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_parse_http ( const char *  s,
int  n,
struct http_message hm,
int  is_req 
)

Definition at line 4464 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 4464 of file mongoose.cc

References http_message::body, end, mg_str::len, http_message::message, http_message::method, mg_http_get_request_len(), mg_http_parse_headers(), mg_skip(), mg_vcasecmp(), mg_str::p, http_message::proto, http_message::query_string, http_message::resp_code, http_message::resp_status_msg, physmon_simulation::s, and http_message::uri.

Referenced by mg_http_handler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 
)

Definition at line 7796 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7796 of file mongoose.cc

References cd(), mg_str::len, mg_get_line_len(), mg_http_get_request_len(), mg_http_parse_header(), mg_ncasecmp(), n, mg_str::p, and Acts::Test::pos.

+ Here is the call graph for this function:

int mg_parse_uri ( 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 
)

Definition at line 3984 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3984 of file mongoose.cc

References end, mg_str::len, merge_hashes::p, mg_str::p, parse_uri_component(), and filter::state.

+ Here is the call graph for this function:

int mg_printf ( struct mg_connection ,
const char *  fmt,
  ... 
)

Definition at line 2330 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2330 of file mongoose.cc

References mg_vprintf().

Referenced by do_ssi_exec(), mg_cgi_ev_handler(), mg_connect_http_opt(), mg_do_ssi_include(), mg_handle_propfind(), mg_handle_put(), mg_handle_ssi_request(), mg_http_send_digest_auth_request(), mg_http_send_file2(), mg_http_send_options(), mg_http_send_port_based_redirect(), mg_print_props(), mg_send_directory_listing(), mg_send_head(), mg_send_http_file(), mg_send_response_line(), mg_send_ssi_file(), mg_send_websocket_handshake2(), mg_ws_handshake(), send_error(), send_nothing(), send_status(), and send_updates().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_printf_html_escape ( struct mg_connection nc,
const char *  fmt,
  ... 
)

Definition at line 6117 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6117 of file mongoose.cc

References i, j, mg_str::len, mg_avprintf(), MG_FREE, mg_send(), and MG_VPRINTF_BUFFER_SIZE.

+ Here is the call graph for this function:

void mg_printf_http_chunk ( struct mg_connection nc,
const char *  fmt,
  ... 
)

Definition at line 6097 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6097 of file mongoose.cc

References mg_str::len, mg_avprintf(), MG_FREE, mg_send_http_chunk(), and MG_VPRINTF_BUFFER_SIZE.

Referenced by mg_print_dir_entry(), and mg_send_directory_listing().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_printf_websocket_frame ( struct mg_connection nc,
int  op_and_flags,
const char *  fmt,
  ... 
)

Definition at line 4759 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 4759 of file mongoose.cc

References mg_avprintf(), MG_FREE, mg_send_websocket_frame(), and MG_VPRINTF_BUFFER_SIZE.

+ Here is the call graph for this function:

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

Definition at line 7834 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7834 of file mongoose.cc

References mg_http_proto_data::endpoints, handler(), mg_http_endpoint::handler, mg_http_get_proto_data(), mg_http_endpoint::name, mg_http_endpoint::name_len, mg_http_endpoint::next, and strdup().

+ Here is the call graph for this function:

int mg_resolve ( const char *  domain_name,
char *  ip_addr_buf,
size_t  buf_len 
)

Definition at line 2371 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2371 of file mongoose.cc

References mg_resolve2().

+ Here is the call graph for this function:

int mg_resolve_async ( struct mg_mgr mgr,
const char *  name,
int  query,
mg_resolve_callback_t  cb,
void *  data 
)

Definition at line 9542 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9542 of file mongoose.cc

References mg_resolve_async_opt().

+ Here is the call graph for this function:

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 
)

Definition at line 9549 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9549 of file mongoose.cc

References mg_resolve_async_request::callback, Acts::Test::cb, configureMap::data, mg_resolve_async_request::data, DBG, mg_resolve_async_opts::dns_conn, mg_resolve_async_opts::max_retries, mg_resolve_async_request::max_retries, MG_CALLOC, mg_connect(), mg_dns_server, mg_get_ip_address_of_nameserver(), mg_resolve_async_eh(), mg_resolve_async_request::name, mg_resolve_async_opts::nameserver_url, mg_resolve_async_request::query, mg_resolve_async_opts::timeout, mg_resolve_async_request::timeout, and mg_connection::user_data.

Referenced by mg_connect_opt(), and mg_resolve_async().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_resolve_from_hosts_file ( const char *  host,
union socket_address usa 
)

Definition at line 9443 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9443 of file mongoose.cc

References KFPMath::a, KFPMath::b, Acts::PhysicalConstants::c, fclose(), line, merge_hashes::p, and socket_address::sin.

Referenced by mg_parse_address().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_rpc_create_error ( char *  buf,
int  len,
struct mg_rpc_request req,
int  code,
const char *  message,
const char *  fmt,
  ... 
)

Definition at line 8283 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8283 of file mongoose.cc

References mg_rpc_request::id, json_emit(), json_emit_va(), json_token::len, n, and json_token::ptr.

Referenced by mg_rpc_create_std_error().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_rpc_create_reply ( char *  buf,
int  len,
const struct mg_rpc_request req,
const char *  result_fmt,
  ... 
)

Definition at line 8243 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8243 of file mongoose.cc

References mg_rpc_request::id, json_emit(), json_emit_quoted_str(), json_emit_unquoted_str(), json_emit_va(), JSON_TYPE_NULL, JSON_TYPE_STRING, json_token::len, n, json_token::ptr, and json_token::type.

+ Here is the call graph for this function:

int mg_rpc_create_request ( char *  buf,
int  len,
const char *  method,
const char *  id,
const char *  params_fmt,
  ... 
)

Definition at line 8267 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8267 of file mongoose.cc

References json_emit(), json_emit_va(), and n.

+ Here is the call graph for this function:

int mg_rpc_create_std_error ( char *  buf,
int  len,
struct mg_rpc_request req,
int  code 
)

Definition at line 8301 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8301 of file mongoose.cc

References JSON_RPC_INVALID_PARAMS_ERROR, JSON_RPC_INVALID_REQUEST_ERROR, JSON_RPC_METHOD_NOT_FOUND_ERROR, JSON_RPC_PARSE_ERROR, JSON_RPC_SERVER_ERROR, gtest_output_test::message, and mg_rpc_create_error().

Referenced by mg_rpc_dispatch().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_rpc_dispatch ( const char *  buf,
int  ,
char *  dst,
int  dst_len,
const char **  methods,
mg_rpc_handler_t handlers 
)

Definition at line 8329 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8329 of file mongoose.cc

References find_json_token(), i, mg_rpc_request::id, JSON_RPC_INVALID_REQUEST_ERROR, JSON_RPC_METHOD_NOT_FOUND_ERROR, JSON_RPC_PARSE_ERROR, JSON_RPC_SERVER_ERROR, JSON_STRING_INVALID, json_token::len, mg_rpc_request::message, mg_rpc_request::method, mg_rpc_create_std_error(), n, mg_rpc_request::params, parse_json(), and json_token::ptr.

+ Here is the call graph for this function:

int mg_rpc_parse_reply ( const char *  buf,
int  len,
struct json_token toks,
int  max_toks,
struct mg_rpc_reply ,
struct mg_rpc_error  
)

Definition at line 8368 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8368 of file mongoose.cc

References mg_rpc_error::error_code, mg_rpc_error::error_data, mg_rpc_error::error_message, find_json_token(), mg_rpc_reply::id, mg_rpc_error::id, mg_rpc_reply::message, mg_rpc_error::message, n, parse_json(), and mg_rpc_reply::result.

+ Here is the call graph for this function:

void mg_send ( struct mg_connection ,
const void *  buf,
int  len 
)

Definition at line 2687 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2687 of file mongoose.cc

References mg_connection::flags, mg_mgr::hexdump_file, mg_connection::last_io_time, MG_EV_SEND, MG_F_UDP, mg_hexdump_connection(), mg_if_tcp_send(), mg_if_udp_send(), mg_time(), and mg_connection::mgr.

Referenced by dns_handler(), mg_forward(), mg_handle_cgi(), mg_handle_propfind(), mg_http_send_error(), mg_http_transfer_file_data(), mg_mqtt_connack(), mg_mqtt_publish(), mg_mqtt_suback(), mg_mqtt_subscribe(), mg_mqtt_unsubscribe(), mg_printf_html_escape(), mg_send_dns_query(), mg_send_file_data(), mg_send_head(), mg_send_http_chunk(), mg_send_mqtt_handshake_opt(), mg_send_mqtt_short_command(), mg_send_ssi_file(), mg_send_websocket_frame(), mg_send_websocket_framev(), mg_send_ws_header(), and mg_vprintf().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_dns_query ( struct mg_connection nc,
const char *  name,
int  query_type 
)

Definition at line 9052 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9052 of file mongoose.cc

References mbuf::buf, cleanup(), DBG, mg_connection::flags, mg_dns_message::flags, mg_dns_resource_record::kind, mbuf::len, mbuf_free(), mbuf_init(), mbuf_insert(), MG_CALLOC, mg_dns_encode_record(), mg_dns_insert_header(), MG_DNS_QUESTION, mg_dns_tid, MG_F_UDP, MG_FREE, mg_send(), mg_dns_message::num_questions, mg_dns_message::questions, mg_dns_resource_record::rclass, mg_dns_resource_record::rtype, and mg_dns_message::transaction_id.

Referenced by mg_resolve_async_eh().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_head ( struct mg_connection n,
int  status_code,
int64_t  content_length,
const char *  extra_headers 
)

Definition at line 5681 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 5681 of file mongoose.cc

References mg_printf(), mg_send(), and mg_send_response_line().

Referenced by mg_http_send_error().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_http_chunk ( struct mg_connection nc,
const char *  buf,
size_t  len 
)

Definition at line 6087 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6087 of file mongoose.cc

References mg_send(), and n.

Referenced by mg_printf_http_chunk(), and mg_send_directory_listing().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_mqtt_handshake ( struct mg_connection nc,
const char *  client_id 
)

Definition at line 8504 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8504 of file mongoose.cc

References mg_send_mqtt_handshake_opt().

+ Here is the call graph for this function:

void mg_send_mqtt_handshake_opt ( struct mg_connection nc,
const char *  client_id,
struct mg_send_mqtt_handshake_opts   
)

Definition at line 8509 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8509 of file mongoose.cc

References mg_send_mqtt_handshake_opts::flags, mg_send_mqtt_handshake_opts::keep_alive, MG_MQTT_CMD_CONNECT, MG_MQTT_HAS_PASSWORD, MG_MQTT_HAS_USER_NAME, mg_send(), mg_send_mqtt_handshake_opts::password, and mg_send_mqtt_handshake_opts::user_name.

Referenced by mg_send_mqtt_handshake().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_response_line ( struct mg_connection c,
int  status_code,
const char *  extra_headers 
)

Definition at line 5642 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 5642 of file mongoose.cc

References mg_printf().

Referenced by mg_handle_ssi_request(), mg_http_send_file2(), mg_http_send_port_based_redirect(), mg_send_directory_listing(), and mg_send_head().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_websocket_frame ( struct mg_connection nc,
int  op_and_flags,
const void *  data,
size_t  data_len 
)

Definition at line 4723 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 4723 of file mongoose.cc

References DBG, mg_connection::flags, MG_F_SEND_AND_CLOSE, mg_send(), mg_send_ws_header(), mg_ws_mask_frame(), mg_connection::send_mbuf, and WEBSOCKET_OP_CLOSE.

Referenced by broadcast(), initial_ws_update(), mg_printf_websocket_frame(), and mg_websocket_handler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_send_websocket_framev ( struct mg_connection nc,
int  op_and_flags,
const struct mg_str strings,
int  num_strings 
)

Definition at line 4737 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 4737 of file mongoose.cc

References mg_connection::flags, i, mg_str::len, MG_F_SEND_AND_CLOSE, mg_send(), mg_send_ws_header(), mg_ws_mask_frame(), mg_connection::send_mbuf, and WEBSOCKET_OP_CLOSE.

+ Here is the call graph for this function:

void mg_send_websocket_handshake ( struct mg_connection nc,
const char *  uri,
const char *  extra_headers 
)

Definition at line 5634 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 5634 of file mongoose.cc

References mg_send_websocket_handshake2(), and MG_WS_NO_HOST_HEADER_MAGIC.

+ Here is the call graph for this function:

void mg_send_websocket_handshake2 ( struct mg_connection nc,
const char *  path,
const char *  host,
const char *  protocol,
const char *  extra_headers 
)

Definition at line 5605 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 5605 of file mongoose.cc

References mg_base64_encode(), mg_printf(), and MG_WS_NO_HOST_HEADER_MAGIC.

Referenced by mg_connect_ws_opt(), and mg_send_websocket_handshake().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_serve_http ( struct mg_connection nc,
struct http_message hm,
struct mg_serve_http_opts  opts 
)

Definition at line 7576 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7576 of file mongoose.cc

References mg_serve_http_opts::cgi_file_pattern, mg_serve_http_opts::document_root, mg_serve_http_opts::enable_directory_listing, mg_connection::flags, mg_serve_http_opts::index_files, mg_serve_http_opts::ip_acl, mg_check_ip_acl(), MG_F_SEND_AND_CLOSE, MG_FREE, mg_get_http_header(), mg_http_send_error(), mg_http_send_port_based_redirect(), mg_normalize_uri_path(), mg_send_http_file(), mg_uri_to_local_path(), mg_vcmp(), mg_serve_http_opts::per_directory_auth_file, http_message::proto, mg_connection::sa, socket_address::sin, mg_serve_http_opts::ssi_pattern, and http_message::uri.

Referenced by ev_handler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_set_close_on_exec ( sock_t  )

Definition at line 7970 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7970 of file mongoose.cc

Referenced by mg_do_ssi_include(), mg_handle_put(), mg_handle_ssi_request(), mg_sock_set(), and mg_socketpair().

+ Here is the caller graph for this function:

void mg_set_protocol_dns ( struct mg_connection nc)

Definition at line 9255 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 9255 of file mongoose.cc

References dns_handler(), and mg_connection::proto_handler.

+ Here is the call graph for this function:

void mg_set_protocol_http_websocket ( struct mg_connection nc)

Definition at line 5599 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 5599 of file mongoose.cc

References mg_http_handler(), and mg_connection::proto_handler.

Referenced by mg_connect_http_base(), and mg_server().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_set_protocol_mqtt ( struct mg_connection nc)

Definition at line 8500 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 8500 of file mongoose.cc

References mqtt_handler(), and mg_connection::proto_handler.

+ Here is the call graph for this function:

const char* mg_set_ssl ( struct mg_connection nc,
const char *  cert,
const char *  ca_cert 
)

Referenced by mg_bind_opt(), mg_connect_http_base(), and mg_connect_opt().

+ Here is the caller graph for this function:

double mg_set_timer ( struct mg_connection c,
double  timestamp 
)

Definition at line 3080 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3080 of file mongoose.cc

References DBG, mg_connection::ev_timer_time, mg_connection::flags, MG_F_RESOLVING, mg_connection::priv_2, and CDB::timestamp.

const char* mg_skip ( const char *  s,
const char *  end_string,
const char *  delimiters,
struct mg_str v 
)

Definition at line 7859 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7859 of file mongoose.cc

References mg_str::len, mg_str::p, and physmon_simulation::s.

Referenced by mg_http_parse_headers(), and mg_parse_http().

+ Here is the caller graph for this function:

void mg_sock_addr_to_str ( const union socket_address sa,
char *  buf,
size_t  len,
int  flags 
)

Definition at line 7980 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7980 of file mongoose.cc

References if(), MG_SOCK_STRINGIFY_IP, MG_SOCK_STRINGIFY_PORT, socket_address::sa, socket_address::sin, socket_address::sin6, and start.

Referenced by mg_conn_addr_to_str(), and mg_sock_to_str().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_sock_set ( struct mg_connection nc,
sock_t  sock 
)

Definition at line 3601 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3601 of file mongoose.cc

References DBG, mg_set_close_on_exec(), mg_set_non_blocking_mode(), and mg_connection::sock.

Referenced by mg_accept_conn(), mg_add_sock_opt(), mg_if_listen_tcp(), and mg_if_listen_udp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mg_sock_to_str ( sock_t  sock,
char *  buf,
size_t  len,
int  flags 
)

Definition at line 3829 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3829 of file mongoose.cc

References mg_sock_addr_to_str(), mg_sock_get_addr(), and MG_SOCK_STRINGIFY_REMOTE.

Referenced by mg_prepare_cgi_environment().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_socketpair ( sock_t  [2],
int  sock_type 
)

Definition at line 3774 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3774 of file mongoose.cc

References mg_set_close_on_exec(), socket_address::sa, and socket_address::sin.

Referenced by mg_ev_mgr_init(), and mg_handle_cgi().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_stat ( const char *  path,
cs_stat_t *  st 
)

Definition at line 7905 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7905 of file mongoose.cc

References ARRAY_SIZE, DBG, and MAX_PATH_SIZE.

Referenced by mg_create_itermediate_directories(), mg_find_index_file(), mg_handle_delete(), mg_handle_put(), mg_remove_directory(), mg_scan_directory(), mg_send_http_file(), and mg_uri_to_local_path().

+ Here is the caller graph for this function:

double mg_time ( )

Definition at line 3114 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 3114 of file mongoose.cc

References cs_time().

Referenced by mg_create_connection_base(), mg_mgr_poll(), mg_recv_common(), mg_send(), and resolve_cb().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_url_decode ( const char *  src,
int  src_len,
char *  dst,
int  dst_len,
int  is_form_url_encoded 
)

Definition at line 6022 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 6022 of file mongoose.cc

References KFPMath::a, KFPMath::b, HEXTOI, i, and j.

Referenced by mg_get_http_var(), and mg_uri_to_local_path().

+ Here is the caller graph for this function:

int mg_vcasecmp ( const struct mg_str str2,
const char *  str1 
)

Definition at line 7886 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7886 of file mongoose.cc

References mg_str::len, mg_ncasecmp(), mg_str::p, and physmon_track_finding_ttbar::r.

Referenced by mg_get_mime_type(), mg_http_handler(), mg_http_send_file2(), mg_is_not_modified(), and mg_parse_http().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mg_vcmp ( const struct mg_str str2,
const char *  str1 
)

Definition at line 7895 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 7895 of file mongoose.cc

References mg_str::len, mg_str::p, and physmon_track_finding_ttbar::r.

Referenced by ev_handler(), mg_handle_propfind(), mg_http_send_file2(), mg_http_send_port_based_redirect(), mg_is_creation_request(), mg_is_dav_request(), mg_normalize_uri_path(), mg_send_http_file(), mg_serve_http(), and mg_uri_to_local_path().

+ Here is the caller graph for this function:

int mg_vprintf ( struct mg_connection ,
const char *  fmt,
va_list  ap 
)

Definition at line 2316 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 2316 of file mongoose.cc

References mg_avprintf(), MG_FREE, mg_send(), and MG_VPRINTF_BUFFER_SIZE.

Referenced by mg_printf().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int parse_json ( const char *  json_string,
int  json_string_length,
struct json_token tokens_array,
int  size_of_tokens_array 
)

Definition at line 980 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 980 of file mongoose.cc

References arr, frozen::cur, doit(), frozen::end, frozen::max_tokens, physmon_simulation::s, frozen::tokens, and TRY.

Referenced by mg_rpc_dispatch(), and mg_rpc_parse_reply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct json_token* parse_json2 ( const char *  json_string,
int  string_length 
)
read

Definition at line 994 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 994 of file mongoose.cc

References frozen::cur, frozen::do_realloc, doit(), frozen::end, FROZEN_FREE, physmon_simulation::s, and frozen::tokens.

+ Here is the call graph for this function:

Variable Documentation

Definition at line 340 of file mongoose.cc.

View newest version in sPHENIX GitHub at line 340 of file mongoose.cc