src/wifi/model/ctrl-headers.h
author Daniel Lertpratchya <nikkipui@gmail.com>
Mon, 18 Feb 2013 10:35:03 -0500
changeset 9238 e6c89f14f09b
parent 7386 2310ed220a61
child 10483 e3a02ed14587
permissions -rw-r--r--
Prevent EndTxNoAck after sending a Block ACK response
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7141
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     2
/*
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     3
 * Copyright (c) 2009 MIRKO BANCHI
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     4
 *
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     8
 *
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    12
 * GNU General Public License for more details.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    13
 *
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    17
 *
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    18
 * Author: Mirko Banchi <mk.banchi@gmail.com>
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    19
 */
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    20
#ifndef CTRL_HEADERS_H
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    21
#define CTRL_HEADERS_H
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    22
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    23
#include "ns3/header.h"
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    24
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    25
namespace ns3 {
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    26
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    27
enum BlockAckType
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    28
{
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    29
  BASIC_BLOCK_ACK,
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    30
  COMPRESSED_BLOCK_ACK,
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    31
  MULTI_TID_BLOCK_ACK
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    32
};
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    33
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    34
/**
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    35
 * \ingroup wifi
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    36
 * \brief Headers for Block ack request.
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    37
 *
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    38
 *  802.11n standard includes three types of block ack:
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    39
 *    - Basic block ack (unique type in 802.11e)
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    40
 *    - Compressed block ack
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    41
 *    - Multi-TID block ack
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    42
 *  For now only basic block ack and compressed block ack
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    43
 *  are supported.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    44
 *  Basic block ack is also default variant.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    45
 */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    46
class CtrlBAckRequestHeader : public Header
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    47
{
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    48
public:
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    49
  CtrlBAckRequestHeader ();
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    50
  ~CtrlBAckRequestHeader ();
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    51
  static TypeId GetTypeId (void);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    52
  virtual TypeId GetInstanceTypeId (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    53
  virtual void Print (std::ostream &os) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    54
  virtual uint32_t GetSerializedSize (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    55
  virtual void Serialize (Buffer::Iterator start) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    56
  virtual uint32_t Deserialize (Buffer::Iterator start);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    57
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    58
  void SetHtImmediateAck (bool immediateAck);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    59
  void SetType (enum BlockAckType type);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    60
  void SetTidInfo (uint8_t tid);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    61
  void SetStartingSequence (uint16_t seq);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    62
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    63
  bool MustSendHtImmediateAck (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    64
  uint8_t GetTidInfo (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    65
  uint16_t GetStartingSequence (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    66
  bool IsBasic (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    67
  bool IsCompressed (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    68
  bool IsMultiTid (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    69
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    70
  uint16_t GetStartingSequenceControl (void) const;
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    71
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    72
private:
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    73
  void SetStartingSequenceControl (uint16_t seqControl);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    74
  uint16_t GetBarControl (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    75
  void SetBarControl (uint16_t bar);
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    76
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    77
  /**
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    78
   * The lsb bit of the BAR control field is used only for the
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    79
   * HT (High Throughput) delayed block ack configuration.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    80
   * For now only non HT immediate block ack is implemented so this field
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    81
   * is here only for a future implementation of HT delayed variant.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    82
   */
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    83
  bool m_barAckPolicy;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    84
  bool m_multiTid;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    85
  bool m_compressed;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    86
  uint16_t m_tidInfo;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    87
  uint16_t m_startingSeq;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    88
};
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    89
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    90
/**
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    91
 * \ingroup wifi
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    92
 * \brief Headers for Block ack response.
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    93
 *
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    94
 *  802.11n standard includes three types of block ack:
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    95
 *    - Basic block ack (unique type in 802.11e)
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    96
 *    - Compressed block ack
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    97
 *    - Multi-TID block ack
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    98
 *  For now only basic block ack and compressed block ack
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    99
 *  are supported.
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   100
 *  Basic block ack is also default variant.
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   101
 */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   102
class CtrlBAckResponseHeader : public Header
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   103
{
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   104
public:
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   105
  CtrlBAckResponseHeader ();
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   106
  ~CtrlBAckResponseHeader ();
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   107
  static TypeId GetTypeId (void);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   108
  virtual TypeId GetInstanceTypeId (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   109
  virtual void Print (std::ostream &os) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   110
  virtual uint32_t GetSerializedSize (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   111
  virtual void Serialize (Buffer::Iterator start) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   112
  virtual uint32_t Deserialize (Buffer::Iterator start);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   113
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   114
  void SetHtImmediateAck (bool immeadiateAck);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   115
  void SetType (enum BlockAckType type);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   116
  void SetTidInfo (uint8_t tid);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   117
  void SetStartingSequence (uint16_t seq);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   118
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   119
  bool MustSendHtImmediateAck (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   120
  uint8_t GetTidInfo (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   121
  uint16_t GetStartingSequence (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   122
  bool IsBasic (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   123
  bool IsCompressed (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   124
  bool IsMultiTid (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   125
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   126
  void SetReceivedPacket (uint16_t seq);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   127
  void SetReceivedFragment (uint16_t seq, uint8_t frag);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   128
  bool IsPacketReceived (uint16_t seq) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   129
  bool IsFragmentReceived (uint16_t seq, uint8_t frag) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   130
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   131
  uint16_t GetStartingSequenceControl (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   132
  void SetStartingSequenceControl (uint16_t seqControl);
6588
a83484625502 Improve block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6273
diff changeset
   133
  const uint16_t* GetBitmap (void) const;
a83484625502 Improve block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6273
diff changeset
   134
  uint64_t GetCompressedBitmap (void) const;
6589
385ef147f7b6 Add ResetBitmap method to block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6588
diff changeset
   135
385ef147f7b6 Add ResetBitmap method to block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6588
diff changeset
   136
  void ResetBitmap (void);
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   137
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   138
private:
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   139
  uint16_t GetBaControl (void) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   140
  void SetBaControl (uint16_t bar);
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   141
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   142
  Buffer::Iterator SerializeBitmap (Buffer::Iterator start) const;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   143
  Buffer::Iterator DeserializeBitmap (Buffer::Iterator start);
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   144
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   145
  /**
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   146
   * This function is used to correctly index in both bitmap
6273
8d70de29d514 spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents: 5948
diff changeset
   147
   * and compressed bitmap, one bit or one block of 16 bits respectively.
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   148
   *
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   149
   * for more details see 7.2.1.8 in IEEE 802.11n/D4.00
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   150
   *
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   151
   * \param seq the sequence number
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   152
   *
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   153
   * \return If we are using basic block ack, return value represents index of
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   154
   * block of 16 bits for packet having sequence number equals to <i>seq</i>.
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   155
   * If we are using compressed block ack, return value represents bit
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   156
   * to set to 1 in the compressed bitmap to indicate that packet having
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   157
   * sequence number equals to <i>seq</i> was correctly received.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   158
   */
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   159
  uint8_t IndexInBitmap (uint16_t seq) const;
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   160
6588
a83484625502 Improve block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6273
diff changeset
   161
  /**
a83484625502 Improve block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6273
diff changeset
   162
   * Checks if sequence number <i>seq</i> can be acknowledged in the bitmap.
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   163
   *
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   164
   * \param seq the sequence number
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   165
   *
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   166
   * \return
6588
a83484625502 Improve block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6273
diff changeset
   167
   */
a83484625502 Improve block ack response header
Mirko Banchi <mk.banchi@gmail.com>
parents: 6273
diff changeset
   168
  bool IsInBitmap (uint16_t seq) const;
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   169
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   170
  /**
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   171
   * The lsb bit of the BA control field is used only for the
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   172
   * HT (High Throughput) delayed block ack configuration.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   173
   * For now only non HT immediate block ack is implemented so this field
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   174
   * is here only for a future implementation of HT delayed variant.
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   175
   */
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   176
  bool m_baAckPolicy;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   177
  bool m_multiTid;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   178
  bool m_compressed;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   179
  uint16_t m_tidInfo;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   180
  uint16_t m_startingSeq;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   181
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   182
  union
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
   183
  {
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   184
    uint16_t m_bitmap[64];
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   185
    uint64_t m_compressedBitmap;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   186
  } bitmap;
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   187
};
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   188
7386
2310ed220a61 standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents: 7385
diff changeset
   189
} // namespace ns3
5948
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   190
34bd93988e2b add block ack headers
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   191
#endif /* CTRL_HEADERS_H */