A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
dsr-option-header.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Yufei Cheng
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Yufei Cheng <yfcheng@ittc.ku.edu>
7
*
8
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
9
* ResiliNets Research Group https://resilinets.org/
10
* Information and Telecommunication Technology Center (ITTC)
11
* and Department of Electrical Engineering and Computer Science
12
* The University of Kansas Lawrence, KS USA.
13
*
14
* Work supported in part by NSF FIND (Future Internet Design) Program
15
* under grant CNS-0626918 (Postmodern Internet Architecture),
16
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
17
* US Department of Defense (DoD), and ITTC at The University of Kansas.
18
*/
19
20
#include "
dsr-option-header.h
"
21
22
#include "ns3/address-utils.h"
23
#include "ns3/assert.h"
24
#include "ns3/enum.h"
25
#include "ns3/header.h"
26
#include "ns3/ipv4-address.h"
27
#include "ns3/log.h"
28
#include "ns3/packet.h"
29
30
namespace
ns3
31
{
32
33
NS_LOG_COMPONENT_DEFINE
(
"DsrOptionHeader"
);
34
35
namespace
dsr
36
{
37
38
NS_OBJECT_ENSURE_REGISTERED
(DsrOptionHeader);
39
40
TypeId
41
DsrOptionHeader::GetTypeId
()
42
{
43
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionHeader"
)
44
.
AddConstructor
<
DsrOptionHeader
>()
45
.SetParent<Header>()
46
.SetGroupName(
"Dsr"
);
47
return
tid;
48
}
49
50
TypeId
51
DsrOptionHeader::GetInstanceTypeId
()
const
52
{
53
return
GetTypeId
();
54
}
55
56
DsrOptionHeader::DsrOptionHeader
()
57
: m_type(0),
58
m_length(0)
59
{
60
}
61
62
DsrOptionHeader::~DsrOptionHeader
()
63
{
64
}
65
66
void
67
DsrOptionHeader::SetType
(uint8_t type)
68
{
69
m_type
= type;
70
}
71
72
uint8_t
73
DsrOptionHeader::GetType
()
const
74
{
75
return
m_type
;
76
}
77
78
void
79
DsrOptionHeader::SetLength
(uint8_t length)
80
{
81
m_length
= length;
82
}
83
84
uint8_t
85
DsrOptionHeader::GetLength
()
const
86
{
87
return
m_length
;
88
}
89
90
void
91
DsrOptionHeader::Print
(std::ostream& os)
const
92
{
93
os <<
"( type = "
<< (
uint32_t
)
m_type
<<
" length = "
<< (
uint32_t
)
m_length
<<
" )"
;
94
}
95
96
uint32_t
97
DsrOptionHeader::GetSerializedSize
()
const
98
{
99
return
m_length
+ 2;
100
}
101
102
void
103
DsrOptionHeader::Serialize
(
Buffer::Iterator
start)
const
104
{
105
Buffer::Iterator
i = start;
106
107
i.
WriteU8
(
m_type
);
108
i.
WriteU8
(
m_length
);
109
i.
Write
(
m_data
.
Begin
(),
m_data
.
End
());
110
}
111
112
uint32_t
113
DsrOptionHeader::Deserialize
(
Buffer::Iterator
start)
114
{
115
Buffer::Iterator
i = start;
116
117
m_type
= i.
ReadU8
();
118
m_length
= i.
ReadU8
();
119
120
m_data
=
Buffer
();
121
m_data
.
AddAtEnd
(
m_length
);
122
Buffer::Iterator
dataStart = i;
123
i.
Next
(
m_length
);
124
Buffer::Iterator
dataEnd = i;
125
m_data
.
Begin
().
Write
(dataStart, dataEnd);
126
127
return
GetSerializedSize
();
128
}
129
130
DsrOptionHeader::Alignment
131
DsrOptionHeader::GetAlignment
()
const
132
{
133
Alignment
retVal = {1, 0};
134
return
retVal;
135
}
136
137
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionPad1Header
);
138
139
TypeId
140
DsrOptionPad1Header::GetTypeId
()
141
{
142
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionPad1Header"
)
143
.
AddConstructor
<
DsrOptionPad1Header
>()
144
.SetParent<DsrOptionHeader>()
145
.SetGroupName(
"Dsr"
);
146
return
tid;
147
}
148
149
TypeId
150
DsrOptionPad1Header::GetInstanceTypeId
()
const
151
{
152
return
GetTypeId
();
153
}
154
155
DsrOptionPad1Header::DsrOptionPad1Header
()
156
{
157
SetType
(224);
158
}
159
160
DsrOptionPad1Header::~DsrOptionPad1Header
()
161
{
162
}
163
164
void
165
DsrOptionPad1Header::Print
(std::ostream& os)
const
166
{
167
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" )"
;
168
}
169
170
uint32_t
171
DsrOptionPad1Header::GetSerializedSize
()
const
172
{
173
return
1;
174
}
175
176
void
177
DsrOptionPad1Header::Serialize
(
Buffer::Iterator
start)
const
178
{
179
Buffer::Iterator
i = start;
180
181
i.
WriteU8
(
GetType
());
182
}
183
184
uint32_t
185
DsrOptionPad1Header::Deserialize
(
Buffer::Iterator
start)
186
{
187
Buffer::Iterator
i = start;
188
189
SetType
(i.
ReadU8
());
190
191
return
GetSerializedSize
();
192
}
193
194
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionPadnHeader
);
195
196
TypeId
197
DsrOptionPadnHeader::GetTypeId
()
198
{
199
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionPadnHeader"
)
200
.
AddConstructor
<
DsrOptionPadnHeader
>()
201
.SetParent<DsrOptionHeader>()
202
.SetGroupName(
"Dsr"
);
203
return
tid;
204
}
205
206
TypeId
207
DsrOptionPadnHeader::GetInstanceTypeId
()
const
208
{
209
return
GetTypeId
();
210
}
211
212
DsrOptionPadnHeader::DsrOptionPadnHeader
(
uint32_t
pad)
213
{
214
SetType
(0);
215
NS_ASSERT_MSG
(pad >= 2,
"PadN must be at least 2 bytes long"
);
216
SetLength
(pad - 2);
217
}
218
219
DsrOptionPadnHeader::~DsrOptionPadnHeader
()
220
{
221
}
222
223
void
224
DsrOptionPadnHeader::Print
(std::ostream& os)
const
225
{
226
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
() <<
" )"
;
227
}
228
229
uint32_t
230
DsrOptionPadnHeader::GetSerializedSize
()
const
231
{
232
return
GetLength
() + 2;
233
}
234
235
void
236
DsrOptionPadnHeader::Serialize
(
Buffer::Iterator
start)
const
237
{
238
Buffer::Iterator
i = start;
239
240
i.
WriteU8
(
GetType
());
241
i.
WriteU8
(
GetLength
());
242
243
for
(
int
padding = 0; padding <
GetLength
(); padding++)
244
{
245
i.
WriteU8
(0);
246
}
247
}
248
249
uint32_t
250
DsrOptionPadnHeader::Deserialize
(
Buffer::Iterator
start)
251
{
252
Buffer::Iterator
i = start;
253
254
SetType
(i.
ReadU8
());
255
SetLength
(i.
ReadU8
());
256
257
return
GetSerializedSize
();
258
}
259
260
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionRreqHeader
);
261
262
TypeId
263
DsrOptionRreqHeader::GetTypeId
()
264
{
265
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionRreqHeader"
)
266
.
AddConstructor
<
DsrOptionRreqHeader
>()
267
.SetParent<DsrOptionHeader>()
268
.SetGroupName(
"Dsr"
);
269
return
tid;
270
}
271
272
TypeId
273
DsrOptionRreqHeader::GetInstanceTypeId
()
const
274
{
275
return
GetTypeId
();
276
}
277
278
DsrOptionRreqHeader::DsrOptionRreqHeader
()
279
: m_ipv4Address(0)
280
{
281
SetType
(1);
282
SetLength
(6 +
m_ipv4Address
.size() * 4);
283
}
284
285
DsrOptionRreqHeader::~DsrOptionRreqHeader
()
286
{
287
}
288
289
void
290
DsrOptionRreqHeader::SetNumberAddress
(uint8_t n)
291
{
292
m_ipv4Address
.clear();
293
m_ipv4Address
.assign(n,
Ipv4Address
());
294
}
295
296
Ipv4Address
297
DsrOptionRreqHeader::GetTarget
()
298
{
299
return
m_target
;
300
}
301
302
void
303
DsrOptionRreqHeader::SetTarget
(
Ipv4Address
target)
304
{
305
m_target
= target;
306
}
307
308
void
309
DsrOptionRreqHeader::AddNodeAddress
(
Ipv4Address
ipv4)
310
{
311
m_ipv4Address
.push_back(ipv4);
312
SetLength
(6 +
m_ipv4Address
.size() * 4);
313
}
314
315
void
316
DsrOptionRreqHeader::SetNodesAddress
(std::vector<Ipv4Address> ipv4Address)
317
{
318
m_ipv4Address
= ipv4Address;
319
SetLength
(6 +
m_ipv4Address
.size() * 4);
320
}
321
322
std::vector<Ipv4Address>
323
DsrOptionRreqHeader::GetNodesAddresses
()
const
324
{
325
return
m_ipv4Address
;
326
}
327
328
uint32_t
329
DsrOptionRreqHeader::GetNodesNumber
()
const
330
{
331
return
m_ipv4Address
.size();
332
}
333
334
void
335
DsrOptionRreqHeader::SetNodeAddress
(uint8_t index,
Ipv4Address
addr)
336
{
337
m_ipv4Address
.at(index) = addr;
338
}
339
340
Ipv4Address
341
DsrOptionRreqHeader::GetNodeAddress
(uint8_t index)
const
342
{
343
return
m_ipv4Address
.at(index);
344
}
345
346
void
347
DsrOptionRreqHeader::SetId
(uint16_t identification)
348
{
349
m_identification
= identification;
350
}
351
352
uint16_t
353
DsrOptionRreqHeader::GetId
()
const
354
{
355
return
m_identification
;
356
}
357
358
void
359
DsrOptionRreqHeader::Print
(std::ostream& os)
const
360
{
361
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
() <<
""
;
362
363
for
(
auto
it =
m_ipv4Address
.begin(); it !=
m_ipv4Address
.end(); it++)
364
{
365
os << *it <<
" "
;
366
}
367
368
os <<
")"
;
369
}
370
371
uint32_t
372
DsrOptionRreqHeader::GetSerializedSize
()
const
373
{
374
return
8 +
m_ipv4Address
.size() * 4;
375
}
376
377
void
378
DsrOptionRreqHeader::Serialize
(
Buffer::Iterator
start)
const
379
{
380
Buffer::Iterator
i = start;
381
uint8_t buff[4];
382
383
i.
WriteU8
(
GetType
());
384
i.
WriteU8
(
GetLength
());
385
i.
WriteHtonU16
(
m_identification
);
386
WriteTo
(i,
m_target
);
387
388
for
(
auto
it =
m_ipv4Address
.begin(); it !=
m_ipv4Address
.end(); it++)
389
{
390
it->Serialize(buff);
391
i.
Write
(buff, 4);
392
}
393
}
394
395
uint32_t
396
DsrOptionRreqHeader::Deserialize
(
Buffer::Iterator
start)
397
{
398
Buffer::Iterator
i = start;
399
uint8_t buff[4];
400
401
SetType
(i.
ReadU8
());
402
SetLength
(i.
ReadU8
());
403
m_identification
= i.
ReadNtohU16
();
404
ReadFrom
(i,
m_target
);
405
406
for
(std::size_t index = 0; index <
m_ipv4Address
.size(); index++)
407
{
408
i.
Read
(buff, 4);
409
m_address
=
Ipv4Address::Deserialize
(buff);
410
SetNodeAddress
(
static_cast<
uint8_t
>
(index),
m_address
);
411
}
412
413
return
GetSerializedSize
();
414
}
415
416
DsrOptionHeader::Alignment
417
DsrOptionRreqHeader::GetAlignment
()
const
418
{
419
Alignment
retVal = {4, 0};
420
return
retVal;
421
}
422
423
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionRrepHeader
);
424
425
TypeId
426
DsrOptionRrepHeader::GetTypeId
()
427
{
428
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionRrepHeader"
)
429
.
AddConstructor
<
DsrOptionRrepHeader
>()
430
.SetParent<DsrOptionHeader>()
431
.SetGroupName(
"Dsr"
);
432
return
tid;
433
}
434
435
TypeId
436
DsrOptionRrepHeader::GetInstanceTypeId
()
const
437
{
438
return
GetTypeId
();
439
}
440
441
DsrOptionRrepHeader::DsrOptionRrepHeader
()
442
: m_ipv4Address(0)
443
{
444
SetType
(2);
445
SetLength
(2 +
m_ipv4Address
.size() * 4);
446
}
447
448
DsrOptionRrepHeader::~DsrOptionRrepHeader
()
449
{
450
}
451
452
void
453
DsrOptionRrepHeader::SetNumberAddress
(uint8_t n)
454
{
455
m_ipv4Address
.clear();
456
m_ipv4Address
.assign(n,
Ipv4Address
());
457
}
458
459
void
460
DsrOptionRrepHeader::SetNodesAddress
(std::vector<Ipv4Address> ipv4Address)
461
{
462
m_ipv4Address
= ipv4Address;
463
SetLength
(2 +
m_ipv4Address
.size() * 4);
464
}
465
466
std::vector<Ipv4Address>
467
DsrOptionRrepHeader::GetNodesAddress
()
const
468
{
469
return
m_ipv4Address
;
470
}
471
472
void
473
DsrOptionRrepHeader::SetNodeAddress
(uint8_t index,
Ipv4Address
addr)
474
{
475
m_ipv4Address
.at(index) = addr;
476
}
477
478
Ipv4Address
479
DsrOptionRrepHeader::GetNodeAddress
(uint8_t index)
const
480
{
481
return
m_ipv4Address
.at(index);
482
}
483
484
Ipv4Address
485
DsrOptionRrepHeader::GetTargetAddress
(std::vector<Ipv4Address> ipv4Address)
const
486
{
487
return
m_ipv4Address
.at(ipv4Address.size() - 1);
488
}
489
490
void
491
DsrOptionRrepHeader::Print
(std::ostream& os)
const
492
{
493
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
() <<
""
;
494
495
for
(
auto
it =
m_ipv4Address
.begin(); it !=
m_ipv4Address
.end(); it++)
496
{
497
os << *it <<
" "
;
498
}
499
500
os <<
")"
;
501
}
502
503
uint32_t
504
DsrOptionRrepHeader::GetSerializedSize
()
const
505
{
506
return
4 +
m_ipv4Address
.size() * 4;
507
}
508
509
void
510
DsrOptionRrepHeader::Serialize
(
Buffer::Iterator
start)
const
511
{
512
Buffer::Iterator
i = start;
513
uint8_t buff[4];
514
515
i.
WriteU8
(
GetType
());
516
i.
WriteU8
(
GetLength
());
517
i.
WriteU8
(0);
518
i.
WriteU8
(0);
519
520
for
(
auto
it =
m_ipv4Address
.begin(); it !=
m_ipv4Address
.end(); it++)
521
{
522
it->Serialize(buff);
523
i.
Write
(buff, 4);
524
}
525
}
526
527
uint32_t
528
DsrOptionRrepHeader::Deserialize
(
Buffer::Iterator
start)
529
{
530
Buffer::Iterator
i = start;
531
uint8_t buff[4];
532
533
SetType
(i.
ReadU8
());
534
SetLength
(i.
ReadU8
());
535
i.
ReadU8
();
536
i.
ReadU8
();
537
538
for
(std::size_t index = 0; index <
m_ipv4Address
.size(); index++)
539
{
540
i.
Read
(buff, 4);
541
m_address
=
Ipv4Address::Deserialize
(buff);
542
SetNodeAddress
(
static_cast<
uint8_t
>
(index),
m_address
);
543
}
544
545
return
GetSerializedSize
();
546
}
547
548
DsrOptionHeader::Alignment
549
DsrOptionRrepHeader::GetAlignment
()
const
550
{
551
Alignment
retVal = {4, 0};
552
return
retVal;
553
}
554
555
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionSRHeader
);
556
557
TypeId
558
DsrOptionSRHeader::GetTypeId
()
559
{
560
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionSRHeader"
)
561
.
AddConstructor
<
DsrOptionSRHeader
>()
562
.SetParent<DsrOptionHeader>()
563
.SetGroupName(
"Dsr"
);
564
return
tid;
565
}
566
567
TypeId
568
DsrOptionSRHeader::GetInstanceTypeId
()
const
569
{
570
return
GetTypeId
();
571
}
572
573
DsrOptionSRHeader::DsrOptionSRHeader
()
574
: m_segmentsLeft(0),
575
m_ipv4Address(0)
576
{
577
SetType
(96);
578
SetLength
(2 +
m_ipv4Address
.size() * 4);
579
}
580
581
DsrOptionSRHeader::~DsrOptionSRHeader
()
582
{
583
}
584
585
void
586
DsrOptionSRHeader::SetSegmentsLeft
(uint8_t segmentsLeft)
587
{
588
m_segmentsLeft
= segmentsLeft;
589
}
590
591
uint8_t
592
DsrOptionSRHeader::GetSegmentsLeft
()
const
593
{
594
return
m_segmentsLeft
;
595
}
596
597
void
598
DsrOptionSRHeader::SetSalvage
(uint8_t salvage)
599
{
600
m_salvage
= salvage;
601
}
602
603
uint8_t
604
DsrOptionSRHeader::GetSalvage
()
const
605
{
606
return
m_salvage
;
607
}
608
609
void
610
DsrOptionSRHeader::SetNumberAddress
(uint8_t n)
611
{
612
m_ipv4Address
.clear();
613
m_ipv4Address
.assign(n,
Ipv4Address
());
614
}
615
616
void
617
DsrOptionSRHeader::SetNodesAddress
(std::vector<Ipv4Address> ipv4Address)
618
{
619
m_ipv4Address
= ipv4Address;
620
SetLength
(2 +
m_ipv4Address
.size() * 4);
621
}
622
623
std::vector<Ipv4Address>
624
DsrOptionSRHeader::GetNodesAddress
()
const
625
{
626
return
m_ipv4Address
;
627
}
628
629
void
630
DsrOptionSRHeader::SetNodeAddress
(uint8_t index,
Ipv4Address
addr)
631
{
632
m_ipv4Address
.at(index) = addr;
633
}
634
635
Ipv4Address
636
DsrOptionSRHeader::GetNodeAddress
(uint8_t index)
const
637
{
638
return
m_ipv4Address
.at(index);
639
}
640
641
uint8_t
642
DsrOptionSRHeader::GetNodeListSize
()
const
643
{
644
return
m_ipv4Address
.size();
645
}
646
647
void
648
DsrOptionSRHeader::Print
(std::ostream& os)
const
649
{
650
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
() <<
""
;
651
652
for
(
auto
it =
m_ipv4Address
.begin(); it !=
m_ipv4Address
.end(); it++)
653
{
654
os << *it <<
" "
;
655
}
656
657
os <<
")"
;
658
}
659
660
uint32_t
661
DsrOptionSRHeader::GetSerializedSize
()
const
662
{
663
return
4 +
m_ipv4Address
.size() * 4;
664
}
665
666
void
667
DsrOptionSRHeader::Serialize
(
Buffer::Iterator
start)
const
668
{
669
Buffer::Iterator
i = start;
670
uint8_t buff[4];
671
672
i.
WriteU8
(
GetType
());
673
i.
WriteU8
(
GetLength
());
674
i.
WriteU8
(
m_salvage
);
675
i.
WriteU8
(
m_segmentsLeft
);
676
677
for
(
auto
it =
m_ipv4Address
.begin(); it !=
m_ipv4Address
.end(); it++)
678
{
679
it->Serialize(buff);
680
i.
Write
(buff, 4);
681
}
682
}
683
684
uint32_t
685
DsrOptionSRHeader::Deserialize
(
Buffer::Iterator
start)
686
{
687
Buffer::Iterator
i = start;
688
uint8_t buff[4];
689
690
SetType
(i.
ReadU8
());
691
SetLength
(i.
ReadU8
());
692
m_salvage
= i.
ReadU8
();
693
m_segmentsLeft
= i.
ReadU8
();
694
695
for
(std::size_t index = 0; index <
m_ipv4Address
.size(); index++)
696
{
697
i.
Read
(buff, 4);
698
m_address
=
Ipv4Address::Deserialize
(buff);
699
SetNodeAddress
(
static_cast<
uint8_t
>
(index),
m_address
);
700
}
701
702
return
GetSerializedSize
();
703
}
704
705
DsrOptionHeader::Alignment
706
DsrOptionSRHeader::GetAlignment
()
const
707
{
708
Alignment
retVal = {4, 0};
709
return
retVal;
710
}
711
712
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionRerrHeader
);
713
714
TypeId
715
DsrOptionRerrHeader::GetTypeId
()
716
{
717
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionRerrHeader"
)
718
.
AddConstructor
<
DsrOptionRerrHeader
>()
719
.SetParent<DsrOptionHeader>()
720
.SetGroupName(
"Dsr"
);
721
return
tid;
722
}
723
724
TypeId
725
DsrOptionRerrHeader::GetInstanceTypeId
()
const
726
{
727
return
GetTypeId
();
728
}
729
730
DsrOptionRerrHeader::DsrOptionRerrHeader
()
731
: m_errorType(0),
732
m_salvage(0),
733
m_errorLength(4)
734
{
735
SetType
(3);
736
SetLength
(18);
737
}
738
739
DsrOptionRerrHeader::~DsrOptionRerrHeader
()
740
{
741
}
742
743
void
744
DsrOptionRerrHeader::SetErrorType
(uint8_t errorType)
745
{
746
m_errorType
= errorType;
747
}
748
749
uint8_t
750
DsrOptionRerrHeader::GetErrorType
()
const
751
{
752
return
m_errorType
;
753
}
754
755
void
756
DsrOptionRerrHeader::SetSalvage
(uint8_t salvage)
757
{
758
m_salvage
= salvage;
759
}
760
761
uint8_t
762
DsrOptionRerrHeader::GetSalvage
()
const
763
{
764
return
m_salvage
;
765
}
766
767
void
768
DsrOptionRerrHeader::SetErrorSrc
(
Ipv4Address
errorSrcAddress)
769
{
770
m_errorSrcAddress
= errorSrcAddress;
771
}
772
773
Ipv4Address
774
DsrOptionRerrHeader::GetErrorSrc
()
const
775
{
776
return
m_errorSrcAddress
;
777
}
778
779
void
780
DsrOptionRerrHeader::SetErrorDst
(
Ipv4Address
errorDstAddress)
781
{
782
m_errorDstAddress
= errorDstAddress;
783
}
784
785
Ipv4Address
786
DsrOptionRerrHeader::GetErrorDst
()
const
787
{
788
return
m_errorDstAddress
;
789
}
790
791
void
792
DsrOptionRerrHeader::Print
(std::ostream& os)
const
793
{
794
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
()
795
<<
" errorType = "
<< (
uint32_t
)
m_errorType
<<
" salvage = "
<< (
uint32_t
)
m_salvage
796
<<
" error source = "
<<
m_errorSrcAddress
<<
" error dst = "
<<
m_errorDstAddress
<<
" )"
;
797
}
798
799
uint32_t
800
DsrOptionRerrHeader::GetSerializedSize
()
const
801
{
802
return
20;
803
}
804
805
void
806
DsrOptionRerrHeader::Serialize
(
Buffer::Iterator
start)
const
807
{
808
Buffer::Iterator
i = start;
809
810
i.
WriteU8
(
GetType
());
811
i.
WriteU8
(
GetLength
());
812
i.
WriteU8
(
m_errorType
);
813
i.
WriteU8
(
m_salvage
);
814
WriteTo
(i,
m_errorSrcAddress
);
815
WriteTo
(i,
m_errorDstAddress
);
816
i.
Write
(
m_errorData
.
Begin
(),
m_errorData
.
End
());
817
}
818
819
uint32_t
820
DsrOptionRerrHeader::Deserialize
(
Buffer::Iterator
start)
821
{
822
Buffer::Iterator
i = start;
823
824
SetType
(i.
ReadU8
());
825
SetLength
(i.
ReadU8
());
826
m_errorType
= i.
ReadU8
();
827
m_salvage
= i.
ReadU8
();
828
ReadFrom
(i,
m_errorSrcAddress
);
829
ReadFrom
(i,
m_errorDstAddress
);
830
831
m_errorData
=
Buffer
();
832
m_errorData
.
AddAtEnd
(
m_errorLength
);
833
Buffer::Iterator
dataStart = i;
834
i.
Next
(
m_errorLength
);
835
Buffer::Iterator
dataEnd = i;
836
m_errorData
.
Begin
().
Write
(dataStart, dataEnd);
837
838
return
GetSerializedSize
();
839
}
840
841
DsrOptionHeader::Alignment
842
DsrOptionRerrHeader::GetAlignment
()
const
843
{
844
Alignment
retVal = {4, 0};
845
return
retVal;
846
}
847
848
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionRerrUnreachHeader
);
849
850
TypeId
851
DsrOptionRerrUnreachHeader::GetTypeId
()
852
{
853
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionRerrUnreachHeader"
)
854
.
AddConstructor
<
DsrOptionRerrUnreachHeader
>()
855
.SetParent<DsrOptionRerrHeader>()
856
.SetGroupName(
"Dsr"
);
857
return
tid;
858
}
859
860
TypeId
861
DsrOptionRerrUnreachHeader::GetInstanceTypeId
()
const
862
{
863
return
GetTypeId
();
864
}
865
866
DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader
()
867
: m_salvage(0)
868
{
869
SetType
(3);
870
SetLength
(18);
871
SetErrorType
(1);
872
}
873
874
DsrOptionRerrUnreachHeader::~DsrOptionRerrUnreachHeader
()
875
{
876
}
877
878
void
879
DsrOptionRerrUnreachHeader::SetSalvage
(uint8_t salvage)
880
{
881
m_salvage
= salvage;
882
}
883
884
uint8_t
885
DsrOptionRerrUnreachHeader::GetSalvage
()
const
886
{
887
return
m_salvage
;
888
}
889
890
void
891
DsrOptionRerrUnreachHeader::SetErrorSrc
(
Ipv4Address
errorSrcAddress)
892
{
893
m_errorSrcAddress
= errorSrcAddress;
894
}
895
896
Ipv4Address
897
DsrOptionRerrUnreachHeader::GetErrorSrc
()
const
898
{
899
return
m_errorSrcAddress
;
900
}
901
902
void
903
DsrOptionRerrUnreachHeader::SetErrorDst
(
Ipv4Address
errorDstAddress)
904
{
905
m_errorDstAddress
= errorDstAddress;
906
}
907
908
Ipv4Address
909
DsrOptionRerrUnreachHeader::GetErrorDst
()
const
910
{
911
return
m_errorDstAddress
;
912
}
913
914
void
915
DsrOptionRerrUnreachHeader::SetUnreachNode
(
Ipv4Address
unreachNode)
916
{
917
m_unreachNode
= unreachNode;
918
}
919
920
Ipv4Address
921
DsrOptionRerrUnreachHeader::GetUnreachNode
()
const
922
{
923
return
m_unreachNode
;
924
}
925
926
void
927
DsrOptionRerrUnreachHeader::SetOriginalDst
(
Ipv4Address
originalDst)
928
{
929
m_originalDst
= originalDst;
930
}
931
932
Ipv4Address
933
DsrOptionRerrUnreachHeader::GetOriginalDst
()
const
934
{
935
return
m_originalDst
;
936
}
937
938
void
939
DsrOptionRerrUnreachHeader::Print
(std::ostream& os)
const
940
{
941
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
()
942
<<
" errorType = "
<< (
uint32_t
)
m_errorType
<<
" salvage = "
<< (
uint32_t
)
m_salvage
943
<<
" error source = "
<<
m_errorSrcAddress
<<
" error dst = "
<<
m_errorDstAddress
944
<<
" unreach node = "
<<
m_unreachNode
<<
" )"
;
945
}
946
947
uint32_t
948
DsrOptionRerrUnreachHeader::GetSerializedSize
()
const
949
{
950
return
20;
951
}
952
953
void
954
DsrOptionRerrUnreachHeader::Serialize
(
Buffer::Iterator
start)
const
955
{
956
Buffer::Iterator
i = start;
957
958
i.
WriteU8
(
GetType
());
959
i.
WriteU8
(
GetLength
());
960
i.
WriteU8
(
GetErrorType
());
961
i.
WriteU8
(
m_salvage
);
962
WriteTo
(i,
m_errorSrcAddress
);
963
WriteTo
(i,
m_errorDstAddress
);
964
WriteTo
(i,
m_unreachNode
);
965
WriteTo
(i,
m_originalDst
);
966
}
967
968
uint32_t
969
DsrOptionRerrUnreachHeader::Deserialize
(
Buffer::Iterator
start)
970
{
971
Buffer::Iterator
i = start;
972
973
SetType
(i.
ReadU8
());
974
SetLength
(i.
ReadU8
());
975
SetErrorType
(i.
ReadU8
());
976
m_salvage
= i.
ReadU8
();
977
ReadFrom
(i,
m_errorSrcAddress
);
978
ReadFrom
(i,
m_errorDstAddress
);
979
ReadFrom
(i,
m_unreachNode
);
980
ReadFrom
(i,
m_originalDst
);
981
982
return
GetSerializedSize
();
983
}
984
985
DsrOptionHeader::Alignment
986
DsrOptionRerrUnreachHeader::GetAlignment
()
const
987
{
988
Alignment
retVal = {4, 0};
989
return
retVal;
990
}
991
992
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionRerrUnsupportedHeader
);
993
994
TypeId
995
DsrOptionRerrUnsupportedHeader::GetTypeId
()
996
{
997
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionRerrUnsupportedHeader"
)
998
.
AddConstructor
<
DsrOptionRerrUnsupportedHeader
>()
999
.SetParent<DsrOptionRerrHeader>()
1000
.SetGroupName(
"Dsr"
);
1001
return
tid;
1002
}
1003
1004
TypeId
1005
DsrOptionRerrUnsupportedHeader::GetInstanceTypeId
()
const
1006
{
1007
return
GetTypeId
();
1008
}
1009
1010
DsrOptionRerrUnsupportedHeader::DsrOptionRerrUnsupportedHeader
()
1011
: m_salvage(0)
1012
{
1013
SetType
(3);
1014
SetLength
(14);
1015
SetErrorType
(3);
1016
}
1017
1018
DsrOptionRerrUnsupportedHeader::~DsrOptionRerrUnsupportedHeader
()
1019
{
1020
}
1021
1022
void
1023
DsrOptionRerrUnsupportedHeader::SetSalvage
(uint8_t salvage)
1024
{
1025
m_salvage
= salvage;
1026
}
1027
1028
uint8_t
1029
DsrOptionRerrUnsupportedHeader::GetSalvage
()
const
1030
{
1031
return
m_salvage
;
1032
}
1033
1034
void
1035
DsrOptionRerrUnsupportedHeader::SetErrorSrc
(
Ipv4Address
errorSrcAddress)
1036
{
1037
m_errorSrcAddress
= errorSrcAddress;
1038
}
1039
1040
Ipv4Address
1041
DsrOptionRerrUnsupportedHeader::GetErrorSrc
()
const
1042
{
1043
return
m_errorSrcAddress
;
1044
}
1045
1046
void
1047
DsrOptionRerrUnsupportedHeader::SetErrorDst
(
Ipv4Address
errorDstAddress)
1048
{
1049
m_errorDstAddress
= errorDstAddress;
1050
}
1051
1052
Ipv4Address
1053
DsrOptionRerrUnsupportedHeader::GetErrorDst
()
const
1054
{
1055
return
m_errorDstAddress
;
1056
}
1057
1058
void
1059
DsrOptionRerrUnsupportedHeader::SetUnsupported
(uint16_t unsupported)
1060
{
1061
m_unsupported
= unsupported;
1062
}
1063
1064
uint16_t
1065
DsrOptionRerrUnsupportedHeader::GetUnsupported
()
const
1066
{
1067
return
m_unsupported
;
1068
}
1069
1070
void
1071
DsrOptionRerrUnsupportedHeader::Print
(std::ostream& os)
const
1072
{
1073
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
()
1074
<<
" errorType = "
<< (
uint32_t
)
m_errorType
<<
" salvage = "
<< (
uint32_t
)
m_salvage
1075
<<
" error source = "
<<
m_errorSrcAddress
<<
" error dst = "
<<
m_errorDstAddress
1076
<<
" unsupported option = "
<<
m_unsupported
<<
" )"
;
1077
}
1078
1079
uint32_t
1080
DsrOptionRerrUnsupportedHeader::GetSerializedSize
()
const
1081
{
1082
return
16;
1083
}
1084
1085
void
1086
DsrOptionRerrUnsupportedHeader::Serialize
(
Buffer::Iterator
start)
const
1087
{
1088
Buffer::Iterator
i = start;
1089
1090
i.
WriteU8
(
GetType
());
1091
i.
WriteU8
(
GetLength
());
1092
i.
WriteU8
(
GetErrorType
());
1093
i.
WriteU8
(
m_salvage
);
1094
WriteTo
(i,
m_errorSrcAddress
);
1095
WriteTo
(i,
m_errorDstAddress
);
1096
i.
WriteU16
(
m_unsupported
);
1097
}
1098
1099
uint32_t
1100
DsrOptionRerrUnsupportedHeader::Deserialize
(
Buffer::Iterator
start)
1101
{
1102
Buffer::Iterator
i = start;
1103
1104
SetType
(i.
ReadU8
());
1105
SetLength
(i.
ReadU8
());
1106
SetErrorType
(i.
ReadU8
());
1107
m_salvage
= i.
ReadU8
();
1108
ReadFrom
(i,
m_errorSrcAddress
);
1109
ReadFrom
(i,
m_errorDstAddress
);
1110
m_unsupported
= i.
ReadU16
();
1111
1112
return
GetSerializedSize
();
1113
}
1114
1115
DsrOptionHeader::Alignment
1116
DsrOptionRerrUnsupportedHeader::GetAlignment
()
const
1117
{
1118
Alignment
retVal = {4, 0};
1119
return
retVal;
1120
}
1121
1122
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionAckReqHeader
);
1123
1124
TypeId
1125
DsrOptionAckReqHeader::GetTypeId
()
1126
{
1127
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionAckReqHeader"
)
1128
.
AddConstructor
<
DsrOptionAckReqHeader
>()
1129
.SetParent<DsrOptionHeader>()
1130
.SetGroupName(
"Dsr"
);
1131
return
tid;
1132
}
1133
1134
TypeId
1135
DsrOptionAckReqHeader::GetInstanceTypeId
()
const
1136
{
1137
return
GetTypeId
();
1138
}
1139
1140
DsrOptionAckReqHeader::DsrOptionAckReqHeader
()
1141
: m_identification(0)
1142
1143
{
1144
SetType
(160);
1145
SetLength
(2);
1146
}
1147
1148
DsrOptionAckReqHeader::~DsrOptionAckReqHeader
()
1149
{
1150
}
1151
1152
void
1153
DsrOptionAckReqHeader::SetAckId
(uint16_t identification)
1154
{
1155
m_identification
= identification;
1156
}
1157
1158
uint16_t
1159
DsrOptionAckReqHeader::GetAckId
()
const
1160
{
1161
return
m_identification
;
1162
}
1163
1164
void
1165
DsrOptionAckReqHeader::Print
(std::ostream& os)
const
1166
{
1167
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
()
1168
<<
" id = "
<<
m_identification
<<
" )"
;
1169
}
1170
1171
uint32_t
1172
DsrOptionAckReqHeader::GetSerializedSize
()
const
1173
{
1174
return
4;
1175
}
1176
1177
void
1178
DsrOptionAckReqHeader::Serialize
(
Buffer::Iterator
start)
const
1179
{
1180
Buffer::Iterator
i = start;
1181
1182
i.
WriteU8
(
GetType
());
1183
i.
WriteU8
(
GetLength
());
1184
i.
WriteU16
(
m_identification
);
1185
}
1186
1187
uint32_t
1188
DsrOptionAckReqHeader::Deserialize
(
Buffer::Iterator
start)
1189
{
1190
Buffer::Iterator
i = start;
1191
1192
SetType
(i.
ReadU8
());
1193
SetLength
(i.
ReadU8
());
1194
m_identification
= i.
ReadU16
();
1195
1196
return
GetSerializedSize
();
1197
}
1198
1199
DsrOptionHeader::Alignment
1200
DsrOptionAckReqHeader::GetAlignment
()
const
1201
{
1202
Alignment
retVal = {4, 0};
1203
return
retVal;
1204
}
1205
1206
NS_OBJECT_ENSURE_REGISTERED
(
DsrOptionAckHeader
);
1207
1208
TypeId
1209
DsrOptionAckHeader::GetTypeId
()
1210
{
1211
static
TypeId
tid =
TypeId
(
"ns3::dsr::DsrOptionAckHeader"
)
1212
.
AddConstructor
<
DsrOptionAckHeader
>()
1213
.SetParent<DsrOptionHeader>()
1214
.SetGroupName(
"Dsr"
);
1215
return
tid;
1216
}
1217
1218
TypeId
1219
DsrOptionAckHeader::GetInstanceTypeId
()
const
1220
{
1221
return
GetTypeId
();
1222
}
1223
1224
DsrOptionAckHeader::DsrOptionAckHeader
()
1225
: m_identification(0)
1226
{
1227
SetType
(32);
1228
SetLength
(10);
1229
}
1230
1231
DsrOptionAckHeader::~DsrOptionAckHeader
()
1232
{
1233
}
1234
1235
void
1236
DsrOptionAckHeader::SetAckId
(uint16_t identification)
1237
{
1238
m_identification
= identification;
1239
}
1240
1241
uint16_t
1242
DsrOptionAckHeader::GetAckId
()
const
1243
{
1244
return
m_identification
;
1245
}
1246
1247
void
1248
DsrOptionAckHeader::SetRealSrc
(
Ipv4Address
realSrcAddress)
1249
{
1250
m_realSrcAddress
= realSrcAddress;
1251
}
1252
1253
Ipv4Address
1254
DsrOptionAckHeader::GetRealSrc
()
const
1255
{
1256
return
m_realSrcAddress
;
1257
}
1258
1259
void
1260
DsrOptionAckHeader::SetRealDst
(
Ipv4Address
realDstAddress)
1261
{
1262
m_realDstAddress
= realDstAddress;
1263
}
1264
1265
Ipv4Address
1266
DsrOptionAckHeader::GetRealDst
()
const
1267
{
1268
return
m_realDstAddress
;
1269
}
1270
1271
void
1272
DsrOptionAckHeader::Print
(std::ostream& os)
const
1273
{
1274
os <<
"( type = "
<< (
uint32_t
)
GetType
() <<
" length = "
<< (
uint32_t
)
GetLength
()
1275
<<
" id = "
<<
m_identification
<<
" real src = "
<<
m_realSrcAddress
1276
<<
" real dst = "
<<
m_realDstAddress
<<
" )"
;
1277
}
1278
1279
uint32_t
1280
DsrOptionAckHeader::GetSerializedSize
()
const
1281
{
1282
return
12;
1283
}
1284
1285
void
1286
DsrOptionAckHeader::Serialize
(
Buffer::Iterator
start)
const
1287
{
1288
Buffer::Iterator
i = start;
1289
1290
i.
WriteU8
(
GetType
());
1291
i.
WriteU8
(
GetLength
());
1292
i.
WriteU16
(
m_identification
);
1293
WriteTo
(i,
m_realSrcAddress
);
1294
WriteTo
(i,
m_realDstAddress
);
1295
}
1296
1297
uint32_t
1298
DsrOptionAckHeader::Deserialize
(
Buffer::Iterator
start)
1299
{
1300
Buffer::Iterator
i = start;
1301
1302
SetType
(i.
ReadU8
());
1303
SetLength
(i.
ReadU8
());
1304
m_identification
= i.
ReadU16
();
1305
ReadFrom
(i,
m_realSrcAddress
);
1306
ReadFrom
(i,
m_realDstAddress
);
1307
1308
return
GetSerializedSize
();
1309
}
1310
1311
DsrOptionHeader::Alignment
1312
DsrOptionAckHeader::GetAlignment
()
const
1313
{
1314
Alignment
retVal = {4, 0};
1315
return
retVal;
1316
}
1317
}
/* namespace dsr */
1318
}
/* namespace ns3 */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Buffer::Iterator::ReadU8
uint8_t ReadU8()
Definition
buffer.h:1016
ns3::Buffer::Iterator::WriteU8
void WriteU8(uint8_t data)
Definition
buffer.h:870
ns3::Buffer::Iterator::Write
void Write(const uint8_t *buffer, uint32_t size)
Definition
buffer.cc:937
ns3::Buffer::Iterator::WriteU16
void WriteU16(uint16_t data)
Definition
buffer.cc:848
ns3::Buffer::Iterator::Read
void Read(uint8_t *buffer, uint32_t size)
Definition
buffer.cc:1114
ns3::Buffer::Iterator::WriteHtonU16
void WriteHtonU16(uint16_t data)
Definition
buffer.h:904
ns3::Buffer::Iterator::ReadNtohU16
uint16_t ReadNtohU16()
Definition
buffer.h:943
ns3::Buffer::Iterator::ReadU16
uint16_t ReadU16()
Definition
buffer.h:1024
ns3::Buffer::Iterator::Next
void Next()
go forward by one byte
Definition
buffer.h:842
ns3::Buffer
automatically resized byte buffer
Definition
buffer.h:83
ns3::Buffer::Begin
Buffer::Iterator Begin() const
Definition
buffer.h:1063
ns3::Buffer::AddAtEnd
void AddAtEnd(uint32_t end)
Definition
buffer.cc:349
ns3::Buffer::End
Buffer::Iterator End() const
Definition
buffer.h:1070
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition
ipv4-address.h:31
ns3::Ipv4Address::Deserialize
static Ipv4Address Deserialize(const uint8_t buf[4])
Definition
ipv4-address.cc:295
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::AddConstructor
TypeId AddConstructor()
Record in this TypeId the fact that the default constructor is accessible.
Definition
type-id.h:670
ns3::dsr::DsrOptionAckHeader
Header of Dsr Option ack.
Definition
dsr-option-header.h:1192
ns3::dsr::DsrOptionAckHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:1219
ns3::dsr::DsrOptionAckHeader::SetAckId
void SetAckId(uint16_t identification)
Set the Ack id number.
Definition
dsr-option-header.cc:1236
ns3::dsr::DsrOptionAckHeader::GetAckId
uint16_t GetAckId() const
Set the Ack id number.
Definition
dsr-option-header.cc:1242
ns3::dsr::DsrOptionAckHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:1298
ns3::dsr::DsrOptionAckHeader::m_identification
uint16_t m_identification
Identification field.
Definition
dsr-option-header.h:1273
ns3::dsr::DsrOptionAckHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:1209
ns3::dsr::DsrOptionAckHeader::SetRealSrc
void SetRealSrc(Ipv4Address realSrcAddress)
Set Error source ip address.
Definition
dsr-option-header.cc:1248
ns3::dsr::DsrOptionAckHeader::SetRealDst
void SetRealDst(Ipv4Address realDstAddress)
Set Error source ip address.
Definition
dsr-option-header.cc:1260
ns3::dsr::DsrOptionAckHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:1286
ns3::dsr::DsrOptionAckHeader::m_realDstAddress
Ipv4Address m_realDstAddress
Ack destination address.
Definition
dsr-option-header.h:1281
ns3::dsr::DsrOptionAckHeader::GetRealDst
Ipv4Address GetRealDst() const
Get Error source ip address.
Definition
dsr-option-header.cc:1266
ns3::dsr::DsrOptionAckHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:1312
ns3::dsr::DsrOptionAckHeader::DsrOptionAckHeader
DsrOptionAckHeader()
Constructor.
Definition
dsr-option-header.cc:1224
ns3::dsr::DsrOptionAckHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:1280
ns3::dsr::DsrOptionAckHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:1272
ns3::dsr::DsrOptionAckHeader::m_realSrcAddress
Ipv4Address m_realSrcAddress
Ack source address.
Definition
dsr-option-header.h:1277
ns3::dsr::DsrOptionAckHeader::GetRealSrc
Ipv4Address GetRealSrc() const
Get Error source ip address.
Definition
dsr-option-header.cc:1254
ns3::dsr::DsrOptionAckHeader::~DsrOptionAckHeader
~DsrOptionAckHeader() override
Destructor.
Definition
dsr-option-header.cc:1231
ns3::dsr::DsrOptionAckReqHeader
Header of Dsr Option ack request.
Definition
dsr-option-header.h:1109
ns3::dsr::DsrOptionAckReqHeader::~DsrOptionAckReqHeader
~DsrOptionAckReqHeader() override
Destructor.
Definition
dsr-option-header.cc:1148
ns3::dsr::DsrOptionAckReqHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:1178
ns3::dsr::DsrOptionAckReqHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:1165
ns3::dsr::DsrOptionAckReqHeader::DsrOptionAckReqHeader
DsrOptionAckReqHeader()
Constructor.
Definition
dsr-option-header.cc:1140
ns3::dsr::DsrOptionAckReqHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:1188
ns3::dsr::DsrOptionAckReqHeader::SetAckId
void SetAckId(uint16_t identification)
Set the Ack request id number.
Definition
dsr-option-header.cc:1153
ns3::dsr::DsrOptionAckReqHeader::m_identification
uint16_t m_identification
The identification field.
Definition
dsr-option-header.h:1170
ns3::dsr::DsrOptionAckReqHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:1172
ns3::dsr::DsrOptionAckReqHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:1200
ns3::dsr::DsrOptionAckReqHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:1135
ns3::dsr::DsrOptionAckReqHeader::GetAckId
uint16_t GetAckId() const
Set the Ack request id number.
Definition
dsr-option-header.cc:1159
ns3::dsr::DsrOptionAckReqHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:1125
ns3::dsr::DsrOptionHeader
header for Dsr Options.
Definition
dsr-option-header.h:42
ns3::dsr::DsrOptionHeader::GetAlignment
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:131
ns3::dsr::DsrOptionHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:41
ns3::dsr::DsrOptionHeader::m_data
Buffer m_data
The anonymous data of this option.
Definition
dsr-option-header.h:134
ns3::dsr::DsrOptionHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:113
ns3::dsr::DsrOptionHeader::GetType
uint8_t GetType() const
Get the type of the option.
Definition
dsr-option-header.cc:73
ns3::dsr::DsrOptionHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:103
ns3::dsr::DsrOptionHeader::~DsrOptionHeader
~DsrOptionHeader() override
Destructor.
Definition
dsr-option-header.cc:62
ns3::dsr::DsrOptionHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:51
ns3::dsr::DsrOptionHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:91
ns3::dsr::DsrOptionHeader::SetType
void SetType(uint8_t type)
Set the type of the option.
Definition
dsr-option-header.cc:67
ns3::dsr::DsrOptionHeader::m_length
uint8_t m_length
The option length.
Definition
dsr-option-header.h:130
ns3::dsr::DsrOptionHeader::m_type
uint8_t m_type
The type of the option.
Definition
dsr-option-header.h:126
ns3::dsr::DsrOptionHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:97
ns3::dsr::DsrOptionHeader::DsrOptionHeader
DsrOptionHeader()
Constructor.
Definition
dsr-option-header.cc:56
ns3::dsr::DsrOptionHeader::SetLength
void SetLength(uint8_t length)
Set the option length.
Definition
dsr-option-header.cc:79
ns3::dsr::DsrOptionHeader::GetLength
uint8_t GetLength() const
Get the option length.
Definition
dsr-option-header.cc:85
ns3::dsr::DsrOptionPad1Header
Header of Dsr Option Pad1.
Definition
dsr-option-header.h:142
ns3::dsr::DsrOptionPad1Header::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:185
ns3::dsr::DsrOptionPad1Header::~DsrOptionPad1Header
~DsrOptionPad1Header() override
Destructor.
Definition
dsr-option-header.cc:160
ns3::dsr::DsrOptionPad1Header::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:177
ns3::dsr::DsrOptionPad1Header::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:165
ns3::dsr::DsrOptionPad1Header::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:171
ns3::dsr::DsrOptionPad1Header::DsrOptionPad1Header
DsrOptionPad1Header()
Constructor.
Definition
dsr-option-header.cc:155
ns3::dsr::DsrOptionPad1Header::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:150
ns3::dsr::DsrOptionPad1Header::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:140
ns3::dsr::DsrOptionPadnHeader
Header of Dsr Option Padn.
Definition
dsr-option-header.h:190
ns3::dsr::DsrOptionPadnHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:250
ns3::dsr::DsrOptionPadnHeader::DsrOptionPadnHeader
DsrOptionPadnHeader(uint32_t pad=2)
Constructor.
Definition
dsr-option-header.cc:212
ns3::dsr::DsrOptionPadnHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:230
ns3::dsr::DsrOptionPadnHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:207
ns3::dsr::DsrOptionPadnHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:224
ns3::dsr::DsrOptionPadnHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:197
ns3::dsr::DsrOptionPadnHeader::~DsrOptionPadnHeader
~DsrOptionPadnHeader() override
Destructor.
Definition
dsr-option-header.cc:219
ns3::dsr::DsrOptionPadnHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:236
ns3::dsr::DsrOptionRerrHeader
Header of Dsr Option Route Error.
Definition
dsr-option-header.h:714
ns3::dsr::DsrOptionRerrHeader::GetErrorType
uint8_t GetErrorType() const
Get the route error type.
Definition
dsr-option-header.cc:750
ns3::dsr::DsrOptionRerrHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:820
ns3::dsr::DsrOptionRerrHeader::m_errorData
Buffer m_errorData
The anonymous data of this option.
Definition
dsr-option-header.h:825
ns3::dsr::DsrOptionRerrHeader::SetSalvage
virtual void SetSalvage(uint8_t salvage)
Set the salvage value of the packet.
Definition
dsr-option-header.cc:756
ns3::dsr::DsrOptionRerrHeader::GetErrorSrc
virtual Ipv4Address GetErrorSrc() const
Get the route error source address.
Definition
dsr-option-header.cc:774
ns3::dsr::DsrOptionRerrHeader::SetErrorType
void SetErrorType(uint8_t errorType)
Set the route error type.
Definition
dsr-option-header.cc:744
ns3::dsr::DsrOptionRerrHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:800
ns3::dsr::DsrOptionRerrHeader::m_errorSrcAddress
Ipv4Address m_errorSrcAddress
The error source address.
Definition
dsr-option-header.h:817
ns3::dsr::DsrOptionRerrHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:715
ns3::dsr::DsrOptionRerrHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:806
ns3::dsr::DsrOptionRerrHeader::m_salvage
uint8_t m_salvage
The salvage field.
Definition
dsr-option-header.h:809
ns3::dsr::DsrOptionRerrHeader::DsrOptionRerrHeader
DsrOptionRerrHeader()
Constructor.
Definition
dsr-option-header.cc:730
ns3::dsr::DsrOptionRerrHeader::~DsrOptionRerrHeader
~DsrOptionRerrHeader() override
Destructor.
Definition
dsr-option-header.cc:739
ns3::dsr::DsrOptionRerrHeader::SetErrorDst
virtual void SetErrorDst(Ipv4Address errorDstAddress)
Set the error destination ip address.
Definition
dsr-option-header.cc:780
ns3::dsr::DsrOptionRerrHeader::GetErrorDst
virtual Ipv4Address GetErrorDst() const
Get the error destination ip address.
Definition
dsr-option-header.cc:786
ns3::dsr::DsrOptionRerrHeader::m_errorDstAddress
Ipv4Address m_errorDstAddress
The error destination address.
Definition
dsr-option-header.h:821
ns3::dsr::DsrOptionRerrHeader::m_errorLength
uint16_t m_errorLength
The specific error message length.
Definition
dsr-option-header.h:813
ns3::dsr::DsrOptionRerrHeader::m_errorType
uint8_t m_errorType
The error type or route error option.
Definition
dsr-option-header.h:805
ns3::dsr::DsrOptionRerrHeader::GetSalvage
virtual uint8_t GetSalvage() const
Get the salvage value of the packet.
Definition
dsr-option-header.cc:762
ns3::dsr::DsrOptionRerrHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:842
ns3::dsr::DsrOptionRerrHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:792
ns3::dsr::DsrOptionRerrHeader::SetErrorSrc
virtual void SetErrorSrc(Ipv4Address errorSrcAddress)
Set the route error source address.
Definition
dsr-option-header.cc:768
ns3::dsr::DsrOptionRerrHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:725
ns3::dsr::DsrOptionRerrUnreachHeader
Route Error (RERR) Unreachable node address option Message Format.
Definition
dsr-option-header.h:843
ns3::dsr::DsrOptionRerrUnreachHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:861
ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst
void SetOriginalDst(Ipv4Address originalDst)
Set the unreachable node ip address.
Definition
dsr-option-header.cc:927
ns3::dsr::DsrOptionRerrUnreachHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:954
ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc
Ipv4Address GetErrorSrc() const override
Get the route error source address.
Definition
dsr-option-header.cc:897
ns3::dsr::DsrOptionRerrUnreachHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:851
ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst
void SetErrorDst(Ipv4Address errorDstAddress) override
Set the error destination ip address.
Definition
dsr-option-header.cc:903
ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc
void SetErrorSrc(Ipv4Address errorSrcAddress) override
Set the route error source address.
Definition
dsr-option-header.cc:891
ns3::dsr::DsrOptionRerrUnreachHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:948
ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage
uint8_t GetSalvage() const override
Get the salvage value of the packet.
Definition
dsr-option-header.cc:885
ns3::dsr::DsrOptionRerrUnreachHeader::m_unreachNode
Ipv4Address m_unreachNode
The unreachable node address.
Definition
dsr-option-header.h:960
ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst
Ipv4Address GetOriginalDst() const
Get the unreachable node ip address.
Definition
dsr-option-header.cc:933
ns3::dsr::DsrOptionRerrUnreachHeader::~DsrOptionRerrUnreachHeader
~DsrOptionRerrUnreachHeader() override
Destructor.
Definition
dsr-option-header.cc:874
ns3::dsr::DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader
DsrOptionRerrUnreachHeader()
Constructor.
Definition
dsr-option-header.cc:866
ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode
void SetUnreachNode(Ipv4Address unreachNode)
Set the unreachable node ip address.
Definition
dsr-option-header.cc:915
ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage
void SetSalvage(uint8_t salvage) override
Set the salvage value of the packet.
Definition
dsr-option-header.cc:879
ns3::dsr::DsrOptionRerrUnreachHeader::m_errorType
uint8_t m_errorType
The error type or route error option.
Definition
dsr-option-header.h:944
ns3::dsr::DsrOptionRerrUnreachHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:986
ns3::dsr::DsrOptionRerrUnreachHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:939
ns3::dsr::DsrOptionRerrUnreachHeader::m_errorSrcAddress
Ipv4Address m_errorSrcAddress
The error source address.
Definition
dsr-option-header.h:952
ns3::dsr::DsrOptionRerrUnreachHeader::m_salvage
uint8_t m_salvage
The salvage field.
Definition
dsr-option-header.h:948
ns3::dsr::DsrOptionRerrUnreachHeader::m_originalDst
Ipv4Address m_originalDst
The original destination address.
Definition
dsr-option-header.h:964
ns3::dsr::DsrOptionRerrUnreachHeader::m_errorDstAddress
Ipv4Address m_errorDstAddress
The error destination address.
Definition
dsr-option-header.h:956
ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode
Ipv4Address GetUnreachNode() const
Get the unreachable node ip address.
Definition
dsr-option-header.cc:921
ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst
Ipv4Address GetErrorDst() const override
Get the error destination ip address.
Definition
dsr-option-header.cc:909
ns3::dsr::DsrOptionRerrUnreachHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:969
ns3::dsr::DsrOptionRerrUnsupportedHeader
Route Error (RERR) Unsupported option Message Format.
Definition
dsr-option-header.h:984
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetErrorDst
Ipv4Address GetErrorDst() const override
Get the error destination ip address.
Definition
dsr-option-header.cc:1053
ns3::dsr::DsrOptionRerrUnsupportedHeader::SetErrorSrc
void SetErrorSrc(Ipv4Address errorSrcAddress) override
Set the route error source address.
Definition
dsr-option-header.cc:1035
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetUnsupported
uint16_t GetUnsupported() const
Get the unsupported option type value.
Definition
dsr-option-header.cc:1065
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:995
ns3::dsr::DsrOptionRerrUnsupportedHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:1086
ns3::dsr::DsrOptionRerrUnsupportedHeader::m_errorType
uint8_t m_errorType
The error type or route error option.
Definition
dsr-option-header.h:1075
ns3::dsr::DsrOptionRerrUnsupportedHeader::SetSalvage
void SetSalvage(uint8_t salvage) override
Set the salvage value of the packet.
Definition
dsr-option-header.cc:1023
ns3::dsr::DsrOptionRerrUnsupportedHeader::m_errorDstAddress
Ipv4Address m_errorDstAddress
The error destination address.
Definition
dsr-option-header.h:1087
ns3::dsr::DsrOptionRerrUnsupportedHeader::~DsrOptionRerrUnsupportedHeader
~DsrOptionRerrUnsupportedHeader() override
Destructor.
Definition
dsr-option-header.cc:1018
ns3::dsr::DsrOptionRerrUnsupportedHeader::SetUnsupported
void SetUnsupported(uint16_t optionType)
Set the unsupported option type value.
Definition
dsr-option-header.cc:1059
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:1080
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:1005
ns3::dsr::DsrOptionRerrUnsupportedHeader::m_salvage
uint8_t m_salvage
The salvage field.
Definition
dsr-option-header.h:1079
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:1116
ns3::dsr::DsrOptionRerrUnsupportedHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:1100
ns3::dsr::DsrOptionRerrUnsupportedHeader::SetErrorDst
void SetErrorDst(Ipv4Address errorDstAddress) override
Set the error destination ip address.
Definition
dsr-option-header.cc:1047
ns3::dsr::DsrOptionRerrUnsupportedHeader::DsrOptionRerrUnsupportedHeader
DsrOptionRerrUnsupportedHeader()
Constructor.
Definition
dsr-option-header.cc:1010
ns3::dsr::DsrOptionRerrUnsupportedHeader::m_errorSrcAddress
Ipv4Address m_errorSrcAddress
The error source address.
Definition
dsr-option-header.h:1083
ns3::dsr::DsrOptionRerrUnsupportedHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:1071
ns3::dsr::DsrOptionRerrUnsupportedHeader::m_unsupported
uint16_t m_unsupported
The unsupported option.
Definition
dsr-option-header.h:1091
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetErrorSrc
Ipv4Address GetErrorSrc() const override
Get the route error source address.
Definition
dsr-option-header.cc:1041
ns3::dsr::DsrOptionRerrUnsupportedHeader::GetSalvage
uint8_t GetSalvage() const override
Get the salvage value of the packet.
Definition
dsr-option-header.cc:1029
ns3::dsr::DsrOptionRrepHeader
Header of Dsr Option Route Reply.
Definition
dsr-option-header.h:429
ns3::dsr::DsrOptionRrepHeader::GetTargetAddress
Ipv4Address GetTargetAddress(std::vector< Ipv4Address > ipv4Address) const
Get the target node Ip address.
Definition
dsr-option-header.cc:485
ns3::dsr::DsrOptionRrepHeader::DsrOptionRrepHeader
DsrOptionRrepHeader()
Constructor.
Definition
dsr-option-header.cc:441
ns3::dsr::DsrOptionRrepHeader::m_address
Ipv4Address m_address
The Ip address to write to when deserialize the packet.
Definition
dsr-option-header.h:513
ns3::dsr::DsrOptionRrepHeader::SetNodeAddress
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
Definition
dsr-option-header.cc:473
ns3::dsr::DsrOptionRrepHeader::SetNumberAddress
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
Definition
dsr-option-header.cc:453
ns3::dsr::DsrOptionRrepHeader::GetNodesAddress
std::vector< Ipv4Address > GetNodesAddress() const
Get the vector of ipv4 address.
Definition
dsr-option-header.cc:467
ns3::dsr::DsrOptionRrepHeader::~DsrOptionRrepHeader
~DsrOptionRrepHeader() override
Destructor.
Definition
dsr-option-header.cc:448
ns3::dsr::DsrOptionRrepHeader::m_ipv4Address
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
Definition
dsr-option-header.h:521
ns3::dsr::DsrOptionRrepHeader::GetNodeAddress
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
Definition
dsr-option-header.cc:479
ns3::dsr::DsrOptionRrepHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:426
ns3::dsr::DsrOptionRrepHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:549
ns3::dsr::DsrOptionRrepHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:528
ns3::dsr::DsrOptionRrepHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:436
ns3::dsr::DsrOptionRrepHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:510
ns3::dsr::DsrOptionRrepHeader::SetNodesAddress
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
Definition
dsr-option-header.cc:460
ns3::dsr::DsrOptionRrepHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:504
ns3::dsr::DsrOptionRrepHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:491
ns3::dsr::DsrOptionRreqHeader
Header of Dsr Option Route Request.
Definition
dsr-option-header.h:259
ns3::dsr::DsrOptionRreqHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:263
ns3::dsr::DsrOptionRreqHeader::SetNodesAddress
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
Definition
dsr-option-header.cc:316
ns3::dsr::DsrOptionRreqHeader::m_target
Ipv4Address m_target
Ipv4 address of target node.
Definition
dsr-option-header.h:371
ns3::dsr::DsrOptionRreqHeader::SetNumberAddress
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
Definition
dsr-option-header.cc:290
ns3::dsr::DsrOptionRreqHeader::m_address
Ipv4Address m_address
Ipv4 address to write when deserializing the packet.
Definition
dsr-option-header.h:375
ns3::dsr::DsrOptionRreqHeader::SetNodeAddress
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
Definition
dsr-option-header.cc:335
ns3::dsr::DsrOptionRreqHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:273
ns3::dsr::DsrOptionRreqHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:378
ns3::dsr::DsrOptionRreqHeader::~DsrOptionRreqHeader
~DsrOptionRreqHeader() override
Destructor.
Definition
dsr-option-header.cc:285
ns3::dsr::DsrOptionRreqHeader::GetNodeAddress
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
Definition
dsr-option-header.cc:341
ns3::dsr::DsrOptionRreqHeader::m_identification
uint16_t m_identification
Identifier of the packet.
Definition
dsr-option-header.h:367
ns3::dsr::DsrOptionRreqHeader::SetTarget
void SetTarget(Ipv4Address target)
Set the target ipv4 address.
Definition
dsr-option-header.cc:303
ns3::dsr::DsrOptionRreqHeader::GetTarget
Ipv4Address GetTarget()
Get the target ipv4 address.
Definition
dsr-option-header.cc:297
ns3::dsr::DsrOptionRreqHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:417
ns3::dsr::DsrOptionRreqHeader::DsrOptionRreqHeader
DsrOptionRreqHeader()
Constructor.
Definition
dsr-option-header.cc:278
ns3::dsr::DsrOptionRreqHeader::GetNodesAddresses
std::vector< Ipv4Address > GetNodesAddresses() const
Get the vector of ipv4 address.
Definition
dsr-option-header.cc:323
ns3::dsr::DsrOptionRreqHeader::m_ipv4Address
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
Definition
dsr-option-header.h:383
ns3::dsr::DsrOptionRreqHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:359
ns3::dsr::DsrOptionRreqHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:372
ns3::dsr::DsrOptionRreqHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:396
ns3::dsr::DsrOptionRreqHeader::GetNodesNumber
uint32_t GetNodesNumber() const
Get the number of nodes.
Definition
dsr-option-header.cc:329
ns3::dsr::DsrOptionRreqHeader::AddNodeAddress
void AddNodeAddress(Ipv4Address ipv4)
Add one node address.
Definition
dsr-option-header.cc:309
ns3::dsr::DsrOptionRreqHeader::GetId
uint16_t GetId() const
Set the request id number.
Definition
dsr-option-header.cc:353
ns3::dsr::DsrOptionRreqHeader::SetId
void SetId(uint16_t identification)
Set the request id number.
Definition
dsr-option-header.cc:347
ns3::dsr::DsrOptionSRHeader
Header of Dsr Option Source Route.
Definition
dsr-option-header.h:547
ns3::dsr::DsrOptionSRHeader::GetNodeAddress
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
Definition
dsr-option-header.cc:636
ns3::dsr::DsrOptionSRHeader::m_segmentsLeft
uint8_t m_segmentsLeft
Number of left segments.
Definition
dsr-option-header.h:661
ns3::dsr::DsrOptionSRHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Definition
dsr-option-header.cc:667
ns3::dsr::DsrOptionSRHeader::GetNodesAddress
std::vector< Ipv4Address > GetNodesAddress() const
Get the vector of ipv4 address.
Definition
dsr-option-header.cc:624
ns3::dsr::DsrOptionSRHeader::m_address
Ipv4Address m_address
The ip address header deserialize to.
Definition
dsr-option-header.h:657
ns3::dsr::DsrOptionSRHeader::SetNumberAddress
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
Definition
dsr-option-header.cc:610
ns3::dsr::DsrOptionSRHeader::GetTypeId
static TypeId GetTypeId()
Get the type identificator.
Definition
dsr-option-header.cc:558
ns3::dsr::DsrOptionSRHeader::SetSalvage
void SetSalvage(uint8_t salvage)
Set the salvage value for a packet.
Definition
dsr-option-header.cc:598
ns3::dsr::DsrOptionSRHeader::Print
void Print(std::ostream &os) const override
Print some information about the packet.
Definition
dsr-option-header.cc:648
ns3::dsr::DsrOptionSRHeader::m_ipv4Address
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
Definition
dsr-option-header.h:673
ns3::dsr::DsrOptionSRHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Definition
dsr-option-header.cc:661
ns3::dsr::DsrOptionSRHeader::SetNodeAddress
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
Definition
dsr-option-header.cc:630
ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft
void SetSegmentsLeft(uint8_t segmentsLeft)
Set the number of segments left to send.
Definition
dsr-option-header.cc:586
ns3::dsr::DsrOptionSRHeader::GetSalvage
uint8_t GetSalvage() const
Get the salvage value for a packet.
Definition
dsr-option-header.cc:604
ns3::dsr::DsrOptionSRHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Definition
dsr-option-header.cc:685
ns3::dsr::DsrOptionSRHeader::GetNodeListSize
uint8_t GetNodeListSize() const
Get the node list size which is the number of ip address of the route.
Definition
dsr-option-header.cc:642
ns3::dsr::DsrOptionSRHeader::m_salvage
uint8_t m_salvage
Number of salvage times for a packet.
Definition
dsr-option-header.h:665
ns3::dsr::DsrOptionSRHeader::DsrOptionSRHeader
DsrOptionSRHeader()
Constructor.
Definition
dsr-option-header.cc:573
ns3::dsr::DsrOptionSRHeader::GetAlignment
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
Definition
dsr-option-header.cc:706
ns3::dsr::DsrOptionSRHeader::SetNodesAddress
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
Definition
dsr-option-header.cc:617
ns3::dsr::DsrOptionSRHeader::GetSegmentsLeft
uint8_t GetSegmentsLeft() const
Get the number of segments left to send.
Definition
dsr-option-header.cc:592
ns3::dsr::DsrOptionSRHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Definition
dsr-option-header.cc:568
ns3::dsr::DsrOptionSRHeader::~DsrOptionSRHeader
~DsrOptionSRHeader() override
Destructor.
Definition
dsr-option-header.cc:581
uint32_t
dsr-option-header.h
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition
assert.h:75
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WriteTo
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
Definition
address-utils.cc:21
ns3::ReadFrom
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
Definition
address-utils.cc:74
ns3::dsr::DsrOptionHeader::Alignment
Represents the alignment requirements of an option header.
Definition
dsr-option-header.h:49
src
dsr
model
dsr-option-header.cc
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0