View | Details | Raw Unified | Return to bug 881
Collapse All | Expand All

(-)a/src/wifi/model/ap-wifi-mac.cc (-11 / +18 lines)
 Lines 323-339    Link Here 
323
  
323
  
324
  return rates;
324
  return rates;
325
}
325
}
326
HtCapabilities
326
Ptr<HtCapabilities>
327
ApWifiMac::GetHtCapabilities (void) const
327
ApWifiMac::GetHtCapabilities (void) const
328
{
328
{
329
 HtCapabilities capabilities;
329
 Ptr<HtCapabilities> capabilities;
330
 capabilities.SetHtSupported(1);
330
 capabilities->SetHtSupported(1);
331
 capabilities.SetLdpc (m_phy->GetLdpc());
331
 capabilities->SetLdpc (m_phy->GetLdpc());
332
 capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval());
332
 capabilities->SetShortGuardInterval20 (m_phy->GetGuardInterval());
333
 capabilities.SetGreenfield (m_phy->GetGreenfield());
333
 capabilities->SetGreenfield (m_phy->GetGreenfield());
334
 for (uint8_t i =0 ; i < m_phy->GetNMcs();i++)
334
 for (uint8_t i =0 ; i < m_phy->GetNMcs();i++)
335
  {
335
  {
336
     capabilities.SetRxMcsBitmask(m_phy->GetMcs(i));
336
     capabilities->SetRxMcsBitmask(m_phy->GetMcs(i));
337
  }
337
  }
338
 return capabilities;
338
 return capabilities;
339
}
339
}
 Lines 553-558    Link Here 
553
              // first, verify that the the station's supported
553
              // first, verify that the the station's supported
554
              // rate set is compatible with our Basic Rate set
554
              // rate set is compatible with our Basic Rate set
555
              MgtAssocRequestHeader assocReq;
555
              MgtAssocRequestHeader assocReq;
556
              WifiInformationElementVector elements;
556
              packet->RemoveHeader (assocReq);
557
              packet->RemoveHeader (assocReq);
557
              SupportedRates rates = assocReq.GetSupportedRates ();
558
              SupportedRates rates = assocReq.GetSupportedRates ();
558
              bool problem = false;
559
              bool problem = false;
 Lines 567-577    Link Here 
567
                }
568
                }
568
               if (m_htSupported)
569
               if (m_htSupported)
