libUPnP 1.14.19
Data Structures | Macros | Enumerations | Functions
httpparser.h File Reference
#include "LinkedList.h"
#include "membuffer.h"
#include "upnputil.h"
#include "uri.h"
Include dependency graph for httpparser.h:
This graph shows which files directly or indirectly include this file:

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
 

Macros

#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_PUT = UPNP_HTTPMETHOD_PUT , HTTPMETHOD_DELETE = UPNP_HTTPMETHOD_DELETE , HTTPMETHOD_GET = UPNP_HTTPMETHOD_GET , HTTPMETHOD_HEAD = UPNP_HTTPMETHOD_HEAD ,
  HTTPMETHOD_POST = UPNP_HTTPMETHOD_POST , HTTPMETHOD_MPOST , HTTPMETHOD_SUBSCRIBE , HTTPMETHOD_UNSUBSCRIBE ,
  HTTPMETHOD_NOTIFY , 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 (http_message_t *msg)
 
void httpmsg_destroy (http_message_t *msg)
 
http_header_thttpmsg_find_hdr_str (http_message_t *msg, const char *header_name)
 
http_header_thttpmsg_find_hdr (http_message_t *msg, int header_name_id, memptr *value)
 
void parser_request_init (http_parser_t *parser)
 
void parser_response_init (http_parser_t *parser, http_method_t request_method)
 
parse_status_t parser_parse (http_parser_t *parser)
 
parse_status_t parser_parse_responseline (http_parser_t *parser)
 
parse_status_t parser_parse_headers (http_parser_t *parser)
 
parse_status_t parser_parse_entity (http_parser_t *parser)
 
parse_status_t parser_get_entity_read_method (http_parser_t *parser)
 
parse_status_t parser_append (http_parser_t *parser, const char *buf, size_t buf_length)
 
parse_status_t matchstr (char *str, size_t slen, const char *fmt,...)
 
int raw_to_int (memptr *raw_value, int base)
 
int raw_find_str (memptr *raw_value, const char *str)
 
const char * method_to_str (http_method_t method)
 
void print_http_headers (http_message_t *hmsg)
 Print the HTTP headers.
 

Enumeration Type Documentation

◆ parse_status_t

status of parsing

Enumerator
PARSE_SUCCESS 

msg was parsed successfully.

PARSE_INCOMPLETE 

need more data to continue.

PARSE_INCOMPLETE_ENTITY 

for responses that don't have length specified.

PARSE_FAILURE 

parse failed; check status code for details.

PARSE_OK 

done partial.

PARSE_NO_MATCH 

token not matched.

PARSE_CONTINUE_1 

private.

Function Documentation

◆ print_http_headers()

void print_http_headers ( http_message_t hmsg)