A Discrete-Event Network Simulator
API
originator-block-ack-agreement.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009, 2010 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  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19  */
20 #ifndef ORIGINATOR_BLOCK_ACK_AGREEMENT_H
21 #define ORIGINATOR_BLOCK_ACK_AGREEMENT_H
22 
23 #include "block-ack-agreement.h"
24 #include "block-ack-window.h"
25 
27 
28 namespace ns3
29 {
30 
31 class WifiMpdu;
32 
57 {
59  friend class BlockAckManager;
61  friend class ::OriginatorBlockAckWindowTest;
62 
63  public:
70  OriginatorBlockAckAgreement(Mac48Address recipient, uint8_t tid);
72 
99  enum State
100  {
105  REJECTED
106  };
107 
113  void SetState(State state);
120  bool IsPending() const;
127  bool IsEstablished() const;
134  bool IsNoReply() const;
141  bool IsReset() const;
148  bool IsRejected() const;
149 
157  uint16_t GetStartingSequence() const override;
158 
166  std::size_t GetDistance(uint16_t seqNumber) const;
167 
172  void InitTxWindow();
173 
195 
196  private:
201  void AdvanceTxWindow();
202 
205 };
206 
207 } // namespace ns3
208 
209 #endif /* ORIGINATOR_BLOCK_ACK_AGREEMENT_H */
Test for the originator block ack window.
Maintains information for a block ack agreement.
Manages all block ack agreements for an originator station.
Block ack window.
an EUI-48 address
Definition: mac48-address.h:46
Maintains the state and information about transmitted MPDUs with Ack Policy set to Block Ack for an o...
void NotifyDiscardedMpdu(Ptr< const WifiMpdu > mpdu)
Advance the transmit window beyond the MPDU that has been reported to be discarded.
uint16_t GetStartingSequence() const override
Return the starting sequence number of the transmit window, if a transmit window has been initialized...
BlockAckWindow m_txWindow
originator's transmit window
void NotifyTransmittedMpdu(Ptr< const WifiMpdu > mpdu)
Advance the transmit window so as to include the transmitted MPDU, if the latter is not an old packet...
void NotifyAckedMpdu(Ptr< const WifiMpdu > mpdu)
Record that the given MPDU has been acknowledged and advance the transmit window if possible.
bool IsPending() const
Check if the current state of this agreement is PENDING.
bool IsReset() const
Check if the current state of this agreement is RESET.
void AdvanceTxWindow()
Advance the transmit window so that the starting sequence number is the nearest unacknowledged MPDU.
OriginatorBlockAckAgreement(Mac48Address recipient, uint8_t tid)
Constructor.
bool IsEstablished() const
Check if the current state of this agreement is ESTABLISHED.
void SetState(State state)
Set the current state.
State
Represents the state for this agreement.
std::size_t GetDistance(uint16_t seqNumber) const
Get the distance between the current starting sequence number and the given sequence number.
bool IsNoReply() const
Check if the current state of this agreement is NO_REPLY.
bool IsRejected() const
Check if the current state of this agreement is REJECTED.
void InitTxWindow()
Initialize the originator's transmit window by setting its size and starting sequence number equal to...
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.