A Discrete-Event Network Simulator
API
dot11s-mac-header.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 IITP RAS
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Kirill Andreev <andreev@iitp.ru>
19  */
20 
21 
22 #ifndef MESH_WIFI_MAC_HEADER_H
23 #define MESH_WIFI_MAC_HEADER_H
24 
25 #include "ns3/header.h"
26 #include "ns3/mac48-address.h"
27 
28 namespace ns3 {
29 namespace dot11s {
37 class MeshHeader : public Header
38 {
39 public:
40  MeshHeader ();
41  ~MeshHeader ();
46  static TypeId GetTypeId ();
47  virtual TypeId GetInstanceTypeId () const;
48  virtual void Print (std::ostream &os) const;
49 
69  Mac48Address GetAddr4 () const;
74  Mac48Address GetAddr5 () const;
79  Mac48Address GetAddr6 () const;
80 
85  void SetMeshSeqno (uint32_t seqno);
90  uint32_t GetMeshSeqno () const;
91 
98  void SetMeshTtl (uint8_t TTL);
103  uint8_t GetMeshTtl () const;
104 
109  void SetAddressExt (uint8_t num_of_addresses);
114  uint8_t GetAddressExt () const;
115 
116  virtual uint32_t GetSerializedSize () const;
117  virtual void Serialize (Buffer::Iterator start) const;
118  virtual uint32_t Deserialize (Buffer::Iterator start);
119 private:
120  uint8_t m_meshFlags;
121  uint8_t m_meshTtl;
122  uint32_t m_meshSeqno;
133  friend bool operator== (const MeshHeader & a, const MeshHeader & b);
134 };
135 bool operator== (const MeshHeader & a, const MeshHeader & b);
136 
137 } // namespace dot11s
138 } // namespace ns3
139 #endif /* MESH_WIFI_MAC_HEADER_H */
iterator in a Buffer instance
Definition: buffer.h:99
Protocol header serialization and deserialization.
Definition: header.h:43
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
an EUI-48 address
Definition: mac48-address.h:44
a unique identifier for an interface.
Definition: type-id.h:59
Mesh Control field, see Section 8.2.4.7.3 IEEE 802.11-2012.
void SetAddr6(Mac48Address address)
Set extended address 6.
void SetMeshSeqno(uint32_t seqno)
Set four-byte mesh sequence number.
virtual TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
Mac48Address m_addr6
MAC address 6.
uint32_t GetMeshSeqno() const
Get the four-byte mesh sequence number.
void SetMeshTtl(uint8_t TTL)
Set mesh TTL subfield corresponding to the remaining number of hops the MSDU/MMPDU is forwarded.
Mac48Address m_addr4
MAC address 4.
static TypeId GetTypeId()
Get the type ID.
Mac48Address GetAddr5() const
Get extended address 5.
Mac48Address GetAddr4() const
Get extended address 4.
uint8_t m_meshFlags
mesh flags
Mac48Address GetAddr6() const
Get extended address 6.
uint8_t GetAddressExt() const
Get Address Extension Mode.
friend bool operator==(const MeshHeader &a, const MeshHeader &b)
equality operator
void SetAddressExt(uint8_t num_of_addresses)
Set Address Extension Mode.
virtual uint32_t GetSerializedSize() const
virtual void Serialize(Buffer::Iterator start) const
void SetAddr5(Mac48Address address)
Set extended address 5.
void SetAddr4(Mac48Address address)
Set extended address 4.
uint8_t GetMeshTtl() const
Get mesh TTL function subfield value.
Mac48Address m_addr5
MAC address 5.
virtual void Print(std::ostream &os) const
uint32_t m_meshSeqno
mesh sequence no
address
Definition: first.py:44
bool operator==(const MeshHeader &a, const MeshHeader &b)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1853