A Discrete-Event Network Simulator
API
ctrl-headers.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 CTRL_HEADERS_H
22 #define CTRL_HEADERS_H
23 
24 #include "ns3/header.h"
25 
26 namespace ns3 {
27 
32 {
36 };
37 
51 {
52 public:
59  static TypeId GetTypeId (void);
60  TypeId GetInstanceTypeId (void) const;
61  void Print (std::ostream &os) const;
62  uint32_t GetSerializedSize (void) const;
63  void Serialize (Buffer::Iterator start) const;
64  uint32_t Deserialize (Buffer::Iterator start);
65 
71  void SetHtImmediateAck (bool immediateAck);
77  void SetType (BlockAckType type);
83  void SetTidInfo (uint8_t tid);
90  void SetStartingSequence (uint16_t seq);
91 
98  bool MustSendHtImmediateAck (void) const;
104  uint8_t GetTidInfo (void) const;
110  uint16_t GetStartingSequence (void) const;
118  bool IsBasic (void) const;
126  bool IsCompressed (void) const;
133  bool IsMultiTid (void) const;
134 
140  uint16_t GetStartingSequenceControl (void) const;
141 
142 
143 private:
150  void SetStartingSequenceControl (uint16_t seqControl);
156  uint16_t GetBarControl (void) const;
162  void SetBarControl (uint16_t bar);
163 
171  bool m_multiTid;
173  uint16_t m_tidInfo;
174  uint16_t m_startingSeq;
175 };
176 
177 
191 {
192 public:
199  static TypeId GetTypeId (void);
200  TypeId GetInstanceTypeId (void) const;
201  void Print (std::ostream &os) const;
202  uint32_t GetSerializedSize (void) const;
203  void Serialize (Buffer::Iterator start) const;
204  uint32_t Deserialize (Buffer::Iterator start);
205 
211  void SetHtImmediateAck (bool immediateAck);
217  void SetType (BlockAckType type);
223  void SetTidInfo (uint8_t tid);
230  void SetStartingSequence (uint16_t seq);
231 
238  bool MustSendHtImmediateAck (void) const;
244  uint8_t GetTidInfo (void) const;
250  uint16_t GetStartingSequence (void) const;
258  bool IsBasic (void) const;
266  bool IsCompressed (void) const;
273  bool IsMultiTid (void) const;
274 
281  void SetReceivedPacket (uint16_t seq);
289  void SetReceivedFragment (uint16_t seq, uint8_t frag);
298  bool IsPacketReceived (uint16_t seq) const;
309  bool IsFragmentReceived (uint16_t seq, uint8_t frag) const;
310 
316  uint16_t GetStartingSequenceControl (void) const;
323  void SetStartingSequenceControl (uint16_t seqControl);
329  const uint16_t* GetBitmap (void) const;
335  uint64_t GetCompressedBitmap (void) const;
336 
340  void ResetBitmap (void);
341 
342 
343 private:
349  uint16_t GetBaControl (void) const;
355  void SetBaControl (uint16_t bar);
356 
371 
386  uint8_t IndexInBitmap (uint16_t seq) const;
387 
395  bool IsInBitmap (uint16_t seq) const;
396 
404  bool m_multiTid;
406  uint16_t m_tidInfo;
407  uint16_t m_startingSeq;
408 
409  union
410  {
411  uint16_t m_bitmap[64];
413  } bitmap;
414 };
415 
416 } //namespace ns3
417 
418 #endif /* CTRL_HEADERS_H */
Protocol header serialization and deserialization.
Definition: header.h:42
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: ctrl-headers.cc:55
bool m_compressed
compressed
Definition: ctrl-headers.h:172
bool IsBasic(void) const
Check if the current ACK policy is basic (i.e.
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
def start()
Definition: core.py:1790
void SetStartingSequenceControl(uint16_t seqControl)
Set the starting sequence control with the given sequence control value.
bool IsMultiTid(void) const
Check if the current ACK policy has multiple TID.
void SetBarControl(uint16_t bar)
Set the Block ACK control.
bool IsPacketReceived(uint16_t seq) const
Check if the packet with the given sequence number was ACKed in this Block ACK response.
bool IsCompressed(void) const
Check if the current ACK policy is compressed ACK and not multiple TID.
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate ACK.
BlockAckType
Enumeration for different block ACK policies.
Definition: ctrl-headers.h:31
bool m_baAckPolicy
The lsb bit of the BA control field is used only for the HT (High Throughput) delayed block ack confi...
Definition: ctrl-headers.h:403
void SetStartingSequence(uint16_t seq)
Set the starting sequence number from the given raw sequence control field.
void SetTidInfo(uint8_t tid)
Set Traffic ID (TID).
void SetType(BlockAckType type)
Set the block ACK type.
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t GetTidInfo(void) const
Return the Traffic ID (TID).
void Print(std::ostream &os) const
Definition: ctrl-headers.cc:61
union ns3::CtrlBAckResponseHeader::@72 bitmap
bitmap union type
void SetBaControl(uint16_t bar)
Set the block ACK control.
uint16_t GetBaControl(void) const
Return the block ACK control.
bool m_barAckPolicy
The lsb bit of the BAR control field is used only for the HT (High Throughput) delayed block ack conf...
Definition: ctrl-headers.h:170
uint32_t GetSerializedSize(void) const
Definition: ctrl-headers.cc:67
uint16_t m_startingSeq
starting seq
Definition: ctrl-headers.h:174
uint8_t IndexInBitmap(uint16_t seq) const
This function is used to correctly index in both bitmap and compressed bitmap, one bit or one block o...
Headers for Block ack response.
Definition: ctrl-headers.h:190
static TypeId GetTypeId(void)
Get the type ID.
Definition: ctrl-headers.cc:44
uint16_t GetStartingSequenceControl(void) const
Return the starting sequence control.
uint16_t m_tidInfo
TID info.
Definition: ctrl-headers.h:406
bool IsFragmentReceived(uint16_t seq, uint8_t frag) const
Check if the packet with the given sequence number and fragment number was ACKed in this Block ACK re...
uint32_t GetSerializedSize(void) const
Buffer::Iterator SerializeBitmap(Buffer::Iterator start) const
Serialize bitmap to the given buffer.
uint32_t Deserialize(Buffer::Iterator start)
void SetTidInfo(uint8_t tid)
Set Traffic ID (TID).
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Buffer::Iterator DeserializeBitmap(Buffer::Iterator start)
Deserialize bitmap from the given buffer.
static TypeId GetTypeId(void)
Get the type ID.
bool IsBasic(void) const
Check if the current ACK policy is basic (i.e.
void SetType(BlockAckType type)
Set the block ACK type.
uint16_t GetStartingSequenceControl(void) const
Return the starting sequence control.
void Serialize(Buffer::Iterator start) const
void ResetBitmap(void)
Reset the bitmap to 0.
bool IsInBitmap(uint16_t seq) const
Checks if sequence number seq can be acknowledged in the bitmap.
bool m_compressed
compressed
Definition: ctrl-headers.h:405
uint8_t GetTidInfo(void) const
Return the Traffic ID (TID).
uint16_t m_startingSeq
starting seq
Definition: ctrl-headers.h:407
void SetReceivedFragment(uint16_t seq, uint8_t frag)
Set the bitmap that the packet with the given sequence number and fragment number was received...
uint16_t m_bitmap[64]
the block ack bitmap
Definition: ctrl-headers.h:411
uint64_t m_compressedBitmap
the compressed block ack bitmap
Definition: ctrl-headers.h:412
void Serialize(Buffer::Iterator start) const
Definition: ctrl-headers.cc:90
void SetStartingSequenceControl(uint16_t seqControl)
Set the starting sequence control with the given sequence control value.
void SetReceivedPacket(uint16_t seq)
Set the bitmap that the packet with the given sequence number was received.
uint16_t GetBarControl(void) const
Return the Block ACK control.
bool MustSendHtImmediateAck(void) const
Check if the current ACK policy is immediate.
const uint16_t * GetBitmap(void) const
Return the bitmap from the block ACK response header.
uint32_t Deserialize(Buffer::Iterator start)
uint16_t m_tidInfo
TID info.
Definition: ctrl-headers.h:173
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate ACK.
void Print(std::ostream &os) const
bool IsCompressed(void) const
Check if the current ACK policy is compressed ACK and not multiple TID.
bool MustSendHtImmediateAck(void) const
Check if the current ACK policy is immediate.
Headers for Block ack request.
Definition: ctrl-headers.h:50
a unique identifier for an interface.
Definition: type-id.h:58
void SetStartingSequence(uint16_t seq)
Set the starting sequence number from the given raw sequence control field.
bool IsMultiTid(void) const
Check if the current ACK policy has multiple TID.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint64_t GetCompressedBitmap(void) const
Return the compressed bitmap from the block ACK response header.