A Discrete-Event Network Simulator
API
block-ack-agreement.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 MIRKO BANCHI
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mirko Banchi <mk.banchi@gmail.com>
18  */
19 
20 #ifndef BLOCK_ACK_AGREEMENT_H
21 #define BLOCK_ACK_AGREEMENT_H
22 
23 #include "block-ack-type.h"
24 
25 #include "ns3/event-id.h"
26 #include "ns3/mac48-address.h"
27 
28 namespace ns3
29 {
35 {
36  friend class HtFrameExchangeManager;
37 
38  public:
45  BlockAckAgreement(Mac48Address peer, uint8_t tid);
46  virtual ~BlockAckAgreement();
52  void SetBufferSize(uint16_t bufferSize);
58  void SetTimeout(uint16_t timeout);
64  void SetStartingSequence(uint16_t seq);
70  void SetStartingSequenceControl(uint16_t seq);
74  void SetImmediateBlockAck();
78  void SetDelayedBlockAck();
84  void SetAmsduSupport(bool supported);
90  uint8_t GetTid() const;
96  Mac48Address GetPeer() const;
102  uint16_t GetBufferSize() const;
108  uint16_t GetTimeout() const;
114  virtual uint16_t GetStartingSequence() const;
120  uint16_t GetStartingSequenceControl() const;
126  uint16_t GetWinEnd() const;
133  bool IsImmediateBlockAck() const;
140  bool IsAmsduSupported() const;
146  void SetHtSupported(bool htSupported);
153  bool IsHtSupported() const;
174  static std::size_t GetDistance(uint16_t seqNumber, uint16_t startingSeqNumber);
175 
176  protected:
180  uint8_t m_tid;
181  uint16_t m_bufferSize;
182  uint16_t m_timeout;
183  uint16_t m_startingSeq;
184  uint16_t m_winEnd;
185  uint8_t m_htSupported;
187 };
188 
189 } // namespace ns3
190 
191 #endif /* BLOCK_ACK_AGREEMENT_H */
Maintains information for a block ack agreement.
uint16_t GetTimeout() const
Return the timeout.
bool IsHtSupported() const
Check whether HT is supported.
BlockAckAgreement(Mac48Address peer, uint8_t tid)
Constructor for BlockAckAgreement with given peer and TID.
Mac48Address m_peer
Peer address.
void SetImmediateBlockAck()
Set block ack policy to immediate Ack.
uint16_t m_winEnd
Ending sequence number.
void SetStartingSequence(uint16_t seq)
Set starting sequence number.
uint8_t m_htSupported
Flag whether HT is supported.
virtual uint16_t GetStartingSequence() const
Return the starting sequence number.
void SetStartingSequenceControl(uint16_t seq)
Set starting sequence control.
BlockAckType GetBlockAckType() const
Get the type of the Block Acks sent by the recipient of this agreement.
EventId m_inactivityEvent
inactivity event
BlockAckReqType GetBlockAckReqType() const
Get the type of the Block Ack Requests sent by the originator of this agreement.
void SetBufferSize(uint16_t bufferSize)
Set buffer size.
uint8_t m_blockAckPolicy
Type of block ack: immediate or delayed.
void SetDelayedBlockAck()
Set block ack policy to delayed Ack.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
uint16_t GetWinEnd() const
Return the last sequence number covered by the ack window.
uint8_t m_tid
Traffic ID.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t m_startingSeq
Starting sequence control.
uint16_t m_bufferSize
Buffer size.
void SetTimeout(uint16_t timeout)
Set timeout.
bool IsImmediateBlockAck() const
Check whether the current ack policy is immediate BlockAck.
uint8_t m_amsduSupported
Flag whether MSDU aggregation is supported.
static std::size_t GetDistance(uint16_t seqNumber, uint16_t startingSeqNumber)
Get the distance between the given starting sequence number and the given sequence number.
uint16_t GetStartingSequenceControl() const
Return the starting sequence control.
uint16_t GetBufferSize() const
Return the buffer size.
void SetHtSupported(bool htSupported)
Enable or disable HT support.
bool IsAmsduSupported() const
Check whether A-MSDU is supported.
Mac48Address GetPeer() const
Return the peer address.
An identifier for simulation events.
Definition: event-id.h:55
HtFrameExchangeManager handles the frame exchange sequences for HT stations.
an EUI-48 address
Definition: mac48-address.h:46
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Time timeout
The different BlockAckRequest variants.
The different BlockAck variants.