Tizen RT Libs&Environment  v1.0 D5
http_server.h File Reference

APIs for HTTP Server. More...

#include <stdio.h>
#include <mqueue.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <netinet/in.h>
#include "tls/config.h"
#include "tls/entropy.h"
#include "tls/ctr_drbg.h"
#include "tls/certs.h"
#include "tls/x509.h"
#include "tls/ssl.h"
#include "tls/net.h"
#include "tls/error.h"
#include "tls/debug.h"
#include "tls/ssl_cache.h"
Include dependency graph for http_server.h:

Go to the source code of this file.

Data Structures

struct  ssl_config_t
 http server ssl config structure. More...
 
struct  http_req_message
 http request message. More...
 
struct  http_server_t
 http server structure. More...
 

Macros

#define HTTP_METHOD_UNKNOWN   -1
 
#define HTTP_METHOD_GET   0
 
#define HTTP_METHOD_PUT   1
 
#define HTTP_METHOD_POST   2
 
#define HTTP_METHOD_DELETE   3
 
#define HTTP_HTTP_VERSION_UNKNOWN   0
 
#define HTTP_HTTP_VERSION_09   9
 
#define HTTP_HTTP_VERSION_10   10
 
#define HTTP_HTTP_VERSION_11   11
 
#define HTTP_CONTENT_LENGTH   0
 
#define HTTP_CHUNKED_ENCODING   1
 
#define HTTP_CONF_MAX_CLIENT   16
 
#define HTTP_CONF_CLIENT_STACKSIZE   8192
 
#define HTTP_CONF_MIN_TLS_MEMORY   80000
 
#define HTTP_CONF_SOCKET_TIMEOUT_MSEC   5000
 
#define HTTP_CONF_MAX_CLIENT_HANDLE   2
 
#define HTTP_CONF_SERVER_MQ_MAX_MSG   10
 
#define HTTP_CONF_SERVER_MQ_PRIO   50
 
#define HTTP_CONF_SERVER_SIGWAKEUP   18
 
#define HTTP_CONF_MAX_REQUEST_LENGTH   2048
 
#define HTTP_CONF_MAX_REQUEST_LINE_LENGTH   256
 
#define HTTP_CONF_MAX_REQUEST_HEADER_URL_LENGTH   128
 
#define HTTP_CONF_MAX_URL_QUERY_LENGTH   64
 
#define HTTP_CONF_MAX_URL_PARAMS_LENGTH   256
 
#define HTTP_CONF_MAX_KEY_LENGTH   32
 
#define HTTP_CONF_MAX_VALUE_LENGTH   256
 
#define HTTP_CONF_MAX_DIVIDED_PATH_LENGTH   32
 
#define HTTP_CONF_MAX_SLASH_COUNT   32
 
#define HTTP_CONF_MAX_QUERY_HANDLER_COUNT   64
 
#define HTTP_CONF_MAX_ENTITY_LENGTH   2048
 
#define HTTP_ERROR_400   "Bad Request"
 
#define HTTP_ERROR_404   "Not Found"
 
#define HTTP_ERROR_500   "Internal Server Error"
 

Typedefs

typedef void(* http_cb_t) (struct http_client_t *client, struct http_req_message *msg)
 typedef for callback function. More...
 

Enumerations

Functions

struct http_server_thttp_server_init (int port)
 http_server_init() initializes the webserver. More...
 
int http_server_start (struct http_server_t *server)
 http_server_start() starts the webserver. More...
 
int http_server_stop (struct http_server_t *server)
 http_server_stop() stops the webserver. Both HTTP server and HTTPS server are stoped by this function. More...
 
void http_server_release (struct http_server_t **server)
 http_server_release() releases the struct http_server_t. More...
 
int http_server_register_cb (struct http_server_t *server, int method, const char *url_format, http_cb_t func)
 http_server_register_cb() registers the cb function to each method on webserver. More...
 
int http_server_deregister_cb (struct http_server_t *server, int method, const char *url_format)
 http_server_deregister_cb() deregisters the cb function to each method on webserver. More...
 
int http_send_response (struct http_client_t *client, int status, const char *body, struct http_keyvalue_list_t *headers)
 http_send_response() sends the response. If receive request, you must send a response by this function. More...
 
int http_tls_init (struct http_server_t *server, struct ssl_config_t *ssl_config)
 http_tls_init() initializes the TLS configuere for webserver. More...
 

Detailed Description

APIs for HTTP Server.

Definition in file http_server.h.