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 {
35  friend class HtFrameExchangeManager;
36 
37 public:
44  BlockAckAgreement (Mac48Address peer, uint8_t tid);
45  virtual ~BlockAckAgreement ();
51  void SetBufferSize (uint16_t bufferSize);
57  void SetTimeout (uint16_t timeout);
63  void SetStartingSequence (uint16_t seq);
69  void SetStartingSequenceControl (uint16_t seq);
73  void SetImmediateBlockAck (void);
77  void SetDelayedBlockAck (void);
83  void SetAmsduSupport (bool supported);
89  uint8_t GetTid (void) const;
95  Mac48Address GetPeer (void) const;
101  uint16_t GetBufferSize (void) const;
107  uint16_t GetTimeout (void) const;
113  virtual uint16_t GetStartingSequence (void) const;
119  uint16_t GetStartingSequenceControl (void) const;
125  uint16_t GetWinEnd (void) const;
132  bool IsImmediateBlockAck (void) const;
139  bool IsAmsduSupported (void) const;
145  void SetHtSupported (bool htSupported);
152  bool IsHtSupported (void) const;
158  BlockAckType GetBlockAckType (void) const;
164  BlockAckReqType GetBlockAckReqType (void) const;
173  static std::size_t GetDistance (uint16_t seqNumber, uint16_t startingSeqNumber);
174 
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 */
ns3::BlockAckAgreement::GetTid
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Definition: block-ack-agreement.cc:100
ns3::BlockAckAgreement::SetHtSupported
void SetHtSupported(bool htSupported)
Enable or disable HT support.
Definition: block-ack-agreement.cc:156
ns3::BlockAckAgreement::BlockAckAgreement
BlockAckAgreement(Mac48Address peer, uint8_t tid)
Constructor for BlockAckAgreement with given peer and TID.
Definition: block-ack-agreement.cc:29
ns3::BlockAckAgreement::m_bufferSize
uint16_t m_bufferSize
Buffer size.
Definition: block-ack-agreement.h:181
ns3::EventId
An identifier for simulation events.
Definition: event-id.h:54
block-ack-type.h
ns3::BlockAckAgreement::m_amsduSupported
uint8_t m_amsduSupported
Flag whether MSDU aggregation is supported.
Definition: block-ack-agreement.h:178
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::BlockAckAgreement::m_startingSeq
uint16_t m_startingSeq
Starting sequence control.
Definition: block-ack-agreement.h:183
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::BlockAckAgreement::m_timeout
uint16_t m_timeout
Timeout.
Definition: block-ack-agreement.h:182
ns3::BlockAckAgreement::GetBlockAckReqType
BlockAckReqType GetBlockAckReqType(void) const
Get the type of the Block Ack Requests sent by the originator of this agreement.
Definition: block-ack-agreement.cc:184
ns3::BlockAckAgreement::SetImmediateBlockAck
void SetImmediateBlockAck(void)
Set block ack policy to immediate Ack.
Definition: block-ack-agreement.cc:79
ns3::BlockAckAgreement
Maintains information for a block ack agreement.
Definition: block-ack-agreement.h:34
ns3::BlockAckAgreement::GetTimeout
uint16_t GetTimeout(void) const
Return the timeout.
Definition: block-ack-agreement.cc:119
ns3::BlockAckAgreement::m_winEnd
uint16_t m_winEnd
Ending sequence number.
Definition: block-ack-agreement.h:184
ns3::HtFrameExchangeManager
HtFrameExchangeManager handles the frame exchange sequences for HT stations.
Definition: ht-frame-exchange-manager.h:45
ns3::BlockAckReqType
The different BlockAckRequest variants.
Definition: block-ack-type.h:75
ns3::BlockAckAgreement::m_blockAckPolicy
uint8_t m_blockAckPolicy
Type of block ack: immediate or delayed.
Definition: block-ack-agreement.h:179
ns3::BlockAckAgreement::GetPeer
Mac48Address GetPeer(void) const
Return the peer address.
Definition: block-ack-agreement.cc:106
ns3::BlockAckType
The different BlockAck variants.
Definition: block-ack-type.h:34
ns3::BlockAckAgreement::GetWinEnd
uint16_t GetWinEnd(void) const
Return the last sequence number covered by the ack window.
Definition: block-ack-agreement.cc:150
ns3::BlockAckAgreement::m_peer
Mac48Address m_peer
Peer address.
Definition: block-ack-agreement.h:177
ns3::BlockAckAgreement::~BlockAckAgreement
virtual ~BlockAckAgreement()
Definition: block-ack-agreement.cc:40
ns3::BlockAckAgreement::IsAmsduSupported
bool IsAmsduSupported(void) const
Check whether A-MSDU is supported.
Definition: block-ack-agreement.cc:144
ns3::BlockAckAgreement::SetStartingSequence
void SetStartingSequence(uint16_t seq)
Set starting sequence number.
Definition: block-ack-agreement.cc:63
ns3::BlockAckAgreement::SetAmsduSupport
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
Definition: block-ack-agreement.cc:93
ns3::BlockAckAgreement::IsHtSupported
bool IsHtSupported(void) const
Check whether HT is supported.
Definition: block-ack-agreement.cc:163
ns3::BlockAckAgreement::GetStartingSequence
virtual uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Definition: block-ack-agreement.cc:125
ns3::BlockAckAgreement::IsImmediateBlockAck
bool IsImmediateBlockAck(void) const
Check whether the current ack policy is immediate BlockAck.
Definition: block-ack-agreement.cc:138
ns3::BlockAckAgreement::GetBufferSize
uint16_t GetBufferSize(void) const
Return the buffer size.
Definition: block-ack-agreement.cc:113
timeout
ns3::Time timeout
Definition: openflow-switch.cc:52
ns3::BlockAckAgreement::SetDelayedBlockAck
void SetDelayedBlockAck(void)
Set block ack policy to delayed Ack.
Definition: block-ack-agreement.cc:86
ns3::BlockAckAgreement::m_inactivityEvent
EventId m_inactivityEvent
inactivity event
Definition: block-ack-agreement.h:186
ns3::BlockAckAgreement::GetStartingSequenceControl
uint16_t GetStartingSequenceControl(void) const
Return the starting sequence control.
Definition: block-ack-agreement.cc:131
ns3::BlockAckAgreement::m_htSupported
uint8_t m_htSupported
Flag whether HT is supported.
Definition: block-ack-agreement.h:185
ns3::BlockAckAgreement::SetTimeout
void SetTimeout(uint16_t timeout)
Set timeout.
Definition: block-ack-agreement.cc:56
ns3::BlockAckAgreement::GetBlockAckType
BlockAckType GetBlockAckType(void) const
Get the type of the Block Acks sent by the recipient of this agreement.
Definition: block-ack-agreement.cc:169
ns3::BlockAckAgreement::SetStartingSequenceControl
void SetStartingSequenceControl(uint16_t seq)
Set starting sequence control.
Definition: block-ack-agreement.cc:71
ns3::BlockAckAgreement::GetDistance
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.
Definition: block-ack-agreement.cc:195
ns3::BlockAckAgreement::m_tid
uint8_t m_tid
Traffic ID.
Definition: block-ack-agreement.h:180
ns3::BlockAckAgreement::SetBufferSize
void SetBufferSize(uint16_t bufferSize)
Set buffer size.
Definition: block-ack-agreement.cc:47