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