A Discrete-Event Network Simulator
API
hwmp-tag.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  * Authors: Kirill Andreev <andreev@iitp.ru>
18  * Aleksey Kovalenko <kovalenko@iitp.ru>
19  * Pavel Boyko <boyko@iitp.ru>
20  */
21 
22 #ifndef HWMP_TAG_H
23 #define HWMP_TAG_H
24 
25 #include "ns3/mac48-address.h"
26 #include "ns3/object.h"
27 #include "ns3/tag.h"
28 
29 namespace ns3
30 {
31 namespace dot11s
32 {
50 class HwmpTag : public Tag
51 {
52  public:
53  HwmpTag();
54  ~HwmpTag() override;
59  void SetAddress(Mac48Address retransmitter);
69  void SetTtl(uint8_t ttl);
74  uint8_t GetTtl() const;
79  void SetMetric(uint32_t metric);
84  uint32_t GetMetric() const;
89  void SetSeqno(uint32_t seqno);
94  uint32_t GetSeqno() const;
96  void DecrementTtl();
97 
102  static TypeId GetTypeId();
103  TypeId GetInstanceTypeId() const override;
104  uint32_t GetSerializedSize() const override;
105  void Serialize(TagBuffer i) const override;
106  void Deserialize(TagBuffer i) override;
107  void Print(std::ostream& os) const override;
108 
109  private:
111  uint8_t m_ttl;
112  uint32_t m_metric;
113  uint32_t m_seqno;
114 };
115 } // namespace dot11s
116 } // namespace ns3
117 #endif
an EUI-48 address
Definition: mac48-address.h:46
read and write tag data
Definition: tag-buffer.h:52
tag a set of bytes in a packet
Definition: tag.h:39
a unique identifier for an interface.
Definition: type-id.h:59
Hwmp tag implements interaction between HWMP protocol and MeshWifiMac.
Definition: hwmp-tag.h:51
void SetTtl(uint8_t ttl)
Set the TTL value.
Definition: hwmp-tag.cc:55
uint32_t GetSeqno() const
Get the sequence number.
Definition: hwmp-tag.cc:85
void SetMetric(uint32_t metric)
Set the metric value.
Definition: hwmp-tag.cc:67
void SetSeqno(uint32_t seqno)
Set sequence number.
Definition: hwmp-tag.cc:79
uint8_t GetTtl() const
Get the TTL value.
Definition: hwmp-tag.cc:61
Mac48Address GetAddress()
Get address from tag.
Definition: hwmp-tag.cc:49
~HwmpTag() override
Definition: hwmp-tag.cc:38
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: hwmp-tag.cc:105
static TypeId GetTypeId()
Get the type ID.
Definition: hwmp-tag.cc:95
void Serialize(TagBuffer i) const override
Definition: hwmp-tag.cc:120
Mac48Address m_address
address
Definition: hwmp-tag.h:110
uint8_t m_ttl
TTL.
Definition: hwmp-tag.h:111
void Deserialize(TagBuffer i) override
Definition: hwmp-tag.cc:135
uint32_t m_metric
metric
Definition: hwmp-tag.h:112
uint32_t GetSerializedSize() const override
Definition: hwmp-tag.cc:111
void Print(std::ostream &os) const override
Definition: hwmp-tag.cc:150
void SetAddress(Mac48Address retransmitter)
Set address.
Definition: hwmp-tag.cc:43
uint32_t m_seqno
sequence no
Definition: hwmp-tag.h:113
uint32_t GetMetric() const
Get the metric value.
Definition: hwmp-tag.cc:73
void DecrementTtl()
Decrement TTL.
Definition: hwmp-tag.cc:159
Every class exported by the ns3 library is enclosed in the ns3 namespace.