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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Kirill Andreev <andreev@iitp.ru>
7
* Pavel Boyko <boyko.iitp.ru>
8
*/
9
10
#ifndef MESH_INFORMATION_ELEMENT_VECTOR_H
11
#define MESH_INFORMATION_ELEMENT_VECTOR_H
12
13
#include "ns3/wifi-information-element.h"
14
15
namespace
ns3
16
{
17
18
#define IE11S_MESH_PEERING_PROTOCOL_VERSION \
19
((WifiInformationElementId)74)
// to be removed (Protocol ID should be part of the Mesh Peering
20
// Management IE)
21
22
/**
23
* \brief Information element vector
24
* \ingroup wifi
25
*
26
* Implements a vector of WifiInformationElements.
27
* Information elements typically come in groups, and the
28
* WifiInformationElementVector class provides a representation of a
29
* series of IEs, and the facility for serialisation to and
30
* deserialisation from the over-the-air format.
31
*/
32
class
MeshInformationElementVector
:
public
Header
33
{
34
public
:
35
MeshInformationElementVector
();
36
~MeshInformationElementVector
()
override
;
37
38
/**
39
* \brief Get the type ID.
40
* \return the object TypeId
41
*/
42
static
TypeId
GetTypeId
();
43
44
TypeId
GetInstanceTypeId
()
const override
;
45
uint32_t
GetSerializedSize
()
const override
;
46
void
Serialize
(
Buffer::Iterator
start)
const override
;
47
/**
48
* \attention This variant should not be used but is implemented due to
49
* backward compatibility reasons
50
*
51
* \param start buffer location to start deserializing from
52
* \return number of bytes deserialized
53
*/
54
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
55
/**
56
* Deserialize a number of WifiInformationElements
57
*
58
* The size of this Header should equal start.GetDistanceFrom (end).
59
*
60
* \param start starting buffer location
61
* \param end ending buffer location
62
* \return number of bytes deserialized
63
*/
64
uint32_t
Deserialize
(
Buffer::Iterator
start,
Buffer::Iterator
end)
override
;
65
void
Print
(std::ostream& os)
const override
;
66
67
/**
68
* \brief Needed when you try to deserialize a lonely IE inside other header
69
*
70
* \param start is the start of the buffer
71
*
72
* \return deserialized bytes
73
*/
74
uint32_t
DeserializeSingleIe
(
Buffer::Iterator
start);
75
76
/// As soon as this is a vector, we define an Iterator
77
typedef
std::vector<Ptr<WifiInformationElement>>::iterator
Iterator
;
78
/**
79
* Returns Begin of the vector
80
* \returns the begin of the vector
81
*/
82
Iterator
Begin
();
83
/**
84
* Returns End of the vector
85
* \returns the end of the vector
86
*/
87
Iterator
End
();
88
/**
89
* add an IE, if maxSize has exceeded, returns false
90
*
91
* \param element wifi information element to add
92
* \returns true is added
93
*/
94
bool
AddInformationElement
(
Ptr<WifiInformationElement>
element);
95
/**
96
* vector of pointers to information elements is the body of IeVector
97
*
98
* \param id the element id to find
99
* \returns the information element
100
*/
101
Ptr<WifiInformationElement>
FindFirst
(
WifiInformationElementId
id
)
const
;
102
103
/**
104
* Check if the given WifiInformationElementVectors are equivalent.
105
*
106
* \param a another WifiInformationElementVector
107
*
108
* \return true if the given WifiInformationElementVectors are equivalent,
109
* false otherwise
110
*/
111
virtual
bool
operator==
(
const
MeshInformationElementVector
& a)
const
;
112
113
protected
:
114
/**
115
* typedef for a vector of WifiInformationElements.
116
*/
117
typedef
std::vector<Ptr<WifiInformationElement>>
IE_VECTOR
;
118
/**
119
* Current number of bytes
120
* \returns the number of bytes
121
*/
122
uint32_t
GetSize
()
const
;
123
IE_VECTOR
m_elements
;
//!< Information element vector
124
uint16_t
m_maxSize
;
//!< Size in bytes (actually, max packet length)
125
};
126
127
}
// namespace ns3
128
129
#endif
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::MeshInformationElementVector
Information element vector.
Definition
mesh-information-element-vector.h:33
ns3::MeshInformationElementVector::End
Iterator End()
Returns End of the vector.
Definition
mesh-information-element-vector.cc:171
ns3::MeshInformationElementVector::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
mesh-information-element-vector.cc:78
ns3::MeshInformationElementVector::AddInformationElement
bool AddInformationElement(Ptr< WifiInformationElement > element)
add an IE, if maxSize has exceeded, returns false
Definition
mesh-information-element-vector.cc:177
ns3::MeshInformationElementVector::m_elements
IE_VECTOR m_elements
Information element vector.
Definition
mesh-information-element-vector.h:123
ns3::MeshInformationElementVector::MeshInformationElementVector
MeshInformationElementVector()
Definition
mesh-information-element-vector.cc:32
ns3::MeshInformationElementVector::~MeshInformationElementVector
~MeshInformationElementVector() override
Definition
mesh-information-element-vector.cc:37
ns3::MeshInformationElementVector::GetSize
uint32_t GetSize() const
Current number of bytes.
Definition
mesh-information-element-vector.cc:201
ns3::MeshInformationElementVector::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
mesh-information-element-vector.cc:57
ns3::MeshInformationElementVector::m_maxSize
uint16_t m_maxSize
Size in bytes (actually, max packet length)
Definition
mesh-information-element-vector.h:124
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:77
ns3::MeshInformationElementVector::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
mesh-information-element-vector.cc:63
ns3::MeshInformationElementVector::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
mesh-information-element-vector.cc:47
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:188
ns3::MeshInformationElementVector::IE_VECTOR
std::vector< Ptr< WifiInformationElement > > IE_VECTOR
typedef for a vector of WifiInformationElements.
Definition
mesh-information-element-vector.h:117
ns3::MeshInformationElementVector::Begin
Iterator Begin()
Returns Begin of the vector.
Definition
mesh-information-element-vector.cc:165
ns3::MeshInformationElementVector::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
mesh-information-element-vector.cc:69
ns3::MeshInformationElementVector::Print
void Print(std::ostream &os) const override
Definition
mesh-information-element-vector.cc:154
ns3::MeshInformationElementVector::operator==
virtual bool operator==(const MeshInformationElementVector &a) const
Check if the given WifiInformationElementVectors are equivalent.
Definition
mesh-information-element-vector.cc:212
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:101
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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:34
src
mesh
model
mesh-information-element-vector.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0