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
ie-dot11s-metric-report.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008,2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Kirill Andreev <andreev@iitp.ru>
7
*/
8
9
#include "
ie-dot11s-metric-report.h
"
10
11
#include "ns3/assert.h"
12
13
namespace
ns3
14
{
15
namespace
dot11s
16
{
17
IeLinkMetricReport::IeLinkMetricReport
()
18
: m_metric(0)
19
{
20
}
21
22
IeLinkMetricReport::IeLinkMetricReport
(
uint32_t
metric)
23
{
24
m_metric
= metric;
25
}
26
27
WifiInformationElementId
28
IeLinkMetricReport::ElementId
()
const
29
{
30
return
IE_MESH_LINK_METRIC_REPORT
;
31
}
32
33
uint16_t
34
IeLinkMetricReport::GetInformationFieldSize
()
const
35
{
36
return
sizeof
(
uint32_t
);
37
}
38
39
uint32_t
40
IeLinkMetricReport::GetMetric
()
const
41
{
42
return
m_metric
;
43
}
44
45
void
46
IeLinkMetricReport::SetMetric
(
uint32_t
metric)
47
{
48
m_metric
= metric;
49
}
50
51
void
52
IeLinkMetricReport::SerializeInformationField
(
Buffer::Iterator
i)
const
53
{
54
i.
WriteHtolsbU32
(
m_metric
);
55
}
56
57
uint16_t
58
IeLinkMetricReport::DeserializeInformationField
(
Buffer::Iterator
start, uint16_t length)
59
{
60
Buffer::Iterator
i = start;
61
m_metric
= i.
ReadLsbtohU32
();
62
return
i.
GetDistanceFrom
(start);
63
}
64
65
void
66
IeLinkMetricReport::Print
(std::ostream& os)
const
67
{
68
os <<
"Metric="
<<
m_metric
;
69
}
70
71
bool
72
operator==
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
73
{
74
return
(a.
m_metric
== b.
m_metric
);
75
}
76
77
bool
78
operator<
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
79
{
80
return
(a.
m_metric
< b.
m_metric
);
81
}
82
83
bool
84
operator>
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
85
{
86
return
(a.
m_metric
> b.
m_metric
);
87
}
88
89
std::ostream&
90
operator<<
(std::ostream& os,
const
IeLinkMetricReport
& a)
91
{
92
a.
Print
(os);
93
return
os;
94
}
95
}
// namespace dot11s
96
}
// namespace ns3
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Buffer::Iterator::WriteHtolsbU32
void WriteHtolsbU32(uint32_t data)
Definition
buffer.cc:899
ns3::Buffer::Iterator::GetDistanceFrom
uint32_t GetDistanceFrom(const Iterator &o) const
Definition
buffer.cc:769
ns3::Buffer::Iterator::ReadLsbtohU32
uint32_t ReadLsbtohU32()
Definition
buffer.cc:1065
ns3::dot11s::IeLinkMetricReport
a IEEE 802.11s Mesh ID 7.3.2.88 of 802.11s draft 3.0
Definition
ie-dot11s-metric-report.h:26
ns3::dot11s::IeLinkMetricReport::operator<
friend bool operator<(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
less than operator
Definition
ie-dot11s-metric-report.cc:78
ns3::dot11s::IeLinkMetricReport::m_metric
uint32_t m_metric
metric
Definition
ie-dot11s-metric-report.h:54
ns3::dot11s::IeLinkMetricReport::ElementId
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
Definition
ie-dot11s-metric-report.cc:28
ns3::dot11s::IeLinkMetricReport::Print
void Print(std::ostream &os) const override
Generate human-readable form of IE.
Definition
ie-dot11s-metric-report.cc:66
ns3::dot11s::IeLinkMetricReport::GetMetric
uint32_t GetMetric() const
Get metric value.
Definition
ie-dot11s-metric-report.cc:40
ns3::dot11s::IeLinkMetricReport::GetInformationFieldSize
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition
ie-dot11s-metric-report.cc:34
ns3::dot11s::IeLinkMetricReport::SetMetric
void SetMetric(uint32_t metric)
Set metric value.
Definition
ie-dot11s-metric-report.cc:46
ns3::dot11s::IeLinkMetricReport::IeLinkMetricReport
IeLinkMetricReport()
Definition
ie-dot11s-metric-report.cc:17
ns3::dot11s::IeLinkMetricReport::SerializeInformationField
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition
ie-dot11s-metric-report.cc:52
ns3::dot11s::IeLinkMetricReport::DeserializeInformationField
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition
ie-dot11s-metric-report.cc:58
uint32_t
ie-dot11s-metric-report.h
ns3::dot11s::operator>
bool operator>(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
Definition
ie-dot11s-metric-report.cc:84
ns3::dot11s::operator==
bool operator==(const MeshHeader &a, const MeshHeader &b)
Definition
dot11s-mac-header.cc:187
ns3::dot11s::operator<<
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Definition
ie-dot11s-beacon-timing.cc:231
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
IE_MESH_LINK_METRIC_REPORT
#define IE_MESH_LINK_METRIC_REPORT
Definition
wifi-information-element.h:142
src
mesh
model
dot11s
ie-dot11s-metric-report.cc
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0