OLD | NEW |
(Empty) | |
| 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 { |
| 30 /** |
| 31 * \ingroup dot11s |
| 32 * |
| 33 * \brief Mesh Control field, see IEEE 802.11s draft 3.0 section 7.1.3.5b |
| 34 * |
| 35 * Header format: | Mesh flags: 1 | TTL: 1 | Sequence number: 4 | Address ext.:
0, 6, 12 or 18 | |
| 36 */ |
| 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 /** |
| 77 * \ingroup dot11s |
| 78 * |
| 79 * \brief See IEEE 802.11s draft 3.0 section 7.2.3.14 |
| 80 * |
| 81 * Header format: | category: 1 | action value: 1 | |
| 82 */ |
| 83 class WifiMeshActionHeader : public Header |
| 84 { |
| 85 public: |
| 86 WifiMeshActionHeader (); |
| 87 ~WifiMeshActionHeader (); |
| 88 |
| 89 /* Compatible with open80211s implementation */ |
| 90 enum CategoryValue //table 7-24 staring from 4 |
| 91 { |
| 92 MESH_PEERING_MGT = 30, |
| 93 MESH_LINK_METRIC = 31, |
| 94 MESH_PATH_SELECTION = 32, |
| 95 MESH_INTERWORKING = 33, |
| 96 MESH_RESOURCE_COORDINATION = 34, |
| 97 MESH_PROXY_FORWARDING = 35, |
| 98 }; |
| 99 /* Compatible with open80211s implementation */ |
| 100 enum PeerLinkMgtActionValue |
| 101 { |
| 102 PEER_LINK_OPEN = 0, |
| 103 PEER_LINK_CONFIRM = 1, |
| 104 PEER_LINK_CLOSE = 2, |
| 105 }; |
| 106 enum LinkMetricActionValue |
| 107 { |
| 108 LINK_METRIC_REQUEST = 0, |
| 109 LINK_METRIC_REPORT, |
| 110 }; |
| 111 /* Compatible with open80211s implementation */ |
| 112 enum PathSelectionActionValue |
| 113 { |
| 114 PATH_SELECTION = 0, |
| 115 }; |
| 116 enum InterworkActionValue |
| 117 { |
| 118 PORTAL_ANNOUNCEMENT = 0, |
| 119 }; |
| 120 enum ResourceCoordinationActionValue |
| 121 { |
| 122 CONGESTION_CONTROL_NOTIFICATION = 0, |
| 123 MDA_SETUP_REQUEST, |
| 124 MDA_SETUP_REPLY, |
| 125 MDAOP_ADVERTISMENT_REQUEST, |
| 126 MDAOP_ADVERTISMENTS, |
| 127 MDAOP_SET_TEARDOWN, |
| 128 BEACON_TIMING_REQUEST, |
| 129 BEACON_TIMING_RESPONSE, |
| 130 TBTT_ADJUSTMENT_REQUEST, |
| 131 MESH_CHANNEL_SWITCH_ANNOUNCEMENT, |
| 132 }; |
| 133 typedef union |
| 134 { |
| 135 enum PeerLinkMgtActionValue peerLink; |
| 136 enum LinkMetricActionValue linkMetrtic; |
| 137 enum PathSelectionActionValue pathSelection; |
| 138 enum InterworkActionValue interwork; |
| 139 enum ResourceCoordinationActionValue resourceCoordination; |
| 140 } ActionValue; |
| 141 void SetAction (enum CategoryValue type,ActionValue action); |
| 142 |
| 143 CategoryValue GetCategory (); |
| 144 ActionValue GetAction (); |
| 145 static TypeId GetTypeId (); |
| 146 virtual TypeId GetInstanceTypeId () const; |
| 147 virtual void Print (std::ostream &os) const; |
| 148 virtual uint32_t GetSerializedSize () const; |
| 149 virtual void Serialize (Buffer::Iterator start) const; |
| 150 virtual uint32_t Deserialize (Buffer::Iterator start); |
| 151 private: |
| 152 uint8_t m_category; |
| 153 uint8_t m_actionValue; |
| 154 }; |
| 155 } //namespace dot11s |
| 156 } // namespace ns3 |
| 157 #endif /* MESH_WIFI_MAC_HEADER_H */ |
OLD | NEW |