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