httpparser.h File Reference
#include "util.h"
#include "membuffer.h"
#include "uri.h"
#include "LinkedList.h"
Go to the source code of this file.
Data Structures |
| struct | scanner_t |
| struct | http_header_t |
| struct | http_message_t |
| struct | http_parser_t |
Defines |
| #define | ENTREAD_DETERMINE_READ_METHOD 1 |
| #define | ENTREAD_USING_CLEN 2 |
| #define | ENTREAD_USING_CHUNKED 3 |
| #define | ENTREAD_UNTIL_CLOSE 4 |
| #define | ENTREAD_CHUNKY_BODY 5 |
| #define | ENTREAD_CHUNKY_HEADERS 6 |
| #define | HDR_UNKNOWN -1 |
| #define | HDR_CACHE_CONTROL 1 |
| #define | HDR_CALLBACK 2 |
| #define | HDR_CONTENT_LENGTH 3 |
| #define | HDR_CONTENT_TYPE 4 |
| #define | HDR_DATE 5 |
| #define | HDR_EXT 6 |
| #define | HDR_HOST 7 |
| #define | HDR_LOCATION 11 |
| #define | HDR_MAN 12 |
| #define | HDR_MX 13 |
| #define | HDR_NT 14 |
| #define | HDR_NTS 15 |
| #define | HDR_SERVER 16 |
| #define | HDR_SEQ 17 |
| #define | HDR_SID 18 |
| #define | HDR_SOAPACTION 19 |
| #define | HDR_ST 20 |
| #define | HDR_TIMEOUT 21 |
| #define | HDR_TRANSFER_ENCODING 22 |
| #define | HDR_USN 23 |
| #define | HDR_USER_AGENT 24 |
| #define | HDR_ACCEPT 25 |
| #define | HDR_ACCEPT_ENCODING 26 |
| #define | HDR_ACCEPT_CHARSET 27 |
| #define | HDR_ACCEPT_LANGUAGE 28 |
| #define | HDR_ACCEPT_RANGE 29 |
| #define | HDR_CONTENT_ENCODING 30 |
| #define | HDR_CONTENT_LANGUAGE 31 |
| #define | HDR_CONTENT_LOCATION 32 |
| #define | HDR_CONTENT_RANGE 33 |
| #define | HDR_IF_RANGE 34 |
| #define | HDR_RANGE 35 |
| #define | HDR_TE 36 |
Enumerations |
| enum | token_type_t {
TT_IDENTIFIER,
TT_WHITESPACE,
TT_CRLF,
TT_CTRL,
TT_SEPARATOR,
TT_QUOTEDSTRING
} |
| enum | parser_pos_t {
POS_REQUEST_LINE,
POS_RESPONSE_LINE,
POS_HEADERS,
POS_ENTITY,
POS_COMPLETE
} |
| enum | http_method_t {
HTTPMETHOD_POST,
HTTPMETHOD_MPOST,
HTTPMETHOD_SUBSCRIBE,
HTTPMETHOD_UNSUBSCRIBE,
HTTPMETHOD_NOTIFY,
HTTPMETHOD_GET,
HTTPMETHOD_HEAD,
HTTPMETHOD_MSEARCH,
HTTPMETHOD_UNKNOWN,
SOAPMETHOD_POST,
HTTPMETHOD_SIMPLEGET
} |
| enum | parse_status_t {
PARSE_SUCCESS = 0,
PARSE_INCOMPLETE,
PARSE_INCOMPLETE_ENTITY,
PARSE_FAILURE,
PARSE_OK,
PARSE_NO_MATCH,
PARSE_CONTINUE_1
} |
Functions |
| void | httpmsg_init (INOUT http_message_t *msg) |
| void | httpmsg_destroy (INOUT http_message_t *msg) |
| http_header_t * | httpmsg_find_hdr_str (IN http_message_t *msg, IN const char *header_name) |
| http_header_t * | httpmsg_find_hdr (IN http_message_t *msg, IN int header_name_id, OUT memptr *value) |
| void | parser_request_init (OUT http_parser_t *parser) |
| void | parser_response_init (OUT http_parser_t *parser, IN http_method_t request_method) |
| parse_status_t | parser_parse (INOUT http_parser_t *parser) |
| parse_status_t | parser_parse_responseline (INOUT http_parser_t *parser) |
| parse_status_t | parser_parse_headers (INOUT http_parser_t *parser) |
| parse_status_t | parser_parse_entity (INOUT http_parser_t *parser) |
| parse_status_t | parser_get_entity_read_method (INOUT http_parser_t *parser) |
| parse_status_t | parser_append (INOUT http_parser_t *parser, IN const char *buf, IN size_t buf_length) |
| int | matchstr (IN char *str, IN size_t slen, IN const char *fmt,...) |
| off_t | raw_to_int (IN memptr *raw_value, int base) |
| int | raw_find_str (IN memptr *raw_value, IN const char *str) |
| const char * | method_to_str (IN http_method_t method) |
| void | print_http_headers (IN http_message_t *hmsg) |
Define Documentation
| #define ENTREAD_CHUNKY_BODY 5 |
| #define ENTREAD_CHUNKY_HEADERS 6 |
| #define ENTREAD_DETERMINE_READ_METHOD 1 |
| #define ENTREAD_UNTIL_CLOSE 4 |
| #define ENTREAD_USING_CHUNKED 3 |
| #define ENTREAD_USING_CLEN 2 |
| #define HDR_ACCEPT_CHARSET 27 |
| #define HDR_ACCEPT_ENCODING 26 |
| #define HDR_ACCEPT_LANGUAGE 28 |
| #define HDR_ACCEPT_RANGE 29 |
| #define HDR_CACHE_CONTROL 1 |
| #define HDR_CONTENT_ENCODING 30 |
| #define HDR_CONTENT_LANGUAGE 31 |
| #define HDR_CONTENT_LENGTH 3 |
| #define HDR_CONTENT_LOCATION 32 |
| #define HDR_CONTENT_RANGE 33 |
| #define HDR_CONTENT_TYPE 4 |
| #define HDR_SOAPACTION 19 |
| #define HDR_TRANSFER_ENCODING 22 |
| #define HDR_USER_AGENT 24 |
Enumeration Type Documentation
- Enumerator:
| HTTPMETHOD_POST |
|
| HTTPMETHOD_MPOST |
|
| HTTPMETHOD_SUBSCRIBE |
|
| HTTPMETHOD_UNSUBSCRIBE |
|
| HTTPMETHOD_NOTIFY |
|
| HTTPMETHOD_GET |
|
| HTTPMETHOD_HEAD |
|
| HTTPMETHOD_MSEARCH |
|
| HTTPMETHOD_UNKNOWN |
|
| SOAPMETHOD_POST |
|
| HTTPMETHOD_SIMPLEGET |
|
Definition at line 111 of file httpparser.h.
- Enumerator:
| PARSE_SUCCESS |
|
| PARSE_INCOMPLETE |
|
| PARSE_INCOMPLETE_ENTITY |
|
| PARSE_FAILURE |
|
| PARSE_OK |
|
| PARSE_NO_MATCH |
|
| PARSE_CONTINUE_1 |
|
Definition at line 169 of file httpparser.h.
- Enumerator:
| POS_REQUEST_LINE |
|
| POS_RESPONSE_LINE |
|
| POS_HEADERS |
|
| POS_ENTITY |
|
| POS_COMPLETE |
|
Definition at line 88 of file httpparser.h.
- Enumerator:
| TT_IDENTIFIER |
|
| TT_WHITESPACE |
|
| TT_CRLF |
|
| TT_CTRL |
|
| TT_SEPARATOR |
|
| TT_QUOTEDSTRING |
|
Definition at line 69 of file httpparser.h.
Function Documentation
| int matchstr |
( |
IN char * |
str, |
|
|
IN size_t |
slen, |
|
|
IN const char * |
fmt, |
|
|
|
... | |
|
) |
| | |
| int raw_find_str |
( |
IN memptr * |
raw_value, |
|
|
IN const char * |
str | |
|
) |
| | |
| off_t raw_to_int |
( |
IN memptr * |
raw_value, |
|
|
int |
base | |
|
) |
| | |