Httpd server.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | BoardStatus |
Typedefs | |
typedef struct BoardStatus | BoardStatus |
typedef int(* | http_handler_t )(struct netconn *client, const char *name, char *revc_buf, size_t revc_len) |
Enumerations | |
enum | { HTTP_CONTENT_JSON = 0, HTTP_CONTENT_HTML, HTTP_CONTENT_CSS, HTTP_CONTENT_JS, HTTP_CONTENT_PNG, HTTP_CONTENT_JPEG, HTTP_CONTENT_GIF, HTTP_CONTENT_PLAIN, HTTP_CONTENT_CNT } |
Functions | |
const char * | get_ext (const char *name) |
Get filename extension type. More... | |
int | http_getValue (char *tolenized_buf, size_t tolenized_buf_len, const char *key, char *value, size_t len) |
Get key value from tokenized buffer. More... | |
void | http_request (void *pvParameters) |
Core HTTP server function processing the request. More... | |
void | http_sendInternalErr (struct netconn *client, int content_type) |
Send HTTP internal server error code. More... | |
void | http_sendOk (struct netconn *client, int content_type) |
Send the HTTP header with the appropriated content type. More... | |
int | http_tokenizeGetRequest (char *raw_buf, size_t raw_len) |
Tokenize a buffer. More... | |
Variables | |
BoardStatus | status |
typedef struct BoardStatus BoardStatus |
typedef int(* http_handler_t)(struct netconn *client, const char *name, char *revc_buf, size_t revc_len) |
anonymous enum |
const char* get_ext | ( | const char * | name | ) |
Get filename extension type.
name | String containing a filename. |
References NULL.
Referenced by cgi_search(), and http_searchContentType().
int http_getValue | ( | char * | tolenized_buf, |
size_t | tolenized_buf_len, | ||
const char * | key, | ||
char * | value, | ||
size_t | len | ||
) |
Get key value from tokenized buffer.
References http_decodeUrl().
Core HTTP server function processing the request.
pvParameters | Netconn socket to use. |
References cgi_search(), cgi_table, fs_file::data, ERR_OK, fs_open(), HTTP_CONTENT_HTML, HTTP_DEFAULT_PAGE, http_getPageName(), http_html_hdr_404, http_searchContentType(), http_sendInternalErr(), http_sendOk(), http_server_error, fs_file::len, netbuf_data(), netbuf_delete(), netconn_close(), NETCONN_COPY, netconn_delete(), netconn_recv(), netconn_write, NULL, and vTaskDelete().
Referenced by http_task().
Send HTTP internal server error code.
References content, http_content_type, http_html_hdr_500, NETCONN_COPY, and netconn_write.
Referenced by http_request().
Send the HTTP header with the appropriated content type.
client | Socket to send data to. |
content_type | Index in the http_content_type table. |
References content, http_content_type, http_html_hdr_200, NETCONN_COPY, and netconn_write.
Referenced by cgi_chipInfo(), cgi_status(), and http_request().
int http_tokenizeGetRequest | ( | char * | raw_buf, |
size_t | raw_len | ||
) |
Tokenize a buffer.
raw_buf | Buffer to parse. |
raw_len | Buffer length. |
BoardStatus status |
Referenced by cgi_status(), pio_handler_process(), and smc_ecc_get_status().