569
                    {//check that the STA supports all MCSs in Basic MCS Set
570
                    {//check that the STA supports all MCSs in Basic MCS Set
570
                      HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
571
                      packet->RemoveHeader (elements);
572
                      Ptr<WifiInformationElement> wifiIe = elements.FindFirst (IE_HT_CAPABILITIES);
573
                      Ptr<HtCapabilities> htcapabilities = DynamicCast<HtCapabilities> (wifiIe);
574
                     // Ptr<HtCapabilities> htcapabilities = assocReq.GetHtCapabilities ();
571
                      for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
575
                      for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
572
                        {
576
                        {
573
                          uint8_t mcs = m_stationManager->GetBasicMcs (i);
577
                          uint8_t mcs = m_stationManager->GetBasicMcs (i);
574
                          if (!htcapabilities.IsSupportedMcs (mcs))
578
                          if (!htcapabilities->IsSupportedMcs (mcs))
575
                            {
579
                            {
576
                              problem = true;
580
                              problem = true;
577
                              break;
581
                              break;
 Lines 600-611    Link Here 
600
                    }
604
                    }
601
                   if (m_htSupported)
605
                   if (m_htSupported)
602
                    {
606
                    {
603
                      HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
607
                      packet->RemoveHeader (elements);
608
                      Ptr<WifiInformationElement> wifiIe = elements.FindFirst (IE_HT_CAPABILITIES);
609
                      Ptr<HtCapabilities> htcapabilities = DynamicCast<HtCapabilities> (wifiIe);
610
                      //Ptr<HtCapabilities> htcapabilities = assocReq.GetHtCapabilities ();
604
                      m_stationManager->AddStationHtCapabilities (from,htcapabilities);
611
                      m_stationManager->AddStationHtCapabilities (from,htcapabilities);
605
                      for (uint32_t j = 0; j < m_phy->GetNMcs (); j++)
612
                      for (uint32_t j = 0; j < m_phy->GetNMcs (); j++)
606
                       {
613
                       {
607
                         uint8_t mcs = m_phy->GetMcs (j);
614
                         uint8_t mcs = m_phy->GetMcs (j);
608
                         if (htcapabilities.IsSupportedMcs (mcs))
615
                         if (htcapabilities->IsSupportedMcs (mcs))
609
                           {
616
                           {
610
                             m_stationManager->AddSupportedMcs (from, mcs);
617
                             m_stationManager->AddSupportedMcs (from, mcs);
611
                           }
618
                           }
(-)a/src/wifi/model/ap-wifi-mac.h (-1 / +1 lines)
 Lines 181-187    Link Here 
181
   * 
181
   * 
182
   * \return the HT capability that we support
182
   * \return the HT capability that we support
183
   */
183
   */
184
  HtCapabilities GetHtCapabilities (void) const;
184
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
185
  /**
185
  /**
186
   * Return an instance of SupportedRates that contains all rates that we support
186
   * Return an instance of SupportedRates that contains all rates that we support
187
   * including HT rates.
187
   * including HT rates.
(-)a/src/wifi/model/mgt-headers.cc (-36 / +82 lines)
 Lines 20-25    Link Here 
20
 * Author: Mirko Banchi <mk.banchi@gmail.com>
20
 * Author: Mirko Banchi <mk.banchi@gmail.com>
21
 */
21
 */
22
#include "mgt-headers.h"
22
#include "mgt-headers.h"
23
#include "wifi-information-element-vector.h"
23
#include "ns3/simulator.h"
24
#include "ns3/simulator.h"
24
#include "ns3/assert.h"
25
#include "ns3/assert.h"
25
26
 Lines 36-41    Link Here 
36
}
37
}
37
38
38
void
39
void
40
MgtProbeRequestHeader::AddInformationElement (Ptr<WifiInformationElement> ie)
41
{
42
  m_elements.AddInformationElement (ie);
43
}
44
45
void
39
MgtProbeRequestHeader::SetSsid (Ssid ssid)
46
MgtProbeRequestHeader::SetSsid (Ssid ssid)
40
{
47
{
41
  m_ssid = ssid;
48
  m_ssid = ssid;
 Lines 51-65    Link Here 
51
  m_rates = rates;
58
  m_rates = rates;
52
}
59
}
53
void 
60
void 
54
MgtProbeRequestHeader::SetHtCapabilities(HtCapabilities htcapabilities)
61
MgtProbeRequestHeader::SetHtCapabilities(Ptr<HtCapabilities> htcapabilities)
55
{
62
{
56
  m_htCapability=htcapabilities;
63
  //m_htCapability = htcapabilities;
64
  m_elements.AddInformationElement (htcapabilities);
57
}
65
}
58
66
59
HtCapabilities 
67
Ptr<HtCapabilities> 
60
MgtProbeRequestHeader::GetHtCapabilities (void) const
68
MgtProbeRequestHeader::GetHtCapabilities (void) const
61
{
69
{
62
   return  m_htCapability;
70
   //return  m_htCapability;
71
   Ptr<WifiInformationElement> wifiIe = m_elements.FindFirst (IE_HT_CAPABILITIES);
72
   Ptr<HtCapabilities> ht = DynamicCast<HtCapabilities> (wifiIe);
73
   return ht;
63
}
74
}
64
SupportedRates
75
SupportedRates
65
MgtProbeRequestHeader::GetSupportedRates (void) const
76
MgtProbeRequestHeader::GetSupportedRates (void) const
 Lines 73-79    Link Here 
73
  size += m_ssid.GetSerializedSize ();
84
  size += m_ssid.GetSerializedSize ();
74
  size += m_rates.GetSerializedSize ();
85
  size += m_rates.GetSerializedSize ();
75
  size += m_rates.extended.GetSerializedSize ();
86
  size += m_rates.extended.GetSerializedSize ();
76
  size += m_htCapability.GetSerializedSize();
87
  //size += m_htCapability.GetSerializedSize();
77
  return size;
88
  return size;
78
}
89
}
79
TypeId
90
TypeId
 Lines 94-101    Link Here 
94
MgtProbeRequestHeader::Print (std::ostream &os) const
105
MgtProbeRequestHeader::Print (std::ostream &os) const
95
{
106
{
96
  os << "ssid=" << m_ssid << ", "
107
  os << "ssid=" << m_ssid << ", "
97
     << "rates=" << m_rates << ", "
108
//     << "rates=" << m_rates << ", "
98
     << "HT Capabilities=" << m_htCapability;
109
//     << "HT Capabilities=" << m_htCapability;
110
     << "rates=" << m_rates;
99
}
111
}
100
void
112
void
101
MgtProbeRequestHeader::Serialize (Buffer::Iterator start) const
113
MgtProbeRequestHeader::Serialize (Buffer::Iterator start) const
 Lines 104-110    Link Here 
104
  i = m_ssid.Serialize (i);
116
  i = m_ssid.Serialize (i);
105
  i = m_rates.Serialize (i);
117
  i = m_rates.Serialize (i);
106
  i = m_rates.extended.Serialize (i);
118
  i = m_rates.extended.Serialize (i);
107
   i = m_htCapability.Serialize(i);
119
//   i = m_htCapability.Serialize(i);
108
}
120
}
109
uint32_t
121
uint32_t
110
MgtProbeRequestHeader::Deserialize (Buffer::Iterator start)
122
MgtProbeRequestHeader::Deserialize (Buffer::Iterator start)
 Lines 113-119    Link Here 
113
  i = m_ssid.Deserialize (i);
125
  i = m_ssid.Deserialize (i);
114
  i = m_rates.Deserialize (i);
126
  i = m_rates.Deserialize (i);
115
  i = m_rates.extended.DeserializeIfPresent (i);
127
  i = m_rates.extended.DeserializeIfPresent (i);
116
  i = m_htCapability.DeserializeIfPresent (i);
128
//  i = m_htCapability.DeserializeIfPresent (i);
117
  return i.GetDistanceFrom (start);
129
  return i.GetDistanceFrom (start);
118
}
130
}
119
131
 Lines 130-135    Link Here 
