A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mesh
model
dot11s
ie-dot11s-metric-report.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008,2009 IITP RAS
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: Kirill Andreev <andreev@iitp.ru>
19
*/
20
21
#include "
ie-dot11s-metric-report.h
"
22
#include "ns3/assert.h"
23
24
namespace
ns3
{
25
namespace
dot11s {
26
IeLinkMetricReport::IeLinkMetricReport
() :
27
m_metric (0)
28
{
29
}
30
IeLinkMetricReport::IeLinkMetricReport
(uint32_t metric)
31
{
32
m_metric
= metric;
33
}
34
WifiInformationElementId
35
IeLinkMetricReport::ElementId
()
const
36
{
37
return
IE_MESH_LINK_METRIC_REPORT
;
38
}
39
uint8_t
40
IeLinkMetricReport::GetInformationFieldSize
(
void
)
const
41
{
42
return
sizeof
(uint32_t);
43
}
44
uint32_t
45
IeLinkMetricReport::GetMetric
()
46
{
47
return
m_metric
;
48
}
49
void
50
IeLinkMetricReport::SetMetric
(uint32_t metric)
51
{
52
m_metric
= metric;
53
}
54
void
55
IeLinkMetricReport::SerializeInformationField
(
Buffer::Iterator
i)
const
56
{
57
i.
WriteHtolsbU32
(
m_metric
);
58
}
59
uint8_t
60
IeLinkMetricReport::DeserializeInformationField
(
Buffer::Iterator
start
, uint8_t length)
61
{
62
Buffer::Iterator
i =
start
;
63
m_metric
= i.
ReadLsbtohU32
();
64
return
i.
GetDistanceFrom
(
start
);
65
}
66
void
67
IeLinkMetricReport::Print
(std::ostream& os)
const
68
{
69
os <<
"Metric="
<<
m_metric
;
70
}
71
bool
72
operator==
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
73
{
74
return
(a.
m_metric
== b.
m_metric
);
75
}
76
bool
77
operator<
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
78
{
79
return
(a.
m_metric
< b.
m_metric
);
80
}
81
bool
82
operator>
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
83
{
84
return
(a.
m_metric
> b.
m_metric
);
85
}
86
std::ostream &
87
operator <<
(std::ostream &os,
const
IeLinkMetricReport
&a)
88
{
89
a.
Print
(os);
90
return
os;
91
}
92
}
// namespace dot11s
93
}
// namespace ns3
ie-dot11s-metric-report.h
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::dot11s::IeLinkMetricReport::SetMetric
void SetMetric(uint32_t metric)
Set metric value.
Definition:
ie-dot11s-metric-report.cc:50
ns3::dot11s::operator==
bool operator==(const MeshHeader &a, const MeshHeader &b)
Definition:
dot11s-mac-header.cc:172
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::dot11s::IeLinkMetricReport::SerializeInformationField
virtual void SerializeInformationField(Buffer::Iterator i) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
Definition:
ie-dot11s-metric-report.cc:55
ns3::dot11s::IeLinkMetricReport::Print
virtual void Print(std::ostream &os) const
Generate human-readable form of IE.
Definition:
ie-dot11s-metric-report.cc:67
ns3::dot11s::operator>
bool operator>(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
Definition:
ie-dot11s-metric-report.cc:82
ns3::Buffer::Iterator::GetDistanceFrom
uint32_t GetDistanceFrom(Iterator const &o) const
Definition:
buffer.cc:783
ns3::dot11s::IeLinkMetricReport::GetMetric
uint32_t GetMetric()
Get metric value.
Definition:
ie-dot11s-metric-report.cc:45
ns3::dot11s::IeLinkMetricReport::m_metric
uint32_t m_metric
metric
Definition:
ie-dot11s-metric-report.h:63
ns3::dot11s::IeLinkMetricReport::ElementId
virtual WifiInformationElementId ElementId() const
Definition:
ie-dot11s-metric-report.cc:35
ns3::dot11s::operator<
bool operator<(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
Definition:
ie-dot11s-metric-report.cc:77
ns3::dot11s::IeLinkMetricReport::GetInformationFieldSize
virtual uint8_t GetInformationFieldSize() const
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:40
IE_MESH_LINK_METRIC_REPORT
#define IE_MESH_LINK_METRIC_REPORT
Definition:
wifi-information-element.h:149
ns3::dot11s::IeLinkMetricReport::IeLinkMetricReport
IeLinkMetricReport()
Definition:
ie-dot11s-metric-report.cc:26
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:34
ns3::dot11s::IeLinkMetricReport::DeserializeInformationField
virtual uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
Definition:
ie-dot11s-metric-report.cc:60
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition:
wifi-information-element.h:40
ns3::dot11s::operator<<
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Definition:
ie-dot11s-beacon-timing.cc:215
ns3::Buffer::Iterator::ReadLsbtohU32
uint32_t ReadLsbtohU32(void)
Definition:
buffer.cc:1076
ns3::Buffer::Iterator::WriteHtolsbU32
void WriteHtolsbU32(uint32_t data)
Definition:
buffer.cc:917
Generated on Wed Nov 7 2018 10:02:04 for ns-3 by
1.8.14