My Project
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
src
msus
webserver
request_parser.h
Go to the documentation of this file.
1
/*
2
START OF LICENSE STUB
3
DeDOS: Declarative Dispersion-Oriented Software
4
Copyright (C) 2017 University of Pennsylvania, Georgetown University
5
6
This program is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
END OF LICENSE STUB
19
*/
20
#ifndef REQUEST_PARSER_H_
21
#define REQUEST_PARSER_H_
22
#include "
webserver/http_parser.h
"
23
24
#define MAX_URL_LEN 256
25
26
struct
parser_state
{
27
char
url
[
MAX_URL_LEN
];
28
int
url_len
;
29
int
headers_complete
;
30
ssize_t (*
recv_fn
)(
int
fd, SSL *ssl,
char
*buf);
31
http_parser_settings
settings
;
32
http_parser
parser
;
33
};
34
35
void
init_parser_state
(
struct
parser_state
*
state
);
36
37
enum
parser_status
{
38
REQ_INCOMPLETE
,
39
REQ_COMPLETE
,
40
REQ_ERROR
41
};
42
43
int
parse_http
(
struct
parser_state
*
state
,
char
*buf, ssize_t bytes);
44
45
#endif
http_parser
Definition:
http_parser.h:307
REQ_COMPLETE
Definition:
request_parser.h:39
parser_state::parser
http_parser parser
Definition:
request_parser.h:32
parse_http
int parse_http(struct parser_state *state, char *buf, ssize_t bytes)
Definition:
request_parser.c:68
parser_state::url
char url[256]
Definition:
request_parser.h:27
REQ_INCOMPLETE
Definition:
request_parser.h:38
MAX_URL_LEN
#define MAX_URL_LEN
Definition:
request_parser.h:24
http_parser_settings
Definition:
http_parser.h:338
REQ_ERROR
Definition:
request_parser.h:40
parser_state::headers_complete
int headers_complete
Definition:
request_parser.h:29
parser_state
Definition:
request_parser.h:26
init_parser_state
void init_parser_state(struct parser_state *state)
Definition:
request_parser.c:58
parser_state::settings
http_parser_settings settings
Definition:
request_parser.h:31
parser_state::recv_fn
ssize_t(* recv_fn)(int fd, SSL *ssl, char *buf)
Definition:
request_parser.h:30
parser_state::url_len
int url_len
Definition:
request_parser.h:28
http_parser.h
parser_status
parser_status
Definition:
request_parser.h:37
state
state
Definition:
http_parser.c:298
Generated by
1.8.6