src/devices/wifi/mgt-headers.cc
author Mirko Banchi <mk.banchi@gmail.com>
Wed, 03 Feb 2010 20:34:48 +0100
changeset 5949 66f939e7aaec
parent 5824 5abf274b52d4
child 6381 cbc1b93b298a
permissions -rw-r--r--
add action frames needed by block ack
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2006 INRIA
5949
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
     4
 * Copyright (c) 2009 MIRKO BANCHI
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 *
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 *
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 * GNU General Public License for more details.
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 *
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 *
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
5949
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
    20
 * Author: Mirko Banchi <mk.banchi@gmail.com>
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
 */
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#include "mgt-headers.h"
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include "ns3/simulator.h"
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include "ns3/assert.h"
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
namespace ns3 {
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
/***********************************************************
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
 *          Probe Request
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
 ***********************************************************/
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    32
NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader);
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    33
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
MgtProbeRequestHeader::~MgtProbeRequestHeader ()
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
{}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
MgtProbeRequestHeader::SetSsid (Ssid ssid)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
  m_ssid = ssid;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
Ssid 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
MgtProbeRequestHeader::GetSsid (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
  return m_ssid;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
MgtProbeRequestHeader::SetSupportedRates (SupportedRates rates)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    50
  m_rates = rates;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    51
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
SupportedRates 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
MgtProbeRequestHeader::GetSupportedRates (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
  return m_rates;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
MgtProbeRequestHeader::GetSerializedSize (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
  uint32_t size = 0;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
  size += m_ssid.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
  size += m_rates.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
  return size;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
}
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    66
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    67
MgtProbeRequestHeader::GetTypeId (void)
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    68
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    69
  static TypeId tid = TypeId ("ns3::MgtProbeRequestHeader")
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    70
    .SetParent<Header> ()
2650
3de4cacb8981 make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2646
diff changeset
    71
    .AddConstructor<MgtProbeRequestHeader> ()
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    72
    ;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    73
  return tid;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    74
}
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    75
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    76
MgtProbeRequestHeader::GetInstanceTypeId (void) const
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    77
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    78
  return GetTypeId ();
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
    79
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    80
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    81
MgtProbeRequestHeader::Print (std::ostream &os) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    82
{
2016
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
    83
  os << "ssid="<<m_ssid<<", "
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
    84
     << "rates="<<m_rates;
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    85
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    86
void
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    87
MgtProbeRequestHeader::Serialize (Buffer::Iterator start) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    88
{  
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    89
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    90
  i = m_ssid.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    91
  i = m_rates.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    92
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    93
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    94
MgtProbeRequestHeader::Deserialize (Buffer::Iterator start)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    95
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    96
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    97
  i = m_ssid.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    98
  i = m_rates.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    99
  return i.GetDistanceFrom (start);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   100
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   101
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   102
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   103
/***********************************************************
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   104
 *          Probe Response
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   105
 ***********************************************************/
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   106
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   107
NS_OBJECT_ENSURE_REGISTERED (MgtProbeResponseHeader);
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   108
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   109
MgtProbeResponseHeader::MgtProbeResponseHeader ()
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   110
{}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   111
MgtProbeResponseHeader::~MgtProbeResponseHeader ()
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   112
{}
4692
f4cd995f1718 Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents: 3662
diff changeset
   113
uint64_t
f4cd995f1718 Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents: 3662
diff changeset
   114
MgtProbeResponseHeader::GetTimestamp()
f4cd995f1718 Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents: 3662
diff changeset
   115
{
f4cd995f1718 Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents: 3662
diff changeset
   116
  return m_timestamp;
f4cd995f1718 Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents: 3662
diff changeset
   117
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   118
Ssid 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   119
MgtProbeResponseHeader::GetSsid (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   120
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   121
  return m_ssid;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   122
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   123
uint64_t 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   124
MgtProbeResponseHeader::GetBeaconIntervalUs (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   125
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   126
  return m_beaconInterval;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   127
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   128
SupportedRates 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   129
MgtProbeResponseHeader::GetSupportedRates (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   130
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   131
  return m_rates;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   132
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   133
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   134
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   135
MgtProbeResponseHeader::SetSsid (Ssid ssid)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   136
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   137
  m_ssid = ssid;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   138
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   139
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   140
MgtProbeResponseHeader::SetBeaconIntervalUs (uint64_t us)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   141
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   142
  m_beaconInterval = us;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   143
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   144
void
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   145
MgtProbeResponseHeader::SetSupportedRates (SupportedRates rates)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   146
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   147
  m_rates = rates;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   148
}
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   149
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   150
MgtProbeResponseHeader::GetTypeId (void)
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   151
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   152
  static TypeId tid = TypeId ("ns3::MgtProbeResponseHeader")
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   153
    .SetParent<Header> ()
2650
3de4cacb8981 make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2646
diff changeset
   154
    .AddConstructor<MgtProbeResponseHeader> ()
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   155
    ;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   156
  return tid;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   157
}
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   158
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   159
MgtProbeResponseHeader::GetInstanceTypeId (void) const
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   160
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   161
  return GetTypeId ();
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   162
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   163
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   164
MgtProbeResponseHeader::GetSerializedSize (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   165
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   166
  uint32_t size = 0;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   167
  size += 8; // timestamp
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   168
  size += 2; // beacon interval
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   169
  size += m_capability.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   170
  size += m_ssid.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   171
  size += m_rates.GetSerializedSize ();
3655
878961da459c do not reserve space for unwritten data to avoid memory initialization problems
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3636
diff changeset
   172
  //size += 3; // ds parameter set
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   173
  // xxx
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   174
  return size;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   175
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   176
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   177
MgtProbeResponseHeader::Print (std::ostream &os) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   178
{
2016
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
   179
  os << "ssid="<<m_ssid<<", "
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
   180
     << "rates="<<m_rates;
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   181
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   182
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   183
MgtProbeResponseHeader::Serialize (Buffer::Iterator start) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   184
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   185
  // timestamp
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   186
  // beacon interval
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   187
  // capability information
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   188
  // ssid
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   189
  // supported rates
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   190
  // fh parameter set
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
  // ds parameter set
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   192
  // cf parameter set
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   193
  // ibss parameter set
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   194
  //XXX
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   195
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   196
  i.WriteHtonU64 (Simulator::Now ().GetMicroSeconds ());
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   197
  i.WriteHtonU16 (m_beaconInterval / 1024);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   198
  i = m_capability.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   199
  i = m_ssid.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   200
  i = m_rates.Serialize (i);
3655
878961da459c do not reserve space for unwritten data to avoid memory initialization problems
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3636
diff changeset
   201
  //i.WriteU8 (0, 3); // ds parameter set.
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   202
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   203
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   204
MgtProbeResponseHeader::Deserialize (Buffer::Iterator start)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   205
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   206
  Buffer::Iterator i = start;
4692
f4cd995f1718 Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents: 3662
diff changeset
   207
  m_timestamp = i.ReadNtohU64();
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   208
  m_beaconInterval = i.ReadNtohU16 ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   209
  m_beaconInterval *= 1024;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   210
  i = m_capability.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   211
  i = m_ssid.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   212
  i = m_rates.Deserialize (i);
3655
878961da459c do not reserve space for unwritten data to avoid memory initialization problems
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3636
diff changeset
   213
  //i.Next (3); // ds parameter set
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   214
  return i.GetDistanceFrom (start);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   215
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   216
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   217
/***********************************************************
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   218
 *          Assoc Request
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   219
 ***********************************************************/
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   220
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   221
NS_OBJECT_ENSURE_REGISTERED (MgtAssocRequestHeader);
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   222
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   223
MgtAssocRequestHeader::MgtAssocRequestHeader ()
3662
eb4d8f900458 initialize sta listen interval
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3655
diff changeset
   224
  : m_listenInterval (0)
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   225
{}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   226
MgtAssocRequestHeader::~MgtAssocRequestHeader ()
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   227
{}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   230
MgtAssocRequestHeader::SetSsid (Ssid ssid)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   231
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   232
  m_ssid = ssid;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   233
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   234
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
MgtAssocRequestHeader::SetSupportedRates (SupportedRates rates)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   236
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   237
  m_rates = rates;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   238
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   239
void
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   240
MgtAssocRequestHeader::SetListenInterval (uint16_t interval)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   241
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   242
  m_listenInterval = interval;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   243
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   244
Ssid 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   245
MgtAssocRequestHeader::GetSsid (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   246
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   247
  return m_ssid;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   248
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   249
SupportedRates 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   250
MgtAssocRequestHeader::GetSupportedRates (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   251
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   252
  return m_rates;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   253
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   254
uint16_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   255
MgtAssocRequestHeader::GetListenInterval (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   256
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   257
  return m_listenInterval;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   258
}
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   259
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   260
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   261
MgtAssocRequestHeader::GetTypeId (void)
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   262
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   263
  static TypeId tid = TypeId ("ns3::MgtAssocRequestHeader")
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   264
    .SetParent<Header> ()
2650
3de4cacb8981 make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2646
diff changeset
   265
    .AddConstructor<MgtAssocRequestHeader> ()
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   266
    ;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   267
  return tid;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   268
}
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   269
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   270
MgtAssocRequestHeader::GetInstanceTypeId (void) const
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   271
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   272
  return GetTypeId ();
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   273
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   274
uint32_t 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   275
MgtAssocRequestHeader::GetSerializedSize (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   276
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   277
  uint32_t size = 0;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   278
  size += m_capability.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   279
  size += 2;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   280
  size += m_ssid.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   281
  size += m_rates.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   282
  return size;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   283
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   284
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   285
MgtAssocRequestHeader::Print (std::ostream &os) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   286
{
2016
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
   287
  os << "ssid="<<m_ssid<<", "
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
   288
     << "rates="<<m_rates;
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   289
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   290
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   291
MgtAssocRequestHeader::Serialize (Buffer::Iterator start) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   292
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   293
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   294
  i = m_capability.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   295
  i.WriteHtonU16 (m_listenInterval);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   296
  i = m_ssid.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   297
  i = m_rates.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   298
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   299
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   300
MgtAssocRequestHeader::Deserialize (Buffer::Iterator start)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   301
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   302
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   303
  i = m_capability.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   304
  m_listenInterval = i.ReadNtohU16 ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   305
  i = m_ssid.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   306
  i = m_rates.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   307
  return i.GetDistanceFrom (start);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   308
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   309
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   310
/***********************************************************
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   311
 *          Assoc Response
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   312
 ***********************************************************/
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   313
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   314
NS_OBJECT_ENSURE_REGISTERED (MgtAssocResponseHeader);
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   315
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   316
MgtAssocResponseHeader::MgtAssocResponseHeader ()
3636
2aee7df86786 make sure aid is initialized
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2650
diff changeset
   317
  : m_aid (0)
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   318
{}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   319
MgtAssocResponseHeader::~MgtAssocResponseHeader ()
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   320
{}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   321
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   322
StatusCode 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   323
MgtAssocResponseHeader::GetStatusCode (void)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   324
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   325
  return m_code;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   326
}
2007
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   327
SupportedRates 
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   328
MgtAssocResponseHeader::GetSupportedRates (void)
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   329
{
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   330
  return m_rates;
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   331
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   332
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   333
MgtAssocResponseHeader::SetStatusCode (StatusCode code)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   334
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   335
  m_code = code;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   336
}
2007
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   337
void 
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   338
MgtAssocResponseHeader::SetSupportedRates (SupportedRates rates)
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   339
{
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   340
  m_rates = rates;
a5fefe9916a0 add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1978
diff changeset
   341
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   342
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   343
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   344
MgtAssocResponseHeader::GetTypeId (void)
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   345
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   346
  static TypeId tid = TypeId ("ns3::MgtAssocResponseHeader")
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   347
    .SetParent<Header> ()
2650
3de4cacb8981 make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2646
diff changeset
   348
    .AddConstructor<MgtAssocResponseHeader> ()
2643
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   349
    ;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   350
  return tid;
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   351
}
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   352
TypeId 
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   353
MgtAssocResponseHeader::GetInstanceTypeId (void) const
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   354
{
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   355
  return GetTypeId ();
2a3324f4dabe define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2016
diff changeset
   356
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   357
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   358
MgtAssocResponseHeader::GetSerializedSize (void) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   359
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   360
  uint32_t size = 0;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   361
  size += m_capability.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   362
  size += m_code.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   363
  size += 2; // aid
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   364
  size += m_rates.GetSerializedSize ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   365
  return size;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   366
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   367
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   368
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   369
MgtAssocResponseHeader::Print (std::ostream &os) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   370
{
2016
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
   371
  os << "status code="<<m_code<<", "
81ae8d171b28 add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2007
diff changeset
   372
     << "rates="<<m_rates;
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   373
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   374
void 
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   375
MgtAssocResponseHeader::Serialize (Buffer::Iterator start) const
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   376
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   377
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   378
  i = m_capability.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   379
  i = m_code.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   380
  i.WriteHtonU16 (m_aid);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   381
  i = m_rates.Serialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   382
}
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   383
uint32_t
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   384
MgtAssocResponseHeader::Deserialize (Buffer::Iterator start)
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   385
{
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   386
  Buffer::Iterator i = start;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   387
  i = m_capability.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   388
  i = m_code.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   389
  m_aid = i.ReadNtohU16 ();
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   390
  i = m_rates.Deserialize (i);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   391
  return i.GetDistanceFrom (start);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   392
}
5824
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   393
/**********************************************************
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   394
 *   ActionFrame
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   395
 **********************************************************/
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   396
WifiActionHeader::WifiActionHeader ()
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   397
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   398
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   399
WifiActionHeader::~WifiActionHeader ()
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   400
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   401
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   402
void
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   403
WifiActionHeader::SetAction (WifiActionHeader::CategoryValue type,
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   404
    WifiActionHeader::ActionValue action)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   405
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   406
  m_category = type;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   407
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   408
  switch (type)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   409
    {
5949
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   410
  case BLOCK_ACK:
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   411
    {
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   412
      m_actionValue = action.blockAck;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   413
      break;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   414
    }
5824
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   415
  case MESH_PEERING_MGT:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   416
    {
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   417
      m_actionValue = action.peerLink;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   418
      break;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   419
    }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   420
  case MESH_PATH_SELECTION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   421
    {
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   422
      m_actionValue = action.pathSelection;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   423
      break;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   424
    }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   425
  case MESH_LINK_METRIC:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   426
  case MESH_INTERWORKING:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   427
  case MESH_RESOURCE_COORDINATION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   428
  case MESH_PROXY_FORWARDING:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   429
    break;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   430
    }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   431
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   432
WifiActionHeader::CategoryValue
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   433
WifiActionHeader::GetCategory ()
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   434
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   435
  switch (m_category)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   436
    {
5949
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   437
  case BLOCK_ACK:
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   438
    return BLOCK_ACK;
5824
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   439
  case MESH_PEERING_MGT:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   440
    return MESH_PEERING_MGT;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   441
  case MESH_LINK_METRIC:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   442
    return MESH_LINK_METRIC;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   443
  case MESH_PATH_SELECTION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   444
    return MESH_PATH_SELECTION;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   445
  case MESH_INTERWORKING:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   446
    return MESH_INTERWORKING;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   447
  case MESH_RESOURCE_COORDINATION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   448
    return MESH_RESOURCE_COORDINATION;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   449
  case MESH_PROXY_FORWARDING:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   450
    return MESH_PROXY_FORWARDING;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   451
  default:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   452
    NS_FATAL_ERROR ("Unknown action value");
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   453
    return MESH_PEERING_MGT;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   454
    }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   455
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   456
WifiActionHeader::ActionValue
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   457
WifiActionHeader::GetAction ()
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   458
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   459
  ActionValue retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   460
  retval.peerLink = PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   461
  switch (m_category)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   462
    {
5949
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   463
  case BLOCK_ACK:
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   464
    switch (m_actionValue)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   465
      {
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   466
    case BLOCK_ACK_ADDBA_REQUEST:
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   467
      retval.blockAck = BLOCK_ACK_ADDBA_REQUEST;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   468
      return retval;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   469
    case BLOCK_ACK_ADDBA_RESPONSE:
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   470
      retval.blockAck = BLOCK_ACK_ADDBA_RESPONSE;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   471
      return retval;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   472
    case BLOCK_ACK_DELBA:
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   473
      retval.blockAck = BLOCK_ACK_DELBA;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   474
      return retval;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   475
      }
5824
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   476
  case MESH_PEERING_MGT:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   477
    switch (m_actionValue)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   478
      {
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   479
    case PEER_LINK_OPEN:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   480
      retval.peerLink = PEER_LINK_OPEN;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   481
      return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   482
    case PEER_LINK_CONFIRM:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   483
      retval.peerLink = PEER_LINK_CONFIRM;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   484
      return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   485
    case PEER_LINK_CLOSE:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   486
      retval.peerLink = PEER_LINK_CLOSE;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   487
      return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   488
    default:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   489
      NS_FATAL_ERROR ("Unknown mesh peering management action code");
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   490
      retval.peerLink = PEER_LINK_OPEN;  /* quiet compiler */
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   491
      return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   492
      }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   493
  case MESH_PATH_SELECTION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   494
    switch (m_actionValue)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   495
      {
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   496
    case PATH_SELECTION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   497
      retval.pathSelection = PATH_SELECTION;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   498
      return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   499
    default:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   500
      NS_FATAL_ERROR ("Unknown mesh path selection action code");
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   501
      retval.peerLink = PEER_LINK_OPEN;  /* quiet compiler */
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   502
      return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   503
      }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   504
  case MESH_LINK_METRIC:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   505
    // not yet supported
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   506
  case MESH_INTERWORKING:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   507
    // not yet supported
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   508
  case MESH_RESOURCE_COORDINATION:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   509
    // not yet supported
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   510
  default:
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   511
    NS_FATAL_ERROR ("Unsupported mesh action");
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   512
    retval.peerLink = PEER_LINK_OPEN;  /* quiet compiler */
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   513
    return retval;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   514
    }
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   515
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   516
TypeId
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   517
WifiActionHeader::GetTypeId ()
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   518
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   519
  static TypeId tid = TypeId ("ns3::WifiActionHeader")
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   520
  .SetParent<Header> ()
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   521
  .AddConstructor<WifiActionHeader> ();
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   522
  return tid;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   523
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   524
TypeId
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   525
WifiActionHeader::GetInstanceTypeId () const
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   526
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   527
  return GetTypeId ();
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   528
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   529
void
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   530
WifiActionHeader::Print (std::ostream &os) const
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   531
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   532
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   533
uint32_t
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   534
WifiActionHeader::GetSerializedSize () const
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   535
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   536
  return 2;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   537
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   538
void
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   539
WifiActionHeader::Serialize (Buffer::Iterator start) const
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   540
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   541
  start.WriteU8 (m_category);
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   542
  start.WriteU8 (m_actionValue);
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   543
}
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   544
uint32_t
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   545
WifiActionHeader::Deserialize (Buffer::Iterator start)
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   546
{
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   547
  Buffer::Iterator i = start;
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   548
  m_category = i.ReadU8 ();
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   549
  m_actionValue = i.ReadU8 ();
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   550
  return i.GetDistanceFrom (start);
5abf274b52d4 Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents: 5133
diff changeset
   551
}
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   552
5949
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   553
/***************************************************
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   554
*                 ADDBARequest
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   555
****************************************************/
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   556
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   557
NS_OBJECT_ENSURE_REGISTERED (MgtAddBaRequestHeader);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   558
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   559
MgtAddBaRequestHeader::MgtAddBaRequestHeader ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   560
 : m_dialogToken (1),
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   561
   m_amsduSupport (1),
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   562
   m_bufferSize (0)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   563
{}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   564
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   565
TypeId
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   566
MgtAddBaRequestHeader::GetTypeId (void)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   567
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   568
  static TypeId tid = TypeId ("ns3::MgtAddBaRequestHeader")
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   569
    .SetParent<Header> ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   570
    .AddConstructor<MgtAddBaRequestHeader> ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   571
  ;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   572
  return tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   573
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   574
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   575
TypeId
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   576
MgtAddBaRequestHeader::GetInstanceTypeId (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   577
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   578
  return GetTypeId ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   579
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   580
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   581
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   582
MgtAddBaRequestHeader::Print (std::ostream &os) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   583
{}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   584
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   585
uint32_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   586
MgtAddBaRequestHeader::GetSerializedSize (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   587
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   588
  uint32_t size = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   589
  size += 1; //Dialog token
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   590
  size += 2; //Block ack parameter set
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   591
  size += 2; //Block ack timeout value
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   592
  size += 2; //Starting sequence control
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   593
  return size;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   594
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   595
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   596
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   597
MgtAddBaRequestHeader::Serialize (Buffer::Iterator start) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   598
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   599
  Buffer::Iterator i = start;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   600
  i.WriteU8 (m_dialogToken);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   601
  i.WriteHtolsbU16 (GetParameterSet ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   602
  i.WriteHtolsbU16 (m_timeoutValue);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   603
  i.WriteHtolsbU16 (GetStartingSequenceControl ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   604
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   605
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   606
uint32_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   607
MgtAddBaRequestHeader::Deserialize (Buffer::Iterator start)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   608
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   609
  Buffer::Iterator i = start;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   610
  m_dialogToken = i.ReadU8 ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   611
  SetParameterSet (i.ReadLsbtohU16 ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   612
  m_timeoutValue = i.ReadLsbtohU16 ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   613
  SetStartingSequenceControl (i.ReadLsbtohU16 ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   614
  return i.GetDistanceFrom (start);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   615
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   616
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   617
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   618
MgtAddBaRequestHeader::SetDelayedBlockAck ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   619
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   620
  m_policy = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   621
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   622
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   623
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   624
MgtAddBaRequestHeader::SetImmediateBlockAck ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   625
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   626
  m_policy = 1;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   627
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   628
  
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   629
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   630
MgtAddBaRequestHeader::SetTid (uint8_t tid)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   631
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   632
  NS_ASSERT (tid < 16);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   633
  m_tid = tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   634
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   635
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   636
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   637
MgtAddBaRequestHeader::SetTimeout (uint16_t timeout)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   638
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   639
  m_timeoutValue = timeout;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   640
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   641
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   642
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   643
MgtAddBaRequestHeader::SetBufferSize (uint16_t size)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   644
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   645
  m_bufferSize = size;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   646
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   647
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   648
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   649
MgtAddBaRequestHeader::SetStartingSequence (uint16_t seq)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   650
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   651
  m_startingSeq = seq;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   652
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   653
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   654
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   655
MgtAddBaRequestHeader::SetAmsduSupport (bool supported)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   656
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   657
  m_amsduSupport = supported;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   658
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   659
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   660
uint8_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   661
MgtAddBaRequestHeader::GetTid (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   662
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   663
  return m_tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   664
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   665
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   666
bool
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   667
MgtAddBaRequestHeader::IsImmediateBlockAck (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   668
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   669
  return (m_policy == 1)?true:false;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   670
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   671
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   672
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   673
MgtAddBaRequestHeader::GetTimeout (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   674
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   675
  return m_timeoutValue;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   676
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   677
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   678
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   679
MgtAddBaRequestHeader::GetBufferSize (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   680
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   681
  return m_bufferSize;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   682
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   683
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   684
bool
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   685
MgtAddBaRequestHeader::IsAmsduSupported (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   686
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   687
  return (m_amsduSupport == 1)?true:false;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   688
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   689
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   690
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   691
MgtAddBaRequestHeader::GetStartingSequence (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   692
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   693
  return m_startingSeq;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   694
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   695
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   696
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   697
MgtAddBaRequestHeader::GetStartingSequenceControl (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   698
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   699
  return (m_startingSeq << 4) & 0xfff0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   700
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   701
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   702
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   703
MgtAddBaRequestHeader::SetStartingSequenceControl (uint16_t seqControl)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   704
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   705
  m_startingSeq = (seqControl >> 4) & 0x0fff;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   706
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   707
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   708
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   709
MgtAddBaRequestHeader::GetParameterSet (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   710
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   711
  uint16_t res = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   712
  res |= m_amsduSupport;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   713
  res |= m_policy << 1;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   714
  res |= m_tid << 2;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   715
  res |= m_bufferSize << 6;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   716
  return res;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   717
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   718
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   719
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   720
MgtAddBaRequestHeader::SetParameterSet (uint16_t params)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   721
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   722
  m_amsduSupport = (params) & 0x01;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   723
  m_policy = (params >> 1) & 0x01;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   724
  m_tid = (params >> 2) & 0x0f;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   725
  m_bufferSize = (params >> 6) & 0x03ff;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   726
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   727
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   728
/***************************************************
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   729
*                 ADDBAResponse
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   730
****************************************************/
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   731
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   732
NS_OBJECT_ENSURE_REGISTERED (MgtAddBaResponseHeader);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   733
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   734
MgtAddBaResponseHeader::MgtAddBaResponseHeader ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   735
  : m_dialogToken (1),
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   736
    m_amsduSupport (1),
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   737
    m_bufferSize (0)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   738
{}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   739
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   740
TypeId
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   741
MgtAddBaResponseHeader::GetTypeId ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   742
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   743
  static TypeId tid = TypeId ("ns3::MgtAddBaResponseHeader")
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   744
    .SetParent<Header> ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   745
    .AddConstructor<MgtAddBaResponseHeader> ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   746
  ;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   747
  return tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   748
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   749
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   750
TypeId
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   751
MgtAddBaResponseHeader::GetInstanceTypeId (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   752
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   753
  return GetTypeId ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   754
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   755
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   756
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   757
MgtAddBaResponseHeader::Print (std::ostream &os) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   758
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   759
  os <<"status code="<<m_code;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   760
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   761
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   762
uint32_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   763
MgtAddBaResponseHeader::GetSerializedSize (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   764
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   765
  uint32_t size = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   766
  size += 1; //Dialog token
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   767
  size += m_code.GetSerializedSize (); //Status code
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   768
  size += 2; //Block ack parameter set
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   769
  size += 2; //Block ack timeout value
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   770
  return size;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   771
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   772
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   773
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   774
MgtAddBaResponseHeader::Serialize (Buffer::Iterator start) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   775
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   776
  Buffer::Iterator i = start;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   777
  i.WriteU8 (m_dialogToken);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   778
  i = m_code.Serialize (i);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   779
  i.WriteHtolsbU16 (GetParameterSet ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   780
  i.WriteHtolsbU16 (m_timeoutValue);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   781
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   782
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   783
uint32_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   784
MgtAddBaResponseHeader::Deserialize (Buffer::Iterator start)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   785
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   786
  Buffer::Iterator i = start;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   787
  m_dialogToken = i.ReadU8 ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   788
  i = m_code.Deserialize (i);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   789
  SetParameterSet (i.ReadLsbtohU16 ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   790
  m_timeoutValue = i.ReadLsbtohU16 ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   791
  return i.GetDistanceFrom (start);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   792
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   793
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   794
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   795
MgtAddBaResponseHeader::SetDelayedBlockAck ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   796
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   797
  m_policy = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   798
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   799
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   800
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   801
MgtAddBaResponseHeader::SetImmediateBlockAck ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   802
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   803
  m_policy = 1;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   804
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   805
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   806
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   807
MgtAddBaResponseHeader::SetTid (uint8_t tid)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   808
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   809
  NS_ASSERT (tid < 16);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   810
  m_tid = tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   811
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   812
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   813
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   814
MgtAddBaResponseHeader::SetTimeout (uint16_t timeout)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   815
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   816
  m_timeoutValue = timeout;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   817
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   818
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   819
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   820
MgtAddBaResponseHeader::SetBufferSize (uint16_t size)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   821
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   822
  m_bufferSize = size;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   823
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   824
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   825
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   826
MgtAddBaResponseHeader::SetStatusCode (StatusCode code)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   827
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   828
  m_code = code;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   829
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   830
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   831
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   832
MgtAddBaResponseHeader::SetAmsduSupport (bool supported)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   833
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   834
  m_amsduSupport = supported;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   835
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   836
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   837
StatusCode
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   838
MgtAddBaResponseHeader::GetStatusCode (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   839
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   840
  return m_code;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   841
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   842
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   843
uint8_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   844
MgtAddBaResponseHeader::GetTid (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   845
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   846
  return m_tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   847
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   848
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   849
bool
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   850
MgtAddBaResponseHeader::IsImmediateBlockAck (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   851
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   852
  return (m_policy == 1)?true:false;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   853
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   854
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   855
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   856
MgtAddBaResponseHeader::GetTimeout (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   857
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   858
  return m_timeoutValue;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   859
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   860
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   861
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   862
MgtAddBaResponseHeader::GetBufferSize (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   863
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   864
  return m_bufferSize;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   865
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   866
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   867
bool
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   868
MgtAddBaResponseHeader::IsAmsduSupported (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   869
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   870
  return (m_amsduSupport == 1)?true:false; 
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   871
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   872
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   873
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   874
MgtAddBaResponseHeader::GetParameterSet (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   875
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   876
  uint16_t res = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   877
  res |= m_amsduSupport;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   878
  res |= m_policy << 1;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   879
  res |= m_tid << 2;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   880
  res |= m_bufferSize << 6;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   881
  return res;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   882
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   883
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   884
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   885
MgtAddBaResponseHeader::SetParameterSet (uint16_t params)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   886
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   887
  m_amsduSupport = (params) & 0x01;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   888
  m_policy = (params >> 1) & 0x01;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   889
  m_tid = (params >> 2) & 0x0f;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   890
  m_bufferSize = (params >> 6) & 0x03ff;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   891
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   892
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   893
/***************************************************
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   894
*                     DelBa
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   895
****************************************************/
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   896
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   897
NS_OBJECT_ENSURE_REGISTERED (MgtDelBaHeader);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   898
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   899
MgtDelBaHeader::MgtDelBaHeader ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   900
  : m_reasonCode (1)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   901
{}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   902
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   903
TypeId
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   904
MgtDelBaHeader::GetTypeId (void)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   905
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   906
  static TypeId tid = TypeId ("ns3::MgtDelBaHeader")
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   907
    .SetParent<Header> ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   908
    .AddConstructor<MgtDelBaHeader> ()
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   909
  ;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   910
  return tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   911
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   912
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   913
TypeId
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   914
MgtDelBaHeader::GetInstanceTypeId (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   915
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   916
  return GetTypeId ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   917
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   918
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   919
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   920
MgtDelBaHeader::Print (std::ostream &os) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   921
{}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   922
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   923
uint32_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   924
MgtDelBaHeader::GetSerializedSize (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   925
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   926
  uint32_t size = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   927
  size += 2; //DelBa parameter set
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   928
  size += 2; //Reason code
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   929
  return size;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   930
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   931
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   932
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   933
MgtDelBaHeader::Serialize (Buffer::Iterator start) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   934
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   935
  Buffer::Iterator i = start;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   936
  i.WriteHtolsbU16 (GetParameterSet ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   937
  i.WriteHtolsbU16 (m_reasonCode);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   938
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   939
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   940
uint32_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   941
MgtDelBaHeader::Deserialize (Buffer::Iterator start)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   942
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   943
  Buffer::Iterator i = start;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   944
  SetParameterSet (i.ReadLsbtohU16 ());
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   945
  m_reasonCode = i.ReadLsbtohU16 ();
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   946
  return i.GetDistanceFrom (start);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   947
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   948
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   949
bool
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   950
MgtDelBaHeader::IsByOriginator (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   951
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   952
  return (m_initiator == 1)?true:false;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   953
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   954
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   955
uint8_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   956
MgtDelBaHeader::GetTid (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   957
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   958
  NS_ASSERT (m_tid < 16);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   959
  uint8_t tid = static_cast<uint8_t> (m_tid);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   960
  return tid;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   961
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   962
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   963
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   964
MgtDelBaHeader::SetByOriginator (void)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   965
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   966
  m_initiator = 1;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   967
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   968
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   969
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   970
MgtDelBaHeader::SetByRecipient (void)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   971
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   972
  m_initiator = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   973
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   974
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   975
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   976
MgtDelBaHeader::SetTid (uint8_t tid)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   977
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   978
  NS_ASSERT (tid < 16);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   979
  m_tid = static_cast<uint16_t> (tid);
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   980
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   981
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   982
uint16_t
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   983
MgtDelBaHeader::GetParameterSet (void) const
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   984
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   985
  uint16_t res = 0;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   986
  res |= m_initiator << 11;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   987
  res |= m_tid << 12;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   988
  return res;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   989
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   990
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   991
void
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   992
MgtDelBaHeader::SetParameterSet (uint16_t params)
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   993
{
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   994
  m_initiator = (params >> 11) & 0x01;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   995
  m_tid = (params >> 12) & 0x0f;
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   996
}
66f939e7aaec add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents: 5824
diff changeset
   997
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   998
} // namespace ns3