A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 namespace dsr {
43 NS_LOG_COMPONENT_DEFINE ("DsrOptionHeader");
44 
45 NS_OBJECT_ENSURE_REGISTERED (DsrOptionHeader);
46 
48 {
49  static TypeId tid = TypeId ("ns3::dsr::DsrOptionHeader")
51  .SetParent<Header> ()
52  ;
53  return tid;
54 }
55 
57 {
58  return GetTypeId ();
59 }
60 
62  : m_type (0),
63  m_length (0)
64 {
65 }
66 
68 {
69 }
70 
71 void DsrOptionHeader::SetType (uint8_t type)
72 {
73  m_type = type;
74 }
75 
76 uint8_t DsrOptionHeader::GetType () const
77 {
78  return m_type;
79 }
80 
81 void DsrOptionHeader::SetLength (uint8_t length)
82 {
83  m_length = length;
84 }
85 
87 {
88  return m_length;
89 }
90 
91 void DsrOptionHeader::Print (std::ostream &os) const
92 {
93  os << "( type = " << (uint32_t)m_type << " length = " << (uint32_t)m_length << " )";
94 }
95 
97 {
98  return m_length + 2;
99 }
100 
102 {
104 
105  i.WriteU8 (m_type);
106  i.WriteU8 (m_length);
107  i.Write (m_data.Begin (), m_data.End ());
108 }
109 
111 {
113 
114  m_type = i.ReadU8 ();
115  m_length = i.ReadU8 ();
116 
117  m_data = Buffer ();
119  Buffer::Iterator dataStart = i;
120  i.Next (m_length);
121  Buffer::Iterator dataEnd = i;
122  m_data.Begin ().Write (dataStart, dataEnd);
123 
124  return GetSerializedSize ();
125 }
126 
128 {
129  Alignment retVal = { 1, 0 };
130  return retVal;
131 }
132 
134 
136 {
137  static TypeId tid = TypeId ("ns3::dsr::DsrOptionPad1Header")
139  .SetParent<DsrOptionHeader> ()
140  ;
141  return tid;
142 }
143 
145 {
146  return GetTypeId ();
147 }
148 
150 {
151  SetType (224);
152 }
153 
155 {
156 }
157 
158 void DsrOptionPad1Header::Print (std::ostream &os) const
159 {
160  os << "( type = " << (uint32_t)GetType () << " )";
161 }
162 
164 {
165  return 1;
166 }
167 
169 {
171 
172  i.WriteU8 (GetType ());
173 }
174 
176 {
178 
179  SetType (i.ReadU8 ());
180 
181  return GetSerializedSize ();
182 }
183 
185 
187 {
188  static TypeId tid = TypeId ("ns3::dsr::DsrOptionPadnHeader")
190  .SetParent<DsrOptionHeader> ()
191  ;
192  return tid;
193 }
194 
196 {
197  return GetTypeId ();
198 }
199 
201 {
202  SetType (0);
203  NS_ASSERT_MSG (pad >= 2, "PadN must be at least 2 bytes long");
204  SetLength (pad - 2);
205 }
206 
208 {
209 }
210 
211 void DsrOptionPadnHeader::Print (std::ostream &os) const
212 {
213  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << " )";
214 }
215 
217 {
218  return GetLength () + 2;
219 }
220 
222 {
224 
225  i.WriteU8 (GetType ());
226  i.WriteU8 (GetLength ());
227 
228  for (int padding = 0; padding < GetLength (); padding++)
229  {
230  i.WriteU8 (0);
231  }
232 }
233 
235 {
237 
238  SetType (i.ReadU8 ());
239  SetLength (i.ReadU8 ());
240 
241  return GetSerializedSize ();
242 }
243 
245 
247 {
248  static TypeId tid = TypeId ("ns3::dsr::DsrOptionRreqHeader")
250  .SetParent<DsrOptionHeader> ()
251  ;
252  return tid;
253 }
254 
256 {
257  return GetTypeId ();
258 }
259 
261  : m_ipv4Address (0)
262 {
263  SetType (1);
264  SetLength (6 + m_ipv4Address.size () * 4);
265 }
266 
268 {
269 }
270 
272 {
273  m_ipv4Address.clear ();
274  m_ipv4Address.assign (n, Ipv4Address (""));
275 }
276 
278 {
279  return m_target;
280 }
281 
283 {
284  m_target = target;
285 }
286 
288 {
289  m_ipv4Address.push_back (ipv4);
290  SetLength (6 + m_ipv4Address.size () * 4);
291 }
292 
293 void DsrOptionRreqHeader::SetNodesAddress (std::vector<Ipv4Address> ipv4Address)
294 {
295  m_ipv4Address = ipv4Address;
296  SetLength (6 + m_ipv4Address.size () * 4);
297 }
298 
299 std::vector<Ipv4Address> DsrOptionRreqHeader::GetNodesAddresses () const
300 {
301  return m_ipv4Address;
302 }
303 
305 {
306  return m_ipv4Address.size ();
307 }
308 
310 {
311  m_ipv4Address.at (index) = addr;
312 }
313 
315 {
316  return m_ipv4Address.at (index);
317 }
318 
319 void DsrOptionRreqHeader::SetId (uint16_t identification)
320 {
321  m_identification = identification;
322 }
323 
324 uint16_t DsrOptionRreqHeader::GetId () const
325 {
326  return m_identification;
327 }
328 
329 void DsrOptionRreqHeader::Print (std::ostream &os) const
330 {
331  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << "";
332 
333  for (std::vector<Ipv4Address>::const_iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
334  {
335  os << *it << " ";
336  }
337 
338  os << ")";
339 }
340 
342 {
343  return 8 + m_ipv4Address.size () * 4;
344 }
345 
347 {
349  uint8_t buff[4];
350 
351  i.WriteU8 (GetType ());
352  i.WriteU8 (GetLength ());
354  WriteTo (i, m_target);
355 
356  for (VectorIpv4Address_t::const_iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
357  {
358  it->Serialize (buff);
359  i.Write (buff, 4);
360  }
361 }
362 
364 {
366  uint8_t buff[4];
367 
368  SetType (i.ReadU8 ());
369  SetLength (i.ReadU8 ());
371  ReadFrom (i, m_target);
372 
373  uint8_t index = 0;
374  for (std::vector<Ipv4Address>::iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
375  {
376  i.Read (buff, 4);
377  m_address = it->Deserialize (buff);
378  SetNodeAddress (index, m_address);
379  ++index;
380  }
381 
382  return GetSerializedSize ();
383 }
384 
386 {
387  Alignment retVal = { 4, 0 };
388  return retVal;
389 }
390 
392 
394 {
395  static TypeId tid = TypeId ("ns3::dsr::DsrOptionRrepHeader")
397  .SetParent<DsrOptionHeader> ()
398  ;
399  return tid;
400 }
401 
403 {
404  return GetTypeId ();
405 }
406 
408  : m_ipv4Address (0)
409 {
410  SetType (2);
411  SetLength (2 + m_ipv4Address.size () * 4);
412 }
413 
415 {
416 }
417 
419 {
420  m_ipv4Address.clear ();
421  m_ipv4Address.assign (n, Ipv4Address (""));
422 }
423 
424 void DsrOptionRrepHeader::SetNodesAddress (std::vector<Ipv4Address> ipv4Address)
425 {
426  m_ipv4Address = ipv4Address;
427  SetLength (2 + m_ipv4Address.size () * 4);
428 }
429 
430 std::vector<Ipv4Address> DsrOptionRrepHeader::GetNodesAddress () const
431 {
432  return m_ipv4Address;
433 }
434 
436 {
437  m_ipv4Address.at (index) = addr;
438 }
439 
441 {
442  return m_ipv4Address.at (index);
443 }
444 
445 Ipv4Address DsrOptionRrepHeader::GetTargetAddress (std::vector<Ipv4Address> ipv4Address) const
446 {
447  return m_ipv4Address.at (ipv4Address.size () - 1);
448 }
449 
450 void DsrOptionRrepHeader::Print (std::ostream &os) const
451 {
452  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << "";
453 
454  for (std::vector<Ipv4Address>::const_iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
455  {
456  os << *it << " ";
457  }
458 
459  os << ")";
460 }
461 
463 {
464  return 4 + m_ipv4Address.size () * 4;
465 }
466 
468 {
470  uint8_t buff[4];
471 
472  i.WriteU8 (GetType ());
473  i.WriteU8 (GetLength ());
474  i.WriteU8 (0);
475  i.WriteU8 (0);
476 
477  for (VectorIpv4Address_t::const_iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
478  {
479  it->Serialize (buff);
480  i.Write (buff, 4);
481  }
482 }
483 
485 {
487  uint8_t buff[4];
488 
489  SetType (i.ReadU8 ());
490  SetLength (i.ReadU8 ());
491  i.ReadU8 ();
492  i.ReadU8 ();
493 
494  uint8_t index = 0;
495  for (std::vector<Ipv4Address>::iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
496  {
497  i.Read (buff, 4);
498  m_address = it->Deserialize (buff);
499  SetNodeAddress (index, m_address);
500  ++index;
501  }
502 
503  return GetSerializedSize ();
504 }
505 
507 {
508  Alignment retVal = { 4, 0 };
509  return retVal;
510 }
511 
513 
515 {
516  static TypeId tid = TypeId ("ns3::dsr::DsrOptionSRHeader")
518  .SetParent<DsrOptionHeader> ()
519  ;
520  return tid;
521 }
522 
524 {
525  return GetTypeId ();
526 }
527 
529  : m_segmentsLeft (0),
530  m_ipv4Address (0)
531 {
532  SetType (96);
533  SetLength (2 + m_ipv4Address.size () * 4);
534 }
535 
537 {
538 }
539 
540 void DsrOptionSRHeader::SetSegmentsLeft (uint8_t segmentsLeft)
541 {
542  m_segmentsLeft = segmentsLeft;
543 }
544 
546 {
547  return m_segmentsLeft;
548 }
549 
550 void DsrOptionSRHeader::SetSalvage (uint8_t salvage)
551 {
552  m_salvage = salvage;
553 }
554 
556 {
557  return m_salvage;
558 }
559 
561 {
562  m_ipv4Address.clear ();
563  m_ipv4Address.assign (n, Ipv4Address (""));
564 }
565 
566 void DsrOptionSRHeader::SetNodesAddress (std::vector<Ipv4Address> ipv4Address)
567 {
568  m_ipv4Address = ipv4Address;
569  SetLength (2 + m_ipv4Address.size () * 4);
570 }
571 
572 std::vector<Ipv4Address> DsrOptionSRHeader::GetNodesAddress () const
573 {
574  return m_ipv4Address;
575 }
576 
578 {
579  m_ipv4Address.at (index) = addr;
580 }
581 
583 {
584  return m_ipv4Address.at (index);
585 }
586 
588 {
589  return m_ipv4Address.size ();
590 }
591 
592 void DsrOptionSRHeader::Print (std::ostream &os) const
593 {
594  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength () << "";
595 
596  for (std::vector<Ipv4Address>::const_iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
597  {
598  os << *it << " ";
599  }
600 
601  os << ")";
602 }
603 
605 {
606  return 4 + m_ipv4Address.size () * 4;
607 }
608 
610 {
612  uint8_t buff[4];
613 
614  i.WriteU8 (GetType ());
615  i.WriteU8 (GetLength ());
616  i.WriteU8 (m_salvage);
618 
619  for (VectorIpv4Address_t::const_iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
620  {
621  it->Serialize (buff);
622  i.Write (buff, 4);
623  }
624 }
625 
627 {
629  uint8_t buff[4];
630 
631  SetType (i.ReadU8 ());
632  SetLength (i.ReadU8 ());
633  m_salvage = i.ReadU8 ();
634  m_segmentsLeft = i.ReadU8 ();
635 
636  uint8_t index = 0;
637  for (std::vector<Ipv4Address>::iterator it = m_ipv4Address.begin (); it != m_ipv4Address.end (); it++)
638  {
639  i.Read (buff, 4);
640  m_address = it->Deserialize (buff);
641  SetNodeAddress (index, m_address);
642  ++index;
643  }
644 
645  return GetSerializedSize ();
646 }
647 
649 {
650  Alignment retVal = { 4, 0 };
651  return retVal;
652 }
653 
655 
657 {
658  static TypeId tid = TypeId ("ns3::dsr::DsrOptionRerrHeader")
660  .SetParent<DsrOptionHeader> ()
661  .AddAttribute ("ErrorType","Type of route errors",
664  MakeEnumChecker (NODE_UNREACHABLE, "Node unreachable",
665  FLOW_STATE_NOT_SUPPORTED, "Flow state not supported",
666  OPTION_NOT_SUPPORTED, "Option not supported"))
667  ;
668  return tid;
669 }
670 
672 {
673  return GetTypeId ();
674 }
675 
677  : m_errorType (0),
678  m_reserved (0),
679  m_salvage (0),
680  m_errorLength (4)
681 {
682  SetType (3);
683  SetLength (18);
684 }
685 
687 {
688 }
689 
690 void DsrOptionRerrHeader::SetErrorType (uint8_t errorType)
691 {
692  m_errorType = errorType;
693 }
694 
696 {
697  return m_errorType;
698 }
699 
700 void DsrOptionRerrHeader::SetSalvage (uint8_t salvage)
701 {
702  m_salvage = salvage;
703 }
704 
706 {
707  return m_salvage;
708 }
709 
711 {
712  m_errorSrcAddress = errorSrcAddress;
713 }
714 
716 {
717  return m_errorSrcAddress;
718 }
719 
721 {
722  m_errorDstAddress = errorDstAddress;
723 }
724 
726 {
727  return m_errorDstAddress;
728 }
729 
730 void DsrOptionRerrHeader::Print (std::ostream &os) const
731 {
732  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength ()
733  << " errorType = " << (uint32_t)m_errorType << " salvage = " << (uint32_t)m_salvage
734  << " error source = " << m_errorSrcAddress << " error dst = " << m_errorDstAddress << " )";
735 
736 }
737 
739 {
740  return 20;
741 }
742 
744 {
746 
747  i.WriteU8 (GetType ());
748  i.WriteU8 (GetLength ());
749  i.WriteU8 (m_errorType);
750  i.WriteU8 (m_salvage);
754 }
755 
757 {
759 
760  SetType (i.ReadU8 ());
761  SetLength (i.ReadU8 ());
762  m_errorType = i.ReadU8 ();
763  m_salvage = i.ReadU8 ();
766 
767  m_errorData = Buffer ();
769  Buffer::Iterator dataStart = i;
770  i.Next (m_errorLength);
771  Buffer::Iterator dataEnd = i;
772  m_errorData.Begin ().Write (dataStart, dataEnd);
773 
774  return GetSerializedSize ();
775 }
776 
778 {
779  Alignment retVal = { 4, 0 };
780  return retVal;
781 }
782 
784 
786 {
787  static TypeId tid = TypeId ("ns3::dsr::DsrOptionRerrUnreachHeader")
789  .SetParent<DsrOptionRerrHeader> ()
790  ;
791  return tid;
792 }
793 
795 {
796  return GetTypeId ();
797 }
798 
800  : m_reserved (0),
801  m_salvage (0)
802 {
803  SetType (3);
804  SetLength (18);
805  SetErrorType (1);
806 }
807 
809 {
810 }
811 
813 {
814  m_salvage = salvage;
815 }
816 
818 {
819  return m_salvage;
820 }
821 
823 {
824  m_errorSrcAddress = errorSrcAddress;
825 }
826 
828 {
829  return m_errorSrcAddress;
830 }
831 
833 {
834  m_errorDstAddress = errorDstAddress;
835 }
836 
838 {
839  return m_errorDstAddress;
840 }
841 
843 {
844  m_unreachNode = unreachNode;
845 }
846 
848 {
849  return m_unreachNode;
850 }
851 
853 {
854  m_originalDst = originalDst;
855 }
856 
858 {
859  return m_originalDst;
860 }
861 
862 void DsrOptionRerrUnreachHeader::Print (std::ostream &os) const
863 {
864  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength ()
865  << " errorType = " << (uint32_t)m_errorType << " salvage = " << (uint32_t)m_salvage
866  << " error source = " << m_errorSrcAddress << " error dst = " << m_errorDstAddress
867  << " unreach node = " << m_unreachNode << " )";
868 }
869 
871 {
872  return 20;
873 }
874 
876 {
878 
879  i.WriteU8 (GetType ());
880  i.WriteU8 (GetLength ());
881  i.WriteU8 (GetErrorType ());
882  i.WriteU8 (m_salvage);
885  WriteTo (i, m_unreachNode);
886  WriteTo (i, m_originalDst);
887 }
888 
890 {
892 
893  SetType (i.ReadU8 ());
894  SetLength (i.ReadU8 ());
895  SetErrorType (i.ReadU8 ());
896  m_salvage = i.ReadU8 ();
899  ReadFrom (i, m_unreachNode);
900  ReadFrom (i, m_originalDst);
901 
902  return GetSerializedSize ();
903 }
904 
906 {
907  Alignment retVal = { 4, 0 };
908  return retVal;
909 }
910 
912 
914 {
915  static TypeId tid = TypeId ("ns3::dsr::DsrOptionRerrUnsupportHeader")
917  .SetParent<DsrOptionRerrHeader> ()
918  ;
919  return tid;
920 }
921 
923 {
924  return GetTypeId ();
925 }
926 
928  : m_reserved (0),
929  m_salvage (0)
930 {
931  SetType (3);
932  SetLength (14);
933  SetErrorType (3);
934 }
935 
937 {
938 }
939 
941 {
942  m_salvage = salvage;
943 }
944 
946 {
947  return m_salvage;
948 }
949 
951 {
952  m_errorSrcAddress = errorSrcAddress;
953 }
954 
956 {
957  return m_errorSrcAddress;
958 }
959 
961 {
962  m_errorDstAddress = errorDstAddress;
963 }
964 
966 {
967  return m_errorDstAddress;
968 }
969 
971 {
972  m_unsupport = unsupport;
973 }
974 
976 {
977  return m_unsupport;
978 }
979 
980 void DsrOptionRerrUnsupportHeader::Print (std::ostream &os) const
981 {
982  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength ()
983  << " errorType = " << (uint32_t)m_errorType << " salvage = " << (uint32_t)m_salvage
984  << " error source = " << m_errorSrcAddress << " error dst = " << m_errorDstAddress
985  << " unsupported option = " << m_unsupport << " )";
986 
987 }
988 
990 {
991  return 16;
992 }
993 
995 {
997 
998  i.WriteU8 (GetType ());
999  i.WriteU8 (GetLength ());
1000  i.WriteU8 (GetErrorType ());
1001  i.WriteU8 (m_salvage);
1004  i.WriteU16 (m_unsupport);
1005 
1006 }
1007 
1009 {
1010  Buffer::Iterator i = start;
1011 
1012  SetType (i.ReadU8 ());
1013  SetLength (i.ReadU8 ());
1014  SetErrorType (i.ReadU8 ());
1015  m_salvage = i.ReadU8 ();
1018  m_unsupport = i.ReadU16 ();
1019 
1020  return GetSerializedSize ();
1021 }
1022 
1024 {
1025  Alignment retVal = { 4, 0 };
1026  return retVal;
1027 }
1028 
1030 
1032 {
1033  static TypeId tid = TypeId ("ns3::dsr::DsrOptionAckReqHeader")
1035  .SetParent<DsrOptionHeader> ()
1036  ;
1037  return tid;
1038 }
1039 
1041 {
1042  return GetTypeId ();
1043 }
1044 
1046  : m_identification (0)
1047 
1048 {
1049  SetType (160);
1050  SetLength (2);
1051 }
1052 
1054 {
1055 }
1056 
1057 void DsrOptionAckReqHeader::SetAckId (uint16_t identification)
1058 {
1059  m_identification = identification;
1060 }
1061 
1063 {
1064  return m_identification;
1065 }
1066 
1067 void DsrOptionAckReqHeader::Print (std::ostream &os) const
1068 {
1069  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength ()
1070  << " id = " << m_identification << " )";
1071 }
1072 
1074 {
1075  return 4;
1076 }
1077 
1079 {
1080  Buffer::Iterator i = start;
1081 
1082  i.WriteU8 (GetType ());
1083  i.WriteU8 (GetLength ());
1085 }
1086 
1088 {
1089  Buffer::Iterator i = start;
1090 
1091  SetType (i.ReadU8 ());
1092  SetLength (i.ReadU8 ());
1093  m_identification = i.ReadU16 ();
1094 
1095  return GetSerializedSize ();
1096 }
1097 
1099 {
1100  Alignment retVal = { 4, 0 };
1101  return retVal;
1102 }
1103 
1105 
1107 {
1108  static TypeId tid = TypeId ("ns3::dsr::DsrOptionAckHeader")
1110  .SetParent<DsrOptionHeader> ()
1111  ;
1112  return tid;
1113 }
1114 
1116 {
1117  return GetTypeId ();
1118 }
1119 
1121  : m_identification (0)
1122 {
1123  SetType (32);
1124  SetLength (10);
1125 }
1126 
1128 {
1129 }
1130 
1131 void DsrOptionAckHeader::SetAckId (uint16_t identification)
1132 {
1133  m_identification = identification;
1134 }
1135 
1137 {
1138  return m_identification;
1139 }
1140 
1142 {
1143  m_realSrcAddress = realSrcAddress;
1144 }
1145 
1147 {
1148  return m_realSrcAddress;
1149 }
1150 
1152 {
1153  m_realDstAddress = realDstAddress;
1154 }
1155 
1157 {
1158  return m_realDstAddress;
1159 }
1160 
1161 void DsrOptionAckHeader::Print (std::ostream &os) const
1162 {
1163  os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength ()
1164  << " id = " << m_identification << " real src = " << m_realSrcAddress
1165  << " real dst = " << m_realDstAddress << " )";
1166 
1167 }
1168 
1170 {
1171  return 12;
1172 }
1173 
1175 {
1176  Buffer::Iterator i = start;
1177 
1178  i.WriteU8 (GetType ());
1179  i.WriteU8 (GetLength ());
1183 }
1184 
1186 {
1187  Buffer::Iterator i = start;
1188 
1189  SetType (i.ReadU8 ());
1190  SetLength (i.ReadU8 ());
1191  m_identification = i.ReadU16 ();
1194 
1195  return GetSerializedSize ();
1196 }
1197 
1199 {
1200  Alignment retVal = { 4, 0 };
1201  return retVal;
1202 }
1203 } /* namespace dsr */
1204 } /* namespace ns3 */