A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dsr-option-header.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Yufei Cheng
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: Yufei Cheng <yfcheng@ittc.ku.edu>
19  *
20  * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
21  * ResiliNets Research Group http://wiki.ittc.ku.edu/resilinets
22  * Information and Telecommunication Technology Center (ITTC)
23  * and Department of Electrical Engineering and Computer Science
24  * The University of Kansas Lawrence, KS USA.
25  *
26  * Work supported in part by NSF FIND (Future Internet Design) Program
27  * under grant CNS-0626918 (Postmodern Internet Architecture),
28  * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
29  * US Department of Defense (DoD), and ITTC at The University of Kansas.
30  */
31 
32 #ifndef DSR_OPTION_HEADER_H
33 #define DSR_OPTION_HEADER_H
34 
35 #include <ostream>
36 #include <algorithm>
37 
38 #include "ns3/header.h"
39 #include "ns3/ipv4-address.h"
40 #include "ns3/simulator.h"
41 
42 namespace ns3 {
43 
44 class Time;
45 namespace dsr {
50 class DsrOptionHeader : public Header
51 {
52 public:
57  struct Alignment
58  {
59  uint8_t factor;
60  uint8_t offset;
61  };
66  static TypeId GetTypeId ();
71  virtual TypeId GetInstanceTypeId () const;
75  DsrOptionHeader ();
79  virtual ~DsrOptionHeader ();
84  void SetType (uint8_t type);
89  uint8_t GetType () const;
94  void SetLength (uint8_t length);
99  uint8_t GetLength () const;
105  virtual void Print (std::ostream &os) const;
110  virtual uint32_t GetSerializedSize () const;
115  virtual void Serialize (Buffer::Iterator start) const;
121  virtual uint32_t Deserialize (Buffer::Iterator start);
129  virtual Alignment GetAlignment () const;
130 
131 private:
135  uint8_t m_type;
139  uint8_t m_length;
144 };
145 
151 {
152 public:
157  static TypeId GetTypeId ();
162  virtual TypeId GetInstanceTypeId () const;
170  virtual ~DsrOptionPad1Header ();
176  virtual void Print (std::ostream &os) const;
181  virtual uint32_t GetSerializedSize () const;
186  virtual void Serialize (Buffer::Iterator start) const;
192  virtual uint32_t Deserialize (Buffer::Iterator start);
193 };
194 
200 {
201 public:
206  static TypeId GetTypeId ();
211  virtual TypeId GetInstanceTypeId () const;
216  DsrOptionPadnHeader (uint32_t pad = 2);
220  virtual ~DsrOptionPadnHeader ();
226  virtual void Print (std::ostream &os) const;
231  virtual uint32_t GetSerializedSize () const;
236  virtual void Serialize (Buffer::Iterator start) const;
242  virtual uint32_t Deserialize (Buffer::Iterator start);
243 };
244 
273 {
274 public:
279  static TypeId GetTypeId ();
284  virtual TypeId GetInstanceTypeId () const;
292  virtual ~DsrOptionRreqHeader ();
297  void SetNumberAddress (uint8_t n);
307  void SetTarget (Ipv4Address target);
312  void SetNodesAddress (std::vector<Ipv4Address> ipv4Address);
317  std::vector<Ipv4Address> GetNodesAddresses () const;
322  uint32_t GetNodesNumber () const;
327  void AddNodeAddress (Ipv4Address ipv4);
333  void SetNodeAddress (uint8_t index, Ipv4Address addr);
339  Ipv4Address GetNodeAddress (uint8_t index) const;
344  void SetId (uint16_t identification);
349  uint16_t GetId () const;
355  virtual void Print (std::ostream &os) const;
360  virtual uint32_t GetSerializedSize () const;
365  virtual void Serialize (Buffer::Iterator start) const;
371  virtual uint32_t Deserialize (Buffer::Iterator start);
376  virtual Alignment GetAlignment () const;
377 
378 private:
383  /*
384  * Ipv4 address of target node
385  */
387  /*
388  * Ipv4 address to write when desearizing the packet
389  */
394  typedef std::vector<Ipv4Address> VectorIpv4Address_t;
399 };
400 
426 // The Route Reply header modified for ns-3 implementation
449 {
450 public:
455  static TypeId GetTypeId ();
460  virtual TypeId GetInstanceTypeId () const;
468  virtual ~DsrOptionRrepHeader ();
473  void SetNumberAddress (uint8_t n);
478  void SetNodesAddress (std::vector<Ipv4Address> ipv4Address);
483  std::vector<Ipv4Address> GetNodesAddress () const;
484  /*
485  * \brief Get the target node Ip address
486  * \return the target address
487  */
488  Ipv4Address GetTargetAddress (std::vector<Ipv4Address> ipv4Address) const;
494  void SetNodeAddress (uint8_t index, Ipv4Address addr);
500  Ipv4Address GetNodeAddress (uint8_t index) const;
506  virtual void Print (std::ostream &os) const;
511  virtual uint32_t GetSerializedSize () const;
516  virtual void Serialize (Buffer::Iterator start) const;
522  virtual uint32_t Deserialize (Buffer::Iterator start);
527  virtual Alignment GetAlignment () const;
528 
529 private:
530  /*
531  * The Ip address to write to when deserialize the packet
532  */
537  typedef std::vector<Ipv4Address> VectorIpv4Address_t;
542 };
543 
570 {
571 public:
576  static TypeId GetTypeId ();
581  virtual TypeId GetInstanceTypeId () const;
589  virtual ~DsrOptionSRHeader ();
590  /*
591  * \brief Set the number of segments left to send
592  * \param segmentsLeft The segments left
593  */
594  void SetSegmentsLeft (uint8_t segmentsLeft);
595  /*
596  * \brief Get the number of segments left to send
597  * \return The segments left
598  */
599  uint8_t GetSegmentsLeft () const;
604  void SetNumberAddress (uint8_t n);
609  void SetNodesAddress (std::vector<Ipv4Address> ipv4Address);
614  std::vector<Ipv4Address> GetNodesAddress () const;
615  /*
616  * \brief Get the node list size which is the number of ip address of the route
617  * \return the node list size
618  */
619  uint8_t GetNodeListSize () const;
625  void SetNodeAddress (uint8_t index, Ipv4Address addr);
631  Ipv4Address GetNodeAddress (uint8_t index) const;
632  /*
633  * \brief Set the salvage value for a packet
634  * \param salvage The salvage value of the packet
635  */
636  void SetSalvage (uint8_t salvage);
637  /*
638  * \brief Get the salvage value for a packet
639  * \return The salvage value of the packet
640  */
641  uint8_t GetSalvage () const;
647  virtual void Print (std::ostream &os) const;
652  virtual uint32_t GetSerializedSize () const;
657  virtual void Serialize (Buffer::Iterator start) const;
663  virtual uint32_t Deserialize (Buffer::Iterator start);
668  virtual Alignment GetAlignment () const;
669 
670 private:
678  uint8_t m_segmentsLeft;
682  uint8_t m_salvage;
686  typedef std::vector<Ipv4Address> VectorIpv4Address_t;
691 };
692 
718 enum ErrorType
720 {
721  NODE_UNREACHABLE = 1, // !< NODE_UNREACHABLE
722  FLOW_STATE_NOT_SUPPORTED = 2, // !< FLOW_STATE_NOT_SUPPORTED
723  OPTION_NOT_SUPPORTED = 3, // !< OPTION_NOT_SUPPORTED
724 };
725 
727 {
728 public:
733  static TypeId GetTypeId ();
738  virtual TypeId GetInstanceTypeId () const;
746  virtual ~DsrOptionRerrHeader ();
751  void SetErrorType (uint8_t errorType);
756  uint8_t GetErrorType () const;
761  virtual void SetErrorSrc (Ipv4Address errorSrcAddress);
766  virtual Ipv4Address GetErrorSrc () const;
770  virtual void SetSalvage (uint8_t salvage);
775  virtual uint8_t GetSalvage () const;
780  virtual void SetErrorDst (Ipv4Address errorDstAddress);
785  virtual Ipv4Address GetErrorDst () const;
791  virtual void Print (std::ostream &os) const;
796  virtual uint32_t GetSerializedSize () const;
801  virtual void Serialize (Buffer::Iterator start) const;
807  virtual uint32_t Deserialize (Buffer::Iterator start);
812  virtual Alignment GetAlignment () const;
813 
814 private:
818  uint8_t m_errorType;
822  uint8_t m_salvage;
826  uint16_t m_errorLength;
839 };
840 
860 /*
861  * \brief The type-specific info field
862  * \verbatim
863  | 0 | 1 | 2 | 3 |
864  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
865  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
866  | Unreachable Node Address |
867  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
868  \endverbatim
869  */
870 
872 {
873 public:
878  static TypeId GetTypeId ();
883  virtual TypeId GetInstanceTypeId () const;
891  virtual ~DsrOptionRerrUnreachHeader ();
896  virtual void SetErrorSrc (Ipv4Address errorSrcAddress);
901  virtual Ipv4Address GetErrorSrc () const;
905  virtual void SetSalvage (uint8_t salvage);
910  virtual uint8_t GetSalvage () const;
915  virtual void SetErrorDst (Ipv4Address errorDstAddress);
920  virtual Ipv4Address GetErrorDst () const;
925  void SetUnreachNode (Ipv4Address unreachNode);
930  Ipv4Address GetUnreachNode () const;
935  void SetOriginalDst (Ipv4Address originalDst);
940  Ipv4Address GetOriginalDst () const;
946  virtual void Print (std::ostream &os) const;
951  virtual uint32_t GetSerializedSize () const;
956  virtual void Serialize (Buffer::Iterator start) const;
962  virtual uint32_t Deserialize (Buffer::Iterator start);
967  virtual Alignment GetAlignment () const;
968 
969 private:
973  uint8_t m_errorType;
977  uint8_t m_salvage;
994 };
995 
1015 /*
1016  * \brief The type-specific info field
1017  * \unsupported option
1018  * \verbatim
1019  | 0 |
1020  0 1 2 3 4 5 6 7
1021  +-+-+-+-+-+-+-+-+
1022  |Unsupported Opt|
1023  +-+-+-+-+-+-+-+-+
1024  \endverbatim
1025  */
1026 
1028 {
1029 public:
1034  static TypeId GetTypeId ();
1039  virtual TypeId GetInstanceTypeId () const;
1047  virtual ~DsrOptionRerrUnsupportHeader ();
1052  virtual void SetErrorSrc (Ipv4Address errorSrcAddress);
1057  virtual Ipv4Address GetErrorSrc () const;
1062  virtual void SetSalvage (uint8_t salvage);
1067  virtual uint8_t GetSalvage () const;
1072  virtual void SetErrorDst (Ipv4Address errorDstAddress);
1077  virtual Ipv4Address GetErrorDst () const;
1082  void SetUnsupported (uint16_t optionType);
1087  uint16_t GetUnsupported () const;
1093  virtual void Print (std::ostream &os) const;
1098  virtual uint32_t GetSerializedSize () const;
1103  virtual void Serialize (Buffer::Iterator start) const;
1109  virtual uint32_t Deserialize (Buffer::Iterator start);
1114  virtual Alignment GetAlignment () const;
1115 
1116 private:
1120  uint8_t m_errorType;
1124  uint8_t m_salvage;
1136  uint16_t m_unsupport;
1137 };
1138 
1157 {
1158 public:
1163  static TypeId GetTypeId ();
1168  virtual TypeId GetInstanceTypeId () const;
1176  virtual ~DsrOptionAckReqHeader ();
1181  void SetAckId (uint16_t identification);
1186  uint16_t GetAckId () const;
1192  virtual void Print (std::ostream &os) const;
1197  virtual uint32_t GetSerializedSize () const;
1202  virtual void Serialize (Buffer::Iterator start) const;
1208  virtual uint32_t Deserialize (Buffer::Iterator start);
1213  virtual Alignment GetAlignment () const;
1214 
1215 private:
1220 };
1221 
1244 {
1245 public:
1250  static TypeId GetTypeId ();
1255  virtual TypeId GetInstanceTypeId () const;
1259  DsrOptionAckHeader ();
1263  virtual ~DsrOptionAckHeader ();
1268  void SetAckId (uint16_t identification);
1273  uint16_t GetAckId () const;
1278  void SetRealSrc (Ipv4Address realSrcAddress);
1283  Ipv4Address GetRealSrc () const;
1288  void SetRealDst (Ipv4Address realDstAddress);
1293  Ipv4Address GetRealDst () const;
1299  virtual void Print (std::ostream &os) const;
1304  virtual uint32_t GetSerializedSize () const;
1309  virtual void Serialize (Buffer::Iterator start) const;
1315  virtual uint32_t Deserialize (Buffer::Iterator start);
1320  virtual Alignment GetAlignment () const;
1321 
1322 private:
1335 };
1336 
1337 static inline std::ostream & operator<< (std::ostream& os, const DsrOptionSRHeader & sr)
1338 {
1339  sr.Print (os);
1340  return os;
1341 }
1342 
1343 } // namespace dsr
1344 } // namespace ns3
1345 
1346 #endif /* DSR_OPTION_HEADER_H */
Protocol header serialization and deserialization.
Definition: header.h:42
virtual void Print(std::ostream &os) const
Print some informations about the packet.
uint8_t m_errorType
The error type or route error option.
void AddNodeAddress(Ipv4Address ipv4)
Add one node address.
uint16_t GetAckId() const
Set the Ack id number.
virtual void SetErrorSrc(Ipv4Address errorSrcAddress)
Set the route error source address.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
virtual Ipv4Address GetErrorDst() const
Get the error destination ip address.
uint16_t m_unsupport
The unsupported option.
void SetAckId(uint16_t identification)
Set the Ack request id number.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
DsrOptionPadnHeader(uint32_t pad=2)
Constructor.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Ipv4Address GetTarget()
Get the target ipv4 address.
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
virtual Ipv4Address GetErrorSrc() const
Get the route error source address.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
static TypeId GetTypeId()
Get the type identificator.
uint16_t GetId() const
Set the request id number.
std::vector< Ipv4Address > VectorIpv4Address_t
A vector of IPv4 Address.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
automatically resized byte buffer
Definition: buffer.h:92
Doxygen introspection did not find any typical Config paths.
std::vector< Ipv4Address > GetNodesAddresses() const
Get the vector of ipv4 address.
Ipv4Address m_unreachNode
The unreachable node address.
virtual void SetErrorDst(Ipv4Address errorDstAddress)
Set the error destination ip address.
Ipv4Address m_errorDstAddress
The error destination address.
virtual void SetErrorSrc(Ipv4Address errorSrcAddress)
Set the route error source address.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetSegmentsLeft(uint8_t segmentsLeft)
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual ~DsrOptionAckReqHeader()
Destructor.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
std::vector< Ipv4Address > GetNodesAddress() const
Get the vector of ipv4 address.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
void SetUnsupported(uint16_t optionType)
Set the unsupported option type value.
Source Route (SR) Message Format.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
virtual ~DsrOptionPadnHeader()
Destructor.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
uint8_t GetLength() const
Get the option length.
Acknowledgement Request (ACK_RREQ) Message Format.
represents the alignment requirements of an option header
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
Ipv4Address GetUnreachNode() const
Get the unreachable node ip address.
iterator in a Buffer instance
Definition: buffer.h:98
virtual void Print(std::ostream &os) const
Print some informations about the packet.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
static TypeId GetTypeId()
Get the type identificator.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
ErrorType
Route Error (RERR) Message Format.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual void SetSalvage(uint8_t salvage)
Set the salvage value of the packet.
uint16_t m_identification
identification field
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
std::vector< Ipv4Address > GetNodesAddress() const
Get the vector of ipv4 address.
Ipv4Address m_errorDstAddress
The error destination address.
Route Reply (RREP) Message Format.
uint16_t m_identification
Identifier of the packet.
Ipv4Address m_errorSrcAddress
The error source address.
static TypeId GetTypeId()
Get the type identificator.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
static TypeId GetTypeId()
Get the type identificator.
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual void SetErrorSrc(Ipv4Address errorSrcAddress)
Set the route error source address.
virtual void SetErrorDst(Ipv4Address errorDstAddress)
Set the error destination ip address.
virtual void SetErrorDst(Ipv4Address errorDstAddress)
Set the error destination ip address.
uint16_t GetAckId() const
Set the Ack request id number.
uint8_t m_salvage
The salavage field.
Buffer m_data
The anonymous data of this option.
virtual ~DsrOptionRerrUnsupportHeader()
Destructor.
std::vector< Ipv4Address > VectorIpv4Address_t
A vector of IPv4 Address.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual ~DsrOptionSRHeader()
Destructor.
uint32_t GetNodesNumber() const
Get the number of nodes.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint8_t m_salvage
The salavage field.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
Ipv4Address GetOriginalDst() const
Get the unreachable node ip address.
uint16_t GetUnsupported() const
Get the unsupported option type value.
static TypeId GetTypeId()
Get the type identificator.
void SetErrorType(uint8_t errorType)
Set the route error type.
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
uint8_t GetErrorType() const
Get the route error type.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
Ipv4Address GetRealSrc() const
Get Error source ip address.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual ~DsrOptionHeader()
Destructor.
Acknowledgement (ACK) Message Format.
void SetTarget(Ipv4Address target)
Set the target ipv4 address.
void SetRealDst(Ipv4Address realDstAddress)
Set Error source ip address.
static TypeId GetTypeId()
Get the type identificator.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
Route Error (RERR) Unsupported option Message Format.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
Ipv4Address m_realSrcAddress
ack source address
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual Ipv4Address GetErrorSrc() const
Get the route error source address.
uint8_t m_type
The type of the option.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual void SetSalvage(uint8_t salvage)
Set the salvage value of the packet.
Ipv4Address m_address
The ip address header deserilize to.
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Route Request (RREQ) Message Format.
void SetId(uint16_t identification)
Set the request id number.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint8_t m_length
The option length.
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
virtual Ipv4Address GetErrorDst() const
Get the error destination ip address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint16_t m_identification
The identification field.
virtual uint8_t GetSalvage() const
Get the salvage value of the packet.
Ipv4Address GetRealDst() const
Get Error source ip address.
static TypeId GetTypeId()
Get the type identificator.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
void SetUnreachNode(Ipv4Address unreachNode)
Set the unreachable node ip address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint8_t m_salvage
The salavage field.
virtual ~DsrOptionAckHeader()
Destructor.
Ipv4Address m_originalDst
The original destination address.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual Ipv4Address GetErrorDst() const
Get the error destination ip address.
virtual ~DsrOptionRerrUnreachHeader()
Destructor.
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
static TypeId GetTypeId()
Get the type identificator.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
static TypeId GetTypeId()
Get the type identificator.
virtual uint8_t GetSalvage() const
Get the salvage value of the packet.
uint8_t m_errorType
The error type or route error option.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
Doxygen introspection did not find any typical Config paths.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Route Error (RERR) Unreachable node address option Message Format.
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
void SetRealSrc(Ipv4Address realSrcAddress)
Set Error source ip address.
void SetType(uint8_t type)
Set the type of the option.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Doxygen introspection did not find any typical Config paths.
virtual ~DsrOptionRerrHeader()
Destructor.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint8_t m_errorType
The error type or route error option.
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
Ipv4Address m_realDstAddress
ack destination address
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ipv4Address GetTargetAddress(std::vector< Ipv4Address > ipv4Address) const
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
virtual ~DsrOptionRreqHeader()
Destructor.
virtual uint32_t GetSerializedSize() const
Get the serialized size of the packet.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
Ipv4Address m_errorDstAddress
The error destination address.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
virtual ~DsrOptionRrepHeader()
Destructor.
static std::ostream & operator<<(std::ostream &os, const DsrRoutingHeader &dsr)
virtual Ipv4Address GetErrorSrc() const
Get the route error source address.
uint8_t m_segmentsLeft
Number of left segments.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
virtual ~DsrOptionPad1Header()
Destructor.
virtual void Print(std::ostream &os) const
Print some informations about the packet.
void SetAckId(uint16_t identification)
Set the Ack id number.
void SetLength(uint8_t length)
Set the option length.
Ipv4Address m_errorSrcAddress
The error source address.
virtual uint8_t GetSalvage() const
Get the salvage value of the packet.
Buffer m_errorData
The anonymous data of this option.
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint8_t GetType() const
Get the type of the option.
a unique identifier for an interface.
Definition: type-id.h:49
uint16_t m_errorLength
The specific error message length.
void SetSalvage(uint8_t salvage)
Ipv4Address m_errorSrcAddress
The error source address.
Doxygen introspection did not find any typical Config paths.
void SetOriginalDst(Ipv4Address originalDst)
Set the unreachable node ip address.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
std::vector< Ipv4Address > VectorIpv4Address_t
type def A vector of IPv4 Address.
static TypeId GetTypeId()
Get the type identificator.
virtual void SetSalvage(uint8_t salvage)
Set the salvage value of the packet.
static TypeId GetTypeId()
Get the type identificator.
uint8_t m_salvage
Number of savlage times for a packet.