WL865E4-P  36.07.001
m2mb_httpd.h File Reference

This file contains the APIs for HTTP server operations. More...

Go to the source code of this file.

Data Structures

struct  M2MB_HTTPD_CONFIG_S
 HTTP server configuration structure. More...
 
struct  M2MB_HTTPD_URI_CTX
 HTTP server URI context structure. More...
 
struct  M2MB_HTTPD_URI_REQ_INFO
 HTTP server URI Request structure. More...
 
struct  M2MB_HTTPD_URI_REQ_CGI_KEY_PAIR
 HTTP server CGI parameter pair structure. More...
 
struct  M2MB_HTTPD_URI_REQ_CGI_FORM_DATA
 HTTP server CGI form data structure. More...
 
#define M2MB_HTTPD_PATH_MAX   31
 
#define M2MB_HTTPD_SRVR_NAME_MAX   512
 
enum  M2MB_HTTPD_CGI_RETURN_E {
  FP_ERR = 0x110,
  FP_OK = 0x120,
  FP_FILE = 0x140,
  FP_DONE = 0x200
}
 Return values enumeration. More...
 
enum  M2MB_HTTPD_MODE_E {
  M2MB_HTTPD_MODE_HTTP = 1,
  M2MB_HTTPD_MODE_HTTPS = 2,
  M2MB_HTTPD_MODE_HTTP_AND_HTTPS = 3
}
 HTTP server operational mode enumeration. More...
 
enum  M2MB_HTTPD_METHOD_E {
  M2MB_HTTPD_METHOD_INVALID = 1,
  M2MB_HTTPD_METHOD_GET = 2,
  M2MB_HTTPD_METHOD_HEAD = 3,
  M2MB_HTTPD_METHOD_POST = 4,
  M2MB_HTTPD_METHOD_PUT = 5,
  M2MB_HTTPD_METHOD_DELETE = 6,
  M2MB_HTTPD_METHOD_TRACE = 7,
  M2MB_HTTPD_METHOD_POSTMULTI = 8
}
 HTTP server request method enumeration. More...
 
enum  M2MB_URI_AUTH_FLAG {
  M2MB_URI_FLAG_NOAUTH = 0x00,
  M2MB_URI_FLAG_AUTHBASIC = 0x02,
  M2MB_URI_FLAG_AUTHMD5 = 0x04
}
 HTTP server URI user authentication enumeration. More...
 
enum  M2MB_HTTPD_URI_USER_EVENT {
  M2MB_HTTPD_URI_USER_EVENT_CON_OPENED = 0x00000001,
  M2MB_HTTPD_URI_USER_EVENT_CON_CLOSE = 0x00000010,
  M2MB_HTTPD_URI_USER_EVENT_HEADERS_RECV = 0x00000100,
  M2MB_HTTPD_URI_USER_EVENT_FORM_RECV = 0x00001000,
  M2MB_HTTPD_URI_USER_EVENT_BODY_RECV = 0x00010000,
  M2MB_HTTPD_URI_USER_EVENT_ALL_RECV = 0x00100000,
  M2MB_HTTPD_URI_USER_EVENT_FORM_FILE_RECV = 0x01000000
}
 HTTP server URI user event enumeration. More...
 
typedef enum M2MB_URI_AUTH_FLAG M2MB_URI_AUTH_FLAG_T
 HTTP server URI user authentication enumeration. More...
 
typedef enum M2MB_HTTPD_URI_USER_EVENT M2MB_HTTPD_URI_USER_EVENT_E
 HTTP server URI user event enumeration. More...
 
typedef struct M2MB_HTTPD_CONFIG_S M2MB_HTTPD_CONFIG_T
 HTTP server configuration structure. More...
 
typedef struct M2MB_HTTPD_URI_CTX M2MB_HTTPD_URICTX_T
 HTTP server URI context structure. More...
 
typedef struct M2MB_HTTPD_URI_REQ_INFO M2MB_HTTPD_URI_REQ_INFO_T
 HTTP server URI Request structure. More...
 
