A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
IE11S_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 << std::endl <<
"<information_element id="
<<
ElementId
() <<
">"
<< std::endl;
70
os <<
"Metric = "
<<
m_metric
;
71
os <<
"</information_element>"
<< std::endl;
72
}
73
bool
74
operator==
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
75
{
76
return
(a.
m_metric
== b.
m_metric
);
77
}
78
bool
79
operator<
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
80
{
81
return
(a.
m_metric
< b.
m_metric
);
82
}
83
bool
84
operator>
(
const
IeLinkMetricReport
& a,
const
IeLinkMetricReport
& b)
85
{
86
return
(a.
m_metric
> b.
m_metric
);
87
}
88
std::ostream &
89
operator <<
(std::ostream &os,
const
IeLinkMetricReport
&a)
90
{
91
a.
Print
(os);
92
return
os;
93
}
94
}
// namespace dot11s
95
}
// namespace ns3
ie-dot11s-metric-report.h
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
In addition, a subclass may optionally override the following...
Definition:
ie-dot11s-metric-report.cc:67
visualizer.core.start
def start
Definition:
core.py:1482
ns3::dot11s::IeLinkMetricReport::SetMetric
void SetMetric(uint32_t metric)
Definition:
ie-dot11s-metric-report.cc:50
ns3::dot11s::operator==
bool operator==(const MeshHeader &a, const MeshHeader &b)
Definition:
dot11s-mac-header.cc:171
ns3::Buffer::Iterator::GetDistanceFrom
uint32_t GetDistanceFrom(Iterator const &o) const
Definition:
buffer.cc:807
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
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
ns3::dot11s::operator>
bool operator>(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
Definition:
ie-dot11s-metric-report.cc:84
ns3::dot11s::IeLinkMetricReport::GetMetric
uint32_t GetMetric()
Definition:
ie-dot11s-metric-report.cc:45
ns3::dot11s::IeLinkMetricReport::m_metric
uint32_t m_metric
Definition:
ie-dot11s-metric-report.h:52
ns3::dot11s::operator<
bool operator<(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
Definition:
ie-dot11s-metric-report.cc:79
ns3::dot11s::IeLinkMetricReport::IeLinkMetricReport
IeLinkMetricReport()
Definition:
ie-dot11s-metric-report.cc:26
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
IE11S_LINK_METRIC_REPORT
#define IE11S_LINK_METRIC_REPORT
Definition:
mesh-information-element.h:28
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::dot11s::IeLinkMetricReport::ElementId
virtual WifiInformationElementId ElementId() const
Own unique Element ID.
Definition:
ie-dot11s-metric-report.cc:35
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition:
wifi-information-element.h:41
ns3::dot11s::operator<<
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Definition:
ie-dot11s-beacon-timing.cc:216
ns3::Buffer::Iterator::ReadLsbtohU32
uint32_t ReadLsbtohU32(void)
Definition:
buffer.cc:1101
ns3::Buffer::Iterator::WriteHtolsbU32
void WriteHtolsbU32(uint32_t data)
Definition:
buffer.cc:942
src
mesh
model
dot11s
ie-dot11s-metric-report.cc
Generated on Sat Apr 19 2014 14:07:03 for ns-3 by
1.8.6