130
MgtProbeResponseHeader::~MgtProbeResponseHeader ()
142
MgtProbeResponseHeader::~MgtProbeResponseHeader ()
131
{
143
{
132
}
144
}
145
146
void
147
MgtProbeResponseHeader::AddInformationElement (Ptr<WifiInformationElement> ie)
148
{
149
  m_elements.AddInformationElement (ie);
150
}
151
133
uint64_t
152
uint64_t
134
MgtProbeResponseHeader::GetTimestamp ()
153
MgtProbeResponseHeader::GetTimestamp ()
135
{
154
{
 Lines 151-165    Link Here 
151
  return m_rates;
170
  return m_rates;
152
}
171
}
153
void 
172
void 
154
MgtProbeResponseHeader::SetHtCapabilities(HtCapabilities htcapabilities)
173
MgtProbeResponseHeader::SetHtCapabilities(Ptr<HtCapabilities> htcapabilities)
155
{
174
{
156
  m_htCapability=htcapabilities;
175
  //m_htCapability = htcapabilities;
176
  m_elements.AddInformationElement (htcapabilities);
157
}
177
}
158
178
159
HtCapabilities 
179
Ptr<HtCapabilities>
160
MgtProbeResponseHeader::GetHtCapabilities (void) const
180
MgtProbeResponseHeader::GetHtCapabilities (void) const
161
{
181
{
162
   return  m_htCapability;
182
   //return  m_htCapability;
183
   Ptr<WifiInformationElement> wifiIe = m_elements.FindFirst (IE_HT_CAPABILITIES);
184
   Ptr<HtCapabilities> ht = DynamicCast<HtCapabilities> (wifiIe);
185
   return ht;
163
}
186
}
164
void
187
void
165
MgtProbeResponseHeader::SetSsid (Ssid ssid)
188
MgtProbeResponseHeader::SetSsid (Ssid ssid)
 Lines 201-207    Link Here 
201
  size += m_rates.GetSerializedSize ();
224
  size += m_rates.GetSerializedSize ();
202
  //size += 3; // ds parameter set
225
  //size += 3; // ds parameter set
203
  size += m_rates.extended.GetSerializedSize ();
226
  size += m_rates.extended.GetSerializedSize ();
204
  size += m_htCapability.GetSerializedSize();
227
  //size += m_htCapability.GetSerializedSize();
205
  // xxx
228
  // xxx
206
  return size;
229
  return size;
207
}
230
}
 Lines 209-216    Link Here 
209
MgtProbeResponseHeader::Print (std::ostream &os) const
232
MgtProbeResponseHeader::Print (std::ostream &os) const
210
{
233
{
211
  os << "ssid=" << m_ssid << ", "
234
  os << "ssid=" << m_ssid << ", "
212
     << "rates=" << m_rates << ", "
235
//     << "rates=" << m_rates << ", "
213
     << "HT Capabilities=" << m_htCapability;
236
//     << "HT Capabilities=" << m_htCapability;
237
     << "rates=" << m_rates;
214
}
238
}
215
void
239
void
216
MgtProbeResponseHeader::Serialize (Buffer::Iterator start) const
240
MgtProbeResponseHeader::Serialize (Buffer::Iterator start) const
 Lines 233-239    Link Here 
233
  i = m_rates.Serialize (i);
257
  i = m_rates.Serialize (i);
234
  //i.WriteU8 (0, 3); // ds parameter set.
258
  //i.WriteU8 (0, 3); // ds parameter set.
235
  i = m_rates.extended.Serialize (i);
259
  i = m_rates.extended.Serialize (i);
236
  i = m_htCapability.Serialize(i);
260
  //i = m_htCapability.Serialize(i);
237
}
261
}
238
uint32_t
262
uint32_t
239
MgtProbeResponseHeader::Deserialize (Buffer::Iterator start)
263
MgtProbeResponseHeader::Deserialize (Buffer::Iterator start)
 Lines 247-253    Link Here 
247
  i = m_rates.Deserialize (i);
271
  i = m_rates.Deserialize (i);
248
  //i.Next (3); // ds parameter set
272
  //i.Next (3); // ds parameter set
249
  i = m_rates.extended.DeserializeIfPresent (i);