typedef struct M2MB_HTTPD_URI_REQ_CGI_KEY_PAIR M2MB_HTTPD_URI_REQ_CGI_KEY_PAIR_T
 HTTP server CGI parameter pair structure. More...
 
typedef struct M2MB_HTTPD_URI_REQ_CGI_FORM_DATA M2MB_HTTPD_URI_REQ_CGI_FORM_DATA_T
 HTTP server CGI form data structure. More...
 
typedef INT32(* M2MB_HTTPD_URI_HANDLER_T) (VOID *conn_handle, VOID *usr_ctx, INT32 **event)
 HTTP server URI Request user call back prototype. More...
 
M2MB_STATUS_T m2mb_httpd_init (M2MB_HTTPD_CONFIG_T *cfg, M2MB_SSL_CTXT_HANDLE ssl_handle)
 HTTP server initialization. More...
 
M2MB_STATUS_T m2mb_httpd_deinit ()
 HTTP server initialization. More...
 
M2MB_STATUS_T m2mb_httpd_start ()
 Start HTTP server. More...
 
M2MB_STATUS_T m2mb_httpd_stop ()
 Stop HTTP server. More...
 
M2MB_STATUS_T m2mb_httpd_is_started ()
 Status of HTTP server. More...
 
M2MB_OS_RESULT_E m2mb_httpd_uri_cfg (CHAR *uri, UINT8 *methods, M2MB_URI_AUTH_FLAG_T flag, M2MB_HTTPD_URI_HANDLER_T fn_cb, VOID *usr_ctx)
 Configure URI to HTTP server. More...
 
M2MB_OS_RESULT_E m2mb_httpd_uri_decfg (char *uri)
 De-Configure URI from HTTP server. More...
 
M2MB_STATUS_T m2mb_httpd_send_headers (VOID *conn_handle, const INT8 *content_type, INT32 content_length, INT32 status_code, const INT8 *status_text, const INT8 *user_headers)
 Send HTTP headers. More...
 
M2MB_STATUS_T m2mb_httpd_send_data (VOID *conn_handle, const INT8 *data, UINT32 length)
 Send HTTP data. More...
 
M2MB_STATUS_T m2mb_httpd_get_message_body (VOID *conn_handle, INT8 *buf, UINT32 *plen)
 Get Message Body of URI request. More...
 
M2MB_STATUS_T m2mb_httpd_get_message_head (VOID *conn_handle, UINT8 *buf, UINT32 *plen)
 Get Message header of URI request. More...
 
INT32 m2mb_httpd_get_content_len (VOID *conn_handle)
 Get content length. More...
 
CHARm2mb_httpd_get_body_location (VOID *conn_handle)
 Get message body location. More...
 
INT32 m2mb_httpd_get_request_type (VOID *conn_handle)
 Get request type. More...
 
M2MB_HTTPD_URI_REQ_CGI_FORM_DATA_Tm2mb_httpd_get_cgi_form (VOID *conn_handle)
 Get CGI form data. More...
 
VOIDm2mb_httpd_FindURICtx_FromIndex (INT32 index)
 Get URI context from URI's index. More...
 
M2MB_STATUS_T m2mb_httpd_user_add (const char *username, const char *password)
 Add a USER to HTTPD module. More...
 
M2MB_STATUS_T m2mb_httpd_user_del (const char *username, const char *password)
 Delete a USER to HTTPD module. More...
 
M2MB_STATUS_T m2mb_httpd_user_validate (char *username, char *password)
 Validate a USER to HTTPD module. More...
 
M2MB_STATUS_T m2mb_httpd_user_change_password (char *username, char *cur_password, char *new_password)
 Change password of a USER to HTTPD module. More...
 

Detailed Description

This file contains the APIs for HTTP server operations.

we866e4/epl/inc/nwk/m2mb_httpd.h

HTTP server module provides APIs to configure, start and stop a HTTP server. This module also provides the APIs to configure URIs, send body/header on or for the configured URIs. Apart from these APIs, this module also deals with the APIs which handle the user-authentication for HTTP server.

Note
Dependencies: "#include m2mb_types.h" "#include m2mb_status.h"
Author
Sandeep Itha
Date
22/01/2018

Definition in file m2mb_httpd.h.