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 
29 namespace ns3
30 {
31 
37 class 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 
197  uint32_t Deserialize(Buffer::Iterator start) override;
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 
312  uint32_t Deserialize(Buffer::Iterator start) override;
313 
314  private:
318  uint8_t m_type;
319 
323  uint8_t m_len;
324 };
325 
331 class 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 
378  Ipv6Address GetIpv6Target() const;
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 
409  uint32_t Deserialize(Buffer::Iterator start) override;
410 
411  private:
415  uint32_t m_reserved;
416 
421 };
422 
428 class 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 
469  Ipv6Address GetIpv6Target() const;
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 
536  uint32_t Deserialize(Buffer::Iterator start) override;
537 
538  private:
542  bool m_flagR;
543 
547  bool m_flagS;
548 
552  bool m_flagO;
553 
557  uint32_t m_reserved;
558 
563 };
564 
570 class 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 
623  void SetReachableTime(uint32_t r);
624 
629  uint32_t GetReachableTime() const;
630 
635  void SetRetransmissionTime(uint32_t r);
636 
641  uint32_t GetRetransmissionTime() const;
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 
689  uint32_t GetSerializedSize() const override;
690 
695  void Serialize(Buffer::Iterator start) const override;
696 
702  uint32_t Deserialize(Buffer::Iterator start) override;
703 
704  private:
708  bool m_flagM;
709 
713  bool m_flagO;
714 
718  bool m_flagH;
719 
723  uint16_t m_LifeTime;
724 
728  uint32_t m_ReachableTime;
729 
734 
738  uint8_t m_curHopLimit;
739 };
740 
746 class Icmpv6RS : public Icmpv6Header
747 {
748  public:
752  Icmpv6RS();
753 
757  ~Icmpv6RS() override;
758 
763  static TypeId GetTypeId();
764 
769  TypeId GetInstanceTypeId() const override;
770 
775  uint32_t GetReserved() const;
776 
781  void SetReserved(uint32_t reserved);
782 
787  void Print(std::ostream& os) const override;
788 
793  uint32_t GetSerializedSize() const override;
794 
799  void Serialize(Buffer::Iterator start) const override;
800 
806  uint32_t Deserialize(Buffer::Iterator start) override;
807 
808  private:
812  uint32_t m_reserved;
813 };
814 
821 {
822  public:
827 
831  ~Icmpv6Redirection() override;
832 
837  static TypeId GetTypeId();
838 
843  TypeId GetInstanceTypeId() const override;
844 
849  Ipv6Address GetTarget() const;
850 
855  void SetTarget(Ipv6Address target);
856 
861  Ipv6Address GetDestination() const;
862 
867  void SetDestination(Ipv6Address destination);
868 
873  void Print(std::ostream& os) const override;
874 
879  uint32_t GetSerializedSize() const override;
880 
885  void Serialize(Buffer::Iterator start) const override;
886 
892  uint32_t Deserialize(Buffer::Iterator start) override;
893 
898  uint32_t GetReserved() const;
899 
904  void SetReserved(uint32_t reserved);
905 
906  private:
911 
916 
920  uint32_t m_reserved;
921 };
922 
928 class Icmpv6Echo : public Icmpv6Header
929 {
930  public:
935  static TypeId GetTypeId();
936 
941  TypeId GetInstanceTypeId() const override;
942 
946  Icmpv6Echo();
947 
952  Icmpv6Echo(bool request);
953 
957  ~Icmpv6Echo() override;
958 
963  uint16_t GetId() const;
964 
969  void SetId(uint16_t id);
970 
975  uint16_t GetSeq() const;
976 
981  void SetSeq(uint16_t seq);
982 
987  void Print(std::ostream& os) const override;
988 
993  uint32_t GetSerializedSize() const override;
994 
999  void Serialize(Buffer::Iterator start) const override;
1000 
1006  uint32_t Deserialize(Buffer::Iterator start) override;
1007 
1008  private:
1012  uint16_t m_id;
1013 
1017  uint16_t m_seq;
1018 };
1019 
1026 {
1027  public:
1032 
1036  ~Icmpv6DestinationUnreachable() override;
1037 
1042  static TypeId GetTypeId();
1043 
1048  TypeId GetInstanceTypeId() const override;
1049 
1054  void SetPacket(Ptr<Packet> p);
1055 
1060  void Print(std::ostream& os) const override;
1061 
1066  uint32_t GetSerializedSize() const override;
1067 
1072  void Serialize(Buffer::Iterator start) const override;
1073 
1079  uint32_t Deserialize(Buffer::Iterator start) override;
1080 
1081  private:
1086 };
1087 
1094 {
1095  public:
1099  Icmpv6TooBig();
1100 
1104  ~Icmpv6TooBig() override;
1105 
1110  static TypeId GetTypeId();
1111 
1116  TypeId GetInstanceTypeId() const override;
1117 
1122  void SetPacket(Ptr<Packet> p);
1123 
1128  uint32_t GetMtu() const;
1129 
1134  void SetMtu(uint32_t mtu);
1135 
1140  void Print(std::ostream& os) const override;
1141 
1146  uint32_t GetSerializedSize() const override;
1147 
1152  void Serialize(Buffer::Iterator start) const override;
1153 
1159  uint32_t Deserialize(Buffer::Iterator start) override;
1160 
1161  private:
1166 
1170  uint32_t m_mtu;
1171 };
1172 
1179 {
1180  public:
1185 
1189  ~Icmpv6TimeExceeded() override;
1190 
1195  static TypeId GetTypeId();
1196 
1201  TypeId GetInstanceTypeId() const override;
1202 
1207  void SetPacket(Ptr<Packet> p);
1208 
1213  void Print(std::ostream& os) const override;
1214 
1219  uint32_t GetSerializedSize() const override;
1220 
1225  void Serialize(Buffer::Iterator start) const override;
1226 
1232  uint32_t Deserialize(Buffer::Iterator start) override;
1233 
1234  private:
1239 };
1240 
1247 {
1248  public:
1253 
1257  ~Icmpv6ParameterError() override;
1258 
1263  static TypeId GetTypeId();
1264 
1269  TypeId GetInstanceTypeId() const override;
1270 
1275  void SetPacket(Ptr<Packet> p);
1276 
1281  uint32_t GetPtr() const;
1282 
1287  void SetPtr(uint32_t ptr);
1288 
1293  void Print(std::ostream& os) const override;
1294 
1299  uint32_t GetSerializedSize() const override;
1300 
1305  void Serialize(Buffer::Iterator start) const override;
1306 
1312  uint32_t Deserialize(Buffer::Iterator start) override;
1313 
1314  private:
1319 
1323  uint32_t m_ptr;
1324 };
1325 
1332 {
1333  public:
1337  Icmpv6OptionMtu();
1338 
1343  Icmpv6OptionMtu(uint32_t mtu);
1344 
1348  ~Icmpv6OptionMtu() override;
1349 
1354  static TypeId GetTypeId();
1355 
1360  TypeId GetInstanceTypeId() const override;
1361 
1366  uint16_t GetReserved() const;
1367 
1372  void SetReserved(uint16_t reserved);
1373 
1378  uint32_t GetMtu() const;
1379 
1384  void SetMtu(uint32_t mtu);
1385 
1390  void Print(std::ostream& os) const override;
1391 
1396  uint32_t GetSerializedSize() const override;
1397 
1402  void Serialize(Buffer::Iterator start) const override;
1403 
1409  uint32_t Deserialize(Buffer::Iterator start) override;
1410 
1411  private:
1415  uint16_t m_reserved;
1416 
1420  uint32_t m_mtu;
1421 };
1422 
1429 {
1430  public:
1435 
1441  Icmpv6OptionPrefixInformation(Ipv6Address network, uint8_t prefixlen);
1442 
1446  ~Icmpv6OptionPrefixInformation() override;
1447 
1452  static TypeId GetTypeId();
1453 
1458  TypeId GetInstanceTypeId() const override;
1459 
1463  enum Flags_t
1464  {
1465  NONE = 0,
1466  ROUTERADDR = 32,
1468  ONLINK = 128
1469  };
1470 
1475  uint8_t GetPrefixLength() const;
1476 
1481  void SetPrefixLength(uint8_t prefixLength);
1482 
1487  uint8_t GetFlags() const;
1488 
1493  void SetFlags(uint8_t flags);
1494 
1499  uint32_t GetValidTime() const;
1500 
1505  void SetValidTime(uint32_t validTime);
1506 
1511  uint32_t GetPreferredTime() const;
1512 
1517  void SetPreferredTime(uint32_t preferredTime);
1518 
1523  uint32_t GetReserved() const;
1524 
1529  void SetReserved(uint32_t reserved);
1530 
1535  Ipv6Address GetPrefix() const;
1536 
1541  void SetPrefix(Ipv6Address prefix);
1542 
1547  void Print(std::ostream& os) const override;
1548 
1553  uint32_t GetSerializedSize() const override;
1554 
1559  void Serialize(Buffer::Iterator start) const override;
1560 
1566  uint32_t Deserialize(Buffer::Iterator start) override;
1567 
1568  private:
1573 
1578 
1582  uint8_t m_flags;
1583 
1587  uint32_t m_validTime;
1588 
1593 
1597  uint32_t m_reserved;
1598 };
1599 
1606 {
1607  public:
1612  Icmpv6OptionLinkLayerAddress(bool source);
1613 
1618  static TypeId GetTypeId();
1619 
1624  TypeId GetInstanceTypeId() const override;
1625 
1631  Icmpv6OptionLinkLayerAddress(bool source, Address addr);
1632 
1637 
1641  ~Icmpv6OptionLinkLayerAddress() override;
1642 
1647  Address GetAddress() const;
1648 
1653  void SetAddress(Address addr);
1654 
1659  void Print(std::ostream& os) const override;
1660 
1665  uint32_t GetSerializedSize() const override;
1666 
1671  void Serialize(Buffer::Iterator start) const override;
1672 
1678  uint32_t Deserialize(Buffer::Iterator start) override;
1679 
1680  private:
1685 };
1686 
1693 {
1694  public:
1699  static TypeId GetTypeId();
1700 
1705  TypeId GetInstanceTypeId() const override;
1706 
1711 
1715  ~Icmpv6OptionRedirected() override;
1716 
1721  void SetPacket(Ptr<Packet> packet);
1722 
1727  void Print(std::ostream& os) const override;
1728 
1733  uint32_t GetSerializedSize() const override;
1734 
1739  void Serialize(Buffer::Iterator start) const override;
1740 
1746  uint32_t Deserialize(Buffer::Iterator start) override;
1747 
1748  private:
1753 };
1754 
1755 } /* namespace ns3 */
1756 
1757 #endif /* ICMPV6_HEADER_H */
a polymophic address class
Definition: address.h:101
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
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.
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.
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.
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.
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.
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.
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.
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.
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.
~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.
static TypeId GetTypeId()
Get the UID of this class.
void SetPtr(uint32_t ptr)
Set the pointer field.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
~Icmpv6ParameterError() override
Destructor.
void Print(std::ostream &os) const override
Print information.
Ptr< Packet > m_packet
The incorrect packet.
uint32_t GetPtr() const
Get the pointer field.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Icmpv6ParameterError()
Constructor.
ICMPv6 Router Advertisement header.
void Print(std::ostream &os) const override
Print information.
Icmpv6RA()
Constructor.
void SetLifeTime(uint16_t l)
Set the node Life time (Neighbor Discovery).
bool m_flagM
The M flag.
uint32_t GetRetransmissionTime() const
Get the node Retransmission time (Neighbor Discovery).
bool m_flagO
The O flag.
void SetFlagH(bool h)
Set the H flag.
void SetRetransmissionTime(uint32_t r)
Set the node Retransmission time (Neighbor Discovery).
void SetCurHopLimit(uint8_t m)
Set the IPv6 maximum number of jumps.
void SetFlagO(bool o)
Set the O flag.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void SetFlagM(bool m)
Set the M flag.
void SetReachableTime(uint32_t r)
Set the node Reachable time (Neighbor Discovery).
static TypeId GetTypeId()
Get the UID of this class.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint32_t m_RetransmissionTimer
The retransmission timer.
uint32_t GetSerializedSize() const override
Get the serialized size.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
uint32_t GetReachableTime() const
Get the node Reachable time (Neighbor Discovery).
uint8_t GetCurHopLimit() const
Get the IPv6 maximum number of jumps.
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.
~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.
ICMPv6 Error Time Exceeded header.
uint32_t GetSerializedSize() const override
Get the serialized size.
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 m_mtu
The MTU value.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint32_t GetMtu() const
Get the MTU field.
Describes an IPv6 address.
Definition: ipv6-address.h:49
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.