OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 IITP RAS | 3 * Copyright (c) 2009 IITP RAS |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 { | 113 { |
114 size += 2; //capability | 114 size += 2; //capability |
115 } | 115 } |
116 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype) | 116 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype) |
117 { | 117 { |
118 size += 2; //AID of remote peer | 118 size += 2; //AID of remote peer |
119 } | 119 } |
120 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) | 120 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) |
121 { | 121 { |
122 size += m_rates.GetSerializedSize (); | 122 size += m_rates.GetSerializedSize (); |
| 123 size += m_rates.extended.GetSerializedSize (); |
123 } | 124 } |
124 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype) | 125 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype) |
125 { | 126 { |
126 size += m_meshId.GetInformationFieldSize () + 2; | 127 size += m_meshId.GetInformationFieldSize () + 2; |
127 } | 128 } |
128 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) | 129 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) |
129 { | 130 { |
130 size += m_config.GetInformationFieldSize () + 2; | 131 size += m_config.GetInformationFieldSize () + 2; |
131 } | 132 } |
132 else | 133 else |
(...skipping 12 matching lines...) Expand all Loading... |
145 { | 146 { |
146 i.WriteHtolsbU16 (m_capability); | 147 i.WriteHtolsbU16 (m_capability); |
147 } | 148 } |
148 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype) | 149 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype) |
149 { | 150 { |
150 i.WriteHtolsbU16 (m_aid); | 151 i.WriteHtolsbU16 (m_aid); |
151 } | 152 } |
152 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) | 153 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) |
153 { | 154 { |
154 i = m_rates.Serialize (i); | 155 i = m_rates.Serialize (i); |
| 156 i = m_rates.extended.Serialize (i); |
155 } | 157 } |
156 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype) | 158 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype) |
157 { | 159 { |
158 i = m_meshId.Serialize (i); | 160 i = m_meshId.Serialize (i); |
159 } | 161 } |
160 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) | 162 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) |
161 { | 163 { |
162 i = m_config.Serialize (i); | 164 i = m_config.Serialize (i); |
163 } | 165 } |
164 else | 166 else |
(...skipping 20 matching lines...) Expand all Loading... |
185 { | 187 { |
186 m_capability = i.ReadLsbtohU16 (); | 188 m_capability = i.ReadLsbtohU16 (); |
187 } | 189 } |
188 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype) | 190 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype) |
189 { | 191 { |
190 m_aid = i.ReadLsbtohU16 (); | 192 m_aid = i.ReadLsbtohU16 (); |
191 } | 193 } |
192 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) | 194 if ((uint8_t) (WifiActionHeader::PEER_LINK_CLOSE) != m_subtype) |
193 { | 195 { |
194 i = m_rates.Deserialize (i); | 196 i = m_rates.Deserialize (i); |
| 197 i = m_rates.extended.DeserializeIfPresent (i); |
195 } | 198 } |
196 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype) | 199 if ((uint8_t) (WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype) |
197 { | 200 { |
198 uint8_t id = i.ReadU8 (); | 201 uint8_t id = i.ReadU8 (); |
199 uint8_t length = i.ReadU8 (); | 202 uint8_t length = i.ReadU8 (); |
200 m_meshId.DeserializeInformationField (i, length); | 203 m_meshId.DeserializeInformationField (i, length); |
201 if ((m_meshId.ElementId () != (WifiInformationElementId) id) || (m_meshId.
GetInformationFieldSize () != length)) | 204 if ((m_meshId.ElementId () != (WifiInformationElementId) id) || (m_meshId.
GetInformationFieldSize () != length)) |
202 { | 205 { |
203 NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!"); | 206 NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!"); |
204 } | 207 } |
(...skipping 19 matching lines...) Expand all Loading... |
224 bool | 227 bool |
225 operator== (const PeerLinkFrameStart & a, const PeerLinkFrameStart & b) | 228 operator== (const PeerLinkFrameStart & a, const PeerLinkFrameStart & b) |
226 { | 229 { |
227 return ((a.m_subtype == b.m_subtype) && (a.m_capability == b.m_capability) &&
(a.m_aid == b.m_aid) | 230 return ((a.m_subtype == b.m_subtype) && (a.m_capability == b.m_capability) &&
(a.m_aid == b.m_aid) |
228 && (a.m_meshId.IsEqual (b.m_meshId)) && (a.m_config == b.m_config) | 231 && (a.m_meshId.IsEqual (b.m_meshId)) && (a.m_config == b.m_config) |
229 && (a.m_reasonCode == b.m_reasonCode)); | 232 && (a.m_reasonCode == b.m_reasonCode)); |
230 } | 233 } |
231 } // namespace dot11s | 234 } // namespace dot11s |
232 } //namespace ns3 | 235 } //namespace ns3 |
233 | 236 |
OLD | NEW |