|
PcapPlusPlus
19.12
|
Go to the documentation of this file. 1 #ifndef PACKETPP_HTTP_LAYER
2 #define PACKETPP_HTTP_LAYER
36 #define PCPP_HTTP_HOST_FIELD "Host"
38 #define PCPP_HTTP_CONNECTION_FIELD "Connection"
40 #define PCPP_HTTP_USER_AGENT_FIELD "User-Agent"
42 #define PCPP_HTTP_REFERER_FIELD "Referer"
44 #define PCPP_HTTP_ACCEPT_FIELD "Accept"
46 #define PCPP_HTTP_ACCEPT_ENCODING_FIELD "Accept-Encoding"
48 #define PCPP_HTTP_ACCEPT_LANGUAGE_FIELD "Accept-Language"
50 #define PCPP_HTTP_COOKIE_FIELD "Cookie"
52 #define PCPP_HTTP_CONTENT_LENGTH_FIELD "Content-Length"
54 #define PCPP_HTTP_CONTENT_ENCODING_FIELD "Content-Encoding"
56 #define PCPP_HTTP_CONTENT_TYPE_FIELD "Content-Type"
58 #define PCPP_HTTP_TRANSFER_ENCODING_FIELD "Transfer-Encoding"
60 #define PCPP_HTTP_SERVER_FIELD "Server"
93 HttpMessage() : TextBasedProtocolMessage() {}
94 HttpMessage(
const HttpMessage& other) : TextBasedProtocolMessage(other) {}
95 HttpMessage& operator=(
const HttpMessage& other) { TextBasedProtocolMessage::operator=(other);
return *
this; }
98 char getHeaderFieldNameValueSeparator()
const {
return ':'; }
99 bool spacesAllowedBetweenHeaderFieldNameAndValue()
const {
return true; }
105 class HttpRequestFirstLine;
200 std::string
getUrl()
const;
215 class HttpResponseFirstLine;
510 std::string
getUri()
const;
517 bool setUri(std::string newUri);
542 int getSize()
const {
return m_FirstLineEndOffset; }
562 void setMessage(std::string message) { m_Message = message; }
563 virtual const char* what()
const throw()
565 return m_Message.c_str();
568 std::string m_Message;
582 int m_FirstLineEndOffset;
653 int getSize()
const {
return m_FirstLineEndOffset; }
673 void setMessage(std::string message) { m_Message = message; }
674 virtual const char* what()
const throw()
676 return m_Message.c_str();
679 std::string m_Message;
686 static HttpVersion parseVersion(
char* data,
size_t dataLen);
693 int m_FirstLineEndOffset;
OsiModelLayer
Definition: ProtocolType.h:224
Definition: HttpLayer.h:318
Definition: HttpLayer.h:246
Definition: HttpLayer.h:248
Definition: HttpLayer.h:278
Definition: HttpLayer.h:266
Definition: HttpLayer.h:388
Definition: HttpLayer.h:308
Definition: ProtocolType.h:239
Definition: HttpLayer.h:491
Definition: HttpLayer.h:288
Definition: HttpLayer.h:328
Definition: HttpLayer.h:316
Definition: HttpLayer.h:294
Definition: HttpLayer.h:134
HttpVersion getVersion() const
Definition: HttpLayer.h:522
Definition: HttpLayer.h:374
Definition: HttpLayer.h:360
static HttpRequestLayer::HttpMethod parseMethod(char *data, size_t dataLen)
Definition: HttpLayer.h:320
Definition: HttpLayer.h:250
HttpRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
HttpResponseLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: HttpLayer.h:390
Definition: HttpLayer.h:252
bool isComplete() const
Definition: HttpLayer.h:550
std::string getUrl() const
Definition: HttpLayer.h:338
Definition: HttpLayer.h:312
Definition: HttpLayer.h:230
Definition: HttpLayer.h:26
Definition: HttpLayer.h:322
HttpMethod
Definition: HttpLayer.h:131
Definition: HttpLayer.h:290
HttpRequestLayer & operator=(const HttpRequestLayer &other)
Definition: HttpLayer.h:348
Definition: HttpLayer.h:258
Definition: HttpLayer.h:240
Definition: HttpLayer.h:342
Definition: HttpLayer.h:256
Definition: HttpLayer.h:286
bool setMethod(HttpRequestLayer::HttpMethod newMethod)
std::string getStatusCodeString() const
Definition: HttpLayer.h:136
Definition: HttpLayer.h:296
HttpResponseLayer::HttpResponseStatusCode getStatusCode() const
Definition: HttpLayer.h:610
Definition: HttpLayer.h:280
Definition: HttpLayer.h:358
Definition: HttpLayer.h:372
Definition: HttpLayer.h:138
virtual HeaderField * addField(const std::string &fieldName, const std::string &fieldValue)
void setVersion(HttpVersion newVersion)
Definition: HttpLayer.h:302
HeaderField * setContentLength(int contentLength, const std::string prevFieldName="")
HttpRequestFirstLine * getFirstLine() const
Definition: HttpLayer.h:191
Definition: HttpLayer.h:314
Definition: HttpLayer.h:334
Definition: HttpLayer.h:30
Definition: HttpLayer.h:368
OsiModelLayer getOsiModelLayer() const
Definition: HttpLayer.h:89
Definition: HttpLayer.h:152
bool setUri(std::string newUri)
HttpRequestLayer::HttpMethod getMethod() const
Definition: HttpLayer.h:498
Definition: HttpLayer.h:324
Definition: HttpLayer.h:268
Definition: HttpLayer.h:71
Definition: HttpLayer.h:264
Definition: HttpLayer.h:384
Definition: HttpLayer.h:352
Definition: HttpLayer.h:300
Definition: HttpLayer.h:150
Definition: HttpLayer.h:669
Definition: HttpLayer.h:382
Definition: HttpLayer.h:558
Definition: HttpLayer.h:366
Definition: HttpLayer.h:603
Definition: HttpLayer.h:310
std::string toString() const
Definition: HttpLayer.h:304
Definition: HttpLayer.h:326
Definition: HttpLayer.h:356
HttpResponseFirstLine * getFirstLine() const
Definition: HttpLayer.h:442
Definition: HttpLayer.h:398
HttpVersion getVersion() const
Definition: HttpLayer.h:633
int getContentLength() const
Definition: HttpLayer.h:28
Definition: HttpLayer.h:270
Definition: HttpLayer.h:392
Definition: HttpLayer.h:364
Definition: TextBasedProtocol.h:106
Definition: HttpLayer.h:306
std::string getUri() const
Definition: HttpLayer.h:284
The main namespace for the PcapPlusPlus lib.
Definition: HttpLayer.h:340
Definition: HttpLayer.h:274
void setVersion(HttpVersion newVersion)
Definition: HttpLayer.h:380
Definition: HttpLayer.h:148
Definition: HttpLayer.h:396
std::string toString() const
static HttpResponseLayer::HttpResponseStatusCode parseStatusCode(char *data, size_t dataLen)
Definition: HttpLayer.h:254
Definition: HttpLayer.h:272
int getSize() const
Definition: HttpLayer.h:653
Definition: HttpLayer.h:400
bool setStatusCode(HttpResponseLayer::HttpResponseStatusCode newStatusCode, std::string statusCodeString="")
Definition: HttpLayer.h:298
Definition: HttpLayer.h:260
Definition: HttpLayer.h:378
bool isComplete() const
Definition: HttpLayer.h:661
int getStatusCodeAsInt() const
Definition: HttpLayer.h:394
Definition: HttpLayer.h:376
Definition: HttpLayer.h:262
int getSize() const
Definition: HttpLayer.h:542
Definition: HttpLayer.h:142
Definition: HttpLayer.h:346
Definition: HttpLayer.h:242
Definition: HttpLayer.h:386
Definition: HttpLayer.h:124
Definition: HttpLayer.h:330
HttpResponseStatusCode
Definition: HttpLayer.h:237
Definition: HttpLayer.h:350
Definition: HttpLayer.h:354
Definition: HttpLayer.h:292
Definition: HttpLayer.h:244
Definition: HttpLayer.h:332
static const std::map< uint16_t, bool > * getHTTPPortMap()
Definition: HttpLayer.h:362
Definition: HttpLayer.h:276
Definition: HttpLayer.h:146
Definition: HttpLayer.h:144
Definition: HttpLayer.h:344
HttpResponseLayer & operator=(const HttpResponseLayer &other)
Definition: HttpLayer.h:24
Definition: HttpLayer.h:336
HttpVersion
Definition: HttpLayer.h:21
Definition: HttpLayer.h:282
Definition: HttpLayer.h:140
Definition: HttpLayer.h:370
virtual HeaderField * insertField(HeaderField *prevField, const std::string &fieldName, const std::string &fieldValue)