A Discrete-Event Network Simulator
API
icmpv6-header.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007-2009 Strasbourg University
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19  * Mehdi Benamor <benamor.mehdi@ensi.rnu.tn>
20  * David Gross <gdavid.devel@gmail.com>
21  */
22 
23 #ifndef ICMPV6_HEADER_H
24 #define ICMPV6_HEADER_H
25 
26 #include "ns3/header.h"
27 #include "ns3/ipv6-address.h"
28 #include "ns3/packet.h"
29 
30 namespace ns3
31 {
32 
38 class Icmpv6Header : public Header
39 {
40 public:
44  enum Type_e
45  {
72  };
73 
78  {
84  };
85 
90  {
96  };
97 
102  {
105  };
106 
111  {
115  };
116 
121  static TypeId GetTypeId ();
122 
127  virtual TypeId GetInstanceTypeId () const;
128 
132  Icmpv6Header ();
133 
137  virtual ~Icmpv6Header ();
138 
143  uint8_t GetType () const;
144 
149  void SetType (uint8_t type);
150 
155  uint8_t GetCode () const;
156 
161  void SetCode (uint8_t code);
162 
167  uint16_t GetChecksum () const;
168 
173  void SetChecksum (uint16_t checksum);
174 
179  virtual void Print (std::ostream& os) const;
180 
185  virtual uint32_t GetSerializedSize () const;
186 
191  virtual void Serialize (Buffer::Iterator start) const;
192 
198  virtual uint32_t Deserialize (Buffer::Iterator start);
199 
208  void CalculatePseudoHeaderChecksum (Ipv6Address src, Ipv6Address dst, uint16_t length, uint8_t protocol);
209 
210 protected:
215 
219  uint16_t m_checksum;
220 
221 private:
225  uint8_t m_type;
226 
230  uint8_t m_code;
231 };
232 
239 {
240 public:
245  static TypeId GetTypeId ();
246 
251  virtual TypeId GetInstanceTypeId () const;
252 
257 
261  virtual ~Icmpv6OptionHeader ();
262 
267  uint8_t GetType () const;
268 
273  void SetType (uint8_t type);
274 
279  uint8_t GetLength () const;
280 
285  void SetLength (uint8_t len);
286 
291  virtual void Print (std::ostream& os) const;
292 
297  virtual uint32_t GetSerializedSize () const;
298 
303  virtual void Serialize (Buffer::Iterator start) const;
304 
310  virtual uint32_t Deserialize (Buffer::Iterator start);
311 
312 private:
316  uint8_t m_type;
317 
321  uint8_t m_len;
322 };
323 
329 class Icmpv6NS : public Icmpv6Header
330 {
331 public:
336  Icmpv6NS (Ipv6Address target);
337 
341  Icmpv6NS ();
342 
346  virtual ~Icmpv6NS ();
347 
352  static TypeId GetTypeId ();
353 
358  virtual TypeId GetInstanceTypeId () const;
359 
364  uint32_t GetReserved () const;
365 
370  void SetReserved (uint32_t reserved);
371 
376  Ipv6Address GetIpv6Target () const;
377 
382  void SetIpv6Target (Ipv6Address target);
383 
388  virtual void Print (std::ostream& os) const;
389 
394  virtual uint32_t GetSerializedSize () const;
395 
400  virtual void Serialize (Buffer::Iterator start) const;
401 
407  virtual uint32_t Deserialize (Buffer::Iterator start);
408 
409 private:
410 
414  uint32_t m_reserved;
415 
420 };
421 
427 class Icmpv6NA : public Icmpv6Header
428 {
429 public:
433  Icmpv6NA ();
434 
438  virtual ~Icmpv6NA ();
439 
444  static TypeId GetTypeId ();
445 
450  virtual TypeId GetInstanceTypeId () const;
451 
456  uint32_t GetReserved () const;
457 
462  void SetReserved (uint32_t reserved);
463 
468  Ipv6Address GetIpv6Target () const;
469 
474  void SetIpv6Target (Ipv6Address target);
475 
480  bool GetFlagR () const;
481 
486  void SetFlagR (bool r);
487 
492  bool GetFlagS () const;
493 
498  void SetFlagS (bool s);
499 
504  bool GetFlagO () const;
505 
510  void SetFlagO (bool o);
511 
516  virtual void Print (std::ostream& os) const;
517 
522  virtual uint32_t GetSerializedSize () const;
523 
528  virtual void Serialize (Buffer::Iterator start) const;
529 
535  virtual uint32_t Deserialize (Buffer::Iterator start);
536 
537 private:
541  bool m_flagR;
542 
546  bool m_flagS;
547 
551  bool m_flagO;
552 
556  uint32_t m_reserved;
557 
562 };
563 
569 class Icmpv6RA : public Icmpv6Header
570 {
571 public:
575  Icmpv6RA ();
576 
580  virtual ~Icmpv6RA ();
581 
586  static TypeId GetTypeId ();
587 
592  virtual TypeId GetInstanceTypeId () const;
593 
598  void SetCurHopLimit (uint8_t m);
599 
604  uint8_t GetCurHopLimit () const;
605 
610  void SetLifeTime (uint16_t l);
611 
616  uint16_t GetLifeTime () const;
617 
622  void SetReachableTime (uint32_t r);
623 
628  uint32_t GetReachableTime () const;
629 
634  void SetRetransmissionTime (uint32_t r);
635 
640  uint32_t GetRetransmissionTime () const;
641 
646  bool GetFlagM () const;
647 
652  void SetFlagM (bool m);
653 
658  bool GetFlagO () const;
659 
664  void SetFlagO (bool o);
665 
670  bool GetFlagH () const;
671 
676  void SetFlagH (bool h);
677 
682  virtual void Print (std::ostream& os) const;
683 
689  uint8_t GetFlags () const;
690 
696  void SetFlags (uint8_t f);
697 
702  virtual uint32_t GetSerializedSize () const;
703 
708  virtual void Serialize (Buffer::Iterator start) const;
709 
715  virtual uint32_t Deserialize (Buffer::Iterator start);
716 
717 private:
721  bool m_flagM;
722 
726  bool m_flagO;
727 
731  bool m_flagH;
732 
736  uint16_t m_LifeTime;
737 
741  uint32_t m_ReachableTime;
742 
747 
751  uint8_t m_curHopLimit;
752 };
753 
759 class Icmpv6RS : public Icmpv6Header
760 {
761 public:
765  Icmpv6RS ();
766 
770  virtual ~Icmpv6RS ();
771 
776  static TypeId GetTypeId ();
777 
782  virtual TypeId GetInstanceTypeId () const;
783 
788  uint32_t GetReserved () const;
789 
794  void SetReserved (uint32_t reserved);
795 
800  virtual void Print (std::ostream& os) const;
801 
806  virtual uint32_t GetSerializedSize () const;
807 
812  virtual void Serialize (Buffer::Iterator start) const;
813 
819  virtual uint32_t Deserialize (Buffer::Iterator start);
820 
821 private:
825  uint32_t m_reserved;
826 };
827 
834 {
835 public:
840 
844  virtual ~Icmpv6Redirection ();
845 
850  static TypeId GetTypeId ();
851 
856  virtual TypeId GetInstanceTypeId () const;
857 
862  Ipv6Address GetTarget () const;
863 
868  void SetTarget (Ipv6Address target);
869 
874  Ipv6Address GetDestination () const;
875 
880  void SetDestination (Ipv6Address destination);
881 
886  virtual void Print (std::ostream& os) const;
887 
892  virtual uint32_t GetSerializedSize () const;
893 
898  virtual void Serialize (Buffer::Iterator start) const;
899 
905  virtual uint32_t Deserialize (Buffer::Iterator start);
906 
911  uint32_t GetReserved () const;
912 
917  void SetReserved (uint32_t reserved);
918 
919 private:
924 
929 
933  uint32_t m_reserved;
934 };
935 
941 class Icmpv6Echo : public Icmpv6Header
942 {
943 public:
948  static TypeId GetTypeId ();
949 
954  virtual TypeId GetInstanceTypeId () const;
955 
959  Icmpv6Echo ();
960 
965  Icmpv6Echo (bool request);
966 
970  virtual ~Icmpv6Echo ();
971 
976  uint16_t GetId () const;
977 
982  void SetId (uint16_t id);
983 
988  uint16_t GetSeq () const;
989 
994  void SetSeq (uint16_t seq);
995 
1000  virtual void Print (std::ostream& os) const;
1001 
1006  virtual uint32_t GetSerializedSize () const;
1007 
1012  virtual void Serialize (Buffer::Iterator start) const;
1013 
1019  virtual uint32_t Deserialize (Buffer::Iterator start);
1020 
1021 private:
1025  uint16_t m_id;
1026 
1030  uint16_t m_seq;
1031 };
1032 
1039 {
1040 public:
1045 
1049  virtual ~Icmpv6DestinationUnreachable ();
1050 
1055  static TypeId GetTypeId ();
1056 
1061  virtual TypeId GetInstanceTypeId () const;
1062 
1067  void SetPacket (Ptr<Packet> p);
1068 
1073  virtual void Print (std::ostream& os) const;
1074 
1079  virtual uint32_t GetSerializedSize () const;
1080 
1085  virtual void Serialize (Buffer::Iterator start) const;
1086 
1092  virtual uint32_t Deserialize (Buffer::Iterator start);
1093 
1094 private:
1099 };
1100 
1107 {
1108 public:
1112  Icmpv6TooBig ();
1113 
1117  virtual ~Icmpv6TooBig ();
1118 
1123  static TypeId GetTypeId ();
1124 
1129  virtual TypeId GetInstanceTypeId () const;
1130 
1135  void SetPacket (Ptr<Packet> p);
1136 
1141  uint32_t GetMtu () const;
1142 
1147  void SetMtu (uint32_t mtu);
1148 
1153  virtual void Print (std::ostream& os) const;
1154 
1159  virtual uint32_t GetSerializedSize () const;
1160 
1165  virtual void Serialize (Buffer::Iterator start) const;
1166 
1172  virtual uint32_t Deserialize (Buffer::Iterator start);
1173 
1174 private:
1175 
1180 
1184  uint32_t m_mtu;
1185 };
1186 
1193 {
1194 public:
1198  Icmpv6TimeExceeded ();
1199 
1203  virtual ~Icmpv6TimeExceeded ();
1204 
1209  static TypeId GetTypeId ();
1210 
1215  virtual TypeId GetInstanceTypeId () const;
1216 
1221  void SetPacket (Ptr<Packet> p);
1222 
1227  virtual void Print (std::ostream& os) const;
1228 
1233  virtual uint32_t GetSerializedSize () const;
1234 
1239  virtual void Serialize (Buffer::Iterator start) const;
1240 
1246  virtual uint32_t Deserialize (Buffer::Iterator start);
1247 
1248 private:
1249 
1254 };
1255 
1262 {
1263 public:
1268 
1272  virtual ~Icmpv6ParameterError ();
1273 
1278  static TypeId GetTypeId ();
1279 
1284  virtual TypeId GetInstanceTypeId () const;
1285 
1290  void SetPacket (Ptr<Packet> p);
1291 
1296  uint32_t GetPtr () const;
1297 
1302  void SetPtr (uint32_t ptr);
1303 
1308  virtual void Print (std::ostream& os) const;
1309 
1314  virtual uint32_t GetSerializedSize () const;
1315 
1320  virtual void Serialize (Buffer::Iterator start) const;
1321 
1327  virtual uint32_t Deserialize (Buffer::Iterator start);
1328 
1329 private:
1330 
1335 
1339  uint32_t m_ptr;
1340 };
1341 
1348 {
1349 public:
1353  Icmpv6OptionMtu ();
1354 
1359  Icmpv6OptionMtu (uint32_t mtu);
1360 
1364  virtual ~Icmpv6OptionMtu ();
1365 
1370  static TypeId GetTypeId ();
1371 
1376  virtual TypeId GetInstanceTypeId () const;
1377 
1382  uint16_t GetReserved () const;
1383 
1388  void SetReserved (uint16_t reserved);
1389 
1394  uint32_t GetMtu () const;
1395 
1400  void SetMtu (uint32_t mtu);
1401 
1406  virtual void Print (std::ostream& os) const;
1407 
1412  virtual uint32_t GetSerializedSize () const;
1413 
1418  virtual void Serialize (Buffer::Iterator start) const;
1419 
1425  virtual uint32_t Deserialize (Buffer::Iterator start);
1426 
1427 private:
1431  uint16_t m_reserved;
1432 
1436  uint32_t m_mtu;
1437 };
1438 
1445 {
1446 public:
1451 
1457  Icmpv6OptionPrefixInformation (Ipv6Address network, uint8_t prefixlen);
1458 
1462  virtual ~Icmpv6OptionPrefixInformation ();
1463 
1468  static TypeId GetTypeId ();
1469 
1474  virtual TypeId GetInstanceTypeId () const;
1475 
1479  typedef enum
1480  {
1481  NONE = 0,
1482  ROUTERADDR = 32,
1484  ONLINK = 128
1486 
1491  uint8_t GetPrefixLength () const;
1492 
1497  void SetPrefixLength (uint8_t prefixLength);
1498 
1503  uint8_t GetFlags () const;
1504 
1509  void SetFlags (uint8_t flags);
1510 
1515  uint32_t GetValidTime () const;
1516 
1521  void SetValidTime (uint32_t validTime);
1522 
1527  uint32_t GetPreferredTime () const;
1528 
1533  void SetPreferredTime (uint32_t preferredTime);
1534 
1539  uint32_t GetReserved () const;
1540 
1545  void SetReserved (uint32_t reserved);
1546 
1551  Ipv6Address GetPrefix () const;
1552 
1557  void SetPrefix (Ipv6Address prefix);
1558 
1563  virtual void Print (std::ostream& os) const;
1564 
1569  virtual uint32_t GetSerializedSize () const;
1570 
1575  virtual void Serialize (Buffer::Iterator start) const;
1576 
1582  virtual uint32_t Deserialize (Buffer::Iterator start);
1583 
1584 private:
1589 
1594 
1598  uint8_t m_flags;
1599 
1603  uint32_t m_validTime;
1604 
1609 
1613  uint32_t m_reserved;
1614 };
1615 
1622 {
1623 public:
1628  Icmpv6OptionLinkLayerAddress (bool source);
1629 
1634  static TypeId GetTypeId ();
1635 
1640  virtual TypeId GetInstanceTypeId (void) const;
1641 
1647  Icmpv6OptionLinkLayerAddress (bool source, Address addr);
1648 
1653 
1657  virtual ~Icmpv6OptionLinkLayerAddress ();
1658 
1663  Address GetAddress () const;
1664 
1669  void SetAddress (Address addr);
1670 
1675  virtual void Print (std::ostream& os) const;
1676 
1681  virtual uint32_t GetSerializedSize () const;
1682 
1687  virtual void Serialize (Buffer::Iterator start) const;
1688 
1694  virtual uint32_t Deserialize (Buffer::Iterator start);
1695 
1696 private:
1701 };
1702 
1709 {
1710 public:
1715  static TypeId GetTypeId ();
1716 
1721  virtual TypeId GetInstanceTypeId () const;
1722 
1727 
1731  virtual ~Icmpv6OptionRedirected ();
1732 
1737  void SetPacket (Ptr<Packet> packet);
1738 
1743  virtual void Print (std::ostream& os) const;
1744 
1749  virtual uint32_t GetSerializedSize () const;
1750 
1755  virtual void Serialize (Buffer::Iterator start) const;
1756 
1762  virtual uint32_t Deserialize (Buffer::Iterator start);
1763 
1764 private:
1769 };
1770 
1771 } /* namespace ns3 */
1772 
1773 #endif /* ICMPV6_HEADER_H */
1774 
double f(double x, void *params)
Definition: 80211b.c:70
a polymophic address class
Definition: address.h:91
iterator in a Buffer instance
Definition: buffer.h:99
Protocol header serialization and deserialization.
Definition: header.h:43
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ICMPv6 Error Destination Unreachable header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual void Print(std::ostream &os) const
Print information.
Ptr< Packet > m_packet
The incorrect Packet.
static TypeId GetTypeId()
Get the UID of this class.
virtual ~Icmpv6DestinationUnreachable()
Destructor.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
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.
virtual void Print(std::ostream &os) const
Print information.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint16_t m_id
ID of the packet (to distinguish response between many ping program).
virtual ~Icmpv6Echo()
Destructor.
uint16_t GetId() const
Get the ID of the packet.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
void SetSeq(uint16_t seq)
Set the sequence number.
uint16_t GetSeq() const
Get the sequence number.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
ICMPv6 header.
Definition: icmpv6-header.h:39
uint8_t GetCode() const
Get the code field.
OptionType_e
ICMPv6 Option type code.
Definition: icmpv6-header.h:78
ErrorDestinationUnreachable_e
ICMPv6 error code : Destination Unreachable.
Definition: icmpv6-header.h:90
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint8_t GetType() const
Get the type field.
Icmpv6Header()
Constructor.
uint8_t m_code
The code.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint16_t GetChecksum() const
Get the checksum.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
ErrorTimeExceeded_e
ICMPv6 error code : Time Exceeded.
static TypeId GetTypeId()
Get the UID of this class.
uint16_t m_checksum
The checksum.
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.
virtual ~Icmpv6Header()
Destructor.
uint8_t m_type
The type.
void SetType(uint8_t type)
Set the type.
Type_e
ICMPv6 type code.
Definition: icmpv6-header.h:45
@ ICMPV6_SECURE_ND_CERTIFICATE_PATH_ADVERTISEMENT
Definition: icmpv6-header.h:70
@ ICMPV6_MOBILITY_HA_DISCOVER_RESPONSE
Definition: icmpv6-header.h:67
@ ICMPV6_ND_NEIGHBOR_ADVERTISEMENT
Definition: icmpv6-header.h:58
@ ICMPV6_ERROR_DESTINATION_UNREACHABLE
Definition: icmpv6-header.h:46
@ ICMPV6_SECURE_ND_CERTIFICATE_PATH_SOLICITATION
Definition: icmpv6-header.h:69
@ ICMPV6_MOBILITY_HA_DISCOVER_REQUEST
Definition: icmpv6-header.h:66
@ ICMPV6_MOBILITY_MOBILE_PREFIX_SOLICITATION
Definition: icmpv6-header.h:68
@ ICMPV6_INVERSE_ND_ADVERSTISEMENT
Definition: icmpv6-header.h:64
void SetChecksum(uint16_t checksum)
Set the checksum.
ErrorParameterError_e
ICMPv6 error code : Parameter Error.
bool m_calcChecksum
Checksum enable or not.
virtual void Print(std::ostream &os) const
Print information.
ICMPv6 Neighbor Advertisement header.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
bool GetFlagS() const
Get the S flag.
virtual void Print(std::ostream &os) const
Print information.
bool m_flagS
The O flag.
uint32_t m_reserved
The reserved value.
virtual TypeId GetInstanceTypeId() const
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.
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.
static TypeId GetTypeId()
Get the UID of this class.
Ipv6Address m_target
The IPv6 target address.
virtual ~Icmpv6NA()
Destructor.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
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.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
uint32_t GetReserved() const
Get the reserved field.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
static TypeId GetTypeId()
Get the UID of this class.
Ipv6Address m_target
The IPv6 target address.
void SetReserved(uint32_t reserved)
Set the reserved field.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual ~Icmpv6NS()
Destructor.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
virtual void Print(std::ostream &os) const
Print information.
Icmpv6NS()
Constructor.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
ICMPv6 option header.
void SetType(uint8_t type)
Set the type of the option.
Icmpv6OptionHeader()
Constructor.
virtual ~Icmpv6OptionHeader()
Destructor.
uint8_t m_len
The length.
virtual void Print(std::ostream &os) const
Print information.
uint8_t m_type
The type.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
static TypeId GetTypeId()
Get the UID of this class.
uint8_t GetType() const
Get the type of the option.
void SetLength(uint8_t len)
Set the length of the option.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint8_t GetLength() const
Get the length of the option in 8 bytes unit.
ICMPv6 MTU option.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
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.
void SetMtu(uint32_t mtu)
Set the MTU.
virtual void Print(std::ostream &os) const
Print information.
virtual ~Icmpv6OptionMtu()
Destructor.
uint32_t m_mtu
The MTU value.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Icmpv6OptionMtu()
Constructor.
uint16_t GetReserved() const
Get the reserved field.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
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).
virtual ~Icmpv6OptionPrefixInformation()
Destructor.
void SetValidTime(uint32_t validTime)
Set the valid time of the information.
void SetPrefix(Ipv6Address prefix)
Set the IPv6 prefix.
virtual void Print(std::ostream &os) const
Print information.
Ipv6Address GetPrefix() const
Get the IPv6 prefix.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
void SetFlags(uint8_t flags)
Set the flags.
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.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t GetPrefixLength() const
Get the prefix length.
void SetPreferredTime(uint32_t preferredTime)
Set the preferred time of the information.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
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.
uint32_t GetPreferredTime() const
Get the preferred time of the information.
ICMPv6 redirected option.
Icmpv6OptionRedirected()
Constructor.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ptr< Packet > m_packet
The redirected packet.
virtual ~Icmpv6OptionRedirected()
Destructor.
static TypeId GetTypeId()
Get the UID of this class.
virtual void Print(std::ostream &os) const
Print information.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
ICMPv6 Error Parameter Error header.
uint32_t m_ptr
The pointer field.
virtual ~Icmpv6ParameterError()
Destructor.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Print(std::ostream &os) const
Print information.
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.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Ptr< Packet > m_packet
The incorrect packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint32_t GetPtr() const
Get the pointer field.
Icmpv6ParameterError()
Constructor.
ICMPv6 Router Advertisement header.
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.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
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.
uint32_t m_RetransmissionTimer
The retransmission timer.
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.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
bool GetFlagM() const
Get the M flag.
uint8_t m_curHopLimit
The max jumps.
virtual ~Icmpv6RA()
Destructor.
uint32_t m_ReachableTime
The reachable time value.
bool m_flagH
The H flag.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual void Print(std::ostream &os) const
Print information.
bool GetFlagH() const
Get the H flag.
ICMPv6 Router Solicitation header.
void SetReserved(uint32_t reserved)
Set the reserved field.
uint32_t GetReserved() const
Get the reserved field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint32_t m_reserved
The reserved value.
static TypeId GetTypeId()
Get the UID of this class.
virtual ~Icmpv6RS()
Destructor.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Print(std::ostream &os) const
Print information.
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.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Icmpv6Redirection()
Constructor.
virtual ~Icmpv6Redirection()
Destructor.
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.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
virtual void Print(std::ostream &os) const
Print information.
static TypeId GetTypeId()
Get the UID of this class.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint32_t m_reserved
Reserved value.
ICMPv6 Error Time Exceeded header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
Icmpv6TimeExceeded()
Constructor.
static TypeId GetTypeId()
Get the UID of this class.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual void Print(std::ostream &os) const
Print information.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual ~Icmpv6TimeExceeded()
Destructor.
Ptr< Packet > m_packet
The incorrect packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
ICMPv6 Error Too Big header.
static TypeId GetTypeId()
Get the UID of this class.
void SetMtu(uint32_t mtu)
Set the MTU.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Ptr< Packet > m_packet
the incorrect packet.
Icmpv6TooBig()
Constructor.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual void Print(std::ostream &os) const
Print information.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
virtual ~Icmpv6TooBig()
Destructor.
uint32_t m_mtu
The MTU value.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
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:59
#define NS_DEPRECATED_3_34
Tag for things deprecated in version ns-3.34.
Definition: deprecated.h:88
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1853