273
  i = m_rates.extended.DeserializeIfPresent (i);
250
  i = m_htCapability.DeserializeIfPresent (i);
274
  //i = m_htCapability.DeserializeIfPresent (i);
251
  return i.GetDistanceFrom (start);
275
  return i.GetDistanceFrom (start);
252
}
276
}
253
277
 Lines 266-271    Link Here 
266
}
290
}
267
291
268
void
292
void
293
MgtAssocRequestHeader::AddInformationElement (Ptr<WifiInformationElement> ie)
294
{
295
  m_elements.AddInformationElement (ie);
296
}
297
298
void
269
MgtAssocRequestHeader::SetSsid (Ssid ssid)
299
MgtAssocRequestHeader::SetSsid (Ssid ssid)
270
{
300
{
271
  m_ssid = ssid;
301
  m_ssid = ssid;
 Lines 276-294    Link Here 
276
  m_rates = rates;
306
  m_rates = rates;
277
}
307
}
278
void 
308
void 
279
MgtAssocRequestHeader::SetHtCapabilities(HtCapabilities htcapabilities)
309
MgtAssocRequestHeader::SetHtCapabilities(Ptr<HtCapabilities> htcapabilities)
280
{
310
{
281
  m_htCapability = htcapabilities;
311
  //m_htCapability = htcapabilities;
312
  m_elements.AddInformationElement (htcapabilities);
282
}
313
}
283
void
314
void
284
MgtAssocRequestHeader::SetListenInterval (uint16_t interval)
315
MgtAssocRequestHeader::SetListenInterval (uint16_t interval)
285
{
316
{
286
  m_listenInterval = interval;
317
  m_listenInterval = interval;
287
}
318
}
288
HtCapabilities 
319
Ptr<HtCapabilities>
289
MgtAssocRequestHeader::GetHtCapabilities (void) const
320
MgtAssocRequestHeader::GetHtCapabilities (void) const
290
{
321
{
291
   return  m_htCapability;
322
   //return  m_htCapability;
323
   Ptr<WifiInformationElement> wifiIe = m_elements.FindFirst (IE_HT_CAPABILITIES);
324
   Ptr<HtCapabilities> ht = DynamicCast<HtCapabilities> (wifiIe);
325
   return ht;
292
}
326
}
293
Ssid
327
Ssid
294
MgtAssocRequestHeader::GetSsid (void) const
328
MgtAssocRequestHeader::GetSsid (void) const
 Lines 328-334    Link Here 
328
  size += 2;
362
  size += 2;
329
  size += m_ssid.GetSerializedSize ();
363
  size += m_ssid.GetSerializedSize ();
330
  size += m_rates.GetSerializedSize ();
364
  size += m_rates.GetSerializedSize ();
331
  size += m_htCapability.GetSerializedSize();
365
  //size += m_htCapability.GetSerializedSize();
332
  size += m_rates.extended.GetSerializedSize ();
366
  size += m_rates.extended.GetSerializedSize ();
333
  return size;
367
  return size;
334
}
368
}
 Lines 336-343    Link Here 
336
MgtAssocRequestHeader::Print (std::ostream &os) const
370
MgtAssocRequestHeader::Print (std::ostream &os) const
337
{
371
{
338
  os << "ssid=" << m_ssid << ", "
372
  os << "ssid=" << m_ssid << ", "
339
     << "rates=" << m_rates<< ", "
373
//     << "rates=" << m_rates<< ", "
340
     << "HT Capabilities=" << m_htCapability;
374
//     << "HT Capabilities=" << m_htCapability;
375
     << "rates=" << m_rates;
341
}
376
}
342
void
377
void
343
MgtAssocRequestHeader::Serialize (Buffer::Iterator start) const
378
MgtAssocRequestHeader::Serialize (Buffer::Iterator start) const
 Lines 348-354    Link Here 
348
  i = m_ssid.Serialize (i);
383
  i = m_ssid.Serialize (i);
349
  i = m_rates.Serialize (i);
384
  i = m_rates.Serialize (i);
350
  i = m_rates.extended.Serialize (i);
385
  i = m_rates.extended.Serialize (i);
351
  i = m_htCapability.Serialize(i);
386
  //i = m_htCapability.Serialize(i);
352
}
387
}
353
uint32_t
388
uint32_t
354
MgtAssocRequestHeader::Deserialize (Buffer::Iterator start)
389
MgtAssocRequestHeader::Deserialize (Buffer::Iterator start)
 Lines 359-365    Link Here 
359
  i = m_ssid.Deserialize (i);
394
  i = m_ssid.Deserialize (i);
360
  i = m_rates.Deserialize (i);
395
  i = m_rates.Deserialize (i);
361
  i = m_rates.extended.DeserializeIfPresent (i);
396
  i = m_rates.extended.DeserializeIfPresent (i);
