EVE 1.0
Collaboration diagram for HTTP:

Modules

 application
 

Data Structures

struct  http_auth_op_t
 
struct  http_server_conf_t
 
struct  http_server_security_t
 
struct  http_content_type_t
 
struct  http_enum_cvt_t
 
struct  toc_segment_ptr_t
 
struct  toc_var_context_t
 

Macros

#define HTTP_SERVER_CONF_DEFAULTS
 
#define CSTRING(x)   (x), (sizeof(x) - 1)
 
#define ENUM_CVT_ENTRY(v, s)
 

Typedefs

typedef bool(* http_auth_callback_t) (struct http_auth_op_t *Op)
 

Enumerations

Functions

bool HttpServerStart (const struct http_server_conf_t *Config, struct http_server_security_t *Security)
 
void HttpServerStop (void)
 

Variables

const uint8_t HttpRequestCount
 
const uint8_t HttpStaticResourceCount
 
const struct http_content_type_t HttpContentTypeTable []
 
const struct http_enum_cvt_t HttpReqTypeTable []
 
const struct http_enum_cvt_t HttpResourceTable []
 

Detailed Description

Macro Definition Documentation

#define HTTP_SERVER_CONF_DEFAULTS
Value:
.ConnectionPoolSize = 5, \
.TlsConnPoolSize = 1, \
.ThreadPoolSize = 1, \
.HandshakePoolSize = 1, \
.ParserPoolSize = 1, \
.SocketBacklogSize = 8, \
.HandshakeTimeout = MS_TO_TICKS(10000), \
.KeepaliveTimeout = MS_TO_TICKS(5000), \
.CloseTimeout = MS_TO_TICKS(2000), \
.TransportTimeout = MS_TO_TICKS(7000)

Default HTTP server configuration

Definition at line 12 of file http-server.h.

#define CSTRING (   x)    (x), (sizeof(x) - 1)

Convert a string literal to a string / length pair

Parameters
xthe string literal

Definition at line 21 of file types.h.

#define ENUM_CVT_ENTRY (   v,
 
)
Value:
{ \
.String = (s), \
.Length = sizeof(s) - 1, \
.Value = (v) \
}

String convert entry initializer macro.

Parameters
vnumerical identifier
scorresponding string literal

Definition at line 28 of file types.h.

Typedef Documentation

typedef bool(* http_auth_callback_t) (struct http_auth_op_t *Op)

Authentication callback

Definition at line 52 of file http-server.h.

Enumeration Type Documentation

Authentication operation type

Enumerator
HTTP_AUTH_QUERY_AUTHENTICATION 

Query if authentication is required

HTTP_AUTH_GET_REALM 

Query a realm string from an application

HTTP_AUTH_GET_PASSWORD_HASH 

Query a password hash for the selected user

HTTP_AUTH_GET_PASSWORD 

Query a plaintext password for the user

Definition at line 27 of file http-server.h.

HTTP resource identifier type.

The engine supports up to 254 unique resources, each of them is mapped to the corresponding ID.

Enumerator
HTTP_RESOURCE__COUNT 

Number of resources supported

Definition at line 19 of file toc-ids.h.

Content type flags for fine tunung of HTTP response headers

Enumerator
FILE_FLAGS_DEFAULT 

Defailt flags, no options set

FILE_FLAGS_GZIP 

Set "Content-Encoding: gzip" HTTP header

FILE_FLAGS__FIRST_SYSTEM 

First system flag

Definition at line 38 of file types.h.

HTTP request identifier type

The engine supports up to 254 unique requests, each of them is mapped to the corresponding ID.

Enumerator
HTTP_REQ_TOC 

/json/toc.json

HTTP_REQ_GET 

/json/get.json

HTTP_REQ_SET 

/json/set.json

HTTP_REQ_PULL 

/json/pull.json?Resource

HTTP_REQ_PUSH 

/json/push.json?Resource

HTTP_REQ_STREAM 

/json/stream.json

HTTP_REQ__SYSTEM_END 

Marks where the system resources ends

HTTP_REQ_UNKNOWN 

Invalid or unknown request

Definition at line 73 of file types.h.

anonymous enum

System part of HTTP resource identifier type

The only defined resource on the system level is an unknown one.

Enumerator
HTTP_RESOURCE_UNKNOWN 

Unknown or invalid resource

Definition at line 90 of file types.h.

Function Documentation

bool HttpServerStart ( const struct http_server_conf_t Config,
struct http_server_security_t Security 
)

Start HTTP/HTTPS server

Note
Caller must ensure persistence of the server general configuration through the server livetime, bit there is no such restrictions for the security configuration.
Parameters
ConfigServer general configuration
SecurityServer security configuration
Returns
true if server was started, false otherwise
void HttpServerStop ( void  )

Stop HTTP/HTTPS server

Variable Documentation

const uint8_t HttpRequestCount

Number of elements in the HttpReqTypeTable table

Definition at line 30 of file instance.h.

const uint8_t HttpStaticResourceCount

Number of elements in the HttpResourceTable table

Definition at line 7 of file instance.h.

const struct http_content_type_t HttpContentTypeTable[]

User-defined content type mapping table

Definition at line 39 of file instance.h.

const struct http_enum_cvt_t HttpReqTypeTable[]

User-defined request to ID mapping table

Definition at line 71 of file instance.h.

const struct http_enum_cvt_t HttpResourceTable[]

User-defined resource to ID mapping table

Definition at line 55 of file instance.h.