18 #ifndef M2MB_HTTPD_API_H 19 #define M2MB_HTTPD_API_H 40 #define M2MB_HTTPD_PATH_MAX 31 41 #define M2MB_HTTPD_SRVR_NAME_MAX 512 44 #define HTTP_CREATED 201 45 #define HTTP_ACCEPTED 202 46 #define HTTP_NO_CONTENT 204 47 #define HTTP_RESET_CONTENT 205 50 #define HTTP_REDIRECT_MULTI 300 51 #define HTTP_REDIRECT_PERM 301 52 #define HTTP_REDIRECT_TEMP 302 53 #define HTTP_REDIRECT_OTHER 303 54 #define HTTP_REDIRECT_NOMOD 304 55 #define HTTP_REDIRECT_PROXY 305 58 #define HTTP_ERROR_BADREQ 400 59 #define HTTP_ERROR_AUTHFAIL 401 60 #define HTTP_ERROR_PAYMENT 402 61 #define HTTP_ERROR_FORBID 403 62 #define HTTP_ERROR_NOFILE 404 63 #define HTTP_ERROR_METHOD 405 64 #define HTTP_ERROR_UNACCEPT 406 65 #define HTTP_ERROR_PROXYAUT 407 66 #define HTTP_ERROR_REQTMO 408 67 #define HTTP_ERROR_CONFLICT 409 68 #define HTTP_ERROR_RESGONE 410 69 #define HTTP_ERROR_LENGTH 411 70 #define HTTP_ERROR_PREFAIL 412 71 #define HTTP_ERROR_TOOBIG 413 72 #define HTTP_ERROR_URIBIG 414 73 #define HTTP_ERROR_BADMEDIA 415 76 #define HTTP_ERROR_SERVER 500 77 #define HTTP_ERROR_NOTIMPLEMENTED 501 78 #define HTTP_ERROR_BADGATEWAY 502 79 #define HTTP_ERROR_OVERLOAD 503 80 #define HTTP_ERROR_GATEAWYTMO 504 81 #define HTTP_ERROR_HTTPVER 505 860 INT32 content_length,
863 UINT8 *user_headers );
M2MB_HTTPD_URI_REQ_CGI_FORM_DATA_T * cgi_form_data
struct M2MB_HTTPD_GET_MSG_INFO M2MB_HTTPD_GET_MSG_INFO_T
The structure is used to GET the HEAD/BODY information.
CHAR root_Path[M2MB_HTTPD_PATH_MAX]
M2MB_HTTPD_URI_CONFIG_PARAMS_T * uri_cfg_params
M2MB_HTTPD_MODE_E
HTTP server operational mode enumeration.
M2MB_HTTPD_URI_USER_EVENT
HTTP server URI user event enumeration.
M2MB_HTTPD_URI_REQ_CGI_KEY_PAIR_T nameval[1]
M2MB_HTTPD_URI_HANDLER_T h
CHAR cert_File[M2MB_HTTPD_PATH_MAX]
struct M2MB_HTTPD_GET_REQUEST_TYPE M2MB_HTTPD_GET_REQUEST_TYPE_T
The structure is used to GET the request type on the connection handler.
CHAR root_Index_Page[M2MB_HTTPD_PATH_MAX]
struct M2MB_HTTPD_USER_INFO M2MB_HTTPD_USER_INFO_T
The structure is used to GET/SET the user information on the HTTPD module.
M2MB_HTTPD_USER_INFO_T * user_info
HTTP server URI Request structure.
struct M2MB_HTTPD_GET_BODY_LOC M2MB_HTTPD_GET_BODY_LOC_T
The structure is used to GET the pointer to the body locaiton on the request.
M2MB_SSL_CTXT_HANDLE ssl_handle
M2MB_HTTPD_GET_CONTENT_LEN_T * get_content_len
enum M2MB_HTTPD_CONF_ID M2MB_HTTPD_CONF_ID_E
HTTP server GET/SET Configuration enumeration.
struct M2MB_HTTPD_INIT_PARAMS M2MB_HTTPD_INIT_PARAMS_T
HTTPD initialization parameters.
M2MB_STATUS_T m2mb_httpd_get_cfg(HANDLE handle, M2MB_HTTPD_CONF_ID_E conf_id, M2MB_HTTPD_CONF_PARAMS_T *conf_params)
GET the HTTPD configuration parameters.
enum M2MB_URI_AUTH_FLAG M2MB_URI_AUTH_FLAG_T
HTTP server URI user authentication enumeration.
This structure is used to set HTTPD URI configuration parameters.
struct M2MB_HTTPD_CONFIG_S M2MB_HTTPD_CONFIG_T
HTTP server configuration structure.
struct M2MB_HTTPD_URI_REQ_CGI_FORM_DATA M2MB_HTTPD_URI_REQ_CGI_FORM_DATA_T
HTTP server CGI form data structure.
struct M2MB_HTTPD_URI_REQ_CGI_KEY_PAIR M2MB_HTTPD_URI_REQ_CGI_KEY_PAIR_T
HTTP server CGI parameter pair structure.
M2MB_URI_CFG_T * m2mb_httpd_get_uri_cfg_from_index(INT32 index)
Gets the URI configuration.
#define M2MB_HTTPD_PATH_MAX
M2MB_HTTPD_CONF_ID
HTTP server GET/SET Configuration enumeration.
M2MB_STATUS_T m2mb_httpd_start(HANDLE handle)
Start HTTP server.
The structure is used to GET the CGI form data with the URI request.
M2MB_HTTPD_CGI_RETURN_E
Return values enumeration.
M2MB_HTTPD_GET_REQUEST_TYPE_T * get_request_type
struct M2MB_HTTPD_URICTXT_FROM_INDEX M2MB_HTTPD_URICTXT_FROM_INDEX_T
The structure is used to GET the applicaiton context of the registered URI.
HTTP server CGI form data structure.
struct M2MB_URI_CFG_S M2MB_URI_CFG_T
HTTP server URI context structure.
M2MB_STATUS_T m2mb_httpd_stop(HANDLE handle)
Stop HTTP server.
M2MB_STATUS_T m2mb_httpd_init(HANDLE *handle, M2MB_HTTPD_INIT_PARAMS_T *init_params)
HTTP server deinitialization.
M2MB_URI_AUTH_FLAG
HTTP server URI user authentication enumeration.
M2MB_STATUS_T m2mb_httpd_deinit(HANDLE handle)
HTTP server deinitialization.
struct M2MB_HTTPD_URI_CTX M2MB_HTTPD_URICTX_T
HTTP server URI context structure.
M2MB_HTTPD_GET_MSG_INFO_T * get_msg_info
The structure is used to GET the content length of the request.
M2MB_STATUS_T m2mb_httpd_set_cfg(HANDLE handle, M2MB_HTTPD_CONF_ID_E conf_id, M2MB_HTTPD_CONF_PARAMS_T *conf_params)
SET the HTTPD configuration parameters.
HTTPD initialization parameters.
HTTP server CGI parameter pair structure.
INT32(* M2MB_HTTPD_URI_HANDLER_T)(VOID *conn_handle, VOID *usr_ctx, INT32 event)
HTTP server URI Request user call back prototype.
M2MB_STATUS_T m2mb_httpd_send_data(VOID *conn_handle, const INT8 *data, UINT32 length)
Send HTTP data.
M2MB_HTTPD_GET_REQ_URI_CGI_FORM_DATA_T * get_uri_cgi_form_data
HTTP server configuration structure.
M2MB_HTTPD_URICTXT_FROM_INDEX_T * get_uri_ctxt
The structure is used to GET/SET the user information on the HTTPD module.
The structure is used to GET the request type on the connection handler.
struct M2MB_HTTPD_GET_CONTENT_LEN M2MB_HTTPD_GET_CONTENT_LEN_T
The structure is used to GET the content length of the request.
M2MB_HTTPD_METHOD_E
HTTP server request method enumeration.
The structure is used to GET the HEAD/BODY information.
HANDLE M2MB_SSL_CTXT_HANDLE
SSL context handle. This is obtained from m2mb_ssl_open API and then used in subsequent SSL APIs...
M2MB_HTTPD_URI_HANDLER_T fn_cb
struct M2MB_HTTPD_URI_CONFIG_PARAMS M2MB_HTTPD_URI_CONFIG_PARAMS_T
This structure is used to set HTTPD URI configuration parameters.
VOID(* webfiles_Setup)(void)
M2MB_HTTPD_CONFIG_T * cfg
M2MB_STATUS_T m2mb_httpd_send_headers(VOID *conn_handle, UINT8 *content_type, INT32 content_length, INT32 status_code, UINT8 *status_text, UINT8 *user_headers)
Send HTTP headers.
M2MB_HTTPD_GET_BODY_LOC_T * get_body_loc
M2MB_URI_AUTH_FLAG_T flag
The structure is used to GET the applicaiton context of the registered URI.
The structure is used to GET the pointer to the body locaiton on the request.
Structure is used by SET/GET configuration paramters of CONF IDs mentioned in enum M2MB_HTTPD_CONF_ID...
struct M2MB_HTTPD_GET_REQ_URI_CGI_FORM_DATA M2MB_HTTPD_GET_REQ_URI_CGI_FORM_DATA_T
The structure is used to GET the CGI form data with the URI request.
enum M2MB_HTTPD_URI_USER_EVENT M2MB_HTTPD_URI_USER_EVENT_E
HTTP server URI user event enumeration.
struct M2MB_HTTPD_URI_REQ_INFO M2MB_HTTPD_URI_REQ_INFO_T
HTTP server URI Request structure.