A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
http-header.h
Go to the documentation of this file.
1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 DOTFEESA www.tk.etf.unsa.ba
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
19
* Miralem Mehic <miralem.mehic@ieee.org>
20
*/
21
22
#ifndef HTTP_HEADER_H
23
#define HTTP_HEADER_H
24
25
#include <ns3/header.h>
26
#include <ns3/nstime.h>
27
#include <string>
28
29
30
namespace
ns3
{
31
32
class
Packet;
33
56
class
HttpHeader
:
public
Header
57
{
58
public
:
60
HttpHeader
();
61
66
static
TypeId
GetTypeId
();
67
68
// Inherited from ObjectBase base class.
69
virtual
TypeId
GetInstanceTypeId
()
const
;
70
71
// Inherited from Header base class.
72
virtual
uint32_t
GetSerializedSize
()
const
;
73
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
74
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
75
virtual
void
Print
(std::ostream &os)
const
;
76
80
std::string
ToString
()
const
;
81
83
enum
ContentType_t
84
{
85
NOT_SET
= 0,
86
MAIN_OBJECT
= 1,
87
EMBEDDED_OBJECT
= 2
88
};
89
90
enum
HttpMethod
{
91
DELETE
= 0,
92
GET
= 1,
93
HEAD
= 2,
94
PATCH
= 3,
95
POST
= 4,
96
PUT
= 5
97
};
98
99
enum
HttpStatus
100
{
101
Continue
= 100,
102
SwitchingProtocol
= 101,
103
Processing
= 102,
104
EarlyHints
= 103,
105
106
Ok
= 200,
107
Created
= 201,
108
Accepted
= 202,
109
NonAuthoritativeInformation
= 203,
110
NoContent
= 204,
111
ResetContent
= 205,
112
PartialContent
= 206,
113
MultiStatus
= 207,
114
AlreadyReported
= 208,
115
ImUsed
= 226,
116
117
MultipleChoice
= 300,
118
MovedPermanently
= 301,
119
Found
= 302,
120
SeeOther
= 303,
121
NotModified
= 304,
122
UseProxy
= 305,
123
TemporaryRedirect
= 307,
124
PermanentRedirect
= 308,
125
126
BadRequest
= 400,
127
Unauthorized
= 401,
128
PaymentRequired
= 402,
129
Forbidden
= 403,
130
NotFound
= 404,
131
MethodNotAllowed
= 405,
132
NotAcceptable
= 406,
133
ProxyAuthenticationRequired
= 407,
134
RequestTimeout
= 408,
135
Conflict
= 409,
136
Gone
= 410,
137
LengthRequired
= 411,
138
PreconditionFailed
= 412,
139
PayloadTooLarge
= 413,
140
UriTooLong
= 414,
141
UnsupportedMediaType
= 415,
142
RangeNotSatisfiable
= 416,
143
ExpectationFailed
= 417,
144
ImaTeapot
= 418,
145
MisdirectedRequest
= 421,
146
UnprocessableEntity
= 422,
147
Locked
= 423,
148
FailedDependency
= 424,
149
TooEarly
= 425,
150
UpgradeRequired
= 426,
151
PreconditionRequired
= 428,
152
TooManyRequests
= 429,
153
RequestHeaderFieldsTooLarge
= 431,
154
UnavailableForLegalReasons
= 451,
155
156
InternalServerError
= 500,
157
NotImplemented
= 501,
158
BadGateway
= 502,
159
ServiceUnavailable
= 503,
160
GatewayTimeout
= 504,
161
HttpVersionNotSupported
= 505,
162
VariantAlsoNegotiates
= 506,
163
InsufficientStorage
= 507,
164
LoopDetected
= 508,
165
NotExtended
= 510,
166
NetworkAuthenticationRequired
= 511
167
};
168
172
void
SetContentType
(
ContentType_t
contentType);
173
177
ContentType_t
GetContentType
()
const
;
178
182
void
SetContentLength
(uint32_t contentLength);
183
187
uint32_t
GetContentLength
()
const
;
188
192
void
SetStatus
(
HttpStatus
status);
193
197
HttpStatus
GetStatus
()
const
;
198
202
void
SetMethod
(
HttpMethod
method);
203
207
HttpMethod
GetMethod
()
const
;
208
212
void
SetUri
(std::string uri);
213
217
std::string
GetUri
()
const
;
218
223
void
SetSize
(uint64_t size);
224
229
uint64_t
GetSize
(
void
)
const
;
230
231
private
:
232
uint16_t
m_method
;
233
uint16_t
m_status
;
234
uint16_t
m_contentType
;
235
uint32_t
m_contentLength
;
236
uint64_t
m_size
{0};
237
std::string
m_uri
;
238
std::vector <std::string>
uriParams
;
239
240
};
// end of `class HttpHeader`
241
242
243
}
// end of `namespace ns3`
244
245
246
#endif
/* HTTP_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:44
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::HttpHeader
Header used by web browsing applications to transmit information about content type,...
Definition:
http-header.h:57
ns3::HttpHeader::m_method
uint16_t m_method
" Connection method field in integer format.
Definition:
http-header.h:232
ns3::HttpHeader::m_uri
std::string m_uri
Definition:
http-header.h:237
ns3::HttpHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
http-header.cc:69
ns3::HttpHeader::uriParams
std::vector< std::string > uriParams
Definition:
http-header.h:238
ns3::HttpHeader::HttpHeader
HttpHeader()
Creates an empty instance .
Definition:
http-header.cc:33
ns3::HttpHeader::m_contentType
uint16_t m_contentType
" Content type field in integer format.
Definition:
http-header.h:234
ns3::HttpHeader::Print
virtual void Print(std::ostream &os) const
Definition:
http-header.cc:121
ns3::HttpHeader::GetStatus
HttpStatus GetStatus() const
Definition:
http-header.cc:414
ns3::HttpHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
Definition:
http-header.cc:54
ns3::HttpHeader::GetSerializedSize
virtual uint32_t GetSerializedSize() const
Definition:
http-header.cc:60
ns3::HttpHeader::GetSize
uint64_t GetSize(void) const
Get the size information that the header is carrying.
Definition:
http-header.cc:205
ns3::HttpHeader::GetUri
std::string GetUri() const
Definition:
http-header.cc:681
ns3::HttpHeader::GetTypeId
static TypeId GetTypeId()
Returns the object TypeId.
Definition:
http-header.cc:44
ns3::HttpHeader::GetContentType
ContentType_t GetContentType() const
Definition:
http-header.cc:162
ns3::HttpHeader::SetSize
void SetSize(uint64_t size)
Set the size information that the header will carry.
Definition:
http-header.cc:199
ns3::HttpHeader::SetContentType
void SetContentType(ContentType_t contentType)
Definition:
http-header.cc:141
ns3::HttpHeader::SetContentLength
void SetContentLength(uint32_t contentLength)
Definition:
http-header.cc:184
ns3::HttpHeader::SetStatus
void SetStatus(HttpStatus status)
Definition:
http-header.cc:211
ns3::HttpHeader::m_status
uint16_t m_status
" Connection status field in integer format.
Definition:
http-header.h:233
ns3::HttpHeader::HttpStatus
HttpStatus
Definition:
http-header.h:100
ns3::HttpHeader::Gone
@ Gone
Definition:
http-header.h:136
ns3::HttpHeader::NotExtended
@ NotExtended
Definition:
http-header.h:165
ns3::HttpHeader::UseProxy
@ UseProxy
Definition:
http-header.h:122
ns3::HttpHeader::PreconditionRequired
@ PreconditionRequired
Definition:
http-header.h:151
ns3::HttpHeader::InternalServerError
@ InternalServerError
Definition:
http-header.h:156
ns3::HttpHeader::NetworkAuthenticationRequired
@ NetworkAuthenticationRequired
Definition:
http-header.h:166
ns3::HttpHeader::ExpectationFailed
@ ExpectationFailed
Definition:
http-header.h:143
ns3::HttpHeader::TooManyRequests
@ TooManyRequests
Definition:
http-header.h:152
ns3::HttpHeader::ImUsed
@ ImUsed
Definition:
http-header.h:115
ns3::HttpHeader::Ok
@ Ok
Definition:
http-header.h:106
ns3::HttpHeader::Found
@ Found
Definition:
http-header.h:119
ns3::HttpHeader::BadRequest
@ BadRequest
Definition:
http-header.h:126
ns3::HttpHeader::RangeNotSatisfiable
@ RangeNotSatisfiable
Definition:
http-header.h:142
ns3::HttpHeader::InsufficientStorage
@ InsufficientStorage
Definition:
http-header.h:163
ns3::HttpHeader::ProxyAuthenticationRequired
@ ProxyAuthenticationRequired
Definition:
http-header.h:133
ns3::HttpHeader::Unauthorized
@ Unauthorized
Definition:
http-header.h:127
ns3::HttpHeader::MethodNotAllowed
@ MethodNotAllowed
Definition:
http-header.h:131
ns3::HttpHeader::BadGateway
@ BadGateway
Definition:
http-header.h:158
ns3::HttpHeader::Locked
@ Locked
Definition:
http-header.h:147
ns3::HttpHeader::RequestHeaderFieldsTooLarge
@ RequestHeaderFieldsTooLarge
Definition:
http-header.h:153
ns3::HttpHeader::VariantAlsoNegotiates
@ VariantAlsoNegotiates
Definition:
http-header.h:162
ns3::HttpHeader::NotModified
@ NotModified
Definition:
http-header.h:121
ns3::HttpHeader::ResetContent
@ ResetContent
Definition:
http-header.h:111
ns3::HttpHeader::UriTooLong
@ UriTooLong
Definition:
http-header.h:140
ns3::HttpHeader::MultiStatus
@ MultiStatus
Definition:
http-header.h:113
ns3::HttpHeader::MovedPermanently
@ MovedPermanently
Definition:
http-header.h:118
ns3::HttpHeader::NoContent
@ NoContent
Definition:
http-header.h:110
ns3::HttpHeader::NonAuthoritativeInformation
@ NonAuthoritativeInformation
Definition:
http-header.h:109
ns3::HttpHeader::TooEarly
@ TooEarly
Definition:
http-header.h:149
ns3::HttpHeader::FailedDependency
@ FailedDependency
Definition:
http-header.h:148
ns3::HttpHeader::SwitchingProtocol
@ SwitchingProtocol
Definition:
http-header.h:102
ns3::HttpHeader::Accepted
@ Accepted
Definition:
http-header.h:108
ns3::HttpHeader::Created
@ Created
Definition:
http-header.h:107
ns3::HttpHeader::PayloadTooLarge
@ PayloadTooLarge
Definition:
http-header.h:139
ns3::HttpHeader::NotImplemented
@ NotImplemented
Definition:
http-header.h:157
ns3::HttpHeader::MultipleChoice
@ MultipleChoice
Definition:
http-header.h:117
ns3::HttpHeader::Forbidden
@ Forbidden
Definition:
http-header.h:129
ns3::HttpHeader::Processing
@ Processing
Definition:
http-header.h:103
ns3::HttpHeader::UnsupportedMediaType
@ UnsupportedMediaType
Definition:
http-header.h:141
ns3::HttpHeader::GatewayTimeout
@ GatewayTimeout
Definition:
http-header.h:160
ns3::HttpHeader::LengthRequired
@ LengthRequired
Definition:
http-header.h:137
ns3::HttpHeader::NotAcceptable
@ NotAcceptable
Definition:
http-header.h:132
ns3::HttpHeader::AlreadyReported
@ AlreadyReported
Definition:
http-header.h:114
ns3::HttpHeader::ServiceUnavailable
@ ServiceUnavailable
Definition:
http-header.h:159
ns3::HttpHeader::Conflict
@ Conflict
Definition:
http-header.h:135
ns3::HttpHeader::PartialContent
@ PartialContent
Definition:
http-header.h:112
ns3::HttpHeader::UnavailableForLegalReasons
@ UnavailableForLegalReasons
Definition:
http-header.h:154
ns3::HttpHeader::PreconditionFailed
@ PreconditionFailed
Definition:
http-header.h:138
ns3::HttpHeader::TemporaryRedirect
@ TemporaryRedirect
Definition:
http-header.h:123
ns3::HttpHeader::NotFound
@ NotFound
Definition:
http-header.h:130
ns3::HttpHeader::UpgradeRequired
@ UpgradeRequired
Definition:
http-header.h:150
ns3::HttpHeader::PaymentRequired
@ PaymentRequired
Definition:
http-header.h:128
ns3::HttpHeader::RequestTimeout
@ RequestTimeout
Definition:
http-header.h:134
ns3::HttpHeader::UnprocessableEntity
@ UnprocessableEntity
Definition:
http-header.h:146
ns3::HttpHeader::MisdirectedRequest
@ MisdirectedRequest
Definition:
http-header.h:145
ns3::HttpHeader::SeeOther
@ SeeOther
Definition:
http-header.h:120
ns3::HttpHeader::EarlyHints
@ EarlyHints
Definition:
http-header.h:104
ns3::HttpHeader::Continue
@ Continue
Definition:
http-header.h:101
ns3::HttpHeader::HttpVersionNotSupported
@ HttpVersionNotSupported
Definition:
http-header.h:161
ns3::HttpHeader::LoopDetected
@ LoopDetected
Definition:
http-header.h:164
ns3::HttpHeader::ImaTeapot
@ ImaTeapot
Definition:
http-header.h:144
ns3::HttpHeader::PermanentRedirect
@ PermanentRedirect
Definition:
http-header.h:124
ns3::HttpHeader::GetMethod
HttpMethod GetMethod() const
Definition:
http-header.cc:649
ns3::HttpHeader::HttpMethod
HttpMethod
Definition:
http-header.h:90
ns3::HttpHeader::HEAD
@ HEAD
Http Method Head.
Definition:
http-header.h:93
ns3::HttpHeader::DELETE
@ DELETE
Http Method Delete.
Definition:
http-header.h:91
ns3::HttpHeader::PUT
@ PUT
Http Method Put.
Definition:
http-header.h:96
ns3::HttpHeader::GET
@ GET
Http Method GET.
Definition:
http-header.h:92
ns3::HttpHeader::PATCH
@ PATCH
Http Method Patch.
Definition:
http-header.h:94
ns3::HttpHeader::POST
@ POST
Http Method Post.
Definition:
http-header.h:95
ns3::HttpHeader::m_contentLength
uint32_t m_contentLength
" Content length field (in bytes unit).
Definition:
http-header.h:235
ns3::HttpHeader::GetContentLength
uint32_t GetContentLength() const
Definition:
http-header.cc:192
ns3::HttpHeader::SetUri
void SetUri(std::string uri)
Definition:
http-header.cc:687
ns3::HttpHeader::ContentType_t
ContentType_t
The possible types of content (default = NOT_SET).
Definition:
http-header.h:84
ns3::HttpHeader::NOT_SET
@ NOT_SET
Integer equivalent = 0.
Definition:
http-header.h:85
ns3::HttpHeader::MAIN_OBJECT
@ MAIN_OBJECT
Integer equivalent = 1.
Definition:
http-header.h:86
ns3::HttpHeader::EMBEDDED_OBJECT
@ EMBEDDED_OBJECT
Integer equivalent = 2.
Definition:
http-header.h:87
ns3::HttpHeader::ToString
std::string ToString() const
Definition:
http-header.cc:132
ns3::HttpHeader::SetMethod
void SetMethod(HttpMethod method)
Definition:
http-header.cc:617
ns3::HttpHeader::m_size
uint64_t m_size
The 'size' information that the header is carrying.
Definition:
http-header.h:236
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:520
src
applications
model
http-header.h
Generated on Sun Mar 3 2024 17:10:53 for ns-3 by
1.9.1