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