A Discrete-Event Network Simulator
API
ie-dot11s-metric-report.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008,2009 IITP RAS
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Kirill Andreev <andreev@iitp.ru>
18  */
19 
21 
22 #include "ns3/assert.h"
23 
24 namespace ns3
25 {
26 namespace dot11s
27 {
29  : m_metric(0)
30 {
31 }
32 
34 {
35  m_metric = metric;
36 }
37 
40 {
42 }
43 
44 uint16_t
46 {
47  return sizeof(uint32_t);
48 }
49 
50 uint32_t
52 {
53  return m_metric;
54 }
55 
56 void
58 {
59  m_metric = metric;
60 }
61 
62 void
64 {
66 }
67 
68 uint16_t
70 {
72  m_metric = i.ReadLsbtohU32();
73  return i.GetDistanceFrom(start);
74 }
75 
76 void
77 IeLinkMetricReport::Print(std::ostream& os) const
78 {
79  os << "Metric=" << m_metric;
80 }
81 
82 bool
84 {
85  return (a.m_metric == b.m_metric);
86 }
87 
88 bool
90 {
91  return (a.m_metric < b.m_metric);
92 }
93 
94 bool
96 {
97  return (a.m_metric > b.m_metric);
98 }
99 
100 std::ostream&
101 operator<<(std::ostream& os, const IeLinkMetricReport& a)
102 {
103  a.Print(os);
104  return os;
105 }
106 } // namespace dot11s
107 } // namespace ns3
iterator in a Buffer instance
Definition: buffer.h:100
void WriteHtolsbU32(uint32_t data)
Definition: buffer.cc:910
uint32_t GetDistanceFrom(const Iterator &o) const
Definition: buffer.cc:780
uint32_t ReadLsbtohU32()
Definition: buffer.cc:1076
bool operator>(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
bool operator==(const MeshHeader &a, const MeshHeader &b)
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
#define IE_MESH_LINK_METRIC_REPORT