A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
mesh-information-element-vector.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Kirill Andreev <andreev@iitp.ru>
18
* Pavel Boyko <boyko.iitp.ru>
19
*/
20
21
#ifndef MESH_INFORMATION_ELEMENT_VECTOR_H
22
#define MESH_INFORMATION_ELEMENT_VECTOR_H
23
24
#include "ns3/wifi-information-element.h"
25
26
namespace
ns3
27
{
28
29
#define IE11S_MESH_PEERING_PROTOCOL_VERSION \
30
((WifiInformationElementId)74)
// to be removed (Protocol ID should be part of the Mesh Peering
31
// Management IE)
32
33
/**
34
* \brief Information element vector
35
* \ingroup wifi
36
*
37
* Implements a vector of WifiInformationElements.
38
* Information elements typically come in groups, and the
39
* WifiInformationElementVector class provides a representation of a
40
* series of IEs, and the facility for serialisation to and
41
* deserialisation from the over-the-air format.
42
*/
43
class
MeshInformationElementVector
:
public
Header
44
{
45
public
:
46
MeshInformationElementVector
();
47
~MeshInformationElementVector
()
override
;
48
49
/**
50
* \brief Get the type ID.
51
* \return the object TypeId
52
*/
53
static
TypeId
GetTypeId
();
54
55
TypeId
GetInstanceTypeId
()
const override
;
56
uint32_t
GetSerializedSize
()
const override
;
57
void
Serialize
(
Buffer::Iterator
start)
const override
;
58
/**
59
* \attention This variant should not be used but is implemented due to
60
* backward compatibility reasons
61
*
62
* \param start buffer location to start deserializing from
63
* \return number of bytes deserialized
64
*/
65
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
66
/**
67
* Deserialize a number of WifiInformationElements
68
*
69
* The size of this Header should equal start.GetDistanceFrom (end).
70
*
71
* \param start starting buffer location
72
* \param end ending buffer location
73
* \return number of bytes deserialized
74
*/
75
uint32_t
Deserialize
(
Buffer::Iterator
start,
Buffer::Iterator
end)
override
;
76
void
Print
(std::ostream& os)
const override
;
77
78
/**
79
* \brief Needed when you try to deserialize a lonely IE inside other header
80
*
81
* \param start is the start of the buffer
82
*
83
* \return deserialized bytes
84
*/
85
uint32_t
DeserializeSingleIe
(
Buffer::Iterator
start);
86
87
/// As soon as this is a vector, we define an Iterator
88
typedef
std::vector<Ptr<WifiInformationElement>>::iterator
Iterator
;
89
/**
90
* Returns Begin of the vector
91
* \returns the begin of the vector
92
*/
93
Iterator
Begin
();
94
/**
95
* Returns End of the vector
96
* \returns the end of the vector
97
*/
98
Iterator
End
();
99
/**
100
* add an IE, if maxSize has exceeded, returns false
101
*
102
* \param element wifi information element to add
103
* \returns true is added
104
*/
105
bool
AddInformationElement
(
Ptr<WifiInformationElement>
element);
106
/**
107
* vector of pointers to information elements is the body of IeVector
108
*
109
* \param id the element id to find
110
* \returns the information element
111
*/
112
Ptr<WifiInformationElement>
FindFirst
(
WifiInformationElementId
id
)
const
;
113
114
/**
115
* Check if the given WifiInformationElementVectors are equivalent.
116
*
117
* \param a another WifiInformationElementVector
118
*
119
* \return true if the given WifiInformationElementVectors are equivalent,
120
* false otherwise
121
*/
122
virtual
bool
operator==
(
const
MeshInformationElementVector
& a)
const
;
123
124
protected
:
125
/**
126
* typedef for a vector of WifiInformationElements.
127
*/
128
typedef
std::vector<Ptr<WifiInformationElement>>
IE_VECTOR
;
129
/**
130
* Current number of bytes
131
* \returns the number of bytes
132
*/
133
uint32_t
GetSize
()
const
;
134
IE_VECTOR
m_elements
;
//!< Information element vector
135
uint16_t
m_maxSize
;
//!< Size in bytes (actually, max packet length)
136
};
137
138
}
// namespace ns3
139
140
#endif
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:44
ns3::MeshInformationElementVector
Information element vector.
Definition:
mesh-information-element-vector.h:44
ns3::MeshInformationElementVector::End
Iterator End()
Returns End of the vector.
Definition:
mesh-information-element-vector.cc:182
ns3::MeshInformationElementVector::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition:
mesh-information-element-vector.cc:89
ns3::MeshInformationElementVector::AddInformationElement
bool AddInformationElement(Ptr< WifiInformationElement > element)
add an IE, if maxSize has exceeded, returns false
Definition:
mesh-information-element-vector.cc:188
ns3::MeshInformationElementVector::m_elements
IE_VECTOR m_elements
Information element vector.
Definition:
mesh-information-element-vector.h:134
ns3::MeshInformationElementVector::MeshInformationElementVector
MeshInformationElementVector()
Definition:
mesh-information-element-vector.cc:43
ns3::MeshInformationElementVector::~MeshInformationElementVector
~MeshInformationElementVector() override
Definition:
mesh-information-element-vector.cc:48
ns3::MeshInformationElementVector::GetSize
uint32_t GetSize() const
Current number of bytes.
Definition:
mesh-information-element-vector.cc:212
ns3::MeshInformationElementVector::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
mesh-information-element-vector.cc:68
ns3::MeshInformationElementVector::m_maxSize
uint16_t m_maxSize
Size in bytes (actually, max packet length)
Definition:
mesh-information-element-vector.h:135
ns3::MeshInformationElementVector::Iterator
std::vector< Ptr< WifiInformationElement > >::iterator Iterator
As soon as this is a vector, we define an Iterator.
Definition:
mesh-information-element-vector.h:88
ns3::MeshInformationElementVector::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
mesh-information-element-vector.cc:74
ns3::MeshInformationElementVector::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
mesh-information-element-vector.cc:58
ns3::MeshInformationElementVector::FindFirst
Ptr< WifiInformationElement > FindFirst(WifiInformationElementId id) const
vector of pointers to information elements is the body of IeVector
Definition:
mesh-information-element-vector.cc:199
ns3::MeshInformationElementVector::IE_VECTOR
std::vector< Ptr< WifiInformationElement > > IE_VECTOR
typedef for a vector of WifiInformationElements.
Definition:
mesh-information-element-vector.h:128
ns3::MeshInformationElementVector::Begin
Iterator Begin()
Returns Begin of the vector.
Definition:
mesh-information-element-vector.cc:176
ns3::MeshInformationElementVector::Serialize
void Serialize(Buffer::Iterator start) const override
Definition:
mesh-information-element-vector.cc:80
ns3::MeshInformationElementVector::Print
void Print(std::ostream &os) const override
Definition:
mesh-information-element-vector.cc:165
ns3::MeshInformationElementVector::operator==
virtual bool operator==(const MeshInformationElementVector &a) const
Check if the given WifiInformationElementVectors are equivalent.
Definition:
mesh-information-element-vector.cc:223
ns3::MeshInformationElementVector::DeserializeSingleIe
uint32_t DeserializeSingleIe(Buffer::Iterator start)
Needed when you try to deserialize a lonely IE inside other header.
Definition:
mesh-information-element-vector.cc:112
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition:
wifi-information-element.h:45
src
mesh
model
mesh-information-element-vector.h
Generated on Tue May 28 2024 23:38:11 for ns-3 by
1.9.6