A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dot11s-mac-header.h
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 ();
42  static TypeId GetTypeId ();
43  virtual TypeId GetInstanceTypeId () const;
44  virtual void Print (std::ostream &os) const;
45 
46  void SetAddr4 (Mac48Address address);
47  void SetAddr5 (Mac48Address address);
48  void SetAddr6 (Mac48Address address);
49  Mac48Address GetAddr4 () const;
50  Mac48Address GetAddr5 () const;
51  Mac48Address GetAddr6 () const;
52 
53  void SetMeshSeqno (uint32_t seqno);
54  uint32_t GetMeshSeqno () const;
55 
56  void SetMeshTtl (uint8_t TTL);
57  uint8_t GetMeshTtl () const;
58 
59  void SetAddressExt (uint8_t num_of_addresses);
60  uint8_t GetAddressExt () const;
61 
62  virtual uint32_t GetSerializedSize () const;
63  virtual void Serialize (Buffer::Iterator start) const;
64  virtual uint32_t Deserialize (Buffer::Iterator start);
65 private:
66  uint8_t m_meshFlags;
67  uint8_t m_meshTtl;
68  uint32_t m_meshSeqno;
69  Mac48Address m_addr4;
70  Mac48Address m_addr5;
71  Mac48Address m_addr6;
72  friend bool operator== (const MeshHeader & a, const MeshHeader & b);
73 };
74 bool operator== (const MeshHeader & a, const MeshHeader & b);
75 
76 } // namespace dot11s
77 } // namespace ns3
78 #endif /* MESH_WIFI_MAC_HEADER_H */
Protocol header serialization and deserialization.
Definition: header.h:42
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual void Print(std::ostream &os) const
iterator in a Buffer instance
Definition: buffer.h:98
virtual void Serialize(Buffer::Iterator start) const
virtual TypeId GetInstanceTypeId() const
an EUI-48 address
Definition: mac48-address.h:41
virtual uint32_t GetSerializedSize() const
Mesh Control field, see IEEE 802.11s draft 3.0 section 7.1.3.5b.
a unique identifier for an interface.
Definition: type-id.h:44