A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-metric-report.h
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
20#ifndef METRIC_REPORT_H
21#define METRIC_REPORT_H
22
23#include "ns3/buffer.h"
24#include "ns3/mesh-information-element-vector.h"
25
26#include <stdint.h>
27
28namespace ns3
29{
30namespace dot11s
31{
32/**
33 * \brief a IEEE 802.11s Mesh ID 7.3.2.88 of 802.11s draft 3.0
34 *
35 */
37{
38 public:
40 /**
41 * Constructor
42 *
43 * \param metric the metric
44 */
46 /**
47 * Set metric value
48 * \param metric the metric
49 */
50 void SetMetric(uint32_t metric);
51 /**
52 * Get metric value
53 * \returns the metric
54 */
55 uint32_t GetMetric() const;
56
57 // Inherited from WifiInformationElement
58 WifiInformationElementId ElementId() const override;
59 void SerializeInformationField(Buffer::Iterator i) const override;
60 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
61 void Print(std::ostream& os) const override;
62 uint16_t GetInformationFieldSize() const override;
63
64 private:
65 uint32_t m_metric; ///< metric
66 /**
67 * equality operator
68 *
69 * \param a lhs
70 * \param b lhs
71 * \returns true if equal
72 */
73 friend bool operator==(const IeLinkMetricReport& a, const IeLinkMetricReport& b);
74 /**
75 * greater than operator
76 *
77 * \param a lhs
78 * \param b lhs
79 * \returns true if equal
80 */
81 friend bool operator>(const IeLinkMetricReport& a, const IeLinkMetricReport& b);
82 /**
83 * less than operator
84 *
85 * \param a lhs
86 * \param b lhs
87 * \returns true if equal
88 */
89 friend bool operator<(const IeLinkMetricReport& a, const IeLinkMetricReport& b);
90};
91
92bool operator==(const IeLinkMetricReport& a, const IeLinkMetricReport& b);
93bool operator>(const IeLinkMetricReport& a, const IeLinkMetricReport& b);
94bool operator<(const IeLinkMetricReport& a, const IeLinkMetricReport& b);
95std::ostream& operator<<(std::ostream& os, const IeLinkMetricReport& linkMetricReport);
96} // namespace dot11s
97} // namespace ns3
98#endif /* METRIC_REPORT_H */
iterator in a Buffer instance
Definition: buffer.h:100
Information element, as defined in 802.11-2007 standard.
bool operator>(const IeLinkMetricReport &a, const IeLinkMetricReport &b)
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.