A Discrete-Event Network Simulator
API
icmpv6-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007-2009 Strasbourg University
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18 * Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
19 * David Gross <gdavid.devel@gmail.com>
20 */
21
22#ifndef ICMPV6_HEADER_H
23#define ICMPV6_HEADER_H
24
25#include "ns3/header.h"
26#include "ns3/ipv6-address.h"
27#include "ns3/packet.h"
28
29namespace ns3
30{
31
37class Icmpv6Header : public Header
38{
39 public:
43 enum Type_e
44 {
71 };
72
77 {
83 };
84
89 {
95 };
96
101 {
104 };
105
110 {
114 };
115
120 static TypeId GetTypeId();
121
126 TypeId GetInstanceTypeId() const override;
127
131 Icmpv6Header();
132
136 ~Icmpv6Header() override;
137
142 uint8_t GetType() const;
143
148 void SetType(uint8_t type);
149
154 uint8_t GetCode() const;
155
160 void SetCode(uint8_t code);
161
166 uint16_t GetChecksum() const;
167
172 void SetChecksum(uint16_t checksum);
173
178 void Print(std::ostream& os) const override;
179
184 uint32_t GetSerializedSize() const override;
185
190 void Serialize(Buffer::Iterator start) const override;
191
198
208 Ipv6Address dst,
209 uint16_t length,
210 uint8_t protocol);
211
212 protected:
217
221 uint16_t m_checksum;
222
223 private:
227 uint8_t m_type;
228
232 uint8_t m_code;
233};
234
241{
242 public:
247 static TypeId GetTypeId();
248
253 TypeId GetInstanceTypeId() const override;
254
259
263 ~Icmpv6OptionHeader() override;
264
269 uint8_t GetType() const;
270
275 void SetType(uint8_t type);
276
281 uint8_t GetLength() const;
282
287 void SetLength(uint8_t len);
288
293 void Print(std::ostream& os) const override;
294
299 uint32_t GetSerializedSize() const override;
300
305 void Serialize(Buffer::Iterator start) const override;
306
313
314 private:
318 uint8_t m_type;
319
323 uint8_t m_len;
324};
325
331class Icmpv6NS : public Icmpv6Header
332{
333 public:
338 Icmpv6NS(Ipv6Address target);
339
343 Icmpv6NS();
344
348 ~Icmpv6NS() override;
349
354 static TypeId GetTypeId();
355
360 TypeId GetInstanceTypeId() const override;
361
366 uint32_t GetReserved() const;
367
372 void SetReserved(uint32_t reserved);
373
379
384 void SetIpv6Target(Ipv6Address target);
385
390 void Print(std::ostream& os) const override;
391
396 uint32_t GetSerializedSize() const override;
397
402 void Serialize(Buffer::Iterator start) const override;
403
410
411 private:
416
421};
422
428class Icmpv6NA : public Icmpv6Header
429{
430 public:
434 Icmpv6NA();
435
439 ~Icmpv6NA() override;
440
445 static TypeId GetTypeId();
446
451 TypeId GetInstanceTypeId() const override;
452
457 uint32_t GetReserved() const;
458
463 void SetReserved(uint32_t reserved);
464
470
475 void SetIpv6Target(Ipv6Address target);
476
481 bool GetFlagR() const;
482
487 void SetFlagR(bool r);
488
493 bool GetFlagS() const;
494
499 void SetFlagS(bool s);
500
505 bool GetFlagO() const;
506
511 void SetFlagO(bool o);
512
517 void Print(std::ostream& os) const override;
518
523 uint32_t GetSerializedSize() const override;
524
529 void Serialize(Buffer::Iterator start) const override;
530
537
538 private:
543
548
553
558
563};
564
570class Icmpv6RA : public Icmpv6Header
571{
572 public:
576 Icmpv6RA();
577
581 ~Icmpv6RA() override;
582
587 static TypeId GetTypeId();
588
593 TypeId GetInstanceTypeId() const override;
594
599 void SetCurHopLimit(uint8_t m);
600
605 uint8_t GetCurHopLimit() const;
606
611 void SetLifeTime(uint16_t l);
612
617 uint16_t GetLifeTime() const;
618
624
630
636
642
647 bool GetFlagM() const;
648
653 void SetFlagM(bool m);
654
659 bool GetFlagO() const;
660
665 void SetFlagO(bool o);
666
671 bool GetFlagH() const;
672
677 void SetFlagH(bool h);
678
683 void Print(std::ostream& os) const override;
684
690 uint8_t GetFlags() const;
691
697 void SetFlags(uint8_t f);
698
703 uint32_t GetSerializedSize() const override;
704
709 void Serialize(Buffer::Iterator start) const override;
710
717
718 private:
723
728
733
737 uint16_t m_LifeTime;
738
743
748
753};
754
760class Icmpv6RS : public Icmpv6Header
761{
762 public:
766 Icmpv6RS();
767
771 ~Icmpv6RS() override;
772
777 static TypeId GetTypeId();
778
783 TypeId GetInstanceTypeId() const override;
784
789 uint32_t GetReserved() const;
790
795 void SetReserved(uint32_t reserved);
796
801 void Print(std::ostream& os) const override;
802
807 uint32_t GetSerializedSize() const override;
808
813 void Serialize(Buffer::Iterator start) const override;
814
821
822 private:
827};
828
835{
836 public:
841
845 ~Icmpv6Redirection() override;
846
851 static TypeId GetTypeId();
852
857 TypeId GetInstanceTypeId() const override;
858
863 Ipv6Address GetTarget() const;
864
869 void SetTarget(Ipv6Address target);
870
876
881 void SetDestination(Ipv6Address destination);
882
887 void Print(std::ostream& os) const override;
888
893 uint32_t GetSerializedSize() const override;
894
899 void Serialize(Buffer::Iterator start) const override;
900
907
912 uint32_t GetReserved() const;
913
918 void SetReserved(uint32_t reserved);
919
920 private:
925
930
935};
936
943{
944 public:
949 static TypeId GetTypeId();
950
955 TypeId GetInstanceTypeId() const override;
956
960 Icmpv6Echo();
961
966 Icmpv6Echo(bool request);
967
971 ~Icmpv6Echo() override;
972
977 uint16_t GetId() const;
978
983 void SetId(uint16_t id);
984
989 uint16_t GetSeq() const;
990
995 void SetSeq(uint16_t seq);
996
1001 void Print(std::ostream& os) const override;
1002
1007 uint32_t GetSerializedSize() const override;
1008
1013 void Serialize(Buffer::Iterator start) const override;
1014
1021
1022 private:
1026 uint16_t m_id;
1027
1031 uint16_t m_seq;
1032};
1033
1040{
1041 public:
1046
1051
1056 static TypeId GetTypeId();
1057
1062 TypeId GetInstanceTypeId() const override;
1063
1068 void SetPacket(Ptr<Packet> p);
1069
1074 void Print(std::ostream& os) const override;
1075
1080 uint32_t GetSerializedSize() const override;
1081
1086 void Serialize(Buffer::Iterator start) const override;
1087
1094
1095 private:
1100};
1101
1108{
1109 public:
1113 Icmpv6TooBig();
1114
1118 ~Icmpv6TooBig() override;
1119
1124 static TypeId GetTypeId();
1125
1130 TypeId GetInstanceTypeId() const override;
1131
1136 void SetPacket(Ptr<Packet> p);
1137
1142 uint32_t GetMtu() const;
1143
1148 void SetMtu(uint32_t mtu);
1149
1154 void Print(std::ostream& os) const override;
1155
1160 uint32_t GetSerializedSize() const override;
1161
1166 void Serialize(Buffer::Iterator start) const override;
1167
1174
1175 private:
1180
1185};
1186
1193{
1194 public:
1199
1203 ~Icmpv6TimeExceeded() override;
1204
1209 static TypeId GetTypeId();
1210
1215 TypeId GetInstanceTypeId() const override;
1216
1221 void SetPacket(Ptr<Packet> p);
1222
1227 void Print(std::ostream& os) const override;
1228
1233 uint32_t GetSerializedSize() const override;
1234
1239 void Serialize(Buffer::Iterator start) const override;
1240
1247
1248 private:
1253};
1254
1261{
1262 public:
1267
1271 ~Icmpv6ParameterError() override;
1272
1277 static TypeId GetTypeId();
1278
1283 TypeId GetInstanceTypeId() const override;
1284
1289 void SetPacket(Ptr<Packet> p);
1290
1295 uint32_t GetPtr() const;
1296
1301 void SetPtr(uint32_t ptr);
1302
1307 void Print(std::ostream& os) const override;
1308
1313 uint32_t GetSerializedSize() const override;
1314
1319 void Serialize(Buffer::Iterator start) const override;
1320
1327
1328 private:
1333
1338};
1339
1346{
1347 public:
1352
1358
1362 ~Icmpv6OptionMtu() override;
1363
1368 static TypeId GetTypeId();
1369
1374 TypeId GetInstanceTypeId() const override;
1375
1380 uint16_t GetReserved() const;
1381
1386 void SetReserved(uint16_t reserved);
1387
1392 uint32_t GetMtu() const;
1393
1398 void SetMtu(uint32_t mtu);
1399
1404 void Print(std::ostream& os) const override;
1405
1410 uint32_t GetSerializedSize() const override;
1411
1416 void Serialize(Buffer::Iterator start) const override;
1417
1424
1425 private:
1429 uint16_t m_reserved;
1430
1435};
1436
1443{
1444 public:
1449
1455 Icmpv6OptionPrefixInformation(Ipv6Address network, uint8_t prefixlen);
1456
1461
1466 static TypeId GetTypeId();
1467
1472 TypeId GetInstanceTypeId() const override;
1473
1477 typedef enum
1478 {
1479 NONE = 0,
1482 ONLINK = 128
1484
1489 uint8_t GetPrefixLength() const;
1490
1495 void SetPrefixLength(uint8_t prefixLength);
1496
1501 uint8_t GetFlags() const;
1502
1507 void SetFlags(uint8_t flags);
1508
1513 uint32_t GetValidTime() const;
1514
1519 void SetValidTime(uint32_t validTime);
1520
1525 uint32_t GetPreferredTime() const;
1526
1531 void SetPreferredTime(uint32_t preferredTime);
1532
1537 uint32_t GetReserved() const;
1538
1543 void SetReserved(uint32_t reserved);
1544
1549 Ipv6Address GetPrefix() const;
1550
1555 void SetPrefix(Ipv6Address prefix);
1556
1561 void Print(std::ostream& os) const override;
1562
1567 uint32_t GetSerializedSize() const override;
1568
1573 void Serialize(Buffer::Iterator start) const override;
1574
1581
1582 private:
1587
1592
1596 uint8_t m_flags;
1597
1602
1607
1612};
1613
1620{
1621 public:
1626 Icmpv6OptionLinkLayerAddress(bool source);
1627
1632 static TypeId GetTypeId();
1633
1638 TypeId GetInstanceTypeId() const override;
1639
1645 Icmpv6OptionLinkLayerAddress(bool source, Address addr);
1646
1651
1656
1661 Address GetAddress() const;
1662
1667 void SetAddress(Address addr);
1668
1673 void Print(std::ostream& os) const override;
1674
1679 uint32_t GetSerializedSize() const override;
1680
1685 void Serialize(Buffer::Iterator start) const override;
1686
1693
1694 private:
1699};
1700
1707{
1708 public:
1713 static TypeId GetTypeId();
1714
1719 TypeId GetInstanceTypeId() const override;
1720
1725
1729 ~Icmpv6OptionRedirected() override;
1730
1735 void SetPacket(Ptr<Packet> packet);
1736
1741 void Print(std::ostream& os) const override;
1742
1747 uint32_t GetSerializedSize() const override;
1748
1753 void Serialize(Buffer::Iterator start) const override;
1754
1761
1762 private:
1767};
1768
1769} /* namespace ns3 */
1770
1771#endif /* ICMPV6_HEADER_H */
double f(double x, void *params)
Definition: 80211b.c:71
a polymophic address class
Definition: address.h:92
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
ICMPv6 Error Destination Unreachable header.
uint32_t GetSerializedSize() const override
Get the serialized size.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
~Icmpv6DestinationUnreachable() override
Destructor.
void Print(std::ostream &os) const override
Print information.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Ptr< Packet > m_packet
The incorrect Packet.
static TypeId GetTypeId()
Get the UID of this class.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
ICMPv6 Echo message.
static TypeId GetTypeId()
Get the UID of this class.
void SetId(uint16_t id)
Set the ID of the packet.
uint16_t m_seq
Sequence number (to distinguish response).
Icmpv6Echo()
Default constructor.
~Icmpv6Echo() override
Destructor.
uint16_t m_id
ID of the packet (to distinguish response between many ping program).
uint16_t GetId() const
Get the ID of the packet.
void Print(std::ostream &os) const override
Print information.
void SetSeq(uint16_t seq)
Set the sequence number.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint16_t GetSeq() const
Get the sequence number.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
ICMPv6 header.
Definition: icmpv6-header.h:38
uint8_t GetCode() const
Get the code field.
OptionType_e
ICMPv6 Option type code.
Definition: icmpv6-header.h:77
ErrorDestinationUnreachable_e
ICMPv6 error code : Destination Unreachable.
Definition: icmpv6-header.h:89
uint8_t GetType() const
Get the type field.
Icmpv6Header()
Constructor.
uint8_t m_code
The code.
uint16_t GetChecksum() const
Get the checksum.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
ErrorTimeExceeded_e
ICMPv6 error code : Time Exceeded.
static TypeId GetTypeId()
Get the UID of this class.
uint16_t m_checksum
The checksum.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void CalculatePseudoHeaderChecksum(Ipv6Address src, Ipv6Address dst, uint16_t length, uint8_t protocol)
Calculate pseudo header checksum for IPv6.
void SetCode(uint8_t code)
Set the code field.
uint8_t m_type
The type.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
void SetType(uint8_t type)
Set the type.
Type_e
ICMPv6 type code.
Definition: icmpv6-header.h:44
@ ICMPV6_SECURE_ND_CERTIFICATE_PATH_ADVERTISEMENT
Definition: icmpv6-header.h:69
@ ICMPV6_MOBILITY_HA_DISCOVER_RESPONSE
Definition: icmpv6-header.h:66
@ ICMPV6_ND_NEIGHBOR_ADVERTISEMENT
Definition: icmpv6-header.h:57
@ ICMPV6_ERROR_DESTINATION_UNREACHABLE
Definition: icmpv6-header.h:45
@ ICMPV6_SECURE_ND_CERTIFICATE_PATH_SOLICITATION
Definition: icmpv6-header.h:68
@ ICMPV6_MOBILITY_HA_DISCOVER_REQUEST
Definition: icmpv6-header.h:65
@ ICMPV6_MOBILITY_MOBILE_PREFIX_SOLICITATION
Definition: icmpv6-header.h:67
@ ICMPV6_INVERSE_ND_ADVERSTISEMENT
Definition: icmpv6-header.h:63
~Icmpv6Header() override
Destructor.
void SetChecksum(uint16_t checksum)
Set the checksum.
void Print(std::ostream &os) const override
Print information.
ErrorParameterError_e
ICMPv6 error code : Parameter Error.
bool m_calcChecksum
Checksum enable or not.
ICMPv6 Neighbor Advertisement header.
bool GetFlagS() const
Get the S flag.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
bool m_flagS
The O flag.
uint32_t m_reserved
The reserved value.
~Icmpv6NA() override
Destructor.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetFlagS(bool s)
Set the S flag.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
void SetFlagR(bool r)
Set the R flag.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
bool GetFlagR() const
Get the R flag.
uint32_t GetSerializedSize() const override
Get the serialized size.
bool GetFlagO() const
Get the O flag.
void SetFlagO(bool o)
Set the O flag.
Icmpv6NA()
Constructor.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
bool m_flagR
The R flag.
void SetReserved(uint32_t reserved)
Set the reserved field.
void Print(std::ostream &os) const override
Print information.
static TypeId GetTypeId()
Get the UID of this class.
Ipv6Address m_target
The IPv6 target address.
bool m_flagO
The M flag.
uint32_t GetReserved() const
Get the reserved field.
ICMPv6 Neighbor Solicitation header.
uint32_t m_reserved
The reserved value.
uint32_t GetSerializedSize() const override
Get the serialized size.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
uint32_t GetReserved() const
Get the reserved field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
static TypeId GetTypeId()
Get the UID of this class.
void Print(std::ostream &os) const override
Print information.
Ipv6Address m_target
The IPv6 target address.
void SetReserved(uint32_t reserved)
Set the reserved field.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
~Icmpv6NS() override
Destructor.
Icmpv6NS()
Constructor.
ICMPv6 option header.
void SetType(uint8_t type)
Set the type of the option.
Icmpv6OptionHeader()
Constructor.
void Print(std::ostream &os) const override
Print information.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint8_t m_len
The length.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint8_t m_type
The type.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static TypeId GetTypeId()
Get the UID of this class.
uint8_t GetType() const
Get the type of the option.
~Icmpv6OptionHeader() override
Destructor.
void SetLength(uint8_t len)
Set the length of the option.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint8_t GetLength() const
Get the length of the option in 8 bytes unit.
ICMPv6 MTU option.
~Icmpv6OptionMtu() override
Destructor.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint16_t m_reserved
The reserved value.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
void SetReserved(uint16_t reserved)
Set the reserved field.
uint32_t GetMtu() const
Get the MTU.
static TypeId GetTypeId()
Get the UID of this class.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void Print(std::ostream &os) const override
Print information.
void SetMtu(uint32_t mtu)
Set the MTU.
uint32_t m_mtu
The MTU value.
Icmpv6OptionMtu()
Constructor.
uint16_t GetReserved() const
Get the reserved field.
ICMPv6 Option Prefix Information.
uint32_t GetValidTime() const
Get the valid time of the information.
uint8_t m_prefixLength
The length of the prefix.
void SetReserved(uint32_t reserved)
Set the reserved field (normally it will be 0x00000000).
void SetValidTime(uint32_t validTime)
Set the valid time of the information.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetPrefix(Ipv6Address prefix)
Set the IPv6 prefix.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Ipv6Address GetPrefix() const
Get the IPv6 prefix.
void SetFlags(uint8_t flags)
Set the flags.
void Print(std::ostream &os) const override
Print information.
uint32_t GetSerializedSize() const override
Get the serialized size.
~Icmpv6OptionPrefixInformation() override
Destructor.
void SetPrefixLength(uint8_t prefixLength)
Set the prefix length.
Flags_t
Icmpv6 Option Prefix Information flag field values.
@ AUTADDRCONF
Autonomous Address Configuration.
Ipv6Address m_prefix
The prefix value.
uint32_t m_reserved
The reserved field.
uint8_t GetPrefixLength() const
Get the prefix length.
void SetPreferredTime(uint32_t preferredTime)
Set the preferred time of the information.
uint32_t m_preferredTime
The preferred time.
uint8_t GetFlags() const
Get the flags.
uint32_t GetReserved() const
Get the reserved field.
uint32_t m_validTime
The valid time.
static TypeId GetTypeId()
Get the UID of this class.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetPreferredTime() const
Get the preferred time of the information.
ICMPv6 redirected option.
Icmpv6OptionRedirected()
Constructor.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
~Icmpv6OptionRedirected() override
Destructor.
Ptr< Packet > m_packet
The redirected packet.
void Print(std::ostream &os) const override
Print information.
uint32_t GetSerializedSize() const override
Get the serialized size.
static TypeId GetTypeId()
Get the UID of this class.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
ICMPv6 Error Parameter Error header.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t m_ptr
The pointer field.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
static TypeId GetTypeId()
Get the UID of this class.
void SetPtr(uint32_t ptr)
Set the pointer field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
~Icmpv6ParameterError() override
Destructor.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
The incorrect packet.
uint32_t GetPtr() const
Get the pointer field.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Icmpv6ParameterError()
Constructor.
ICMPv6 Router Advertisement header.
void Print(std::ostream &os) const override
Print information.
Icmpv6RA()
Constructor.
void SetLifeTime(uint16_t l)
Set the node Life time (Neighbor Discovery).
NS_DEPRECATED_3_34 void SetFlags(uint8_t f)
Setflags.
bool m_flagM
The M flag.
uint32_t GetRetransmissionTime() const
Get the node Retransmission time (Neighbor Discovery).
NS_DEPRECATED_3_34 uint8_t GetFlags() const
Getflags.
bool m_flagO
The O flag.
void SetFlagH(bool h)
Set the H flag.
void SetRetransmissionTime(uint32_t r)
Set the node Retransmission time (Neighbor Discovery).
void SetCurHopLimit(uint8_t m)
Set the IPv6 maximum number of jumps.
void SetFlagO(bool o)
Set the O flag.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void SetFlagM(bool m)
Set the M flag.
void SetReachableTime(uint32_t r)
Set the node Reachable time (Neighbor Discovery).
static TypeId GetTypeId()
Get the UID of this class.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint32_t m_RetransmissionTimer
The retransmission timer.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
uint32_t GetReachableTime() const
Get the node Reachable time (Neighbor Discovery).
uint8_t GetCurHopLimit() const
Get the IPv6 maximum number of jumps.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
bool GetFlagO() const
Get the O flag.
uint16_t m_LifeTime
The lifetime value.
bool GetFlagM() const
Get the M flag.
uint8_t m_curHopLimit
The max jumps.
uint32_t m_ReachableTime
The reachable time value.
bool m_flagH
The H flag.
~Icmpv6RA() override
Destructor.
bool GetFlagH() const
Get the H flag.
ICMPv6 Router Solicitation header.
void SetReserved(uint32_t reserved)
Set the reserved field.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
~Icmpv6RS() override
Destructor.
uint32_t GetReserved() const
Get the reserved field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t m_reserved
The reserved value.
static TypeId GetTypeId()
Get the UID of this class.
void Print(std::ostream &os) const override
Print information.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Icmpv6RS()
Constructor.
ICMPv6 Redirection header.
Ipv6Address m_target
IPv6 target address.
Ipv6Address GetTarget() const
Get the IPv6 target address.
Ipv6Address m_destination
IPv6 destination address.
uint32_t GetReserved() const
Get the reserved field.
uint32_t GetSerializedSize() const override
Get the serialized size.
~Icmpv6Redirection() override
Destructor.
void Print(std::ostream &os) const override
Print information.
Icmpv6Redirection()
Constructor.
void SetDestination(Ipv6Address destination)
Set the IPv6 destination address.
void SetReserved(uint32_t reserved)
Set the reserved field.
Ipv6Address GetDestination() const
Get the IPv6 destination address.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static TypeId GetTypeId()
Get the UID of this class.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t m_reserved
Reserved value.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
ICMPv6 Error Time Exceeded header.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
~Icmpv6TimeExceeded() override
Destructor.
Icmpv6TimeExceeded()
Constructor.
static TypeId GetTypeId()
Get the UID of this class.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
The incorrect packet.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
ICMPv6 Error Too Big header.
static TypeId GetTypeId()
Get the UID of this class.
void SetMtu(uint32_t mtu)
Set the MTU.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
the incorrect packet.
Icmpv6TooBig()
Constructor.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint32_t GetSerializedSize() const override
Get the serialized size.
~Icmpv6TooBig() override
Destructor.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint32_t m_mtu
The MTU value.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetMtu() const
Get the MTU field.
Describes an IPv6 address.
Definition: ipv6-address.h:50
a unique identifier for an interface.
Definition: type-id.h:60
#define NS_DEPRECATED_3_34
Tag for things deprecated in version ns-3.34.
Definition: deprecated.h:94
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1861