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