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
uan-header-rc.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
19
*/
20
21
22
#ifndef UAN_HEADER_RC_H
23
#define UAN_HEADER_RC_H
24
25
#include "ns3/header.h"
26
#include "ns3/nstime.h"
27
#include "ns3/uan-address.h"
28
29
#include <set>
30
31
namespace
ns3 {
32
41
class
UanHeaderRcData
:
public
Header
42
{
43
public
:
44
UanHeaderRcData
();
50
UanHeaderRcData
(uint8_t frameNum,
Time
propDelay);
51
virtual
~UanHeaderRcData
();
52
53
static
TypeId
GetTypeId
(
void
);
54
58
void
SetFrameNo
(uint8_t frameNum);
63
void
SetPropDelay
(
Time
propDelay);
67
uint8_t
GetFrameNo
(
void
)
const
;
72
Time
GetPropDelay
(
void
)
const
;
73
74
// Inherrited methods
75
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
76
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
77
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
78
virtual
void
Print
(std::ostream &os)
const
;
79
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
80
81
private
:
82
uint8_t
m_frameNo
;
83
Time
m_propDelay
;
84
};
85
93
class
UanHeaderRcRts
:
public
Header
94
{
95
public
:
96
UanHeaderRcRts
();
105
UanHeaderRcRts
(uint8_t frameNo, uint8_t retryNo, uint8_t noFrames, uint16_t length,
Time
ts);
106
virtual
~UanHeaderRcRts
();
107
108
static
TypeId
GetTypeId
(
void
);
109
113
void
SetFrameNo
(uint8_t fno);
117
void
SetNoFrames
(uint8_t no);
121
void
SetTimeStamp
(
Time
timeStamp);
126
void
SetLength
(uint16_t length);
130
void
SetRetryNo
(uint8_t no);
131
135
uint8_t
GetFrameNo
(
void
)
const
;
139
uint8_t
GetNoFrames
(
void
)
const
;
144
Time
GetTimeStamp
(
void
)
const
;
148
uint16_t
GetLength
(
void
)
const
;
152
uint8_t
GetRetryNo
(
void
)
const
;
153
154
// Inherrited methods
155
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
156
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
157
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
158
virtual
void
Print
(std::ostream &os)
const
;
159
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
160
161
private
:
162
uint8_t
m_frameNo
;
163
uint8_t
m_noFrames
;
164
uint16_t
m_length
;
165
Time
m_timeStamp
;
166
uint8_t
m_retryNo
;
167
};
168
176
class
UanHeaderRcCtsGlobal
:
public
Header
177
{
178
public
:
182
UanHeaderRcCtsGlobal
();
190
UanHeaderRcCtsGlobal
(
Time
wt,
Time
ts, uint16_t rate, uint16_t retryRate);
191
~UanHeaderRcCtsGlobal
();
192
193
static
TypeId
GetTypeId
(
void
);
194
198
void
SetRateNum
(uint16_t rate);
202
void
SetRetryRate
(uint16_t rate);
206
void
SetWindowTime
(
Time
t);
207
211
void
SetTxTimeStamp
(
Time
timeStamp);
212
216
uint16_t
GetRateNum
(
void
)
const
;
220
uint16_t
GetRetryRate
(
void
)
const
;
224
Time
GetWindowTime
(
void
)
const
;
228
Time
GetTxTimeStamp
(
void
)
const
;
229
230
// Inherrited methods
231
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
232
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
233
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
234
virtual
void
Print
(std::ostream &os)
const
;
235
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
236
237
private
:
238
Time
m_timeStampTx
;
239
Time
m_winTime
;
240
uint16_t
m_retryRate
;
241
uint16_t
m_rateNum
;
242
};
252
class
UanHeaderRcCts
:
public
Header
253
{
254
public
:
255
UanHeaderRcCts
();
264
UanHeaderRcCts
(uint8_t frameNo, uint8_t retryNo,
Time
rtsTs,
Time
delay,
UanAddress
addr);
265
virtual
~UanHeaderRcCts
();
266
267
static
TypeId
GetTypeId
(
void
);
268
272
void
SetFrameNo
(uint8_t frameNo);
276
void
SetRtsTimeStamp
(
Time
timeStamp);
280
void
SetDelayToTx
(
Time
delay);
284
void
SetRetryNo
(uint8_t no);
288
void
SetAddress
(
UanAddress
addr);
289
293
uint8_t
GetFrameNo
(
void
)
const
;
297
Time
GetRtsTimeStamp
(
void
)
const
;
301
Time
GetDelayToTx
(
void
)
const
;
305
uint8_t
GetRetryNo
(
void
)
const
;
309
UanAddress
GetAddress
(
void
)
const
;
310
311
// Inherrited methods
312
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
313
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
314
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
315
virtual
void
Print
(std::ostream &os)
const
;
316
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
317
318
private
:
319
uint8_t
m_frameNo
;
320
Time
m_timeStampRts
;
321
uint8_t
m_retryNo
;
322
Time
m_delay
;
323
UanAddress
m_address
;
324
};
325
330
class
UanHeaderRcAck
:
public
Header
331
{
332
public
:
333
UanHeaderRcAck
();
334
virtual
~UanHeaderRcAck
();
335
336
static
TypeId
GetTypeId
(
void
);
337
341
void
SetFrameNo
(uint8_t frameNo);
345
void
AddNackedFrame
(uint8_t
frame
);
346
350
const
std::set<uint8_t> &
GetNackedFrames
(
void
)
const
;
354
uint8_t
GetFrameNo
(
void
)
const
;
358
uint8_t
GetNoNacks
(
void
)
const
;
359
360
// Inherrited methods
361
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
362
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
363
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
364
virtual
void
Print
(std::ostream &os)
const
;
365
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
366
367
private
:
368
uint8_t
m_frameNo
;
369
std::set<uint8_t>
m_nackedFrames
;
370
371
};
372
373
}
374
375
#endif
/* UAN_HEADER_RC_H */
src
uan
model
uan-header-rc.h
Generated on Fri Dec 21 2012 19:00:47 for ns-3 by
1.8.1.2