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 
688  uint8_t GetFlags () const;
689 
694  void SetFlags (uint8_t f);
695 
700  virtual uint32_t GetSerializedSize () const;
701 
706  virtual void Serialize (Buffer::Iterator start) const;
707 
713  virtual uint32_t Deserialize (Buffer::Iterator start);
714 
715 private:
719  bool m_flagM;
720 
724  bool m_flagO;
725 
729  bool m_flagH;
730 
734  uint8_t m_flags;
735 
739  uint16_t m_LifeTime;
740 
744  uint32_t m_ReachableTime;
745 
750 
754  uint8_t m_curHopLimit;
755 };
756 
762 class Icmpv6RS : public Icmpv6Header
763 {
764 public:
768  Icmpv6RS ();
769 
773  virtual ~Icmpv6RS ();
774 
779  static TypeId GetTypeId ();
780 
785  virtual TypeId GetInstanceTypeId () const;
786 
791  uint32_t GetReserved () const;
792 
797  void SetReserved (uint32_t reserved);
798 
803  virtual void Print (std::ostream& os) const;
804 
809  virtual uint32_t GetSerializedSize () const;
810 
815  virtual void Serialize (Buffer::Iterator start) const;
816 
822  virtual uint32_t Deserialize (Buffer::Iterator start);
823 
824 private:
828  uint32_t m_reserved;
829 };
830 
837 {
838 public:
843 
847  virtual ~Icmpv6Redirection ();
848 
853  static TypeId GetTypeId ();
854 
859  virtual TypeId GetInstanceTypeId () const;
860 
865  Ipv6Address GetTarget () const;
866 
871  void SetTarget (Ipv6Address target);
872 
877  Ipv6Address GetDestination () const;
878 
883  void SetDestination (Ipv6Address destination);
884 
889  virtual void Print (std::ostream& os) const;
890 
895  virtual uint32_t GetSerializedSize () const;
896 
901  virtual void Serialize (Buffer::Iterator start) const;
902 
908  virtual uint32_t Deserialize (Buffer::Iterator start);
909 
914  uint32_t GetReserved () const;
915 
920  void SetReserved (uint32_t reserved);
921 
922 private:
927 
932 
936  uint32_t m_reserved;
937 };
938 
944 class Icmpv6Echo : public Icmpv6Header
945 {
946 public:
951  static TypeId GetTypeId ();
952 
957  virtual TypeId GetInstanceTypeId () const;
958 
962  Icmpv6Echo ();
963 
968  Icmpv6Echo (bool request);
969 
973  virtual ~Icmpv6Echo ();
974 
979  uint16_t GetId () const;
980 
985  void SetId (uint16_t id);
986 
991  uint16_t GetSeq () const;
992 
997  void SetSeq (uint16_t seq);
998 
1003  virtual void Print (std::ostream& os) const;
1004 
1009  virtual uint32_t GetSerializedSize () const;
1010 
1015  virtual void Serialize (Buffer::Iterator start) const;
1016 
1022  virtual uint32_t Deserialize (Buffer::Iterator start);
1023 
1024 private:
1028  uint16_t m_id;
1029 
1033  uint16_t m_seq;
1034 };
1035 
1042 {
1043 public:
1048 
1052  virtual ~Icmpv6DestinationUnreachable ();
1053 
1058  static TypeId GetTypeId ();
1059 
1064  virtual TypeId GetInstanceTypeId () const;
1065 
1070  Ptr<Packet> GetPacket () const;
1071 
1076  void SetPacket (Ptr<Packet> p);
1077 
1082  virtual void Print (std::ostream& os) const;
1083 
1088  virtual uint32_t GetSerializedSize () const;
1089 
1094  virtual void Serialize (Buffer::Iterator start) const;
1095 
1101  virtual uint32_t Deserialize (Buffer::Iterator start);
1102 
1103 private:
1108 };
1109 
1116 {
1117 public:
1121  Icmpv6TooBig ();
1122 
1126  virtual ~Icmpv6TooBig ();
1127 
1132  static TypeId GetTypeId ();
1133 
1138  virtual TypeId GetInstanceTypeId () const;
1139 
1144  Ptr<Packet> GetPacket () const;
1145 
1150  void SetPacket (Ptr<Packet> p);
1151 
1156  uint32_t GetMtu () const;
1157 
1162  void SetMtu (uint32_t mtu);
1163 
1168  virtual void Print (std::ostream& os) const;
1169 
1174  virtual uint32_t GetSerializedSize () const;
1175 
1180  virtual void Serialize (Buffer::Iterator start) const;
1181 
1187  virtual uint32_t Deserialize (Buffer::Iterator start);
1188 
1189 private:
1190 
1195 
1199  uint32_t m_mtu;
1200 };
1201 
1208 {
1209 public:
1213  Icmpv6TimeExceeded ();
1214 
1218  virtual ~Icmpv6TimeExceeded ();
1219 
1224  static TypeId GetTypeId ();
1225 
1230  virtual TypeId GetInstanceTypeId () const;
1231 
1236  Ptr<Packet> GetPacket () const;
1237 
1242  void SetPacket (Ptr<Packet> p);
1243 
1248  virtual void Print (std::ostream& os) const;
1249 
1254  virtual uint32_t GetSerializedSize () const;
1255 
1260  virtual void Serialize (Buffer::Iterator start) const;
1261 
1267  virtual uint32_t Deserialize (Buffer::Iterator start);
1268 
1269 private:
1270 
1275 };
1276 
1283 {
1284 public:
1289 
1293  virtual ~Icmpv6ParameterError ();
1294 
1299  static TypeId GetTypeId ();
1300 
1305  virtual TypeId GetInstanceTypeId () const;
1306 
1311  Ptr<Packet> GetPacket () const;
1312 
1317  void SetPacket (Ptr<Packet> p);
1318 
1323  uint32_t GetPtr () const;
1324 
1329  void SetPtr (uint32_t ptr);
1330 
1335  virtual void Print (std::ostream& os) const;
1336 
1341  virtual uint32_t GetSerializedSize () const;
1342 
1347  virtual void Serialize (Buffer::Iterator start) const;
1348 
1354  virtual uint32_t Deserialize (Buffer::Iterator start);
1355 
1356 private:
1357 
1362 
1366  uint32_t m_ptr;
1367 };
1368 
1375 {
1376 public:
1380  Icmpv6OptionMtu ();
1381 
1386  Icmpv6OptionMtu (uint32_t mtu);
1387 
1391  virtual ~Icmpv6OptionMtu ();
1392 
1397  static TypeId GetTypeId ();
1398 
1403  virtual TypeId GetInstanceTypeId () const;
1404 
1409  uint16_t GetReserved () const;
1410 
1415  void SetReserved (uint16_t reserved);
1416 
1421  uint32_t GetMtu () const;
1422 
1427  void SetMtu (uint32_t mtu);
1428 
1433  virtual void Print (std::ostream& os) const;
1434 
1439  virtual uint32_t GetSerializedSize () const;
1440 
1445  virtual void Serialize (Buffer::Iterator start) const;
1446 
1452  virtual uint32_t Deserialize (Buffer::Iterator start);
1453 
1454 private:
1458  uint16_t m_reserved;
1459 
1463  uint32_t m_mtu;
1464 };
1465 
1472 {
1473 public:
1478 
1484  Icmpv6OptionPrefixInformation (Ipv6Address network, uint8_t prefixlen);
1485 
1489  virtual ~Icmpv6OptionPrefixInformation ();
1490 
1495  static TypeId GetTypeId ();
1496 
1501  virtual TypeId GetInstanceTypeId () const;
1502 
1507  uint8_t GetPrefixLength () const;
1508 
1513  void SetPrefixLength (uint8_t prefixLength);
1514 
1519  uint8_t GetFlags () const;
1520 
1525  void SetFlags (uint8_t flags);
1526 
1531  uint32_t GetValidTime () const;
1532 
1537  void SetValidTime (uint32_t validTime);
1538 
1543  uint32_t GetPreferredTime () const;
1544 
1549  void SetPreferredTime (uint32_t preferredTime);
1550 
1555  uint32_t GetReserved () const;
1556 
1561  void SetReserved (uint32_t reserved);
1562 
1567  Ipv6Address GetPrefix () const;
1568 
1573  void SetPrefix (Ipv6Address prefix);
1574 
1579  virtual void Print (std::ostream& os) const;
1580 
1585  virtual uint32_t GetSerializedSize () const;
1586 
1591  virtual void Serialize (Buffer::Iterator start) const;
1592 
1598  virtual uint32_t Deserialize (Buffer::Iterator start);
1599 
1600 private:
1605 
1610 
1614  uint8_t m_flags;
1615 
1619  uint32_t m_validTime;
1620 
1625 
1629  uint32_t m_reserved;
1630 };
1631 
1638 {
1639 public:
1644  Icmpv6OptionLinkLayerAddress (bool source);
1645 
1650  static TypeId GetTypeId ();
1651 
1656  virtual TypeId GetInstanceTypeId (void) const;
1657 
1663  Icmpv6OptionLinkLayerAddress (bool source, Address addr);
1664 
1669 
1673  virtual ~Icmpv6OptionLinkLayerAddress ();
1674 
1679  Address GetAddress () const;
1680 
1685  void SetAddress (Address addr);
1686 
1691  virtual void Print (std::ostream& os) const;
1692 
1697  virtual uint32_t GetSerializedSize () const;
1698 
1703  virtual void Serialize (Buffer::Iterator start) const;
1704 
1710  virtual uint32_t Deserialize (Buffer::Iterator start);
1711 
1712 private:
1717 };
1718 
1725 {
1726 public:
1731  static TypeId GetTypeId ();
1732 
1737  virtual TypeId GetInstanceTypeId () const;
1738 
1743 
1747  virtual ~Icmpv6OptionRedirected ();
1748 
1753  Ptr<Packet> GetPacket () const;
1754 
1759  void SetPacket (Ptr<Packet> packet);
1760 
1765  virtual void Print (std::ostream& os) const;
1766 
1771  virtual uint32_t GetSerializedSize () const;
1772 
1777  virtual void Serialize (Buffer::Iterator start) const;
1778 
1784  virtual uint32_t Deserialize (Buffer::Iterator start);
1785 
1786 private:
1791 };
1792 
1793 } /* namespace ns3 */
1794 
1795 #endif /* ICMPV6_HEADER_H */
1796 
Protocol header serialization and deserialization.
Definition: header.h:42
uint16_t GetSeq() const
Get the sequence number.
Icmpv6OptionHeader()
Constructor.
Ipv6Address m_destination
IPv6 destination address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Print(std::ostream &os) const
Print information.
void SetLength(uint8_t len)
Set the length of the option.
uint32_t m_reserved
Reserved value.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
void CalculatePseudoHeaderChecksum(Ipv6Address src, Ipv6Address dst, uint16_t length, uint8_t protocol)
Calculate pseudo header checksum for IPv6.
ICMPv6 redirected option.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
bool GetFlagS() const
Get the S flag.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint32_t m_RetransmissionTimer
The retransmission timer.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
static TypeId GetTypeId()
Get the UID of this class.
ICMPv6 Error Parameter Error header.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
ICMPv6 Router Advertisement header.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
ICMPv6 Neighbor Advertisement header.
static TypeId GetTypeId()
Get the UID of this class.
uint8_t m_type
The type.
bool m_flagR
The R flag.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ptr< Packet > m_packet
The incorrect packet.
Ptr< Packet > m_packet
The incorrect Packet.
Icmpv6OptionMtu()
Constructor.
void SetReserved(uint32_t reserved)
Set the reserved field (normally it will be 0x00000000).
uint32_t m_validTime
The valid time.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
void SetReserved(uint32_t reserved)
Set the reserved field.
Icmpv6NS()
Constructor.
virtual ~Icmpv6TimeExceeded()
Destructor.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
ICMPv6 Error Time Exceeded header.
Icmpv6TimeExceeded()
Constructor.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
def start()
Definition: core.py:1858
ICMPv6 Router Solicitation header.
ICMPv6 Neighbor Solicitation header.
void SetType(uint8_t type)
Set the type of the option.
uint32_t m_preferredTime
The preferred time.
uint16_t m_reserved
The reserved value.
static TypeId GetTypeId()
Get the UID of this class.
uint32_t m_reserved
The reserved value.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual void Print(std::ostream &os) const
Print information.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetPtr(uint32_t ptr)
Set the pointer field.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Ptr< Packet > m_packet
The redirected packet.
uint32_t GetReserved() const
Get the reserved field.
ErrorParameterError_e
ICMPv6 error code : Parameter Error.
uint8_t m_len
The length.
void SetRetransmissionTime(uint32_t r)
Set the node Retransmission time (Neighbor Discovery).
static TypeId GetTypeId()
Get the UID of this class.
Ipv6Address m_target
IPv6 target address.
bool m_flagS
The O flag.
static TypeId GetTypeId()
Get the UID of this class.
Ipv6Address m_target
The IPv6 target address.
virtual ~Icmpv6OptionHeader()
Destructor.
uint8_t GetFlags() const
Getflags.
uint16_t m_id
ID of the packet (to distinguish response between many ping program).
static TypeId GetTypeId()
Get the UID of this class.
void SetMtu(uint32_t mtu)
Set the MTU.
uint8_t GetType() const
Get the type of the option.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint8_t m_code
The code.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
static TypeId GetTypeId()
Get the UID of this class.
Icmpv6NA()
Constructor.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Icmpv6Echo()
Default constructor.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
Icmpv6ParameterError()
Constructor.
static TypeId GetTypeId()
Get the UID of this class.
static TypeId GetTypeId()
Get the UID of this class.
iterator in a Buffer instance
Definition: buffer.h:98
a polymophic address class
Definition: address.h:90
virtual void Print(std::ostream &os) const
Print information.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t GetPreferredTime() const
Get the preferred time of the information.
virtual ~Icmpv6OptionPrefixInformation()
Destructor.
void SetLifeTime(uint16_t l)
Set the node Life time (Neighbor Discovery).
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetValidTime(uint32_t validTime)
Set the valid time of the information.
uint8_t m_type
The type.
virtual void Print(std::ostream &os) const
Print information.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
ICMPv6 Error Destination Unreachable header.
uint32_t GetMtu() const
Get the MTU field.
virtual ~Icmpv6ParameterError()
Destructor.
void SetType(uint8_t type)
Set the type.
void SetCurHopLimit(uint8_t m)
Set the IPv6 maximum number of jumps.
uint32_t GetValidTime() const
Get the valid time of the information.
virtual ~Icmpv6NA()
Destructor.
void SetPreferredTime(uint32_t preferredTime)
Set the preferred time of the information.
ICMPv6 header.
Definition: icmpv6-header.h:38
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint32_t m_reserved
The reserved value.
uint16_t m_checksum
The checksum.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
uint8_t GetPrefixLength() const
Get the prefix length.
virtual void Print(std::ostream &os) const
Print information.
void SetPrefixLength(uint8_t prefixLength)
Set the prefix length.
ICMPv6 Option Prefix Information.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Ipv6Address m_target
The IPv6 target address.
Ptr< Packet > m_packet
the incorrect packet.
uint32_t m_reserved
The reserved value.
bool m_flagH
The H flag.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint32_t GetMtu() const
Get the MTU.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint32_t m_reserved
The reserved field.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Icmpv6RS()
Constructor.
virtual void Print(std::ostream &os) const
Print information.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Print(std::ostream &os) const
Print information.
uint8_t m_curHopLimit
The max jumps.
Ptr< Packet > GetPacket() const
Get the redirected packet.
bool GetFlagO() const
Get the O flag.
ErrorDestinationUnreachable_e
ICMPv6 error code : Destination Unreachable.
Definition: icmpv6-header.h:89
ICMPv6 Redirection header.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ipv6Address GetTarget() const
Get the IPv6 target address.
static TypeId GetTypeId()
Get the UID of this class.
uint32_t m_mtu
The MTU value.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
bool m_calcChecksum
Checksum enable or not.
bool m_flagO
The O flag.
uint8_t GetLength() const
Get the length of the option in 8 bytes unit.
uint32_t GetReserved() const
Get the reserved field.
void SetReserved(uint16_t reserved)
Set the reserved field.
virtual void Print(std::ostream &os) const
Print information.
static TypeId GetTypeId()
Get the UID of this class.
void SetReserved(uint32_t reserved)
Set the reserved field.
void SetReserved(uint32_t reserved)
Set the reserved field.
uint8_t GetCode() const
Get the code field.
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.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
virtual void Print(std::ostream &os) const
Print information.
double f(double x, void *params)
Definition: 80211b.c:70
uint8_t m_prefixLength
The length of the prefix.
uint8_t m_flags
The flags field value.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual ~Icmpv6OptionMtu()
Destructor.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual ~Icmpv6RS()
Destructor.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetChecksum(uint16_t checksum)
Set the checksum.
uint32_t GetReserved() const
Get the reserved field.
bool GetFlagM() const
Get the M flag.
uint8_t GetCurHopLimit() const
Get the IPv6 maximum number of jumps.
void SetCode(uint8_t code)
Set the code field.
uint32_t GetReserved() const
Get the reserved field.
ICMPv6 MTU option.
virtual ~Icmpv6OptionRedirected()
Destructor.
virtual ~Icmpv6Redirection()
Destructor.
uint32_t m_ReachableTime
The reachable time value.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
void SetFlagO(bool o)
Set the O flag.
void SetFlagH(bool h)
Set the H flag.
Icmpv6RA()
Constructor.
virtual void Print(std::ostream &os) const
Print information.
virtual ~Icmpv6RA()
Destructor.
void SetReserved(uint32_t reserved)
Set the reserved field.
void SetFlagR(bool r)
Set the R flag.
ICMPv6 Echo message.
bool m_flagO
The M flag.
void SetFlagS(bool s)
Set the S flag.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
void SetFlagM(bool m)
Set the M flag.
void SetFlags(uint8_t flags)
Set the flags.
void SetReachableTime(uint32_t r)
Set the node Reachable time (Neighbor Discovery).
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint32_t m_ptr
The pointer field.
Describes an IPv6 address.
Definition: ipv6-address.h:49
virtual ~Icmpv6Header()
Destructor.
ErrorTimeExceeded_e
ICMPv6 error code : Time Exceeded.
Icmpv6TooBig()
Constructor.
virtual void Print(std::ostream &os) const
Print information.
uint16_t GetReserved() const
Get the reserved field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual ~Icmpv6Echo()
Destructor.
void SetDestination(Ipv6Address destination)
Set the IPv6 destination address.
OptionType_e
ICMPv6 Option type code.
Definition: icmpv6-header.h:77
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual ~Icmpv6TooBig()
Destructor.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint16_t GetChecksum() const
Get the checksum.
virtual void Print(std::ostream &os) const
Print information.
Ipv6Address GetDestination() const
Get the IPv6 destination address.
uint16_t m_LifeTime
The lifetime value.
virtual ~Icmpv6NS()
Destructor.
Ipv6Address GetPrefix() const
Get the IPv6 prefix.
bool GetFlagR() const
Get the R flag.
Ptr< Packet > m_packet
The incorrect packet.
Icmpv6OptionRedirected()
Constructor.
virtual void Print(std::ostream &os) const
Print information.
uint32_t GetPtr() const
Get the pointer field.
Icmpv6Header()
Constructor.
virtual ~Icmpv6DestinationUnreachable()
Destructor.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
static TypeId GetTypeId()
Get the UID of this class.
uint8_t GetType() const
Get the type field.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
uint32_t GetReachableTime() const
Get the node Reachable time (Neighbor Discovery).
uint32_t GetReserved() const
Get the reserved field.
void SetFlags(uint8_t f)
Setflags.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetSeq(uint16_t seq)
Set the sequence number.
bool GetFlagO() const
Get the O flag.
uint32_t m_mtu
The MTU value.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Icmpv6Redirection()
Constructor.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint16_t m_seq
Sequence number (to distinguish response).
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
ICMPv6 Error Too Big header.
a unique identifier for an interface.
Definition: type-id.h:58
Type_e
ICMPv6 type code.
Definition: icmpv6-header.h:44
void SetFlagO(bool o)
Set the O flag.
static TypeId GetTypeId()
Get the UID of this class.
static TypeId GetTypeId()
Get the UID of this class.
void SetPrefix(Ipv6Address prefix)
Set the IPv6 prefix.
bool GetFlagH() const
Get the H flag.
static TypeId GetTypeId()
Get the UID of this class.
uint8_t GetFlags() const
Get the flags.
Ipv6Address m_prefix
The prefix value.
ICMPv6 option header.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
void SetId(uint16_t id)
Set the ID of the packet.
bool m_flagM
The M flag.
uint32_t GetRetransmissionTime() const
Get the node Retransmission time (Neighbor Discovery).
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetMtu(uint32_t mtu)
Set the MTU.
uint16_t GetId() const
Get the ID of the packet.
virtual void Print(std::ostream &os) const
Print information.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.