7#ifndef HTTP_REQUEST_PARSER_H
8#define HTTP_REQUEST_PARSER_H
12#include <boost/shared_ptr.hpp>
17class HttpRequestParser;
147 virtual void defineStates();
154 void receiveStartHandler();
157 void httpMethodHandler();
168 void versionHTTPHandler(
const char expected_letter,
169 const unsigned int next_state);
182 void versionNumberStartHandler(
const unsigned int next_state,
183 unsigned int* storage);
197 void versionNumberHandler(
const char following_character,
198 const unsigned int next_state,
199 unsigned int*
const storage);
213 void expectingNewLineHandler(
const unsigned int next_state);
216 void headerLineStartHandler();
219 void headerLwsHandler();
222 void headerNameHandler();
225 void spaceBeforeHeaderValueHandler();
228 void headerValueHandler();
Base class for the HTTP message parsers.
A generic parser for HTTP requests.
static const int EXPECTING_NEW_LINE1_ST
Parsing first new line (after HTTP version number).
static const int HTTP_URI_ST
Parsing URI.
static const int HTTP_VERSION_MAJOR_ST
Parsing major HTTP version number.
static const int HTTP_VERSION_SLASH_ST
Parsing slash character in "HTTP/Y.X".
static const int SPACE_BEFORE_HEADER_VALUE_ST
Parsing space before header value.
static const int HTTP_BODY_ST
Parsing body of a HTTP message.
static const int HTTP_VERSION_MAJOR_START_ST
Starting to parse major HTTP version number.
static const int EXPECTING_NEW_LINE3_ST
Expecting second new line marking end of HTTP headers.
static const int HEADER_NAME_ST
Parsing header name.
static const int RECEIVE_START_ST
State indicating a beginning of parsing.
void initModel()
Initialize the state model for parsing.
static const int HEADER_LWS_ST
Parsing LWS (Linear White Space), i.e.
static const int HTTP_VERSION_MINOR_ST
Parsing minor HTTP version number.
static const int HEADER_LINE_START_ST
Starting to parse a header line.
static const int HTTP_VERSION_H_ST
Parsing letter "H" of "HTTP".
static const int HTTP_VERSION_MINOR_START_ST
Starting to parse minor HTTP version number.
static const int HTTP_METHOD_ST
Parsing HTTP method, e.g. GET, POST etc.
static const int HEADER_VALUE_ST
Parsing header value.
HttpRequestParser(HttpRequest &request)
Constructor.
static const int EXPECTING_NEW_LINE2_ST
Expecting new line after parsing header value.
static const int HTTP_VERSION_P_ST
Parsing letter "P" in "HTTP".
static const int HTTP_VERSION_T2_ST
Parsing second occurrence of "T" in "HTTP".
static const int HTTP_VERSION_T1_ST
Parsing first occurrence of "T" in "HTTP".
Represents HTTP request message.
static const int SM_DERIVED_STATE_MIN
Value at which custom states in a derived class should begin.
boost::shared_ptr< HttpRequestParser > HttpRequestParserPtr
Pointer to the HttpRequestParser.
boost::shared_ptr< HttpRequestContext > HttpRequestContextPtr
Pointer to the HttpRequestContext.
Defines the logger used by the top-level component of kea-lfc.