A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
block-ack-agreement.cc
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
#include "
block-ack-agreement.h
"
21
22
namespace
ns3 {
23
24
BlockAckAgreement::BlockAckAgreement
()
25
: m_amsduSupported (0),
26
m_blockAckPolicy (1),
27
m_inactivityEvent ()
28
{
29
}
30
31
BlockAckAgreement::BlockAckAgreement
(
Mac48Address
peer, uint8_t tid)
32
: m_amsduSupported (0),
33
m_blockAckPolicy (1),
34
m_inactivityEvent ()
35
{
36
m_tid
= tid;
37
m_peer
= peer;
38
}
39
40
BlockAckAgreement::~BlockAckAgreement
()
41
{
42
m_inactivityEvent
.
Cancel
();
43
}
44
45
void
46
BlockAckAgreement::SetBufferSize
(uint16_t bufferSize)
47
{
48
NS_ASSERT
(bufferSize <= 1024);
49
NS_ASSERT
(bufferSize % 16 == 0);
50
m_bufferSize
= bufferSize;
51
}
52
void
53
BlockAckAgreement::SetTimeout
(uint16_t
timeout
)
54
{
55
m_timeout
=
timeout
;
56
}
57
void
58
BlockAckAgreement::SetStartingSequence
(uint16_t seq)
59
{
60
NS_ASSERT
(seq < 4096);
61
m_startingSeq
= seq;
62
}
63
void
64
BlockAckAgreement::SetImmediateBlockAck
(
void
)
65
{
66
m_blockAckPolicy
= 1;
67
}
68
void
69
BlockAckAgreement::SetDelayedBlockAck
(
void
)
70
{
71
m_blockAckPolicy
= 0;
72
}
73
void
74
BlockAckAgreement::SetAmsduSupport
(
bool
supported)
75
{
76
m_amsduSupported
= supported;
77
}
78
79
uint8_t
80
BlockAckAgreement::GetTid
(
void
)
const
81
{
82
return
m_tid
;
83
}
84
Mac48Address
85
BlockAckAgreement::GetPeer
(
void
)
const
86
{
87
return
m_peer
;
88
}
89
uint16_t
90
BlockAckAgreement::GetBufferSize
(
void
)
const
91
{
92
return
m_bufferSize
;
93
}
94
uint16_t
95
BlockAckAgreement::GetTimeout
(
void
)
const
96
{
97
return
m_timeout
;
98
}
99
uint16_t
100
BlockAckAgreement::GetStartingSequence
(
void
)
const
101
{
102
return
m_startingSeq
;
103
}
104
uint16_t
105
BlockAckAgreement::GetStartingSequenceControl
(
void
)
const
106
{
107
uint16_t seqControl = (
m_startingSeq
<< 4) | 0xfff0;
108
return
seqControl;
109
}
110
bool
111
BlockAckAgreement::IsImmediateBlockAck
(
void
)
const
112
{
113
return
(
m_blockAckPolicy
== 1);
114
}
115
bool
116
BlockAckAgreement::IsAmsduSupported
(
void
)
const
117
{
118
return
(
m_amsduSupported
== 1) ?
true
:
false
;
119
}
120
121
}
// namespace ns3
src
wifi
model
block-ack-agreement.cc
Generated on Tue Nov 13 2012 10:32:24 for ns-3 by
1.8.1.2