A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
dsr-option-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Yufei Cheng
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: Yufei Cheng <yfcheng@ittc.ku.edu>
18 *
19 * James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
20 * ResiliNets Research Group https://resilinets.org/
21 * Information and Telecommunication Technology Center (ITTC)
22 * and Department of Electrical Engineering and Computer Science
23 * The University of Kansas Lawrence, KS USA.
24 *
25 * Work supported in part by NSF FIND (Future Internet Design) Program
26 * under grant CNS-0626918 (Postmodern Internet Architecture),
27 * NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
28 * US Department of Defense (DoD), and ITTC at The University of Kansas.
29 */
30
31#ifndef DSR_OPTION_HEADER_H
32#define DSR_OPTION_HEADER_H
33
34#include "ns3/header.h"
35#include "ns3/ipv4-address.h"
36#include "ns3/simulator.h"
37
38#include <algorithm>
39#include <ostream>
40
41namespace ns3
42{
43
44class Time;
45
46namespace dsr
47{
52class DsrOptionHeader : public Header
53{
54 public:
59 struct Alignment
60 {
61 uint8_t factor;
62 uint8_t offset;
63 };
64
69 static TypeId GetTypeId();
74 TypeId GetInstanceTypeId() const override;
82 ~DsrOptionHeader() override;
87 void SetType(uint8_t type);
92 uint8_t GetType() const;
97 void SetLength(uint8_t length);
102 uint8_t GetLength() const;
107 void Print(std::ostream& os) const override;
112 uint32_t GetSerializedSize() const override;
117 void Serialize(Buffer::Iterator start) const override;
123 uint32_t Deserialize(Buffer::Iterator start) override;
131 virtual Alignment GetAlignment() const;
132
133 private:
137 uint8_t m_type;
141 uint8_t m_length;
146};
147
153{
154 public:
159 static TypeId GetTypeId();
164 TypeId GetInstanceTypeId() const override;
172 ~DsrOptionPad1Header() override;
177 void Print(std::ostream& os) const override;
182 uint32_t GetSerializedSize() const override;
187 void Serialize(Buffer::Iterator start) const override;
193 uint32_t Deserialize(Buffer::Iterator start) override;
194};
195
201{
202 public:
207 static TypeId GetTypeId();
212 TypeId GetInstanceTypeId() const override;
221 ~DsrOptionPadnHeader() override;
226 void Print(std::ostream& os) const override;
231 uint32_t GetSerializedSize() const override;
236 void Serialize(Buffer::Iterator start) const override;
242 uint32_t Deserialize(Buffer::Iterator start) override;
243};
244
273{
274 public:
279 static TypeId GetTypeId();
284 TypeId GetInstanceTypeId() const override;
292 ~DsrOptionRreqHeader() override;
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;
354 void Print(std::ostream& os) const override;
359 uint32_t GetSerializedSize() const override;
364 void Serialize(Buffer::Iterator start) const override;
370 uint32_t Deserialize(Buffer::Iterator start) override;
375 Alignment GetAlignment() const override;
376
377 private:
393 typedef std::vector<Ipv4Address> VectorIpv4Address_t;
398};
399
425// The Route Reply header modified for ns-3 implementation
447{
448 public:
453 static TypeId GetTypeId();
458 TypeId GetInstanceTypeId() const override;
466 ~DsrOptionRrepHeader() override;
471 void SetNumberAddress(uint8_t n);
476 void SetNodesAddress(std::vector<Ipv4Address> ipv4Address);
481 std::vector<Ipv4Address> GetNodesAddress() const;
487 Ipv4Address GetTargetAddress(std::vector<Ipv4Address> ipv4Address) const;
493 void SetNodeAddress(uint8_t index, Ipv4Address addr);
499 Ipv4Address GetNodeAddress(uint8_t index) const;
504 void Print(std::ostream& os) const override;
509 uint32_t GetSerializedSize() const override;
514 void Serialize(Buffer::Iterator start) const override;
520 uint32_t Deserialize(Buffer::Iterator start) override;
525 Alignment GetAlignment() const override;
526
527 private:
535 typedef std::vector<Ipv4Address> VectorIpv4Address_t;
540};
541
568{
569 public:
574 static TypeId GetTypeId();
579 TypeId GetInstanceTypeId() const override;
587 ~DsrOptionSRHeader() override;
592 void SetSegmentsLeft(uint8_t segmentsLeft);
597 uint8_t GetSegmentsLeft() const;
602 void SetNumberAddress(uint8_t n);
607 void SetNodesAddress(std::vector<Ipv4Address> ipv4Address);
612 std::vector<Ipv4Address> GetNodesAddress() const;
617 uint8_t GetNodeListSize() const;
623 void SetNodeAddress(uint8_t index, Ipv4Address addr);
629 Ipv4Address GetNodeAddress(uint8_t index) const;
634 void SetSalvage(uint8_t salvage);
639 uint8_t GetSalvage() const;
644 void Print(std::ostream& os) const override;
649 uint32_t GetSerializedSize() const override;
654 void Serialize(Buffer::Iterator start) const override;
660 uint32_t Deserialize(Buffer::Iterator start) override;
665 Alignment GetAlignment() const override;
666
672 typedef void (*TracedCallback)(const DsrOptionSRHeader& header);
673
674 private:
686 uint8_t m_salvage;
690 typedef std::vector<Ipv4Address> VectorIpv4Address_t;
695};
696
724{
725 NODE_UNREACHABLE = 1, // !< NODE_UNREACHABLE
726 FLOW_STATE_NOT_SUPPORTED = 2, // !< FLOW_STATE_NOT_SUPPORTED
727 OPTION_NOT_SUPPORTED = 3, // !< OPTION_NOT_SUPPORTED
728};
729
731{
732 public:
737 static TypeId GetTypeId();
742 TypeId GetInstanceTypeId() const override;
750 ~DsrOptionRerrHeader() override;
755 void SetErrorType(uint8_t errorType);
760 uint8_t GetErrorType() const;
765 virtual void SetErrorSrc(Ipv4Address errorSrcAddress);
770 virtual Ipv4Address GetErrorSrc() const;
775 virtual void SetSalvage(uint8_t salvage);
780 virtual uint8_t GetSalvage() const;
785 virtual void SetErrorDst(Ipv4Address errorDstAddress);
790 virtual Ipv4Address GetErrorDst() const;
795 void Print(std::ostream& os) const override;
800 uint32_t GetSerializedSize() const override;
805 void Serialize(Buffer::Iterator start) const override;
811 uint32_t Deserialize(Buffer::Iterator start) override;
816 Alignment GetAlignment() const override;
817
818 private:
822 uint8_t m_errorType;
826 uint8_t m_salvage;
843};
844
864/*
865 * \brief The type-specific info field
866 * \verbatim
867 | 0 | 1 | 2 | 3 |
868 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
869 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
870 | Unreachable Node Address |
871 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
872 \endverbatim
873 */
874
876{
877 public:
882 static TypeId GetTypeId();
887 TypeId GetInstanceTypeId() const override;
900 void SetErrorSrc(Ipv4Address errorSrcAddress) override;
905 Ipv4Address GetErrorSrc() const override;
910 void SetSalvage(uint8_t salvage) override;
915 uint8_t GetSalvage() const override;
920 void SetErrorDst(Ipv4Address errorDstAddress) override;
925 Ipv4Address GetErrorDst() const override;
930 void SetUnreachNode(Ipv4Address unreachNode);
940 void SetOriginalDst(Ipv4Address originalDst);
950 void Print(std::ostream& os) const override;
955 uint32_t GetSerializedSize() const override;
960 void Serialize(Buffer::Iterator start) const override;
966 uint32_t Deserialize(Buffer::Iterator start) override;
971 Alignment GetAlignment() const override;
972
973 private:
977 uint8_t m_errorType;
981 uint8_t m_salvage;
998};
999
1019/*
1020 * \brief The type-specific info field
1021 * \unsupported option
1022 * \verbatim
1023 | 0 |
1024 0 1 2 3 4 5 6 7
1025 +-+-+-+-+-+-+-+-+
1026 |Unsupported Opt|
1027 +-+-+-+-+-+-+-+-+
1028 \endverbatim
1029 */
1030
1032{
1033 public:
1038 static TypeId GetTypeId();
1043 TypeId GetInstanceTypeId() const override;
1056 void SetErrorSrc(Ipv4Address errorSrcAddress) override;
1061 Ipv4Address GetErrorSrc() const override;
1066 void SetSalvage(uint8_t salvage) override;
1071 uint8_t GetSalvage() const override;
1076 void SetErrorDst(Ipv4Address errorDstAddress) override;
1081 Ipv4Address GetErrorDst() const override;
1086 void SetUnsupported(uint16_t optionType);
1091 uint16_t GetUnsupported() const;
1096 void Print(std::ostream& os) const override;
1101 uint32_t GetSerializedSize() const override;
1106 void Serialize(Buffer::Iterator start) const override;
1112 uint32_t Deserialize(Buffer::Iterator start) override;
1117 Alignment GetAlignment() const override;
1118
1119 private:
1127 uint8_t m_salvage;
1140};
1141
1160{
1161 public:
1166 static TypeId GetTypeId();
1171 TypeId GetInstanceTypeId() const override;
1179 ~DsrOptionAckReqHeader() override;
1184 void SetAckId(uint16_t identification);
1189 uint16_t GetAckId() const;
1194 void Print(std::ostream& os) const override;
1199 uint32_t GetSerializedSize() const override;
1204 void Serialize(Buffer::Iterator start) const override;
1210 uint32_t Deserialize(Buffer::Iterator start) override;
1215 Alignment GetAlignment() const override;
1216
1217 private:
1222};
1223
1246{
1247 public:
1252 static TypeId GetTypeId();
1257 TypeId GetInstanceTypeId() const override;
1265 ~DsrOptionAckHeader() override;
1270 void SetAckId(uint16_t identification);
1275 uint16_t GetAckId() const;
1280 void SetRealSrc(Ipv4Address realSrcAddress);
1285 Ipv4Address GetRealSrc() const;
1290 void SetRealDst(Ipv4Address realDstAddress);
1295 Ipv4Address GetRealDst() const;
1300 void Print(std::ostream& os) const override;
1305 uint32_t GetSerializedSize() const override;
1310 void Serialize(Buffer::Iterator start) const override;
1316 uint32_t Deserialize(Buffer::Iterator start) override;
1321 Alignment GetAlignment() const override;
1322
1323 private:
1336};
1337
1338[[maybe_unused]] static inline std::ostream&
1339operator<<(std::ostream& os, const DsrOptionSRHeader& sr)
1340{
1341 sr.Print(os);
1342 return os;
1343}
1344
1345} // namespace dsr
1346} // namespace ns3
1347
1348#endif /* DSR_OPTION_HEADER_H */
iterator in a Buffer instance
Definition: buffer.h:100
automatically resized byte buffer
Definition: buffer.h:94
Protocol header serialization and deserialization.
Definition: header.h:44
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Acknowledgement (ACK) Message Format.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetAckId(uint16_t identification)
Set the Ack id number.
uint16_t GetAckId() const
Set the Ack id number.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint16_t m_identification
identification field
static TypeId GetTypeId()
Get the type identificator.
void SetRealSrc(Ipv4Address realSrcAddress)
Set Error source ip address.
void SetRealDst(Ipv4Address realDstAddress)
Set Error source ip address.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Ipv4Address m_realDstAddress
ack destination address
Ipv4Address GetRealDst() const
Get Error source ip address.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
void Print(std::ostream &os) const override
Print some information about the packet.
Ipv4Address m_realSrcAddress
ack source address
Ipv4Address GetRealSrc() const
Get Error source ip address.
~DsrOptionAckHeader() override
Destructor.
Acknowledgement Request (ACK_RREQ) Message Format.
~DsrOptionAckReqHeader() override
Destructor.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void Print(std::ostream &os) const override
Print some information about the packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
void SetAckId(uint16_t identification)
Set the Ack request id number.
uint16_t m_identification
The identification field.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
uint16_t GetAckId() const
Set the Ack request id number.
static TypeId GetTypeId()
Get the type identificator.
Header for Dsr Options.
virtual Alignment GetAlignment() const
Get the Alignment requirement of this option header.
static TypeId GetTypeId()
Get the type identificator.
Buffer m_data
The anonymous data of this option.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint8_t GetType() const
Get the type of the option.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
~DsrOptionHeader() override
Destructor.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Print(std::ostream &os) const override
Print some information about the packet.
void SetType(uint8_t type)
Set the type of the option.
uint8_t m_length
The option length.
uint8_t m_type
The type of the option.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
void SetLength(uint8_t length)
Set the option length.
uint8_t GetLength() const
Get the option length.
Header of Dsr Option Pad1.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
~DsrOptionPad1Header() override
Destructor.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void Print(std::ostream &os) const override
Print some information about the packet.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
static TypeId GetTypeId()
Get the type identificator.
Header of Dsr Option Padn.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Print(std::ostream &os) const override
Print some information about the packet.
static TypeId GetTypeId()
Get the type identificator.
~DsrOptionPadnHeader() override
Destructor.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Header of Dsr Option Route Error.
uint8_t GetErrorType() const
Get the route error type.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Buffer m_errorData
The anonymous data of this option.
virtual void SetSalvage(uint8_t salvage)
Set the salvage value of the packet.
virtual Ipv4Address GetErrorSrc() const
Get the route error source address.
void SetErrorType(uint8_t errorType)
Set the route error type.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Ipv4Address m_errorSrcAddress
The error source address.
static TypeId GetTypeId()
Get the type identificator.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint8_t m_salvage
The salavage field.
~DsrOptionRerrHeader() override
Destructor.
virtual void SetErrorDst(Ipv4Address errorDstAddress)
Set the error destination ip address.
virtual Ipv4Address GetErrorDst() const
Get the error destination ip address.
Ipv4Address m_errorDstAddress
The error destination address.
uint16_t m_errorLength
The specific error message length.
uint8_t m_errorType
The error type or route error option.
virtual uint8_t GetSalvage() const
Get the salvage value of the packet.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
void Print(std::ostream &os) const override
Print some information about the packet.
virtual void SetErrorSrc(Ipv4Address errorSrcAddress)
Set the route error source address.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Route Error (RERR) Unreachable node address option Message Format.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void SetOriginalDst(Ipv4Address originalDst)
Set the unreachable node ip address.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Ipv4Address GetErrorSrc() const override
Get the route error source address.
static TypeId GetTypeId()
Get the type identificator.
void SetErrorDst(Ipv4Address errorDstAddress) override
Set the error destination ip address.
void SetErrorSrc(Ipv4Address errorSrcAddress) override
Set the route error source address.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
uint8_t GetSalvage() const override
Get the salvage value of the packet.
Ipv4Address m_unreachNode
The unreachable node address.
Ipv4Address GetOriginalDst() const
Get the unreachable node ip address.
~DsrOptionRerrUnreachHeader() override
Destructor.
void SetUnreachNode(Ipv4Address unreachNode)
Set the unreachable node ip address.
void SetSalvage(uint8_t salvage) override
Set the salvage value of the packet.
uint8_t m_errorType
The error type or route error option.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
void Print(std::ostream &os) const override
Print some information about the packet.
Ipv4Address m_errorSrcAddress
The error source address.
uint8_t m_salvage
The salavage field.
Ipv4Address m_originalDst
The original destination address.
Ipv4Address m_errorDstAddress
The error destination address.
Ipv4Address GetUnreachNode() const
Get the unreachable node ip address.
Ipv4Address GetErrorDst() const override
Get the error destination ip address.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
Route Error (RERR) Unsupported option Message Format.
Ipv4Address GetErrorDst() const override
Get the error destination ip address.
void SetErrorSrc(Ipv4Address errorSrcAddress) override
Set the route error source address.
uint16_t GetUnsupported() const
Get the unsupported option type value.
static TypeId GetTypeId()
Get the type identificator.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint8_t m_errorType
The error type or route error option.
void SetSalvage(uint8_t salvage) override
Set the salvage value of the packet.
Ipv4Address m_errorDstAddress
The error destination address.
void SetUnsupported(uint16_t optionType)
Set the unsupported option type value.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
void SetErrorDst(Ipv4Address errorDstAddress) override
Set the error destination ip address.
Ipv4Address m_errorSrcAddress
The error source address.
void Print(std::ostream &os) const override
Print some information about the packet.
uint16_t m_unsupported
The unsupported option.
Ipv4Address GetErrorSrc() const override
Get the route error source address.
uint8_t GetSalvage() const override
Get the salvage value of the packet.
Route Reply (RREP) Message Format.
Ipv4Address GetTargetAddress(std::vector< Ipv4Address > ipv4Address) const
Get the target node Ip address.
Ipv4Address m_address
The Ip address to write to when deserialize the packet.
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
std::vector< Ipv4Address > GetNodesAddress() const
Get the vector of ipv4 address.
~DsrOptionRrepHeader() override
Destructor.
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
std::vector< Ipv4Address > VectorIpv4Address_t
type def A vector of IPv4 Address.
static TypeId GetTypeId()
Get the type identificator.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
void Print(std::ostream &os) const override
Print some information about the packet.
Route Request (RREQ) Message Format.
static TypeId GetTypeId()
Get the type identificator.
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
Ipv4Address m_target
Ipv4 address of target node.
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
Ipv4Address m_address
Ipv4 address to write when desearizing the packet.
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
~DsrOptionRreqHeader() override
Destructor.
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
std::vector< Ipv4Address > VectorIpv4Address_t
A vector of IPv4 Address.
uint16_t m_identification
Identifier of the packet.
void SetTarget(Ipv4Address target)
Set the target ipv4 address.
Ipv4Address GetTarget()
Get the target ipv4 address.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
std::vector< Ipv4Address > GetNodesAddresses() const
Get the vector of ipv4 address.
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
void Print(std::ostream &os) const override
Print some information about the packet.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint32_t GetNodesNumber() const
Get the number of nodes.
void AddNodeAddress(Ipv4Address ipv4)
Add one node address.
uint16_t GetId() const
Set the request id number.
void SetId(uint16_t identification)
Set the request id number.
Source Route (SR) Message Format.
Ipv4Address GetNodeAddress(uint8_t index) const
Get a Node IPv4 Address.
uint8_t m_segmentsLeft
Number of left segments.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
std::vector< Ipv4Address > GetNodesAddress() const
Get the vector of ipv4 address.
Ipv4Address m_address
The ip address header deserilize to.
void SetNumberAddress(uint8_t n)
Set the number of ipv4 address.
static TypeId GetTypeId()
Get the type identificator.
void SetSalvage(uint8_t salvage)
Set the salvage value for a packet.
void Print(std::ostream &os) const override
Print some information about the packet.
VectorIpv4Address_t m_ipv4Address
The vector of Nodes' IPv4 Address.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
void SetNodeAddress(uint8_t index, Ipv4Address addr)
Set a Node IPv4 Address.
void SetSegmentsLeft(uint8_t segmentsLeft)
Set the number of segments left to send.
std::vector< Ipv4Address > VectorIpv4Address_t
A vector of IPv4 Address.
uint8_t GetSalvage() const
Get the salvage value for a packet.
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the packet.
uint8_t GetNodeListSize() const
Get the node list size which is the number of ip address of the route.
uint8_t m_salvage
Number of savlage times for a packet.
Alignment GetAlignment() const override
Get the Alignment requirement of this option header.
void SetNodesAddress(std::vector< Ipv4Address > ipv4Address)
Set the vector of ipv4 address.
uint8_t GetSegmentsLeft() const
Get the number of segments left to send.
TypeId GetInstanceTypeId() const override
Get the instance type ID.
~DsrOptionSRHeader() override
Destructor.
ErrorType
Route Error (RERR) Message Format.
@ FLOW_STATE_NOT_SUPPORTED
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:848
static std::ostream & operator<<(std::ostream &os, const DsrRoutingHeader &dsr)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
represents the alignment requirements of an option header