A Discrete-Event Network Simulator
API
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 
26 namespace ns3
27 {
28 namespace dot11s
29 {
35 {
36  public:
37  IePrep();
38  ~IePrep() override;
43  void SetFlags(uint8_t flags);
48  void SetHopcount(uint8_t hopcount);
53  void SetTtl(uint8_t ttl);
58  void SetDestinationAddress(Mac48Address dest_address);
63  void SetDestinationSeqNumber(uint32_t dest_seq_number);
68  void SetLifetime(uint32_t lifetime);
73  void SetMetric(uint32_t metric);
78  void SetOriginatorAddress(Mac48Address originator_address);
83  void SetOriginatorSeqNumber(uint32_t originator_seq_number);
84 
89  uint8_t GetFlags() const;
94  uint8_t GetHopcount() const;
99  uint32_t GetTtl() const;
109  uint32_t GetDestinationSeqNumber() const;
114  uint32_t GetLifetime() const;
119  uint32_t GetMetric() const;
129  uint32_t GetOriginatorSeqNumber() const;
130 
132  void DecrementTtl();
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;
148  uint8_t m_hopcount;
149  uint8_t m_ttl;
151  uint32_t m_destSeqNumber;
152  uint32_t m_lifetime;
153  uint32_t m_metric;
163  friend bool operator==(const IePrep& a, const IePrep& b);
164 };
165 
166 bool operator==(const IePrep& a, const IePrep& b);
167 std::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.