|
MIDAS
|
#include <stdio.h>#include <stdlib.h>#include <stdarg.h>

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 |
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) |
| 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_token * | parse_json2 (const char *json_string, int string_length) |
| struct json_token * | find_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_connection * | mg_next (struct mg_mgr *, struct mg_connection *) |
| struct mg_connection * | mg_add_sock (struct mg_mgr *, sock_t, mg_event_handler_t) |
| struct mg_connection * | mg_add_sock_opt (struct mg_mgr *, sock_t, mg_event_handler_t, struct mg_add_sock_opts) |
| struct mg_connection * | mg_bind (struct mg_mgr *, const char *, mg_event_handler_t) |
| struct mg_connection * | mg_bind_opt (struct mg_mgr *mgr, const char *address, mg_event_handler_t handler, struct mg_bind_opts opts) |
| struct mg_connection * | mg_connect (struct mg_mgr *mgr, const char *address, mg_event_handler_t handler) |
| struct mg_connection * | mg_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) |
| 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_connection * | mg_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_connection * | mg_connect_ws (struct mg_mgr *mgr, mg_event_handler_t event_handler, const char *url, const char *protocol, const char *extra_headers) |
| 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) |
| 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_str * | mg_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_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) |
| 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) |
| 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_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_record * | mg_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_body (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 |