362
  i = m_htCapability.DeserializeIfPresent (i);
397
  //i = m_htCapability.DeserializeIfPresent (i);
363
  return i.GetDistanceFrom (start);
398
  return i.GetDistanceFrom (start);
364
}
399
}
365
400
 Lines 377-382    Link Here 
377
{
412
{
378
}
413
}
379
414
415
void
416
MgtAssocResponseHeader::AddInformationElement (Ptr<WifiInformationElement> ie)
417
{
418
  m_elements.AddInformationElement (ie);
419
}
420
380
StatusCode
421
StatusCode
381
MgtAssocResponseHeader::GetStatusCode (void)
422
MgtAssocResponseHeader::GetStatusCode (void)
382
{
423
{
 Lines 398-412    Link Here 
398
  m_rates = rates;
439
  m_rates = rates;
399
}
440
}
400
void 
441
void 
401
MgtAssocResponseHeader::SetHtCapabilities(HtCapabilities htcapabilities)
442
MgtAssocResponseHeader::SetHtCapabilities(Ptr<HtCapabilities> htcapabilities)
402
{
443
{
403
  m_htCapability=htcapabilities;
444
  //m_htCapability=htcapabilities;
445
  m_elements.AddInformationElement (htcapabilities);
404
}
446
}
405
447
406
HtCapabilities 
448
Ptr<HtCapabilities>
407
MgtAssocResponseHeader::GetHtCapabilities (void) const
449
MgtAssocResponseHeader::GetHtCapabilities (void) const
408
{
450
{
409
   return  m_htCapability;
451
   // return  m_htCapability;
452
   Ptr<WifiInformationElement> wifiIe = m_elements.FindFirst (IE_HT_CAPABILITIES);
453
   Ptr<HtCapabilities> ht = DynamicCast<HtCapabilities> (wifiIe);
454
   return ht;
410
}
455
}
411
TypeId
456
TypeId
412
MgtAssocResponseHeader::GetTypeId (void)
457
MgtAssocResponseHeader::GetTypeId (void)
 Lines 431-437    Link Here 
431
  size += 2; // aid
476
  size += 2; // aid
432
  size += m_rates.GetSerializedSize ();
477
  size += m_rates.GetSerializedSize ();
433
  size += m_rates.extended.GetSerializedSize ();
478
  size += m_rates.extended.GetSerializedSize ();
434
size += m_htCapability.GetSerializedSize();
479
  //size += m_htCapability.GetSerializedSize();
435
  return size;
480
  return size;
436
}
481
}
437
482
 Lines 439-446    Link Here 
439
MgtAssocResponseHeader::Print (std::ostream &os) const
484
MgtAssocResponseHeader::Print (std::ostream &os) const
440
{
485
{
441
  os << "status code=" << m_code << ", "
486
  os << "status code=" << m_code << ", "
442
     << "rates=" << m_rates << ", "
487
//     << "rates=" << m_rates << ", "
443
  << "HT Capabilities=" << m_htCapability;
488
//  << "HT Capabilities=" << m_htCapability;
489
     << "rates=" << m_rates;
444
}
490
}
445
void
491
void
446
MgtAssocResponseHeader::Serialize (Buffer::Iterator start) const
492
MgtAssocResponseHeader::Serialize (Buffer::Iterator start) const
 Lines 451-457    Link Here 
451
  i.WriteHtolsbU16 (m_aid);
497
  i.WriteHtolsbU16 (m_aid);
452
  i = m_rates.Serialize (i);
498
  i = m_rates.Serialize (i);
453
  i = m_rates.extended.Serialize (i);
499
  i = m_rates.extended.Serialize (i);
454
 i = m_htCapability.Serialize(i);
500
  //i = m_htCapability.Serialize(i);
455
}
501
}
456
uint32_t
502
uint32_t
457
MgtAssocResponseHeader::Deserialize (Buffer::Iterator start)
503
MgtAssocResponseHeader::Deserialize (Buffer::Iterator start)
 Lines 462-468    Link Here 
462
  m_aid = i.ReadLsbtohU16 ();
508
  m_aid = i.ReadLsbtohU16 ();
463
  i = m_rates.Deserialize (i);
509
  i = m_rates.Deserialize (i);
464
  i = m_rates.extended.DeserializeIfPresent (i);
510
  i = m_rates.extended.DeserializeIfPresent (i);
465
 i = m_htCapability.DeserializeIfPresent (i);
511
  //i = m_htCapability.DeserializeIfPresent (i);
466
  return i.GetDistanceFrom (start);
512
  return i.GetDistanceFrom (start);
