A Discrete-Event Network Simulator
API
mac-low-transmission-parameters.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
24 
25 namespace ns3 {
26 
28  : m_nextSize (0),
29  m_waitAck (ACK_NONE),
30  m_sendRts (false)
31 {
32 }
33 
34 void
36 {
37  m_nextSize = size;
38 }
39 
40 void
42 {
43  m_nextSize = 0;
44 }
45 
46 void
48 {
50 }
51 
52 void
54 {
56 }
57 
58 void
60 {
62 }
63 
64 void
66 {
68 }
69 
70 void
72 {
74 }
75 
76 void
78 {
79  m_sendRts = true;
80 }
81 
82 void
84 {
85  m_sendRts = false;
86 }
87 
88 bool
90 {
91  return (m_waitAck == ACK_NORMAL);
92 }
93 
94 bool
96 {
97  return (m_waitAck == BLOCK_ACK_BASIC) ? true : false;
98 }
99 
100 bool
102 {
103  return (m_waitAck == BLOCK_ACK_COMPRESSED) ? true : false;
104 }
105 
106 bool
108 {
109  return (m_waitAck == BLOCK_ACK_MULTI_TID) ? true : false;
110 }
111 
112 bool
114 {
115  return m_sendRts;
116 }
117 
118 bool
120 {
121  return (m_nextSize != 0);
122 }
123 
124 uint32_t
126 {
128  return m_nextSize;
129 }
130 
131 std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters &params)
132 {
133  os << "["
134  << "send rts=" << params.m_sendRts << ", "
135  << "next size=" << params.m_nextSize << ", "
136  << "ack=";
137  switch (params.m_waitAck)
138  {
140  os << "none";
141  break;
143  os << "normal";
144  break;
146  os << "basic-block-ack";
147  break;
149  os << "compressed-block-ack";
150  break;
152  os << "multi-tid-block-ack";
153  break;
154  }
155  os << "]";
156  return os;
157 }
158 
159 } //namespace ns3
void EnableBasicBlockAck(void)
Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
control how a packet is transmitted.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
void EnableCompressedBlockAck(void)
Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void EnableAck(void)
Wait ACKTimeout for an ACK.
void DisableRts(void)
Do not send rts and wait for cts before sending data.
void EnableMultiTidBlockAck(void)
NOT IMPLEMENTED FOR NOW.
enum ns3::MacLowTransmissionParameters::@73 m_waitAck
wait ack enumerated type
void EnableRts(void)
Send a RTS, and wait CTSTimeout for a CTS.
void DisableNextData(void)
Do not attempt to send data burst after current transmission.
void DisableAck(void)
Do not wait for Ack after data transmission.