23#ifndef ZEPHYR_INCLUDE_NET_HTTP_PARSER_H_
24#define ZEPHYR_INCLUDE_NET_HTTP_PARSER_H_
27#define HTTP_PARSER_VERSION_MAJOR 2
28#define HTTP_PARSER_VERSION_MINOR 7
29#define HTTP_PARSER_VERSION_PATCH 1
32#if defined(_WIN32) && !defined(__MINGW32__) && \
33 (!defined(_MSC_VER) || _MSC_VER < 1600) && !defined(__WINE__)
63#ifndef HTTP_MAX_HEADER_SIZE
64# define HTTP_MAX_HEADER_SIZE (80 * 1024)
144#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno)
233 const char *data,
size_t len);
http_method
HTTP Request Methods.
Definition: method.h:26
http_errno
Definition: parser.h:107
@ HPE_CB_chunk_complete
Definition: parser.h:118
@ HPE_INVALID_CONTENT_LENGTH
Definition: parser.h:133
@ HPE_INVALID_CONSTANT
Definition: parser.h:136
@ HPE_UNEXPECTED_CONTENT_LENGTH
Definition: parser.h:134
@ HPE_INVALID_CHUNK_SIZE
Definition: parser.h:135
@ HPE_UNKNOWN
Definition: parser.h:140
@ HPE_INVALID_QUERY_STRING
Definition: parser.h:129
@ HPE_INVALID_PORT
Definition: parser.h:127
@ HPE_INVALID_EOF_STATE
Definition: parser.h:119
@ HPE_HEADER_OVERFLOW
Definition: parser.h:120
@ HPE_INVALID_VERSION
Definition: parser.h:122
@ HPE_CB_message_begin
Definition: parser.h:109
@ HPE_CB_headers_complete
Definition: parser.h:113
@ HPE_CB_body
Definition: parser.h:114
@ HPE_INVALID_HOST
Definition: parser.h:126
@ HPE_CB_chunk_header
Definition: parser.h:117
@ HPE_INVALID_PATH
Definition: parser.h:128
@ HPE_STRICT
Definition: parser.h:138
@ HPE_CLOSED_CONNECTION
Definition: parser.h:121
@ HPE_CB_status
Definition: parser.h:116
@ HPE_INVALID_STATUS
Definition: parser.h:123
@ HPE_INVALID_INTERNAL_STATE
Definition: parser.h:137
@ HPE_INVALID_METHOD
Definition: parser.h:124
@ HPE_INVALID_HEADER_TOKEN
Definition: parser.h:132
@ HPE_CB_header_value
Definition: parser.h:112
@ HPE_INVALID_URL
Definition: parser.h:125
@ HPE_CB_header_field
Definition: parser.h:111
@ HPE_OK
Definition: parser.h:108
@ HPE_CB_message_complete
Definition: parser.h:115
@ HPE_CB_url
Definition: parser.h:110
@ HPE_PAUSED
Definition: parser.h:139
@ HPE_LF_EXPECTED
Definition: parser.h:131
@ HPE_INVALID_FRAGMENT
Definition: parser.h:130
int(* http_data_cb)(struct http_parser *, const char *at, size_t length)
Definition: parser.h:89
unsigned long http_parser_version(void)
int http_body_is_final(const struct http_parser *parser)
size_t http_parser_execute(struct http_parser *parser, const struct http_parser_settings *settings, const char *data, size_t len)
void http_parser_settings_init(struct http_parser_settings *settings)
const char * http_errno_description(enum http_errno err)
int http_should_keep_alive(const struct http_parser *parser)
int(* http_cb)(struct http_parser *)
Definition: parser.h:91
void http_parser_pause(struct http_parser *parser, int paused)
flags
Definition: parser.h:96
@ F_CHUNKED
Definition: parser.h:97
@ F_CONNECTION_CLOSE
Definition: parser.h:99
@ F_CONNECTION_KEEP_ALIVE
Definition: parser.h:98
@ F_UPGRADE
Definition: parser.h:102
@ F_CONTENTLENGTH
Definition: parser.h:104
@ F_TRAILING
Definition: parser.h:101
@ F_SKIPBODY
Definition: parser.h:103
@ F_CONNECTION_UPGRADE
Definition: parser.h:100
void http_parser_init(struct http_parser *parser, enum http_parser_type type)
const char * http_method_str(enum http_method m)
const char * http_errno_name(enum http_errno err)
http_parser_type
Definition: parser.h:93
@ HTTP_RESPONSE
Definition: parser.h:93
@ HTTP_REQUEST
Definition: parser.h:93
@ HTTP_BOTH
Definition: parser.h:93
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__INT32_TYPE__ int32_t
Definition: stdint.h:74
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
__INT64_TYPE__ int64_t
Definition: stdint.h:75
__INT8_TYPE__ int8_t
Definition: stdint.h:72
__INT16_TYPE__ int16_t
Definition: stdint.h:73
http_data_cb on_header_value
Definition: parser.h:195
http_cb on_chunk_header
Definition: parser.h:202
http_data_cb on_status
Definition: parser.h:193
http_cb on_headers_complete
Definition: parser.h:196
http_data_cb on_url
Definition: parser.h:192
http_data_cb on_body
Definition: parser.h:197
http_cb on_chunk_complete
Definition: parser.h:203
http_cb on_message_begin
Definition: parser.h:191
http_data_cb on_header_field
Definition: parser.h:194
http_cb on_message_complete
Definition: parser.h:198
unsigned int flags
Definition: parser.h:150
unsigned int state
Definition: parser.h:153
unsigned int index
Definition: parser.h:156
unsigned int upgrade
Definition: parser.h:176
uint32_t nread
Definition: parser.h:159
unsigned int method
Definition: parser.h:167
void * data
PUBLIC.
Definition: parser.h:179
uint64_t content_length
Definition: parser.h:160
unsigned int status_code
Definition: parser.h:166
unsigned int http_errno
Definition: parser.h:168
unsigned int header_state
Definition: parser.h:154
unsigned int type
PRIVATE.
Definition: parser.h:149
unsigned short http_major
READ-ONLY.
Definition: parser.h:164
unsigned int lenient_http_headers
Definition: parser.h:157
unsigned short http_minor
Definition: parser.h:165
const struct sockaddr * addr
Definition: parser.h:186
Generic sockaddr struct.
Definition: net_ip.h:385