467
}
513
}
468
/**********************************************************
514
/**********************************************************
(-)a/src/wifi/model/mgt-headers.h (-8 / +29 lines)
 Lines 30-35    Link Here 
30
#include "supported-rates.h"
30
#include "supported-rates.h"
31
#include "ssid.h"
31
#include "ssid.h"
32
#include "ht-capabilities.h"
32
#include "ht-capabilities.h"
33
#include "wifi-information-element-vector.h"
33
34
34
namespace ns3 {
35
namespace ns3 {
35
36
 Lines 44-49    Link Here 
44
  ~MgtAssocRequestHeader ();
45
  ~MgtAssocRequestHeader ();
45
46
46
  /**
47
  /**
48
   * Add information element
49
   */
50
  void AddInformationElement (Ptr<WifiInformationElement> ie);
51
  /**
47
   * Set the Service Set Identifier (SSID).
52
   * Set the Service Set Identifier (SSID).
48
   *
53
   *
49
   * \param ssid SSID
54
   * \param ssid SSID
 Lines 66-79    Link Here 
66
   *
71
   *
67
   * \param htcapabilities HT capabilities
72
   * \param htcapabilities HT capabilities
68
   */
73
   */
69
  void SetHtCapabilities(HtCapabilities htcapabilities);
74
  void SetHtCapabilities(Ptr<HtCapabilities> htcapabilities);
70
  
75
  
71
  /**
76
  /**
72
   * Return the HT capabilities.
77
   * Return the HT capabilities.
73
   *
78
   *
74
   * \return HT capabilities
79
   * \return HT capabilities
75
   */
80
   */
76
  HtCapabilities GetHtCapabilities (void) const;
81
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
77
  /**
82
  /**
78
   * Return the Service Set Identifier (SSID).
83
   * Return the Service Set Identifier (SSID).
79
   *
84
   *
 Lines 106-111    Link Here 
106
  CapabilityInformation m_capability; //!< Capability information
111
  CapabilityInformation m_capability; //!< Capability information
107
  HtCapabilities m_htCapability; //!< HT capabilities
112
  HtCapabilities m_htCapability; //!< HT capabilities
108
  uint16_t m_listenInterval;
113
  uint16_t m_listenInterval;
114
  WifiInformationElementVector m_elements;
109
};
115
};
110
116
111
117
 Lines 120-125    Link Here 
120
  ~MgtAssocResponseHeader ();
126
  ~MgtAssocResponseHeader ();
121
127
122
  /**
128
  /**
129
   * Add information element
130
   */
131
  void AddInformationElement (Ptr<WifiInformationElement> ie);
132
  /**
123
   * Return the status code.
133
   * Return the status code.
124
   *
134
   *
125
   * \return the status code
135
   * \return the status code
 Lines 136-149    Link Here 
136
   *
146
   *
137
   * \return HT capabilities
147
   * \return HT capabilities
138
   */
148
   */
139
  HtCapabilities GetHtCapabilities (void) const;
149
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
140
150
141
  /**
151
  /**
142
   * Set the HT capabilities.
152
   * Set the HT capabilities.
143
   *
153
   *
144
   * \param htcapabilities HT capabilities
154
   * \param htcapabilities HT capabilities
145
   */
155
   */
146
  void SetHtCapabilities(HtCapabilities htcapabilities);
156
  void SetHtCapabilities(Ptr<HtCapabilities> htcapabilities);
147
  /**
157
  /**
148
   * Set the supported rates.
158
   * Set the supported rates.
149
   *
159
   *
 Lines 170-175    Link Here 
170
  StatusCode m_code; //!< Status code
180
  StatusCode m_code; //!< Status code
171
  uint16_t m_aid;
181
  uint16_t m_aid;
172
  HtCapabilities m_htCapability; //!< HT capabilities
182
  HtCapabilities m_htCapability; //!< HT capabilities
183
  WifiInformationElementVector m_elements;
173
};
184
};
174
185
175
186
 Lines 183-188    Link Here 
183
  ~MgtProbeRequestHeader ();
194
  ~MgtProbeRequestHeader ();
184
195
185
  /**
196
  /**
197
   * Add information element
198
   */
199
  void AddInformationElement (Ptr<WifiInformationElement> ie);
200
  /**
186
   * Set the Service Set Identifier (SSID).
201
   * Set the Service Set Identifier (SSID).
187
   *
202
   *
188
   * \param ssid SSID
203
   * \param ssid SSID
 Lines 211-224    Link Here 
211
   *
226
   *
212
   * \return HT capabilities
227
   * \return HT capabilities
213
   */
228
   */
214
  HtCapabilities GetHtCapabilities (void) const;
229
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
215
230
216
  /**
231
  /**
217
   * Set the HT capabilities.
232
   * Set the HT capabilities.
218
   *
233
   *
219
   * \param htcapabilities HT capabilities
234
   * \param htcapabilities HT capabilities
220
   */
235
   */
221
  void SetHtCapabilities(HtCapabilities htcapabilities);
236
  void SetHtCapabilities(Ptr<HtCapabilities> htcapabilities);
222
  static TypeId GetTypeId (void);
237
  static TypeId GetTypeId (void);
223
  virtual TypeId GetInstanceTypeId (void) const;
