A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
icmpv6-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2009 Strasbourg University
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18 * Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
19 * David Gross <gdavid.devel@gmail.com>
20 */
21
22#ifndef ICMPV6_HEADER_H
23#define ICMPV6_HEADER_H
24
25#include "ns3/header.h"
26#include "ns3/ipv6-address.h"
27#include "ns3/packet.h"
28
29namespace ns3
30{
31
32/**
33 * \ingroup icmpv6
34 *
35 * \brief ICMPv6 header.
36 */
37class Icmpv6Header : public Header
38{
39 public:
40 /**
41 * \brief ICMPv6 type code.
42 */
43 enum Type_e
44 {
71 };
72
73 /**
74 * \brief ICMPv6 Option type code.
75 */
77 {
83 };
84
85 /**
86 * \brief ICMPv6 error code : Destination Unreachable
87 */
89 {
95 };
96
97 /**
98 * \brief ICMPv6 error code : Time Exceeded
99 */
101 {
104 };
105
106 /**
107 * \brief ICMPv6 error code : Parameter Error
108 */
110 {
114 };
115
116 /**
117 * \brief Get the UID of this class.
118 * \return UID
119 */
120 static TypeId GetTypeId();
121
122 /**
123 * \brief Get the instance type ID.
124 * \return instance type ID
125 */
126 TypeId GetInstanceTypeId() const override;
127
128 /**
129 * \brief Constructor.
130 */
131 Icmpv6Header();
132
133 /**
134 * \brief Destructor.
135 */
136 ~Icmpv6Header() override;
137
138 /**
139 * \brief Get the type field.
140 * \return type of ICMPv6 message
141 */
142 uint8_t GetType() const;
143
144 /**
145 * \brief Set the type.
146 * \param type type to set
147 */
148 void SetType(uint8_t type);
149
150 /**
151 * \brief Get the code field.
152 * \return code of ICMPv6 message
153 */
154 uint8_t GetCode() const;
155
156 /**
157 * \brief Set the code field.
158 * \param code code to set
159 */
160 void SetCode(uint8_t code);
161
162 /**
163 * \brief Get the checksum.
164 * \return checksum
165 */
166 uint16_t GetChecksum() const;
167
168 /**
169 * \brief Set the checksum.
170 * \param checksum to set
171 */
172 void SetChecksum(uint16_t checksum);
173
174 /**
175 * \brief Print information.
176 * \param os output stream
177 */
178 void Print(std::ostream& os) const override;
179
180 /**
181 * \brief Get the serialized size.
182 * \return serialized size
183 */
184 uint32_t GetSerializedSize() const override;
185
186 /**
187 * \brief Serialize the packet.
188 * \param start start offset
189 */
190 void Serialize(Buffer::Iterator start) const override;
191
192 /**
193 * \brief Deserialize the packet.
194 * \param start start offset
195 * \return length of packet
196 */
197 uint32_t Deserialize(Buffer::Iterator start) override;
198
199 /**
200 * \brief Calculate pseudo header checksum for IPv6.
201 * \param src source address
202 * \param dst destination address
203 * \param length length
204 * \param protocol the protocol number to use in the
205 * underlying IPv6 packet.
206 */
208 Ipv6Address dst,
209 uint16_t length,
210 uint8_t protocol);
211
212 protected:
213 /**
214 * \brief Checksum enable or not.
215 */
217
218 /**
219 * \brief The checksum.
220 */
221 uint16_t m_checksum;
222
223 private:
224 /**
225 * \brief The type.
226 */
227 uint8_t m_type;
228
229 /**
230 * \brief The code.
231 */
232 uint8_t m_code;
233};
234
235/**
236 * \ingroup icmpv6
237 *
238 * \brief ICMPv6 option header.
239 */
241{
242 public:
243 /**
244 * \brief Get the UID of this class.
245 * \return UID
246 */
247 static TypeId GetTypeId();
248
249 /**
250 * \brief Get the instance type ID.
251 * \return instance type ID
252 */
253 TypeId GetInstanceTypeId() const override;
254
255 /**
256 * \brief Constructor.
257 */
259
260 /**
261 * \brief Destructor.
262 */
263 ~Icmpv6OptionHeader() override;
264
265 /**
266 * \brief Get the type of the option.
267 * \return type
268 */
269 uint8_t GetType() const;
270
271 /**
272 * \brief Set the type of the option.
273 * \param type the type to set
274 */
275 void SetType(uint8_t type);
276
277 /**
278 * \brief Get the length of the option in 8 bytes unit.
279 * \return length of the option
280 */
281 uint8_t GetLength() const;
282
283 /**
284 * \brief Set the length of the option.
285 * \param len length value to set
286 */
287 void SetLength(uint8_t len);
288
289 /**
290 * \brief Print information.
291 * \param os output stream
292 */
293 void Print(std::ostream& os) const override;
294
295 /**
296 * \brief Get the serialized size.
297 * \return serialized size
298 */
299 uint32_t GetSerializedSize() const override;
300
301 /**
302 * \brief Serialize the packet.
303 * \param start start offset
304 */
305 void Serialize(Buffer::Iterator start) const override;
306
307 /**
308 * \brief Deserialize the packet.
309 * \param start start offset
310 * \return length of packet
311 */
312 uint32_t Deserialize(Buffer::Iterator start) override;
313
314 private:
315 /**
316 * \brief The type.
317 */
318 uint8_t m_type;
319
320 /**
321 * \brief The length.
322 */
323 uint8_t m_len;
324};
325
326/**
327 * \ingroup icmpv6
328 *
329 * \brief ICMPv6 Neighbor Solicitation header.
330 */
331class Icmpv6NS : public Icmpv6Header
332{
333 public:
334 /**
335 * \brief Constructor.
336 * \param target target IPv6 address
337 */
338 Icmpv6NS(Ipv6Address target);
339
340 /**
341 * \brief Constructor.
342 */
343 Icmpv6NS();
344
345 /**
346 * \brief Destructor.
347 */
348 ~Icmpv6NS() override;
349
350 /**
351 * \brief Get the UID of this class.
352 * \return UID
353 */
354 static TypeId GetTypeId();
355
356 /**
357 * \brief Get the instance type ID.
358 * \return instance type ID
359 */
360 TypeId GetInstanceTypeId() const override;
361
362 /**
363 * \brief Get the reserved field.
364 * \return reserved value
365 */
366 uint32_t GetReserved() const;
367
368 /**
369 * \brief Set the reserved field.
370 * \param reserved the reserved value
371 */
372 void SetReserved(uint32_t reserved);
373
374 /**
375 * \brief Get the IPv6 target field.
376 * \return IPv6 address
377 */
379
380 /**
381 * \brief Set the IPv6 target field.
382 * \param target IPv6 address
383 */
384 void SetIpv6Target(Ipv6Address target);
385
386 /**
387 * \brief Print information.
388 * \param os output stream
389 */
390 void Print(std::ostream& os) const override;
391
392 /**
393 * \brief Get the serialized size.
394 * \return serialized size
395 */
396 uint32_t GetSerializedSize() const override;
397
398 /**
399 * \brief Serialize the packet.
400 * \param start start offset
401 */
402 void Serialize(Buffer::Iterator start) const override;
403
404 /**
405 * \brief Deserialize the packet.
406 * \param start start offset
407 * \return length of packet
408 */
409 uint32_t Deserialize(Buffer::Iterator start) override;
410
411 private:
412 /**
413 * \brief The reserved value.
414 */
416
417 /**
418 * \brief The IPv6 target address.
419 */
421};
422
423/**
424 * \ingroup icmpv6
425 *
426 * \brief ICMPv6 Neighbor Advertisement header.
427 */
428class Icmpv6NA : public Icmpv6Header
429{
430 public:
431 /**
432 * \brief Constructor.
433 */
434 Icmpv6NA();
435
436 /**
437 * \brief Destructor.
438 */
439 ~Icmpv6NA() override;
440
441 /**
442 * \brief Get the UID of this class.
443 * \return UID
444 */
445 static TypeId GetTypeId();
446
447 /**
448 * \brief Get the instance type ID.
449 * \return instance type ID
450 */
451 TypeId GetInstanceTypeId() const override;
452
453 /**
454 * \brief Get the reserved field.
455 * \return reserved value
456 */
457 uint32_t GetReserved() const;
458
459 /**
460 * \brief Set the reserved field.
461 * \param reserved the reserved value
462 */
463 void SetReserved(uint32_t reserved);
464
465 /**
466 * \brief Get the IPv6 target field.
467 * \return IPv6 address
468 */
470
471 /**
472 * \brief Set the IPv6 target field.
473 * \param target IPv6 address
474 */
475 void SetIpv6Target(Ipv6Address target);
476
477 /**
478 * \brief Get the R flag.
479 * \return R flag
480 */
481 bool GetFlagR() const;
482
483 /**
484 * \brief Set the R flag.
485 * \param r value
486 */
487 void SetFlagR(bool r);
488
489 /**
490 * \brief Get the S flag.
491 * \return S flag
492 */
493 bool GetFlagS() const;
494
495 /**
496 * \brief Set the S flag.
497 * \param s value
498 */
499 void SetFlagS(bool s);
500
501 /**
502 * \brief Get the O flag.
503 * \return O flag
504 */
505 bool GetFlagO() const;
506
507 /**
508 * \brief Set the O flag.
509 * \param o value
510 */
511 void SetFlagO(bool o);
512
513 /**
514 * \brief Print information.
515 * \param os output stream
516 */
517 void Print(std::ostream& os) const override;
518
519 /**
520 * \brief Get the serialized size.
521 * \return serialized size
522 */
523 uint32_t GetSerializedSize() const override;
524
525 /**
526 * \brief Serialize the packet.
527 * \param start start offset
528 */
529 void Serialize(Buffer::Iterator start) const override;
530
531 /**
532 * \brief Deserialize the packet.
533 * \param start start offset
534 * \return length of packet
535 */
536 uint32_t Deserialize(Buffer::Iterator start) override;
537
538 private:
539 /**
540 * \brief The R flag.
541 */
543
544 /**
545 * \brief The O flag.
546 */
548
549 /**
550 * \brief The M flag.
551 */
553
554 /**
555 * \brief The reserved value.
556 */
558
559 /**
560 * \brief The IPv6 target address.
561 */
563};
564
565/**
566 * \ingroup icmpv6
567 *
568 * \brief ICMPv6 Router Advertisement header.
569 */
570class Icmpv6RA : public Icmpv6Header
571{
572 public:
573 /**
574 * \brief Constructor.
575 */
576 Icmpv6RA();
577
578 /**
579 * \brief Destructor.
580 */
581 ~Icmpv6RA() override;
582
583 /**
584 * \brief Get the UID of this class.
585 * \return UID
586 */
587 static TypeId GetTypeId();
588
589 /**
590 * \brief Get the instance type ID.
591 * \return instance type ID
592 */
593 TypeId GetInstanceTypeId() const override;
594
595 /**
596 * \brief Set the IPv6 maximum number of jumps.
597 * \param m maximum jumps
598 */
599 void SetCurHopLimit(uint8_t m);
600
601 /**
602 * \brief Get the IPv6 maximum number of jumps.
603 * \return maximum jumps
604 */
605 uint8_t GetCurHopLimit() const;
606
607 /**
608 * \brief Set the node Life time (Neighbor Discovery).
609 * \param l life time
610 */
611 void SetLifeTime(uint16_t l);
612
613 /**
614 * \brief Get the node Life time (Neighbor Discovery).
615 * \return life time
616 */
617 uint16_t GetLifeTime() const;
618
619 /**
620 * \brief Set the node Reachable time (Neighbor Discovery).
621 * \param r Reachable time
622 */
624
625 /**
626 * \brief Get the node Reachable time (Neighbor Discovery).
627 * \return reachable time
628 */
630
631 /**
632 * \brief Set the node Retransmission time (Neighbor Discovery).
633 * \param r Retransmission time
634 */
636
637 /**
638 * \brief Get the node Retransmission time (Neighbor Discovery).
639 * \return retransmission time
640 */
642
643 /**
644 * \brief Get the M flag.
645 * \return M flag
646 */
647 bool GetFlagM() const;
648
649 /**
650 * \brief Set the M flag.
651 * \param m value
652 */
653 void SetFlagM(bool m);
654
655 /**
656 * \brief Get the O flag.
657 * \return O flag
658 */
659 bool GetFlagO() const;
660
661 /**
662 * \brief Set the O flag.
663 * \param o value
664 */
665 void SetFlagO(bool o);
666
667 /**
668 * \brief Get the H flag.
669 * \return H flag
670 */
671 bool GetFlagH() const;
672
673 /**
674 * \brief Set the H flag.
675 * \param h value
676 */
677 void SetFlagH(bool h);
678
679 /**
680 * \brief Print information.
681 * \param os output stream
682 */
683 void Print(std::ostream& os) const override;
684
685 /**
686 * \brief Get the serialized size.
687 * \return serialized size
688 */
689 uint32_t GetSerializedSize() const override;
690
691 /**
692 * \brief Serialize the packet.
693 * \param start start offset
694 */
695 void Serialize(Buffer::Iterator start) const override;
696
697 /**
698 * \brief Deserialize the packet.
699 * \param start start offset
700 * \return length of packet
701 */
702 uint32_t Deserialize(Buffer::Iterator start) override;
703
704 private:
705 /**
706 * \brief The M flag.
707 */
709
710 /**
711 * \brief The O flag.
712 */
714
715 /**
716 * \brief The H flag.
717 */
719
720 /**
721 * \brief The lifetime value.
722 */
723 uint16_t m_LifeTime;
724
725 /**
726 * \brief The reachable time value.
727 */
729
730 /**
731 * \brief The retransmission timer.
732 */
734
735 /**
736 * \brief The max jumps.
737 */
739};
740
741/**
742 * \ingroup icmpv6
743 *
744 * \brief ICMPv6 Router Solicitation header.
745 */
746class Icmpv6RS : public Icmpv6Header
747{
748 public:
749 /**
750 * \brief Constructor.
751 */
752 Icmpv6RS();
753
754 /**
755 * \brief Destructor.
756 */
757 ~Icmpv6RS() override;
758
759 /**
760 * \brief Get the UID of this class.
761 * \return UID
762 */
763 static TypeId GetTypeId();
764
765 /**
766 * \brief Get the instance type ID.
767 * \return instance type ID
768 */
769 TypeId GetInstanceTypeId() const override;
770
771 /**
772 * \brief Get the reserved field.
773 * \return reserved value
774 */
775 uint32_t GetReserved() const;
776
777 /**
778 * \brief Set the reserved field.
779 * \param reserved the reserved value
780 */
781 void SetReserved(uint32_t reserved);
782
783 /**
784 * \brief Print information.
785 * \param os output stream
786 */
787 void Print(std::ostream& os) const override;
788
789 /**
790 * \brief Get the serialized size.
791 * \return serialized size
792 */
793 uint32_t GetSerializedSize() const override;
794
795 /**
796 * \brief Serialize the packet.
797 * \param start start offset
798 */
799 void Serialize(Buffer::Iterator start) const override;
800
801 /**
802 * \brief Deserialize the packet.
803 * \param start start offset
804 * \return length of packet
805 */
806 uint32_t Deserialize(Buffer::Iterator start) override;
807
808 private:
809 /**
810 * \brief The reserved value.
811 */
813};
814
815/**
816 * \ingroup icmpv6
817 *
818 * \brief ICMPv6 Redirection header.
819 */
821{
822 public:
823 /**
824 * \brief Constructor.
825 */
827
828 /**
829 * \brief Destructor.
830 */
831 ~Icmpv6Redirection() override;
832
833 /**
834 * \brief Get the UID of this class.
835 * \return UID
836 */
837 static TypeId GetTypeId();
838
839 /**
840 * \brief Get the instance type ID.
841 * \return instance type ID
842 */
843 TypeId GetInstanceTypeId() const override;
844
845 /**
846 * \brief Get the IPv6 target address.
847 * \return the IPv6 target address
848 */
849 Ipv6Address GetTarget() const;
850
851 /**
852 * \brief Set the IPv6 target address.
853 * \param target IPv6 target address
854 */
855 void SetTarget(Ipv6Address target);
856
857 /**
858 * \brief Get the IPv6 destination address.
859 * \return the IPv6 destination address
860 */
862
863 /**
864 * \brief Set the IPv6 destination address.
865 * \param destination IPv6 destination address
866 */
867 void SetDestination(Ipv6Address destination);
868
869 /**
870 * \brief Print information.
871 * \param os output stream
872 */
873 void Print(std::ostream& os) const override;
874
875 /**
876 * \brief Get the serialized size.
877 * \return serialized size
878 */
879 uint32_t GetSerializedSize() const override;
880
881 /**
882 * \brief Serialize the packet.
883 * \param start start offset
884 */
885 void Serialize(Buffer::Iterator start) const override;
886
887 /**
888 * \brief Deserialize the packet.
889 * \param start start offset
890 * \return length of packet
891 */
892 uint32_t Deserialize(Buffer::Iterator start) override;
893
894 /**
895 * \brief Get the reserved field.
896 * \return reserved value
897 */
898 uint32_t GetReserved() const;
899
900 /**
901 * \brief Set the reserved field.
902 * \param reserved the reserved value
903 */
904 void SetReserved(uint32_t reserved);
905
906 private:
907 /**
908 * \brief IPv6 target address.
909 */
911
912 /**
913 * \brief IPv6 destination address.
914 */
916
917 /**
918 * \brief Reserved value.
919 */
921};
922
923/**
924 * \ingroup icmpv6
925 *
926 * \brief ICMPv6 Echo message.
927 */
929{
930 public:
931 /**
932 * \brief Get the UID of this class.
933 * \return UID
934 */
935 static TypeId GetTypeId();
936
937 /**
938 * \brief Get the instance type ID.
939 * \return instance type ID
940 */
941 TypeId GetInstanceTypeId() const override;
942
943 /**
944 * \brief Default constructor.
945 */
946 Icmpv6Echo();
947
948 /**
949 * \brief Constructor.
950 * \param request request or reply message
951 */
952 Icmpv6Echo(bool request);
953
954 /**
955 * \brief Destructor.
956 */
957 ~Icmpv6Echo() override;
958
959 /**
960 * \brief Get the ID of the packet.
961 * \return id
962 */
963 uint16_t GetId() const;
964
965 /**
966 * \brief Set the ID of the packet.
967 * \param id id to set
968 */
969 void SetId(uint16_t id);
970
971 /**
972 * \brief Get the sequence number.
973 * \return sequence number
974 */
975 uint16_t GetSeq() const;
976
977 /**
978 * \brief Set the sequence number.
979 * \param seq sequence to set
980 */
981 void SetSeq(uint16_t seq);
982
983 /**
984 * \brief Print information.
985 * \param os output stream
986 */
987 void Print(std::ostream& os) const override;
988
989 /**
990 * \brief Get the serialized size.
991 * \return serialized size
992 */
993 uint32_t GetSerializedSize() const override;
994
995 /**
996 * \brief Serialize the packet.
997 * \param start start offset
998 */
999 void Serialize(Buffer::Iterator start) const override;
1000
1001 /**
1002 * \brief Deserialize the packet.
1003 * \param start start offset
1004 * \return length of packet
1005 */
1006 uint32_t Deserialize(Buffer::Iterator start) override;
1007
1008 private:
1009 /**
1010 * \brief ID of the packet (to distinguish response between many ping program).
1011 */
1012 uint16_t m_id;
1013
1014 /**
1015 * \brief Sequence number (to distinguish response).
1016 */
1017 uint16_t m_seq;
1018};
1019
1020/**
1021 * \ingroup icmpv6
1022 *
1023 * \brief ICMPv6 Error Destination Unreachable header.
1024 */
1026{
1027 public:
1028 /**
1029 * \brief Constructor.
1030 */
1032
1033 /**
1034 * \brief Destructor.
1035 */
1037
1038 /**
1039 * \brief Get the UID of this class.
1040 * \return UID
1041 */
1042 static TypeId GetTypeId();
1043
1044 /**
1045 * \brief Get the instance type ID.
1046 * \return instance type ID
1047 */
1048 TypeId GetInstanceTypeId() const override;
1049
1050 /**
1051 * \brief Set the incorrect packet.
1052 * \param p the incorrect packet
1053 */
1054 void SetPacket(Ptr<Packet> p);
1055
1056 /**
1057 * \brief Print information.
1058 * \param os output stream
1059 */
1060 void Print(std::ostream& os) const override;
1061
1062 /**
1063 * \brief Get the serialized size.
1064 * \return serialized size
1065 */
1066 uint32_t GetSerializedSize() const override;
1067
1068 /**
1069 * \brief Serialize the packet.
1070 * \param start start offset
1071 */
1072 void Serialize(Buffer::Iterator start) const override;
1073
1074 /**
1075 * \brief Deserialize the packet.
1076 * \param start start offset
1077 * \return length of packet
1078 */
1079 uint32_t Deserialize(Buffer::Iterator start) override;
1080
1081 private:
1082 /**
1083 * \brief The incorrect Packet.
1084 */
1086};
1087
1088/**
1089 * \ingroup icmpv6
1090 *
1091 * \brief ICMPv6 Error Too Big header.
1092 */
1094{
1095 public:
1096 /**
1097 * \brief Constructor.
1098 */
1099 Icmpv6TooBig();
1100
1101 /**
1102 * \brief Destructor.
1103 */
1104 ~Icmpv6TooBig() override;
1105
1106 /**
1107 * \brief Get the UID of this class.
1108 * \return UID
1109 */
1110 static TypeId GetTypeId();
1111
1112 /**
1113 * \brief Get the instance type ID.
1114 * \return instance type ID
1115 */
1116 TypeId GetInstanceTypeId() const override;
1117
1118 /**
1119 * \brief Set the incorrect packet.
1120 * \param p the incorrect packet
1121 */
1122 void SetPacket(Ptr<Packet> p);
1123
1124 /**
1125 * \brief Get the MTU field.
1126 * \return MTU value
1127 */
1128 uint32_t GetMtu() const;
1129
1130 /**
1131 * \brief Set the MTU.
1132 * \param mtu the MTU
1133 */
1134 void SetMtu(uint32_t mtu);
1135
1136 /**
1137 * \brief Print information.
1138 * \param os output stream
1139 */
1140 void Print(std::ostream& os) const override;
1141
1142 /**
1143 * \brief Get the serialized size.
1144 * \return serialized size
1145 */
1146 uint32_t GetSerializedSize() const override;
1147
1148 /**
1149 * \brief Serialize the packet.
1150 * \param start start offset
1151 */
1152 void Serialize(Buffer::Iterator start) const override;
1153
1154 /**
1155 * \brief Deserialize the packet.
1156 * \param start start offset
1157 * \return length of packet
1158 */
1159 uint32_t Deserialize(Buffer::Iterator start) override;
1160
1161 private:
1162 /**
1163 * \brief the incorrect packet.
1164 */
1166
1167 /**
1168 * \brief The MTU value.
1169 */
1171};
1172
1173/**
1174 * \ingroup icmpv6
1175 *
1176 * \brief ICMPv6 Error Time Exceeded header.
1177 */
1179{
1180 public:
1181 /**
1182 * \brief Constructor.
1183 */
1185
1186 /**
1187 * \brief Destructor.
1188 */
1189 ~Icmpv6TimeExceeded() override;
1190
1191 /**
1192 * \brief Get the UID of this class.
1193 * \return UID
1194 */
1195 static TypeId GetTypeId();
1196
1197 /**
1198 * \brief Get the instance type ID.
1199 * \return instance type ID
1200 */
1201 TypeId GetInstanceTypeId() const override;
1202
1203 /**
1204 * \brief Set the incorrect packet.
1205 * \param p the incorrect packet
1206 */
1207 void SetPacket(Ptr<Packet> p);
1208
1209 /**
1210 * \brief Print information.
1211 * \param os output stream
1212 */
1213 void Print(std::ostream& os) const override;
1214
1215 /**
1216 * \brief Get the serialized size.
1217 * \return serialized size
1218 */
1219 uint32_t GetSerializedSize() const override;
1220
1221 /**
1222 * \brief Serialize the packet.
1223 * \param start start offset
1224 */
1225 void Serialize(Buffer::Iterator start) const override;
1226
1227 /**
1228 * \brief Deserialize the packet.
1229 * \param start start offset
1230 * \return length of packet
1231 */
1232 uint32_t Deserialize(Buffer::Iterator start) override;
1233
1234 private:
1235 /**
1236 * \brief The incorrect packet.
1237 */
1239};
1240
1241/**
1242 * \ingroup icmpv6
1243 *
1244 * \brief ICMPv6 Error Parameter Error header.
1245 */
1247{
1248 public:
1249 /**
1250 * \brief Constructor.
1251 */
1253
1254 /**
1255 * \brief Destructor.
1256 */
1257 ~Icmpv6ParameterError() override;
1258
1259 /**
1260 * \brief Get the UID of this class.
1261 * \return UID
1262 */
1263 static TypeId GetTypeId();
1264
1265 /**
1266 * \brief Get the instance type ID.
1267 * \return instance type ID
1268 */
1269 TypeId GetInstanceTypeId() const override;
1270
1271 /**
1272 * \brief Set the incorrect packet.
1273 * \param p the incorrect packet
1274 */
1275 void SetPacket(Ptr<Packet> p);
1276
1277 /**
1278 * \brief Get the pointer field.
1279 * \return pointer value
1280 */
1281 uint32_t GetPtr() const;
1282
1283 /**
1284 * \brief Set the pointer field.
1285 * \param ptr byte where the error is located in the incorrect packet
1286 */
1287 void SetPtr(uint32_t ptr);
1288
1289 /**
1290 * \brief Print information.
1291 * \param os output stream
1292 */
1293 void Print(std::ostream& os) const override;
1294
1295 /**
1296 * \brief Get the serialized size.
1297 * \return serialized size
1298 */
1299 uint32_t GetSerializedSize() const override;
1300
1301 /**
1302 * \brief Serialize the packet.
1303 * \param start start offset
1304 */
1305 void Serialize(Buffer::Iterator start) const override;
1306
1307 /**
1308 * \brief Deserialize the packet.
1309 * \param start start offset
1310 * \return length of packet
1311 */
1312 uint32_t Deserialize(Buffer::Iterator start) override;
1313
1314 private:
1315 /**
1316 * \brief The incorrect packet.
1317 */
1319
1320 /**
1321 * \brief The pointer field.
1322 */
1324};
1325
1326/**
1327 * \ingroup icmpv6
1328 *
1329 * \brief ICMPv6 MTU option.
1330 */
1332{
1333 public:
1334 /**
1335 * \brief Constructor.
1336 */
1338
1339 /**
1340 * \brief Constructor.
1341 * \param mtu MTU used.
1342 */
1344
1345 /**
1346 * \brief Destructor.
1347 */
1348 ~Icmpv6OptionMtu() override;
1349
1350 /**
1351 * \brief Get the UID of this class.
1352 * \return UID
1353 */
1354 static TypeId GetTypeId();
1355
1356 /**
1357 * \brief Get the instance type ID.
1358 * \return instance type ID
1359 */
1360 TypeId GetInstanceTypeId() const override;
1361
1362 /**
1363 * \brief Get the reserved field.
1364 * \return the reserved value
1365 */
1366 uint16_t GetReserved() const;
1367
1368 /**
1369 * \brief Set the reserved field.
1370 * \param reserved the reserved value
1371 */
1372 void SetReserved(uint16_t reserved);
1373
1374 /**
1375 * \brief Get the MTU.
1376 * \return the MTU value
1377 */
1378 uint32_t GetMtu() const;
1379
1380 /**
1381 * \brief Set the MTU.
1382 * \param mtu the MTU to set
1383 */
1384 void SetMtu(uint32_t mtu);
1385
1386 /**
1387 * \brief Print information.
1388 * \param os output stream
1389 */
1390 void Print(std::ostream& os) const override;
1391
1392 /**
1393 * \brief Get the serialized size.
1394 * \return serialized size
1395 */
1396 uint32_t GetSerializedSize() const override;
1397
1398 /**
1399 * \brief Serialize the packet.
1400 * \param start start offset
1401 */
1402 void Serialize(Buffer::Iterator start) const override;
1403
1404 /**
1405 * \brief Deserialize the packet.
1406 * \param start start offset
1407 * \return length of packet
1408 */
1409 uint32_t Deserialize(Buffer::Iterator start) override;
1410
1411 private:
1412 /**
1413 * \brief The reserved value
1414 */
1415 uint16_t m_reserved;
1416
1417 /**
1418 * \brief The MTU value.
1419 */
1421};
1422
1423/**
1424 * \ingroup icmpv6
1425 *
1426 * \brief ICMPv6 Option Prefix Information.
1427 */
1429{
1430 public:
1431 /**
1432 * \brief Constructor.
1433 */
1435
1436 /**
1437 * \brief Constructor.
1438 * \param network prefix
1439 * \param prefixlen prefix length
1440 */
1441 Icmpv6OptionPrefixInformation(Ipv6Address network, uint8_t prefixlen);
1442
1443 /**
1444 * \brief Destructor.
1445 */
1447
1448 /**
1449 * \brief Get the UID of this class.
1450 * \return UID
1451 */
1452 static TypeId GetTypeId();
1453
1454 /**
1455 * \brief Get the instance type ID.
1456 * \return instance type ID
1457 */
1458 TypeId GetInstanceTypeId() const override;
1459
1460 /**
1461 * \brief Icmpv6 Option Prefix Information flag field values
1462 */
1464 {
1465 NONE = 0, //!< No flags
1466 ROUTERADDR = 32, //!< Router Address
1467 AUTADDRCONF = 64, //!< Autonomous Address Configuration
1468 ONLINK = 128 //!< On-link
1470
1471 /**
1472 * \brief Get the prefix length.
1473 * \return prefix length
1474 */
1475 uint8_t GetPrefixLength() const;
1476
1477 /**
1478 * \brief Set the prefix length.
1479 * \param prefixLength the prefix length
1480 */
1481 void SetPrefixLength(uint8_t prefixLength);
1482
1483 /**
1484 * \brief Get the flags.
1485 * \return the flags.
1486 */
1487 uint8_t GetFlags() const;
1488
1489 /**
1490 * \brief Set the flags.
1491 * \param flags the flags to set
1492 */
1493 void SetFlags(uint8_t flags);
1494
1495 /**
1496 * \brief Get the valid time of the information.
1497 * \return valid time
1498 */
1499 uint32_t GetValidTime() const;
1500
1501 /**
1502 * \brief Set the valid time of the information.
1503 * \param validTime valid time
1504 */
1505 void SetValidTime(uint32_t validTime);
1506
1507 /**
1508 * \brief Get the preferred time of the information.
1509 * \return preferred time
1510 */
1511 uint32_t GetPreferredTime() const;
1512
1513 /**
1514 * \brief Set the preferred time of the information.
1515 * \param preferredTime preferred time
1516 */
1517 void SetPreferredTime(uint32_t preferredTime);
1518
1519 /**
1520 * \brief Get the reserved field.
1521 * \return the reserved field (should be 0x00000000)
1522 */
1523 uint32_t GetReserved() const;
1524
1525 /**
1526 * \brief Set the reserved field (normally it will be 0x00000000).
1527 * \param reserved reserved value
1528 */
1529 void SetReserved(uint32_t reserved);
1530
1531 /**
1532 * \brief Get the IPv6 prefix.
1533 * \return IPv6 prefix
1534 */
1535 Ipv6Address GetPrefix() const;
1536
1537 /**
1538 * \brief Set the IPv6 prefix.
1539 * \param prefix the IPv6 prefix
1540 */
1541 void SetPrefix(Ipv6Address prefix);
1542
1543 /**
1544 * \brief Print information.
1545 * \param os output stream
1546 */
1547 void Print(std::ostream& os) const override;
1548
1549 /**
1550 * \brief Get the serialized size.
1551 * \return serialized size
1552 */
1553 uint32_t GetSerializedSize() const override;
1554
1555 /**
1556 * \brief Serialize the packet.
1557 * \param start start offset
1558 */
1559 void Serialize(Buffer::Iterator start) const override;
1560
1561 /**
1562 * \brief Deserialize the packet.
1563 * \param start start offset
1564 * \return length of packet
1565 */
1566 uint32_t Deserialize(Buffer::Iterator start) override;
1567
1568 private:
1569 /**
1570 * \brief The prefix value.
1571 */
1573
1574 /**
1575 * \brief The length of the prefix.
1576 */
1578
1579 /**
1580 * \brief The flags.
1581 */
1582 uint8_t m_flags;
1583
1584 /**
1585 * \brief The valid time.
1586 */
1588
1589 /**
1590 * \brief The preferred time.
1591 */
1593
1594 /**
1595 * \brief The reserved field.
1596 */
1598};
1599
1600/**
1601 * \ingroup icmpv6
1602 *
1603 * \brief ICMPv6 link-layer address option.
1604 */
1606{
1607 public:
1608 /**
1609 * \brief Constructor.
1610 * \param source source hardware address or target hardware address for the option
1611 */
1612 Icmpv6OptionLinkLayerAddress(bool source);
1613
1614 /**
1615 * \brief Get the UID of this class.
1616 * \return UID
1617 */
1618 static TypeId GetTypeId();
1619
1620 /**
1621 * \brief Get the instance type ID.
1622 * \return instance type ID
1623 */
1624 TypeId GetInstanceTypeId() const override;
1625
1626 /**
1627 * \brief Constructor.
1628 * \param source source hardware address or target hardware address for the option
1629 * \param addr hardware address
1630 */
1631 Icmpv6OptionLinkLayerAddress(bool source, Address addr);
1632
1633 /**
1634 * \brief Constructor.
1635 */
1637
1638 /**
1639 * \brief Destructor.
1640 */
1642
1643 /**
1644 * \brief Get the hardware address.
1645 * \return the hardware address
1646 */
1647 Address GetAddress() const;
1648
1649 /**
1650 * \brief Set the hardware address.
1651 * \param addr the address to set
1652 */
1653 void SetAddress(Address addr);
1654
1655 /**
1656 * \brief Print information.
1657 * \param os output stream
1658 */
1659 void Print(std::ostream& os) const override;
1660
1661 /**
1662 * \brief Get the serialized size.
1663 * \return serialized size
1664 */
1665 uint32_t GetSerializedSize() const override;
1666
1667 /**
1668 * \brief Serialize the packet.
1669 * \param start start offset
1670 */
1671 void Serialize(Buffer::Iterator start) const override;
1672
1673 /**
1674 * \brief Deserialize the packet.
1675 * \param start start offset
1676 * \return length of packet
1677 */
1678 uint32_t Deserialize(Buffer::Iterator start) override;
1679
1680 private:
1681 /**
1682 * \brief The hardware address.
1683 */
1685};
1686
1687/**
1688 * \ingroup icmpv6
1689 *
1690 * \brief ICMPv6 redirected option.
1691 */
1693{
1694 public:
1695 /**
1696 * \brief Get the UID of this class.
1697 * \return UID
1698 */
1699 static TypeId GetTypeId();
1700
1701 /**
1702 * \brief Get the instance type ID.
1703 * \return instance type ID
1704 */
1705 TypeId GetInstanceTypeId() const override;
1706
1707 /**
1708 * \brief Constructor.
1709 */
1711
1712 /**
1713 * \brief Destructor.
1714 */
1715 ~Icmpv6OptionRedirected() override;
1716
1717 /**
1718 * \brief Set the redirected packet.
1719 * \param packet the redirected packet
1720 */
1721 void SetPacket(Ptr<Packet> packet);
1722
1723 /**
1724 * \brief Print information.
1725 * \param os output stream
1726 */
1727 void Print(std::ostream& os) const override;
1728
1729 /**
1730 * \brief Get the serialized size.
1731 * \return serialized size
1732 */
1733 uint32_t GetSerializedSize() const override;
1734
1735 /**
1736 * \brief Serialize the packet.
1737 * \param start start offset
1738 */
1739 void Serialize(Buffer::Iterator start) const override;
1740
1741 /**
1742 * \brief Deserialize the packet.
1743 * \param start start offset
1744 * \return length of packet
1745 */
1746 uint32_t Deserialize(Buffer::Iterator start) override;
1747
1748 private:
1749 /**
1750 * \brief The redirected packet.
1751 */
1753};
1754
1755} /* namespace ns3 */
1756
1757#endif /* ICMPV6_HEADER_H */
a polymophic address class
Definition: address.h:101
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
ICMPv6 Error Destination Unreachable header.
uint32_t GetSerializedSize() const override
Get the serialized size.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
~Icmpv6DestinationUnreachable() override
Destructor.
void Print(std::ostream &os) const override
Print information.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Ptr< Packet > m_packet
The incorrect Packet.
static TypeId GetTypeId()
Get the UID of this class.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
ICMPv6 Echo message.
static TypeId GetTypeId()
Get the UID of this class.
void SetId(uint16_t id)
Set the ID of the packet.
uint16_t m_seq
Sequence number (to distinguish response).
Icmpv6Echo()
Default constructor.
~Icmpv6Echo() override
Destructor.
uint16_t m_id
ID of the packet (to distinguish response between many ping program).
uint16_t GetId() const
Get the ID of the packet.
void Print(std::ostream &os) const override
Print information.
void SetSeq(uint16_t seq)
Set the sequence number.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint16_t GetSeq() const
Get the sequence number.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
ICMPv6 header.
Definition: icmpv6-header.h:38
uint8_t GetCode() const
Get the code field.
OptionType_e
ICMPv6 Option type code.
Definition: icmpv6-header.h:77
ErrorDestinationUnreachable_e
ICMPv6 error code : Destination Unreachable.
Definition: icmpv6-header.h:89
uint8_t GetType() const
Get the type field.
Icmpv6Header()
Constructor.
uint8_t m_code
The code.
uint16_t GetChecksum() const
Get the checksum.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
ErrorTimeExceeded_e
ICMPv6 error code : Time Exceeded.
static TypeId GetTypeId()
Get the UID of this class.
uint16_t m_checksum
The checksum.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void CalculatePseudoHeaderChecksum(Ipv6Address src, Ipv6Address dst, uint16_t length, uint8_t protocol)
Calculate pseudo header checksum for IPv6.
void SetCode(uint8_t code)
Set the code field.
uint8_t m_type
The type.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
void SetType(uint8_t type)
Set the type.
Type_e
ICMPv6 type code.
Definition: icmpv6-header.h:44
@ ICMPV6_SECURE_ND_CERTIFICATE_PATH_ADVERTISEMENT
Definition: icmpv6-header.h:69
@ ICMPV6_MOBILITY_HA_DISCOVER_RESPONSE
Definition: icmpv6-header.h:66
@ ICMPV6_ND_NEIGHBOR_ADVERTISEMENT
Definition: icmpv6-header.h:57
@ ICMPV6_ERROR_DESTINATION_UNREACHABLE
Definition: icmpv6-header.h:45
@ ICMPV6_SECURE_ND_CERTIFICATE_PATH_SOLICITATION
Definition: icmpv6-header.h:68
@ ICMPV6_MOBILITY_HA_DISCOVER_REQUEST
Definition: icmpv6-header.h:65
@ ICMPV6_MOBILITY_MOBILE_PREFIX_SOLICITATION
Definition: icmpv6-header.h:67
@ ICMPV6_INVERSE_ND_ADVERSTISEMENT
Definition: icmpv6-header.h:63
~Icmpv6Header() override
Destructor.
void SetChecksum(uint16_t checksum)
Set the checksum.
void Print(std::ostream &os) const override
Print information.
ErrorParameterError_e
ICMPv6 error code : Parameter Error.
bool m_calcChecksum
Checksum enable or not.
ICMPv6 Neighbor Advertisement header.
bool GetFlagS() const
Get the S flag.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
bool m_flagS
The O flag.
uint32_t m_reserved
The reserved value.
~Icmpv6NA() override
Destructor.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetFlagS(bool s)
Set the S flag.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
void SetFlagR(bool r)
Set the R flag.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
bool GetFlagR() const
Get the R flag.
uint32_t GetSerializedSize() const override
Get the serialized size.
bool GetFlagO() const
Get the O flag.
void SetFlagO(bool o)
Set the O flag.
Icmpv6NA()
Constructor.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
bool m_flagR
The R flag.
void SetReserved(uint32_t reserved)
Set the reserved field.
void Print(std::ostream &os) const override
Print information.
static TypeId GetTypeId()
Get the UID of this class.
Ipv6Address m_target
The IPv6 target address.
bool m_flagO
The M flag.
uint32_t GetReserved() const
Get the reserved field.
ICMPv6 Neighbor Solicitation header.
uint32_t m_reserved
The reserved value.
uint32_t GetSerializedSize() const override
Get the serialized size.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
uint32_t GetReserved() const
Get the reserved field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
static TypeId GetTypeId()
Get the UID of this class.
void Print(std::ostream &os) const override
Print information.
Ipv6Address m_target
The IPv6 target address.
void SetReserved(uint32_t reserved)
Set the reserved field.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
~Icmpv6NS() override
Destructor.
Icmpv6NS()
Constructor.
ICMPv6 option header.
void SetType(uint8_t type)
Set the type of the option.
Icmpv6OptionHeader()
Constructor.
void Print(std::ostream &os) const override
Print information.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint8_t m_len
The length.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint8_t m_type
The type.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static TypeId GetTypeId()
Get the UID of this class.
uint8_t GetType() const
Get the type of the option.
~Icmpv6OptionHeader() override
Destructor.
void SetLength(uint8_t len)
Set the length of the option.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint8_t GetLength() const
Get the length of the option in 8 bytes unit.
ICMPv6 MTU option.
~Icmpv6OptionMtu() override
Destructor.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint16_t m_reserved
The reserved value.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
void SetReserved(uint16_t reserved)
Set the reserved field.
uint32_t GetMtu() const
Get the MTU.
static TypeId GetTypeId()
Get the UID of this class.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void Print(std::ostream &os) const override
Print information.
void SetMtu(uint32_t mtu)
Set the MTU.
uint32_t m_mtu
The MTU value.
Icmpv6OptionMtu()
Constructor.
uint16_t GetReserved() const
Get the reserved field.
ICMPv6 Option Prefix Information.
uint32_t GetValidTime() const
Get the valid time of the information.
uint8_t m_prefixLength
The length of the prefix.
void SetReserved(uint32_t reserved)
Set the reserved field (normally it will be 0x00000000).
void SetValidTime(uint32_t validTime)
Set the valid time of the information.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetPrefix(Ipv6Address prefix)
Set the IPv6 prefix.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Ipv6Address GetPrefix() const
Get the IPv6 prefix.
void SetFlags(uint8_t flags)
Set the flags.
void Print(std::ostream &os) const override
Print information.
uint32_t GetSerializedSize() const override
Get the serialized size.
~Icmpv6OptionPrefixInformation() override
Destructor.
void SetPrefixLength(uint8_t prefixLength)
Set the prefix length.
Flags_t
Icmpv6 Option Prefix Information flag field values.
@ AUTADDRCONF
Autonomous Address Configuration.
Ipv6Address m_prefix
The prefix value.
uint32_t m_reserved
The reserved field.
uint8_t GetPrefixLength() const
Get the prefix length.
void SetPreferredTime(uint32_t preferredTime)
Set the preferred time of the information.
uint32_t m_preferredTime
The preferred time.
uint8_t GetFlags() const
Get the flags.
uint32_t GetReserved() const
Get the reserved field.
uint32_t m_validTime
The valid time.
static TypeId GetTypeId()
Get the UID of this class.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetPreferredTime() const
Get the preferred time of the information.
ICMPv6 redirected option.
Icmpv6OptionRedirected()
Constructor.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
~Icmpv6OptionRedirected() override
Destructor.
Ptr< Packet > m_packet
The redirected packet.
void Print(std::ostream &os) const override
Print information.
uint32_t GetSerializedSize() const override
Get the serialized size.
static TypeId GetTypeId()
Get the UID of this class.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
ICMPv6 Error Parameter Error header.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t m_ptr
The pointer field.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
static TypeId GetTypeId()
Get the UID of this class.
void SetPtr(uint32_t ptr)
Set the pointer field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
~Icmpv6ParameterError() override
Destructor.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
The incorrect packet.
uint32_t GetPtr() const
Get the pointer field.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Icmpv6ParameterError()
Constructor.
ICMPv6 Router Advertisement header.
void Print(std::ostream &os) const override
Print information.
Icmpv6RA()
Constructor.
void SetLifeTime(uint16_t l)
Set the node Life time (Neighbor Discovery).
bool m_flagM
The M flag.
uint32_t GetRetransmissionTime() const
Get the node Retransmission time (Neighbor Discovery).
bool m_flagO
The O flag.
void SetFlagH(bool h)
Set the H flag.
void SetRetransmissionTime(uint32_t r)
Set the node Retransmission time (Neighbor Discovery).
void SetCurHopLimit(uint8_t m)
Set the IPv6 maximum number of jumps.
void SetFlagO(bool o)
Set the O flag.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void SetFlagM(bool m)
Set the M flag.
void SetReachableTime(uint32_t r)
Set the node Reachable time (Neighbor Discovery).
static TypeId GetTypeId()
Get the UID of this class.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint32_t m_RetransmissionTimer
The retransmission timer.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
uint32_t GetReachableTime() const
Get the node Reachable time (Neighbor Discovery).
uint8_t GetCurHopLimit() const
Get the IPv6 maximum number of jumps.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
bool GetFlagO() const
Get the O flag.
uint16_t m_LifeTime
The lifetime value.
bool GetFlagM() const
Get the M flag.
uint8_t m_curHopLimit
The max jumps.
uint32_t m_ReachableTime
The reachable time value.
bool m_flagH
The H flag.
~Icmpv6RA() override
Destructor.
bool GetFlagH() const
Get the H flag.
ICMPv6 Router Solicitation header.
void SetReserved(uint32_t reserved)
Set the reserved field.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
~Icmpv6RS() override
Destructor.
uint32_t GetReserved() const
Get the reserved field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t m_reserved
The reserved value.
static TypeId GetTypeId()
Get the UID of this class.
void Print(std::ostream &os) const override
Print information.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Icmpv6RS()
Constructor.
ICMPv6 Redirection header.
Ipv6Address m_target
IPv6 target address.
Ipv6Address GetTarget() const
Get the IPv6 target address.
Ipv6Address m_destination
IPv6 destination address.
uint32_t GetReserved() const
Get the reserved field.
uint32_t GetSerializedSize() const override
Get the serialized size.
~Icmpv6Redirection() override
Destructor.
void Print(std::ostream &os) const override
Print information.
Icmpv6Redirection()
Constructor.
void SetDestination(Ipv6Address destination)
Set the IPv6 destination address.
void SetReserved(uint32_t reserved)
Set the reserved field.
Ipv6Address GetDestination() const
Get the IPv6 destination address.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static TypeId GetTypeId()
Get the UID of this class.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t m_reserved
Reserved value.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
ICMPv6 Error Time Exceeded header.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
~Icmpv6TimeExceeded() override
Destructor.
Icmpv6TimeExceeded()
Constructor.
static TypeId GetTypeId()
Get the UID of this class.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
The incorrect packet.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
ICMPv6 Error Too Big header.
static TypeId GetTypeId()
Get the UID of this class.
void SetMtu(uint32_t mtu)
Set the MTU.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
the incorrect packet.
Icmpv6TooBig()
Constructor.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint32_t GetSerializedSize() const override
Get the serialized size.
~Icmpv6TooBig() override
Destructor.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint32_t m_mtu
The MTU value.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetMtu() const
Get the MTU field.
Describes an IPv6 address.
Definition: ipv6-address.h:49
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.