A Discrete-Event Network Simulator
API
originator-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, 2010 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  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
20  */
21 #ifndef ORIGINATOR_BLOCK_ACK_AGREEMENT_H
22 #define ORIGINATOR_BLOCK_ACK_AGREEMENT_H
23 
24 #include "block-ack-agreement.h"
25 #include "block-ack-window.h"
26 
28 
29 namespace ns3 {
30 
31 class WifiMacQueueItem;
32 
59 {
61  friend class BlockAckManager;
63  friend class ::OriginatorBlockAckWindowTest;
64 
65 
66 public:
73  OriginatorBlockAckAgreement (Mac48Address recipient, uint8_t tid);
100  enum State
102  {
108  };
114  void SetState (State state);
121  bool IsPending (void) const;
128  bool IsEstablished (void) const;
135  bool IsNoReply (void) const;
142  bool IsReset (void) const;
149  bool IsRejected (void) const;
150 
158  uint16_t GetStartingSequence (void) const;
159 
167  std::size_t GetDistance (uint16_t seqNumber) const;
168 
173  void InitTxWindow (void);
174 
196 
197 
198 private:
203  void AdvanceTxWindow (void);
204 
207 };
208 
209 } //namespace ns3
210 
211 #endif /* ORIGINATOR_BLOCK_ACK_AGREEMENT_H */
void AdvanceTxWindow(void)
Advance the transmit window so that the starting sequence number is the nearest unacknowledged MPDU...
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Maintains the state and information about transmitted MPDUs with Ack Policy set to Block Ack for an o...
OriginatorBlockAckAgreement(Mac48Address recipient, uint8_t tid)
Constructor.
bool IsNoReply(void) const
Check if the current state of this agreement is NO_REPLY.
bool IsEstablished(void) const
Check if the current state of this agreement is ESTABLISHED.
bool IsPending(void) const
Check if the current state of this agreement is PENDING.
std::size_t GetDistance(uint16_t seqNumber) const
Get the distance between the current starting sequence number and the given sequence number...
bool IsRejected(void) const
Check if the current state of this agreement is REJECTED.
BlockAckWindow m_txWindow
originator&#39;s transmit window
void NotifyDiscardedMpdu(Ptr< const WifiMacQueueItem > mpdu)
Advance the transmit window beyond the MPDU that has been reported to be discarded.
Block ack window.
Test for the originator block ack window.
void SetState(State state)
Set the current state.
void NotifyAckedMpdu(Ptr< const WifiMacQueueItem > mpdu)
Record that the given MPDU has been acknowledged and advance the transmit window if possible...
void NotifyTransmittedMpdu(Ptr< const WifiMacQueueItem > mpdu)
Advance the transmit window so as to include the transmitted MPDU, if the latter is not an old packet...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
an EUI-48 address
Definition: mac48-address.h:43
State
Represents the state for this agreement.
Maintains information for a block ack agreement.
bool IsReset(void) const
Check if the current state of this agreement is RESET.
uint16_t GetStartingSequence(void) const
Return the starting sequence number of the transmit window, if a transmit window has been initialized...
Manages all block ack agreements for an originator station.
void InitTxWindow(void)
Initialize the originator&#39;s transmit window by setting its size and starting sequence number equal to...