238
  virtual TypeId GetInstanceTypeId (void) const;
224
  virtual void Print (std::ostream &os) const;
239
  virtual void Print (std::ostream &os) const;
 Lines 229-234    Link Here 
229
  Ssid m_ssid; //!< Service Set ID (SSID)
244
  Ssid m_ssid; //!< Service Set ID (SSID)
230
  SupportedRates m_rates; //!< List of supported rates
245
  SupportedRates m_rates; //!< List of supported rates
231
  HtCapabilities m_htCapability; //!< HT capabilities
246
  HtCapabilities m_htCapability; //!< HT capabilities
247
  WifiInformationElementVector m_elements;
232
};
248
};
233
249
234
250
 Lines 243-248    Link Here 
243
  ~MgtProbeResponseHeader ();
259
  ~MgtProbeResponseHeader ();
244
260
245
  /**
261
  /**
262
   * Add information element
263
   */
264
  void AddInformationElement (Ptr<WifiInformationElement> ie);
265
  /**
246
   * Return the Service Set Identifier (SSID).
266
   * Return the Service Set Identifier (SSID).
247
   *
267
   *
248
   * \return SSID
268
   * \return SSID
 Lines 265-278    Link Here 
265
   *
285
   *
266
   * \return HT capabilities
286
   * \return HT capabilities
267
   */
287
   */
268
  HtCapabilities GetHtCapabilities (void) const;
288
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
269
289
270
  /**
290
  /**
271
   * Set the HT capabilities.
291
   * Set the HT capabilities.
272
   *
292
   *
273
   * \param htcapabilities HT capabilities
293
   * \param htcapabilities HT capabilities
274
   */
294
   */
275
  void SetHtCapabilities(HtCapabilities htcapabilities);
295
  void SetHtCapabilities(Ptr<HtCapabilities> htcapabilities);
276
  /**
296
  /**
277
   * Set the Service Set Identifier (SSID).
297
   * Set the Service Set Identifier (SSID).
278
   *
298
   *
 Lines 311-316    Link Here 
311
  SupportedRates m_rates; //!< List of supported rates
331
  SupportedRates m_rates; //!< List of supported rates
312
  CapabilityInformation m_capability; //!< Capability information
332
  CapabilityInformation m_capability; //!< Capability information
313
  HtCapabilities m_htCapability; //!< HT capabilities
333
  HtCapabilities m_htCapability; //!< HT capabilities
334
  WifiInformationElementVector m_elements;
314
};
335
};
315
336
316
337
(-)a/src/wifi/model/sta-wifi-mac.cc (-10 / +18 lines)
 Lines 215-222    Link Here 
215
  assoc.SetSupportedRates (GetSupportedRates ());
215
  assoc.SetSupportedRates (GetSupportedRates ());
216
  if (m_htSupported)
216
  if (m_htSupported)
217
    {
217
    {
218
      WifiInformationElementVector elements;
219
      Ptr<HtCapabilities> ht = Create<HtCapabilities> ();
218
      assoc.SetHtCapabilities (GetHtCapabilities());
220
      assoc.SetHtCapabilities (GetHtCapabilities());
219
      hdr.SetNoOrder();
221
      hdr.SetNoOrder();
222
      packet->AddHeader (elements);
220
    }
223
    }
221
224
222
  packet->AddHeader (assoc);
225
  packet->AddHeader (assoc);
 Lines 546-551    Link Here 
546
      if (m_state == WAIT_ASSOC_RESP)
549
      if (m_state == WAIT_ASSOC_RESP)
547
        {
550
        {
548
          MgtAssocResponseHeader assocResp;
551
          MgtAssocResponseHeader assocResp;
552
          WifiInformationElementVector elements;
549
          packet->RemoveHeader (assocResp);
553
          packet->RemoveHeader (assocResp);
550
          if (m_assocRequestEvent.IsRunning ())
554
          if (m_assocRequestEvent.IsRunning ())
551
            {
555
            {
 Lines 558-564    Link Here 
558
              SupportedRates rates = assocResp.GetSupportedRates ();
562
              SupportedRates rates = assocResp.GetSupportedRates ();
559
              if (m_htSupported)
563
              if (m_htSupported)
560
                {
564
                {
561
                  HtCapabilities htcapabilities = assocResp.GetHtCapabilities ();
565
                  Ptr<WifiInformationElement> wifiIe = elements.FindFirst (IE_HT_CAPABILITIES);
566
                  Ptr<HtCapabilities> htcapabilities = DynamicCast<HtCapabilities> (wifiIe);
567
                  //Ptr<HtCapabilities> htcapabilities = assocResp.GetHtCapabilities ();
562
                  m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (),htcapabilities);
568
                  m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (),htcapabilities);
563
                }
569
                }
564
570
 Lines 576-586    Link Here 
576
                }
582
                }
577
              if(m_htSupported)
583
              if(m_htSupported)
578
                {
584
                {
579
                  HtCapabilities htcapabilities = assocResp.GetHtCapabilities ();
585
                  Ptr<WifiInformationElement> wifiIe = elements.FindFirst (IE_HT_CAPABILITIES);
586
                  Ptr<HtCapabilities> htcapabilities = DynamicCast<HtCapabilities> (wifiIe);
587
                  //Ptr<HtCapabilities> htcapabilities = assocResp.GetHtCapabilities ();
580
                  for (uint32_t i = 0; i < m_phy->GetNMcs(); i++)
588
                  for (uint32_t i = 0; i < m_phy->GetNMcs(); i++)
581
                    {
589
                    {
582
                       uint8_t mcs=m_phy->GetMcs(i);
590
                       uint8_t mcs=m_phy->GetMcs(i);
583
                       if (htcapabilities.IsSupportedMcs (mcs))
591
                       if (htcapabilities->IsSupportedMcs (mcs))
584
                         {
592
                         {
585
                           m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
593
                           m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
586
                          //here should add a control to add basic MCS when it is implemented
594
                          //here should add a control to add basic MCS when it is implemented
 Lines 625-641    Link Here 
625
    }
633
    }
626
  return rates;
634
  return rates;
627
}
635
}
628
HtCapabilities
636
Ptr<HtCapabilities>
629
StaWifiMac::GetHtCapabilities (void) const
637
StaWifiMac::GetHtCapabilities (void) const
630
{
638
{
631
 HtCapabilities capabilities;
639
 Ptr<HtCapabilities> capabilities;
632
 capabilities.SetHtSupported(1);
640
 capabilities->SetHtSupported(1);
633
 capabilities.SetLdpc (m_phy->GetLdpc());
641
 capabilities->SetLdpc (m_phy->GetLdpc());
634
 capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval());
642
 capabilities->SetShortGuardInterval20 (m_phy->GetGuardInterval());
635
 capabilities.SetGreenfield (m_phy->GetGreenfield());
643
 capabilities->SetGreenfield (m_phy->GetGreenfield());
636
for (uint8_t i =0 ; i < m_phy->GetNMcs();i++)
644
for (uint8_t i =0 ; i < m_phy->GetNMcs();i++)
637
  {
645
  {
638
     capabilities.SetRxMcsBitmask(m_phy->GetMcs(i));
646
     capabilities->SetRxMcsBitmask(m_phy->GetMcs(i));
639
  }
647
  }
640
 return capabilities;
648
 return capabilities;
641
}
649
}
(-)a/src/wifi/model/sta-wifi-mac.h (-1 / +1 lines)
 Lines 176-182    Link Here 
176
   * 
176
   * 
177
   * \return the HT capability that we support
177
   * \return the HT capability that we support
178
   */
