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_thttpmsg_find_hdr_str (IN http_message_t *msg, IN const char *header_name)
http_header_thttpmsg_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

Definition at line 102 of file httpparser.h.

#define ENTREAD_CHUNKY_HEADERS   6

Definition at line 103 of file httpparser.h.

#define ENTREAD_DETERMINE_READ_METHOD   1

Definition at line 98 of file httpparser.h.

#define ENTREAD_UNTIL_CLOSE   4

Definition at line 101 of file httpparser.h.

#define ENTREAD_USING_CHUNKED   3

Definition at line 100 of file httpparser.h.

#define ENTREAD_USING_CLEN   2

Definition at line 99 of file httpparser.h.

#define HDR_ACCEPT   25

Definition at line 154 of file httpparser.h.

#define HDR_ACCEPT_CHARSET   27

Definition at line 156 of file httpparser.h.

#define HDR_ACCEPT_ENCODING   26

Definition at line 155 of file httpparser.h.

#define HDR_ACCEPT_LANGUAGE   28

Definition at line 157 of file httpparser.h.

#define HDR_ACCEPT_RANGE   29

Definition at line 158 of file httpparser.h.

#define HDR_CACHE_CONTROL   1

Definition at line 128 of file httpparser.h.

#define HDR_CALLBACK   2

Definition at line 129 of file httpparser.h.

#define HDR_CONTENT_ENCODING   30

Definition at line 159 of file httpparser.h.

#define HDR_CONTENT_LANGUAGE   31

Definition at line 160 of file httpparser.h.

#define HDR_CONTENT_LENGTH   3

Definition at line 130 of file httpparser.h.

#define HDR_CONTENT_LOCATION   32

Definition at line 161 of file httpparser.h.

#define HDR_CONTENT_RANGE   33

Definition at line 162 of file httpparser.h.

#define HDR_CONTENT_TYPE   4

Definition at line 131 of file httpparser.h.

#define HDR_DATE   5

Definition at line 132 of file httpparser.h.

#define HDR_EXT   6

Definition at line 133 of file httpparser.h.

#define HDR_HOST   7

Definition at line 134 of file httpparser.h.

#define HDR_IF_RANGE   34

Definition at line 163 of file httpparser.h.

#define HDR_LOCATION   11

Definition at line 138 of file httpparser.h.

#define HDR_MAN   12

Definition at line 139 of file httpparser.h.

#define HDR_MX   13

Definition at line 140 of file httpparser.h.

#define HDR_NT   14

Definition at line 141 of file httpparser.h.

#define HDR_NTS   15

Definition at line 142 of file httpparser.h.

#define HDR_RANGE   35

Definition at line 164 of file httpparser.h.

#define HDR_SEQ   17

Definition at line 144 of file httpparser.h.

#define HDR_SERVER   16

Definition at line 143 of file httpparser.h.

#define HDR_SID   18

Definition at line 145 of file httpparser.h.

#define HDR_SOAPACTION   19

Definition at line 146 of file httpparser.h.

#define HDR_ST   20

Definition at line 147 of file httpparser.h.

#define HDR_TE   36

Definition at line 165 of file httpparser.h.

#define HDR_TIMEOUT   21

Definition at line 148 of file httpparser.h.

#define HDR_TRANSFER_ENCODING   22

Definition at line 149 of file httpparser.h.

#define HDR_UNKNOWN   -1

Definition at line 127 of file httpparser.h.

#define HDR_USER_AGENT   24

Definition at line 151 of file httpparser.h.

#define HDR_USN   23

Definition at line 150 of file httpparser.h.


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

void httpmsg_destroy ( INOUT http_message_t msg  ) 
http_header_t* httpmsg_find_hdr ( IN http_message_t msg,
IN int  header_name_id,
OUT memptr value 
)
http_header_t* httpmsg_find_hdr_str ( IN http_message_t msg,
IN const char *  header_name 
)
void httpmsg_init ( INOUT http_message_t msg  ) 
int matchstr ( IN char *  str,
IN size_t  slen,
IN const char *  fmt,
  ... 
)
const char* method_to_str ( IN http_method_t  method  ) 
parse_status_t parser_append ( INOUT http_parser_t parser,
IN const char *  buf,
IN size_t  buf_length 
)
parse_status_t parser_get_entity_read_method ( INOUT http_parser_t parser  ) 
parse_status_t parser_parse ( INOUT http_parser_t parser  ) 
parse_status_t parser_parse_entity ( INOUT http_parser_t parser  ) 
parse_status_t parser_parse_headers ( INOUT http_parser_t parser  ) 
parse_status_t parser_parse_responseline ( INOUT http_parser_t parser  ) 
void parser_request_init ( OUT http_parser_t parser  ) 
void parser_response_init ( OUT http_parser_t parser,
IN http_method_t  request_method 
)
void print_http_headers ( IN http_message_t hmsg  ) 
int raw_find_str ( IN memptr raw_value,
IN const char *  str 
)
off_t raw_to_int ( IN memptr raw_value,
int  base 
)

Generated on Fri Mar 26 20:16:54 2010 for MediaTomb by  doxygen 1.6.1