A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-prep.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 WIFI_PREP_INFORMATION_ELEMENT_H
21#define WIFI_PREP_INFORMATION_ELEMENT_H
22
23#include "ns3/mac48-address.h"
24#include "ns3/mesh-information-element-vector.h"
25
26namespace ns3
27{
28namespace dot11s
29{
30/**
31 * \ingroup dot11s
32 * \brief See 7.3.2.97 of 802.11s draft 2.07
33 */
35{
36 public:
37 IePrep();
38 ~IePrep() override;
39 /**
40 * Set flags function
41 * \param flags the flags to set
42 */
43 void SetFlags(uint8_t flags);
44 /**
45 * Set hop count function
46 * \param hopcount the hop count
47 */
48 void SetHopcount(uint8_t hopcount);
49 /**
50 * Set TTL function
51 * \param ttl the TTL
52 */
53 void SetTtl(uint8_t ttl);
54 /**
55 * Set destination address function
56 * \param dest_address
57 */
58 void SetDestinationAddress(Mac48Address dest_address);
59 /**
60 * Set destination sequence number function
61 * \param dest_seq_number the destination sequence number
62 */
63 void SetDestinationSeqNumber(uint32_t dest_seq_number);
64 /**
65 * Set lifetime function
66 * \param lifetime the lifetime
67 */
68 void SetLifetime(uint32_t lifetime);
69 /**
70 * Set metric function
71 * \param metric the metric to set
72 */
73 void SetMetric(uint32_t metric);
74 /**
75 * Set originator address function
76 * \param originator_address the originator address
77 */
78 void SetOriginatorAddress(Mac48Address originator_address);
79 /**
80 * Set originator sequence number function
81 * \param originator_seq_number the originator sequence number
82 */
83 void SetOriginatorSeqNumber(uint32_t originator_seq_number);
84
85 /**
86 * Get flags function
87 * \returns the flags
88 */
89 uint8_t GetFlags() const;
90 /**
91 * Get hop count function
92 * \returns the hop count
93 */
94 uint8_t GetHopcount() const;
95 /**
96 * Get TTL function
97 * \returns the TTL
98 */
99 uint32_t GetTtl() const;
100 /**
101 * Get destination address function
102 * \returns the destination MAC address
103 */
105 /**
106 * Get destination sequence number function
107 * \returns the destination sequence number
108 */
110 /**
111 * Get lifetime function
112 * \returns the lifetime
113 */
114 uint32_t GetLifetime() const;
115 /**
116 * Get metric function
117 * \returns the metric
118 */
119 uint32_t GetMetric() const;
120 /**
121 * Get originator address function
122 * \returns the MAC address of the originator
123 */
125 /**
126 * Get originator sequence number
127 * \returns the originator sequence number
128 */
130
131 /// Decrement TTL function
132 void DecrementTtl();
133 /**
134 * Increment metric function
135 * \param metric the metric to increment
136 */
137 void IncrementMetric(uint32_t metric);
138
139 // Inherited from WifiInformationElement
140 WifiInformationElementId ElementId() const override;
141 void SerializeInformationField(Buffer::Iterator i) const override;
142 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
143 uint16_t GetInformationFieldSize() const override;
144 void Print(std::ostream& os) const override;
145
146 private:
147 uint8_t m_flags; ///< flags
148 uint8_t m_hopcount; ///< hop count
149 uint8_t m_ttl; ///< TTL
150 Mac48Address m_destinationAddress; ///< destination address
151 uint32_t m_destSeqNumber; ///< destination sequence number
152 uint32_t m_lifetime; ///< lifetime
153 uint32_t m_metric; ///< metric
154 Mac48Address m_originatorAddress; ///< originator address
155 uint32_t m_originatorSeqNumber; ///< originator sequence number
156 /**
157 * equality operator
158 *
159 * \param a lhs
160 * \param b rhs
161 * \returns true if equal
162 */
163 friend bool operator==(const IePrep& a, const IePrep& b);
164};
165
166bool operator==(const IePrep& a, const IePrep& b);
167std::ostream& operator<<(std::ostream& os, const IePrep& prep);
168} // namespace dot11s
169} // namespace ns3
170#endif
iterator in a Buffer instance
Definition: buffer.h:100
an EUI-48 address
Definition: mac48-address.h:46
Information element, as defined in 802.11-2007 standard.
See 7.3.2.97 of 802.11s draft 2.07.
uint32_t GetMetric() const
Get metric function.
uint8_t m_flags
flags
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetTtl(uint8_t ttl)
Set TTL function.
uint32_t m_lifetime
lifetime
void SetDestinationSeqNumber(uint32_t dest_seq_number)
Set destination sequence number function.
uint32_t m_destSeqNumber
destination sequence number
uint8_t GetFlags() const
Get flags function.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Mac48Address GetDestinationAddress() const
Get destination address function.
void SetFlags(uint8_t flags)
Set flags function.
void SetHopcount(uint8_t hopcount)
Set hop count function.
uint8_t m_hopcount
hop count
uint32_t m_originatorSeqNumber
originator sequence number
void IncrementMetric(uint32_t metric)
Increment metric function.
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)
uint32_t GetLifetime() const
Get lifetime function.
uint32_t GetOriginatorSeqNumber() const
Get originator sequence number.
friend bool operator==(const IePrep &a, const IePrep &b)
equality operator
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address function.
void SetMetric(uint32_t metric)
Set metric function.
void SetDestinationAddress(Mac48Address dest_address)
Set destination address function.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint32_t m_metric
metric
void SetLifetime(uint32_t lifetime)
Set lifetime function.
Mac48Address GetOriginatorAddress() const
Get originator address function.
uint32_t GetTtl() const
Get TTL function.
void DecrementTtl()
Decrement TTL function.
void SetOriginatorSeqNumber(uint32_t originator_seq_number)
Set originator sequence number function.
Mac48Address m_originatorAddress
originator address
uint32_t GetDestinationSeqNumber() const
Get destination sequence number function.
Mac48Address m_destinationAddress
destination address
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint8_t GetHopcount() const
Get hop count function.
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.