178
   */
179
  HtCapabilities GetHtCapabilities (void) const;
179
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
180
180
181
181
182
  enum MacState m_state;
182
  enum MacState m_state;
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-3 / +3 lines)
 Lines 1250-1262    Link Here 
1250
}
1250
}
1251
//Used by all stations to record HT capabilities of remote stations
1251
//Used by all stations to record HT capabilities of remote stations
1252
void
1252
void
1253
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htcapabilities)
1253
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, Ptr<HtCapabilities> htcapabilities)
1254
{
1254
{
1255
  NS_LOG_FUNCTION (this << from << htcapabilities);
1255
  NS_LOG_FUNCTION (this << from << htcapabilities);
1256
  WifiRemoteStationState *state;
1256
  WifiRemoteStationState *state;
1257
  state=LookupState (from);
1257
  state=LookupState (from);
1258
  state->m_shortGuardInterval=htcapabilities.GetShortGuardInterval20();
1258
  state->m_shortGuardInterval=htcapabilities->GetShortGuardInterval20();
1259
  state->m_greenfield=htcapabilities.GetGreenfield();
1259
  state->m_greenfield=htcapabilities->GetGreenfield();
1260
 
1260
 
1261
}
1261
}
1262
//Used by mac low to choose format used GF, MF or Non HT
1262
//Used by mac low to choose format used GF, MF or Non HT
(-)a/src/wifi/model/wifi-remote-station-manager.h (-1 / +1 lines)
 Lines 161-167    Link Here 
161
   * \param from the address of the station being recorded
161
   * \param from the address of the station being recorded
162
   * \param htcapabilities the HT capabilities of the station
162
   * \param htcapabilities the HT capabilities of the station
163
   */
163
   */
164
  void AddStationHtCapabilities (Mac48Address from, HtCapabilities htcapabilities);
164
  void AddStationHtCapabilities (Mac48Address from, Ptr<HtCapabilities> htcapabilities);
165
  /**
165
  /**
166
   * Enable or disable HT capability support.
166
   * Enable or disable HT capability support.
167
   *
167
   *

Return to bug 881