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
dot11s-mac-header.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
* Author: Kirill Andreev <andreev@iitp.ru>
7
*/
8
9
#ifndef MESH_WIFI_MAC_HEADER_H
10
#define MESH_WIFI_MAC_HEADER_H
11
12
#include "ns3/header.h"
13
#include "ns3/mac48-address.h"
14
15
namespace
ns3
16
{
17
namespace
dot11s
18
{
19
/**
20
* \ingroup dot11s
21
*
22
* \brief Mesh Control field, see Section 8.2.4.7.3 IEEE 802.11-2012
23
*
24
* Header format: | Mesh flags: 1 | TTL: 1 | Sequence number: 4 | Address ext.: 0, 6, or 12 |
25
*/
26
class
MeshHeader
:
public
Header
27
{
28
public
:
29
MeshHeader
();
30
~MeshHeader
()
override
;
31
/**
32
* \brief Get the type ID.
33
* \return the object TypeId
34
*/
35
static
TypeId
GetTypeId
();
36
TypeId
GetInstanceTypeId
()
const override
;
37
void
Print
(std::ostream& os)
const override
;
38
39
/**
40
* Set extended address 4
41
* \param address the MAC address to set
42
*/
43
void
SetAddr4
(
Mac48Address
address);
44
/**
45
* Set extended address 5
46
* \param address the MAC address
47
*/
48
void
SetAddr5
(
Mac48Address
address);
49
/**
50
* Set extended address 6
51
* \param address the MAC address
52
*/
53
void
SetAddr6
(
Mac48Address
address);
54
/**
55
* Get extended address 4
56
* \returns the MAC address
57
*/
58
Mac48Address
GetAddr4
()
const
;
59
/**
60
* Get extended address 5
61
* \returns the MAC address
62
*/
63
Mac48Address
GetAddr5
()
const
;
64
/**
65
* Get extended address 6
66
* \returns the MAC address
67
*/
68
Mac48Address
GetAddr6
()
const
;
69
70
/**
71
* Set four-byte mesh sequence number
72
* \param seqno the sequence number to set
73
*/
74
void
SetMeshSeqno
(
uint32_t
seqno);
75
/**
76
* Get the four-byte mesh sequence number
77
* \returns the sequence number
78
*/
79
uint32_t
GetMeshSeqno
()
const
;
80
81
/**
82
* Set mesh TTL subfield corresponding to the remaining number of hops
83
* the MSDU/MMPDU is forwarded.
84
*
85
* \param TTL the TTL value to set
86
*/
87
void
SetMeshTtl
(uint8_t TTL);
88
/**
89
* Get mesh TTL function subfield value
90
* \returns the TTL value
91
*/
92
uint8_t
GetMeshTtl
()
const
;
93
94
/**
95
* Set Address Extension Mode
96
* \param num_of_addresses value between 0 and 3 for the two-bit field
97
*/
98
void
SetAddressExt
(uint8_t num_of_addresses);
99
/**
100
* Get Address Extension Mode
101
* \returns the address extension mode value
102
*/
103
uint8_t
GetAddressExt
()
const
;
104
105
uint32_t
GetSerializedSize
()
const override
;
106
void
Serialize
(
Buffer::Iterator
start)
const override
;
107
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
108
109
private
:
110
uint8_t
m_meshFlags
;
///< mesh flags
111
uint8_t
m_meshTtl
;
///< mesh TTL
112
uint32_t
m_meshSeqno
;
///< mesh sequence no
113
Mac48Address
m_addr4
;
///< MAC address 4
114
Mac48Address
m_addr5
;
///< MAC address 5
115
Mac48Address
m_addr6
;
///< MAC address 6
116
/**
117
* equality operator
118
*
119
* \param a left hand side
120
* \param b right hand side
121
* \returns true if equal
122
*/
123
friend
bool
operator==
(
const
MeshHeader
& a,
const
MeshHeader
& b);
124
};
125
126
bool
operator==
(
const
MeshHeader
& a,
const
MeshHeader
& b);
127
128
}
// namespace dot11s
129
}
// namespace ns3
130
#endif
/* MESH_WIFI_MAC_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::dot11s::MeshHeader
Mesh Control field, see Section 8.2.4.7.3 IEEE 802.11-2012.
Definition
dot11s-mac-header.h:27
ns3::dot11s::MeshHeader::MeshHeader
MeshHeader()
Definition
dot11s-mac-header.cc:32
ns3::dot11s::MeshHeader::SetAddr6
void SetAddr6(Mac48Address address)
Set extended address 6.
Definition
dot11s-mac-header.cc:65
ns3::dot11s::MeshHeader::SetMeshSeqno
void SetMeshSeqno(uint32_t seqno)
Set four-byte mesh sequence number.
Definition
dot11s-mac-header.cc:89
ns3::dot11s::MeshHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
dot11s-mac-header.cc:132
ns3::dot11s::MeshHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
dot11s-mac-header.cc:47
ns3::dot11s::MeshHeader::m_addr6
Mac48Address m_addr6
MAC address 6.
Definition
dot11s-mac-header.h:115
ns3::dot11s::MeshHeader::GetMeshSeqno
uint32_t GetMeshSeqno() const
Get the four-byte mesh sequence number.
Definition
dot11s-mac-header.cc:95
ns3::dot11s::MeshHeader::~MeshHeader
~MeshHeader() override
Definition
dot11s-mac-header.cc:42
ns3::dot11s::MeshHeader::SetMeshTtl
void SetMeshTtl(uint8_t TTL)
Set mesh TTL subfield corresponding to the remaining number of hops the MSDU/MMPDU is forwarded.
Definition
dot11s-mac-header.cc:101
ns3::dot11s::MeshHeader::m_addr4
Mac48Address m_addr4
MAC address 4.
Definition
dot11s-mac-header.h:113
ns3::dot11s::MeshHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
dot11s-mac-header.cc:155
ns3::dot11s::MeshHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
dot11s-mac-header.cc:23
ns3::dot11s::MeshHeader::Print
void Print(std::ostream &os) const override
Definition
dot11s-mac-header.cc:179
ns3::dot11s::MeshHeader::GetAddr5
Mac48Address GetAddr5() const
Get extended address 5.
Definition
dot11s-mac-header.cc:77
ns3::dot11s::MeshHeader::GetAddr4
Mac48Address GetAddr4() const
Get extended address 4.
Definition
dot11s-mac-header.cc:71
ns3::dot11s::MeshHeader::m_meshFlags
uint8_t m_meshFlags
mesh flags
Definition
dot11s-mac-header.h:110
ns3::dot11s::MeshHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
dot11s-mac-header.cc:126
ns3::dot11s::MeshHeader::GetAddr6
Mac48Address GetAddr6() const
Get extended address 6.
Definition
dot11s-mac-header.cc:83
ns3::dot11s::MeshHeader::GetAddressExt
uint8_t GetAddressExt() const
Get Address Extension Mode.
Definition
dot11s-mac-header.cc:120
ns3::dot11s::MeshHeader::operator==
friend bool operator==(const MeshHeader &a, const MeshHeader &b)
equality operator
Definition
dot11s-mac-header.cc:187
ns3::dot11s::MeshHeader::SetAddressExt
void SetAddressExt(uint8_t num_of_addresses)
Set Address Extension Mode.
Definition
dot11s-mac-header.cc:113
ns3::dot11s::MeshHeader::SetAddr5
void SetAddr5(Mac48Address address)
Set extended address 5.
Definition
dot11s-mac-header.cc:59
ns3::dot11s::MeshHeader::SetAddr4
void SetAddr4(Mac48Address address)
Set extended address 4.
Definition
dot11s-mac-header.cc:53
ns3::dot11s::MeshHeader::m_meshTtl
uint8_t m_meshTtl
mesh TTL
Definition
dot11s-mac-header.h:111
ns3::dot11s::MeshHeader::GetMeshTtl
uint8_t GetMeshTtl() const
Get mesh TTL function subfield value.
Definition
dot11s-mac-header.cc:107
ns3::dot11s::MeshHeader::m_addr5
Mac48Address m_addr5
MAC address 5.
Definition
dot11s-mac-header.h:114
ns3::dot11s::MeshHeader::m_meshSeqno
uint32_t m_meshSeqno
mesh sequence no
Definition
dot11s-mac-header.h:112
uint32_t
ns3::dot11s::operator==
bool operator==(const MeshHeader &a, const MeshHeader &b)
Definition
dot11s-mac-header.cc:187
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mesh
model
dot11s
dot11s-mac-header.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0