This library contains functions for implementing http server in DS80C400 ROM
For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.
Go to the source code of this file.
Data Structures | |
| struct | _http_request |
| struct | _http_response |
| struct | _http_session |
| struct | _http_variable |
Defines | |
| #define | HTTP_VERSION 3 |
| #define | HTTP_INSUFFICIENT_MEMORY -1 |
| #define | HTTP_LOGFILE_ERROR -2 |
| #define | HTTP_SOCKET_ERROR -3 |
| #define | HTTP_REQUEST_NOT_PROCESSED -4 |
| #define | HTTP_DENY_CONNECTION -5 |
| #define | HTTP_TASK_ERROR -6 |
| #define | HTTP_SERVER_ALREADY_RUNNING -7 |
| #define | HTTP_NOSERVERTASK -8 |
| #define | HTTP_STATUS_SUCCESS 0 |
| #define | HTTP_DISABLE_LOG 0 |
| #define | HTTP_ENABLE_LOG 1 |
| #define | HTTP_ENABLE_VARIABLE_PARSING 1 |
| #define | HTTP_DISABLE_VARIABLE_PARSING 0 |
| #define | HTTP_STOP_SERVERTASK 0 |
| #define | HTTP_RUN_SERVERTASK 1 |
| #define | DEFAULT_BUF_SIZE 400 |
| #define | DEFAULT_MAX_PENDING_CONNECIONS 5 |
| #define | HTTP_DEFAULT_PORT 80 |
| #define | HTTP_MAX_URL 400 |
| #define | HTTP_MAX_BUFSIZE 400 |
| #define | HTTP_GET_METHOD 1 |
| #define | HTTP_POST_METHOD 2 |
| #define | HTTP_HEAD_METHOD 3 |
Typedefs | |
| typedef _http_variable | http_variable |
| typedef _http_request | http_request |
| typedef _http_response | http_response |
| typedef _http_session | http_session |
Functions | |
| unsigned int | http_version (void) |
| Returns the version number of http server library. | |
| int | http_init (struct sockaddr server_addr) |
| Initializes http server library. | |
| int | http_setrootdir (char *rootdir) |
| Sets http root directory. | |
| char * | http_getrootdir (void) |
| Returns http root directory. | |
| int | http_setindexpage (char *index) |
| Sets index page name. | |
| char * | http_getindexpage (void) |
| Returns current index page. | |
| void | http_setportnumber (int portnumber) |
| Sets HTTP Server Port number. | |
| int | http_getportnumber (void) |
| Returns current http server port number. | |
| void | http_setheaderbufsize (int buffersize) |
| Sets header buffer size. | |
| int | http_getheaderbufsize (void) |
| Returns header buffer size. | |
| void | http_set_req_linesize (int buffersize) |
| Sets the maximum size value of each line of http request. | |
| int | http_get_req_linesize (void) |
| Returns the maximum size value of each line of http request. | |
| void | http_set_req_process_options (char flag) |
| Sets Http request Variable parsing status flag value. | |
| char | http_get_req_process_options (void) |
| Returns Http request Variable parsing status flag value. | |
| int | http_getlogging (void) |
| Returns logging status. | |
| int | http_setlogging (char logstatus) |
| Sets logging status. | |
| char * | http_getlogfilename (void) |
| Returns log file name. | |
| int | http_setlogfilename (char *logfilename) |
| Sets log file name. | |
| void | http_setmaxconnections (int max_connection) |
| Sets maximum number of pending connections value. | |
| int | http_getmaxconnections (void) |
| Returns the current value for maximum number of pending connections. | |
| void | http_setclientsocktimeout (long milli_sec) |
| Sets http client socket timeout value. | |
| long | http_getclientsocktimeout (void) |
| Returns the current value for http client socket timeout. | |
| void | http_reg_req_callback (int(*func)()) |
| Registers callback function to process http request. | |
| void | http_reg_acl_callback (int(*func)()) |
| Registers access control callback function. | |
| void | http_sendheaders (http_session *https) |
| Sends http response headers to client. | |
| int | http_start_server (void) |
| Starts http server. | |
| int | http_kill_server (void) |
| Terminates http server. | |
| void | http_decode_urlencodeddata (char *pathname) |
| Decodes the url path which was encoded in "application/x-www-form-urlencoded" format. | |
| char | http_hex_from_ascii (char c) |
| Returns hexadecimal value for input ascii digit. | |
| int | http_change_server_state (char server_state) |
| Changes Http Server state. | |
|
|
Define for default header buffer size |
|
|
Define for default maximum pending connections allowed |
|
|
Define for default http port number
|
|
|
Error value to indicate that http client connection is denied by access control callback function
|
|
|
Define for disabling logging activity
|
|
|
Define for disabling variable parsing status flag |
|
|
Define for enabling logging activity
|
|
|
Define for enabling variable parsing status flag |
|
|
Get request method type
|
|
|
Head request method type
|
|
|
Insufficient memory error value |
|
|
Error opening log file
|
|
|
Define for maximum buffer size
|
|
|
Define for maximum url path name size
|
|
|
Error value to indicate that http server task is not running |
|
|
Post request method type
|
|
|
Error value to indicate that http request was not processed by callback function
|
|
|
Define for running http server task
|
|
|
Error value to indicate that server is already running
|
|
|
Socket error value
|
|
|
Http Status Success value, this value is returned when operation is completed successfully
|
|
|
Define for stopping http server task
|
|
|
New task creation error
|
|
|
Version number associated with this header file. Should be the same as the version number returned by the http_version function.
|
|
|
Structure for http request |
|
|
Structure for http response |
|
|
Structure for http session |
|
|
Structure for http variable names and values |
|
|
Changes Http Server state. This function sets http server state This function is safe to be called from multiple processes at the same time.
|
|
|
Decodes the url path which was encoded in "application/x-www-form-urlencoded" format. This function decodes the url path which was encoded in "application/x-www-form-urlencoded" format. This function is safe to be called from multiple processes at the same time.
|
|
|
Returns the maximum size value of each line of http request. This function returns the maximum size value of each line of http request This function is safe to be called from multiple processes at the same time.
|
|
|
Returns Http request Variable parsing status flag value. This function is safe to be called from multiple processes at the same time.
|
|
|
Returns the current value for http client socket timeout. This function returns the current value for http client socket timeout This function is safe to be called from multiple processes at the same time.
|
|
|
Returns header buffer size. This function returns buffer size value for http request and response headers. This function is safe to be called from multiple processes at the same time.
|
|
|
Returns current index page. This function returns the current index page name. This function is safe to be called from multiple processes at the same time.
|
|
|
Returns log file name. This function returns the log file name. This function is safe to be called from multiple processes at the same time.
|
|
|
Returns logging status. This function returns the current logging status This function is safe to be called from multiple processes at the same time.
|
|
|
Returns the current value for maximum number of pending connections. This function returns the current value for maximum number of pending connections This function is safe to be called from multiple processes at the same time.
|
|
|
Returns current http server port number. This function returns the current http server port number This function is safe to be called from multiple processes at the same time.
|
|
|
Returns http root directory. This function returns the current root directory path name. This function is safe to be called from multiple processes at the same time.
|
|
|
Returns hexadecimal value for input ascii digit. This function returns hexadecimal value for input ascii digit This function is safe to be called from multiple processes at the same time.
|
|
|
Initializes http server library. This function initializes the internal data structures of http server library
|
|
|
Terminates http server. This function Terminates http server This function is safe to be called from multiple processes at the same time.
|
|
|
Registers access control callback function. This function registers callback function to process http request
Access control callback function should have the following function prototype to receive the sockaddr pointer int << http access control call back function name >> (sockaddr *address) NOTE: Access control callback routine should return HTTP_STATUS_SUCCESS value to process the http request, HTTP_DENY_CONNECTION error value to deny the client connection
|
|
|
Registers callback function to process http request. This function registers callback function to process http request
int << http request process call back function name >> (http_session *https) NOTE: Http request process callback routine should return HTTP_STATUS_SUCCESS value, if the request was processed. HTTP_REQUEST_NOT_PROCESSED error value to let http library process the request.
|
|
|
Sends http response headers to client. This function sends http response headers to client This function is safe to be called from multiple processes at the same time. NOTE: the response code, content type, content length, and response header values can be modified from application before sending response headers
|
|
|
Sets the maximum size value of each line of http request. This function sets the maximum size value of each line of http request
|
|
|
Sets Http request Variable parsing status flag value. This function sets http request variable parsing status flag value. By default, the flag contains HTTP_ENABLE_VARIABLE_PARSING value. When the flag is set with HTTP_ENABLE_VARIABLE_PARSING, The http server parses the variables from "query string", and "message body" and stores it in variable list. The variable needs to be passed using standard convention(variablename=value) to make http server library to parse the variables successfully. The parsing process can be disabled by setting HTTP_DISABLE_VARIABLE_PARSING value, and user can access both "query string" and "messagebody" values from querystring,messagebody members of http session object. This function is safe to be called from multiple processes at the same time.
|
|
|
Sets http client socket timeout value. This function sets http client socket timeout value
|
|
|
Sets header buffer size. This function sets both http request and http response header buffer size
|
|
|
Sets index page name. This function sets index page name in http library. Index page will be sent to http client if url request path is "/"
|
|
|
Sets log file name. This function sets log file name with http library.
|
|
|
Sets logging status. This function sets the logging status with http server library
|
|
|
Sets maximum number of pending connections value. This function sets maximum number of pending connections allowed in the listen queue
|
|
|
Sets HTTP Server Port number. This function sets http server port number
|
|
|
Sets http root directory. This function sets http root directory in http library. url pathname for particular resource is "relative path name" to root directory.
|
|
|
Starts http server. This function starts http server This function is safe to be called from multiple processes at the same time.
|
|
|
Returns the version number of http server library.
|
| Copyright 2004 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |