A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
olsr-header.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INESC Porto
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: Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
18
*/
19
20
#ifndef OLSR_HEADER_H
21
#define OLSR_HEADER_H
22
23
#include "
olsr-repositories.h
"
24
25
#include "ns3/header.h"
26
#include "ns3/ipv4-address.h"
27
#include "ns3/nstime.h"
28
29
#include <stdint.h>
30
#include <vector>
31
32
namespace
ns3
33
{
34
namespace
olsr
35
{
36
37
double
EmfToSeconds
(uint8_t emf);
38
uint8_t
SecondsToEmf
(
double
seconds);
39
78
class
PacketHeader
:
public
Header
79
{
80
public
:
81
PacketHeader
();
82
~PacketHeader
()
override
;
83
88
void
SetPacketLength
(uint16_t length)
89
{
90
m_packetLength
= length;
91
}
92
97
uint16_t
GetPacketLength
()
const
98
{
99
return
m_packetLength
;
100
}
101
106
void
SetPacketSequenceNumber
(uint16_t seqnum)
107
{
108
m_packetSequenceNumber
= seqnum;
109
}
110
115
uint16_t
GetPacketSequenceNumber
()
const
116
{
117
return
m_packetSequenceNumber
;
118
}
119
120
private
:
121
uint16_t
m_packetLength
;
122
uint16_t
m_packetSequenceNumber
;
123
124
public
:
129
static
TypeId
GetTypeId
();
130
TypeId
GetInstanceTypeId
()
const override
;
131
void
Print
(std::ostream& os)
const override
;
132
uint32_t
GetSerializedSize
()
const override
;
133
void
Serialize
(
Buffer::Iterator
start
)
const override
;
134
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
135
};
136
160
class
MessageHeader
:
public
Header
161
{
162
public
:
166
enum
MessageType
167
{
168
HELLO_MESSAGE
= 1,
169
TC_MESSAGE
= 2,
170
MID_MESSAGE
= 3,
171
HNA_MESSAGE
= 4,
172
};
173
174
MessageHeader
();
175
~MessageHeader
()
override
;
176
181
void
SetMessageType
(
MessageType
messageType)
182
{
183
m_messageType
= messageType;
184
}
185
190
MessageType
GetMessageType
()
const
191
{
192
return
m_messageType
;
193
}
194
199
void
SetVTime
(
Time
time)
200
{
201
m_vTime
=
SecondsToEmf
(time.
GetSeconds
());
202
}
203
208
Time
GetVTime
()
const
209
{
210
return
Seconds
(
EmfToSeconds
(
m_vTime
));
211
}
212
217
void
SetOriginatorAddress
(
Ipv4Address
originatorAddress)
218
{
219
m_originatorAddress
= originatorAddress;
220
}
221
226
Ipv4Address
GetOriginatorAddress
()
const
227
{
228
return
m_originatorAddress
;
229
}
230
235
void
SetTimeToLive
(uint8_t timeToLive)
236
{
237
m_timeToLive
= timeToLive;
238
}
239
244
uint8_t
GetTimeToLive
()
const
245
{
246
return
m_timeToLive
;
247
}
248
253
void
SetHopCount
(uint8_t hopCount)
254
{
255
m_hopCount
= hopCount;
256
}
257
262
uint8_t
GetHopCount
()
const
263
{
264
return
m_hopCount
;
265
}
266
271
void
SetMessageSequenceNumber
(uint16_t messageSequenceNumber)
272
{
273
m_messageSequenceNumber
= messageSequenceNumber;
274
}
275
280
uint16_t
GetMessageSequenceNumber
()
const
281
{
282
return
m_messageSequenceNumber
;
283
}
284
285
private
:
286
MessageType
m_messageType
;
287
uint8_t
m_vTime
;
288
Ipv4Address
m_originatorAddress
;
289
uint8_t
m_timeToLive
;
290
uint8_t
m_hopCount
;
291
uint16_t
m_messageSequenceNumber
;
292
uint16_t
m_messageSize
;
293
294
public
:
299
static
TypeId
GetTypeId
();
300
TypeId
GetInstanceTypeId
()
const override
;
301
void
Print
(std::ostream& os)
const override
;
302
uint32_t
GetSerializedSize
()
const override
;
303
void
Serialize
(
Buffer::Iterator
start
)
const override
;
304
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
305
322
struct
Mid
323
{
324
std::vector<Ipv4Address>
interfaceAddresses
;
329
void
Print
(std::ostream& os)
const
;
334
uint32_t
GetSerializedSize
()
const
;
342
void
Serialize
(
Buffer::Iterator
start
)
const
;
352
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
353
};
354
385
struct
Hello
386
{
390
struct
LinkMessage
391
{
392
uint8_t
linkCode
;
393
std::vector<Ipv4Address>
394
neighborInterfaceAddresses
;
395
};
396
397
uint8_t
hTime
;
398
403
void
SetHTime
(
Time
time)
404
{
405
this->hTime =
SecondsToEmf
(time.
GetSeconds
());
406
}
407
412
Time
GetHTime
()
const
413
{
414
return
Seconds
(
EmfToSeconds
(this->hTime));
415
}
416
417
Willingness
willingness
;
419
std::vector<LinkMessage>
linkMessages
;
420
425
void
Print
(std::ostream& os)
const
;
430
uint32_t
GetSerializedSize
()
const
;
438
void
Serialize
(
Buffer::Iterator
start
)
const
;
448
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
449
};
450
469
struct
Tc
470
{
471
std::vector<Ipv4Address>
neighborAddresses
;
472
uint16_t
ansn
;
473
478
void
Print
(std::ostream& os)
const
;
483
uint32_t
GetSerializedSize
()
const
;
491
void
Serialize
(
Buffer::Iterator
start
)
const
;
501
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
502
};
503
524
struct
Hna
525
{
529
struct
Association
530
{
531
Ipv4Address
address
;
532
Ipv4Mask
mask
;
533
};
534
535
std::vector<Association>
associations
;
536
541
void
Print
(std::ostream& os)
const
;
546
uint32_t
GetSerializedSize
()
const
;
554
void
Serialize
(
Buffer::Iterator
start
)
const
;
564
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
565
};
566
567
private
:
571
struct
572
{
573
Mid
mid
;
574
Hello
hello
;
575
Tc
tc
;
576
Hna
hna
;
577
}
m_message
;
578
579
public
:
584
Mid
&
GetMid
()
585
{
586
if
(
m_messageType
== 0)
587
{
588
m_messageType
=
MID_MESSAGE
;
589
}
590
else
591
{
592
NS_ASSERT
(
m_messageType
==
MID_MESSAGE
);
593
}
594
return
m_message
.mid;
595
}
596
601
Hello
&
GetHello
()
602
{
603
if
(
m_messageType
== 0)
604
{
605
m_messageType
=
HELLO_MESSAGE
;
606
}
607
else
608
{
609
NS_ASSERT
(
m_messageType
==
HELLO_MESSAGE
);
610
}
611
return
m_message
.hello;
612
}
613
618
Tc
&
GetTc
()
619
{
620
if
(
m_messageType
== 0)
621
{
622
m_messageType
=
TC_MESSAGE
;
623
}
624
else
625
{
626
NS_ASSERT
(
m_messageType
==
TC_MESSAGE
);
627
}
628
return
m_message
.tc;
629
}
630
635
Hna
&
GetHna
()
636
{
637
if
(
m_messageType
== 0)
638
{
639
m_messageType
=
HNA_MESSAGE
;
640
}
641
else
642
{
643
NS_ASSERT
(
m_messageType
==
HNA_MESSAGE
);
644
}
645
return
m_message
.hna;
646
}
647
652
const
Mid
&
GetMid
()
const
653
{
654
NS_ASSERT
(
m_messageType
==
MID_MESSAGE
);
655
return
m_message
.mid;
656
}
657
662
const
Hello
&
GetHello
()
const
663
{
664
NS_ASSERT
(
m_messageType
==
HELLO_MESSAGE
);
665
return
m_message
.hello;
666
}
667
672
const
Tc
&
GetTc
()
const
673
{
674
NS_ASSERT
(
m_messageType
==
TC_MESSAGE
);
675
return
m_message
.tc;
676
}
677
682
const
Hna
&
GetHna
()
const
683
{
684
NS_ASSERT
(
m_messageType
==
HNA_MESSAGE
);
685
return
m_message
.hna;
686
}
687
};
688
689
inline
std::ostream&
690
operator<<
(std::ostream& os,
const
PacketHeader
& packet)
691
{
692
packet.
Print
(os);
693
return
os;
694
}
695
696
inline
std::ostream&
697
operator<<
(std::ostream& os,
const
MessageHeader
& message)
698
{
699
message.
Print
(os);
700
return
os;
701
}
702
703
typedef
std::vector<MessageHeader>
MessageList
;
704
705
inline
std::ostream&
706
operator<<
(std::ostream& os,
const
MessageList
& messages)
707
{
708
os <<
"["
;
709
for
(
auto
messageIter = messages.begin(); messageIter != messages.end(); messageIter++)
710
{
711
messageIter->Print(os);
712
if
(messageIter + 1 != messages.end())
713
{
714
os <<
", "
;
715
}
716
}
717
os <<
"]"
;
718
return
os;
719
}
720
721
}
// namespace olsr
722
}
// namespace ns3
723
724
#endif
/* OLSR_HEADER_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:44
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::Ipv4Mask
a class to represent an Ipv4 address mask
Definition:
ipv4-address.h:257
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::Time::GetSeconds
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition:
nstime.h:403
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::olsr::MessageHeader
This header can store HELP, TC, MID and HNA messages.
Definition:
olsr-header.h:161
ns3::olsr::MessageHeader::mid
Mid mid
MID message (optional).
Definition:
olsr-header.h:573
ns3::olsr::MessageHeader::~MessageHeader
~MessageHeader() override
Definition:
olsr-header.cc:166
ns3::olsr::MessageHeader::SetOriginatorAddress
void SetOriginatorAddress(Ipv4Address originatorAddress)
Set the originator address.
Definition:
olsr-header.h:217
ns3::olsr::MessageHeader::GetOriginatorAddress
Ipv4Address GetOriginatorAddress() const
Get the originator address.
Definition:
olsr-header.h:226
ns3::olsr::MessageHeader::SetHopCount
void SetHopCount(uint8_t hopCount)
Set the hop count.
Definition:
olsr-header.h:253
ns3::olsr::MessageHeader::Print
void Print(std::ostream &os) const override
Definition:
olsr-header.cc:213
ns3::olsr::MessageHeader::m_messageType
MessageType m_messageType
The message type.
Definition:
olsr-header.h:286
ns3::olsr::MessageHeader::GetHello
Hello & GetHello()
Set the message type to HELLO and return the message content.
Definition:
olsr-header.h:601
ns3::olsr::MessageHeader::GetTimeToLive
uint8_t GetTimeToLive() const
Get the time to live.
Definition:
olsr-header.h:244
ns3::olsr::MessageHeader::GetTc
Tc & GetTc()
Set the message type to TC and return the message content.
Definition:
olsr-header.h:618
ns3::olsr::MessageHeader::GetHna
const Hna & GetHna() const
Get the HNA message.
Definition:
olsr-header.h:682
ns3::olsr::MessageHeader::m_hopCount
uint8_t m_hopCount
The hop count.
Definition:
olsr-header.h:290
ns3::olsr::MessageHeader::hello
Hello hello
HELLO message (optional).
Definition:
olsr-header.h:574
ns3::olsr::MessageHeader::m_originatorAddress
Ipv4Address m_originatorAddress
The originator address.
Definition:
olsr-header.h:288
ns3::olsr::MessageHeader::hna
Hna hna
HNA message (optional).
Definition:
olsr-header.h:576
ns3::olsr::MessageHeader::m_vTime
uint8_t m_vTime
The validity time.
Definition:
olsr-header.h:287
ns3::olsr::MessageHeader::SetMessageSequenceNumber
void SetMessageSequenceNumber(uint16_t messageSequenceNumber)
Set the message sequence number.
Definition:
olsr-header.h:271
ns3::olsr::MessageHeader::m_timeToLive
uint8_t m_timeToLive
The time to live.
Definition:
olsr-header.h:289
ns3::olsr::MessageHeader::tc
Tc tc
TC message (optional).
Definition:
olsr-header.h:575
ns3::olsr::MessageHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
olsr-header.cc:181
ns3::olsr::MessageHeader::SetMessageType
void SetMessageType(MessageType messageType)
Set the message type.
Definition:
olsr-header.h:181
ns3::olsr::MessageHeader::GetHopCount
uint8_t GetHopCount() const
Get the hop count.
Definition:
olsr-header.h:262
ns3::olsr::MessageHeader::GetHello
const Hello & GetHello() const
Get the HELLO message.
Definition:
olsr-header.h:662
ns3::olsr::MessageHeader::MessageHeader
MessageHeader()
Definition:
olsr-header.cc:161
ns3::olsr::MessageHeader::GetTc
const Tc & GetTc() const
Get the TC message.
Definition:
olsr-header.h:672
ns3::olsr::MessageHeader::GetMessageType
MessageType GetMessageType() const
Get the message type.
Definition:
olsr-header.h:190
ns3::olsr::MessageHeader::GetVTime
Time GetVTime() const
Get the validity time.
Definition:
olsr-header.h:208
ns3::olsr::MessageHeader::GetMid
const Mid & GetMid() const
Get the MID message.
Definition:
olsr-header.h:652
ns3::olsr::MessageHeader::SetTimeToLive
void SetTimeToLive(uint8_t timeToLive)
Set the time to live.
Definition:
olsr-header.h:235
ns3::olsr::MessageHeader::GetHna
Hna & GetHna()
Set the message type to HNA and return the message content.
Definition:
olsr-header.h:635
ns3::olsr::MessageHeader::m_messageSize
uint16_t m_messageSize
The message size.
Definition:
olsr-header.h:292
ns3::olsr::MessageHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
olsr-header.cc:187
ns3::olsr::MessageHeader::GetMessageSequenceNumber
uint16_t GetMessageSequenceNumber() const
Get the message sequence number.
Definition:
olsr-header.h:280
ns3::olsr::MessageHeader::GetMid
Mid & GetMid()
Set the message type to MID and return the message content.
Definition:
olsr-header.h:584
ns3::olsr::MessageHeader::SetVTime
void SetVTime(Time time)
Set the validity time.
Definition:
olsr-header.h:199
ns3::olsr::MessageHeader::m_messageSequenceNumber
uint16_t m_messageSequenceNumber
The message sequence number.
Definition:
olsr-header.h:291
ns3::olsr::MessageHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition:
olsr-header.cc:258
ns3::olsr::MessageHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
olsr-header.cc:171
ns3::olsr::MessageHeader::m_message
struct ns3::olsr::MessageHeader::@68 m_message
Structure holding the message content.
ns3::olsr::MessageHeader::MessageType
MessageType
Message type.
Definition:
olsr-header.h:167
ns3::olsr::MessageHeader::TC_MESSAGE
@ TC_MESSAGE
Definition:
olsr-header.h:169
ns3::olsr::MessageHeader::HNA_MESSAGE
@ HNA_MESSAGE
Definition:
olsr-header.h:171
ns3::olsr::MessageHeader::MID_MESSAGE
@ MID_MESSAGE
Definition:
olsr-header.h:170
ns3::olsr::MessageHeader::HELLO_MESSAGE
@ HELLO_MESSAGE
Definition:
olsr-header.h:168
ns3::olsr::PacketHeader
The basic layout of any packet in OLSR is as follows (omitting IP and UDP headers):
Definition:
olsr-header.h:79
ns3::olsr::PacketHeader::PacketHeader
PacketHeader()
Definition:
olsr-header.cc:104
ns3::olsr::PacketHeader::SetPacketSequenceNumber
void SetPacketSequenceNumber(uint16_t seqnum)
Set the packet sequence number.
Definition:
olsr-header.h:106
ns3::olsr::PacketHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
olsr-header.cc:113
ns3::olsr::PacketHeader::~PacketHeader
~PacketHeader() override
Definition:
olsr-header.cc:108
ns3::olsr::PacketHeader::SetPacketLength
void SetPacketLength(uint16_t length)
Set the packet total length.
Definition:
olsr-header.h:88
ns3::olsr::PacketHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
olsr-header.cc:129
ns3::olsr::PacketHeader::m_packetLength
uint16_t m_packetLength
The packet length.
Definition:
olsr-header.h:121
ns3::olsr::PacketHeader::GetPacketLength
uint16_t GetPacketLength() const
Get the packet total length.
Definition:
olsr-header.h:97
ns3::olsr::PacketHeader::Print
void Print(std::ostream &os) const override
Definition:
olsr-header.cc:135
ns3::olsr::PacketHeader::m_packetSequenceNumber
uint16_t m_packetSequenceNumber
The packet sequence number.
Definition:
olsr-header.h:122
ns3::olsr::PacketHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition:
olsr-header.cc:141
ns3::olsr::PacketHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
olsr-header.cc:123
ns3::olsr::PacketHeader::GetPacketSequenceNumber
uint16_t GetPacketSequenceNumber() const
Get the packet sequence number.
Definition:
olsr-header.h:115
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition:
assert.h:66
ns3::olsr::Willingness
Willingness
Willingness for forwarding packets from other nodes.
Definition:
olsr-repositories.h:47
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1326
ns3::olsr::EmfToSeconds
double EmfToSeconds(uint8_t olsrFormat)
Converts a number of seconds in the mantissa/exponent format to a decimal number.
Definition:
olsr-header.cc:92
ns3::olsr::SecondsToEmf
uint8_t SecondsToEmf(double seconds)
Converts a decimal number of seconds to the mantissa/exponent format.
Definition:
olsr-header.cc:49
ns3::olsr::operator<<
std::ostream & operator<<(std::ostream &os, const PacketHeader &packet)
Definition:
olsr-header.h:690
ns3::olsr::MessageList
std::vector< MessageHeader > MessageList
Definition:
olsr-header.h:703
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
olsr
Definition:
olsr.py:1
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:520
olsr-repositories.h
ns3::olsr::MessageHeader::Hello::LinkMessage
Link message item.
Definition:
olsr-header.h:391
ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode
uint8_t linkCode
Link code.
Definition:
olsr-header.h:392
ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses
std::vector< Ipv4Address > neighborInterfaceAddresses
Neighbor interface address container.
Definition:
olsr-header.h:394
ns3::olsr::MessageHeader::Hello
HELLO Message Format.
Definition:
olsr-header.h:386
ns3::olsr::MessageHeader::Hello::SetHTime
void SetHTime(Time time)
Set the HELLO emission interval.
Definition:
olsr-header.h:403
ns3::olsr::MessageHeader::Hello::Deserialize
uint32_t Deserialize(Buffer::Iterator start, uint32_t messageSize)
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
Definition:
olsr-header.cc:455
ns3::olsr::MessageHeader::Hello::willingness
Willingness willingness
The willingness of a node to carry and forward traffic for other nodes.
Definition:
olsr-header.h:417
ns3::olsr::MessageHeader::Hello::Print
void Print(std::ostream &os) const
This method is used to print the content of a Hello message.
Definition:
olsr-header.cc:396
ns3::olsr::MessageHeader::Hello::linkMessages
std::vector< LinkMessage > linkMessages
Link messages container.
Definition:
olsr-header.h:419
ns3::olsr::MessageHeader::Hello::hTime
uint8_t hTime
HELLO emission interval (coded)
Definition:
olsr-header.h:397
ns3::olsr::MessageHeader::Hello::GetSerializedSize
uint32_t GetSerializedSize() const
Returns the expected size of the header.
Definition:
olsr-header.cc:383
ns3::olsr::MessageHeader::Hello::GetHTime
Time GetHTime() const
Get the HELLO emission interval.
Definition:
olsr-header.h:412
ns3::olsr::MessageHeader::Hello::Serialize
void Serialize(Buffer::Iterator start) const
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet.
Definition:
olsr-header.cc:424
ns3::olsr::MessageHeader::Hna::Association
Association item structure.
Definition:
olsr-header.h:530
ns3::olsr::MessageHeader::Hna::Association::mask
Ipv4Mask mask
IPv4 netmask.
Definition:
olsr-header.h:532
ns3::olsr::MessageHeader::Hna::Association::address
Ipv4Address address
IPv4 Address.
Definition:
olsr-header.h:531
ns3::olsr::MessageHeader::Hna
HNA (Host Network Association) Message Format.
Definition:
olsr-header.h:525
ns3::olsr::MessageHeader::Hna::Serialize
void Serialize(Buffer::Iterator start) const
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet.
Definition:
olsr-header.cc:584
ns3::olsr::MessageHeader::Hna::Deserialize
uint32_t Deserialize(Buffer::Iterator start, uint32_t messageSize)
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
Definition:
olsr-header.cc:596
ns3::olsr::MessageHeader::Hna::associations
std::vector< Association > associations
Association container.
Definition:
olsr-header.h:535
ns3::olsr::MessageHeader::Hna::Print
void Print(std::ostream &os) const
This method is used to print the content of a Hna message.
Definition:
olsr-header.cc:564
ns3::olsr::MessageHeader::Hna::GetSerializedSize
uint32_t GetSerializedSize() const
Returns the expected size of the header.
Definition:
olsr-header.cc:558
ns3::olsr::MessageHeader::Mid
MID Message Format.
Definition:
olsr-header.h:323
ns3::olsr::MessageHeader::Mid::GetSerializedSize
uint32_t GetSerializedSize() const
Returns the expected size of the header.
Definition:
olsr-header.cc:325
ns3::olsr::MessageHeader::Mid::interfaceAddresses
std::vector< Ipv4Address > interfaceAddresses
Interface Address container.
Definition:
olsr-header.h:324
ns3::olsr::MessageHeader::Mid::Serialize
void Serialize(Buffer::Iterator start) const
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet.
Definition:
olsr-header.cc:351
ns3::olsr::MessageHeader::Mid::Print
void Print(std::ostream &os) const
This method is used to print the content of a MID message.
Definition:
olsr-header.cc:331
ns3::olsr::MessageHeader::Mid::Deserialize
uint32_t Deserialize(Buffer::Iterator start, uint32_t messageSize)
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
Definition:
olsr-header.cc:363
ns3::olsr::MessageHeader::Tc
TC Message Format.
Definition:
olsr-header.h:470
ns3::olsr::MessageHeader::Tc::ansn
uint16_t ansn
Advertised Neighbor Sequence Number.
Definition:
olsr-header.h:472
ns3::olsr::MessageHeader::Tc::neighborAddresses
std::vector< Ipv4Address > neighborAddresses
Neighbor address container.
Definition:
olsr-header.h:471
ns3::olsr::MessageHeader::Tc::Serialize
void Serialize(Buffer::Iterator start) const
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet.
Definition:
olsr-header.cc:520
ns3::olsr::MessageHeader::Tc::GetSerializedSize
uint32_t GetSerializedSize() const
Returns the expected size of the header.
Definition:
olsr-header.cc:493
ns3::olsr::MessageHeader::Tc::Print
void Print(std::ostream &os) const
This method is used to print the content of a Tc message.
Definition:
olsr-header.cc:499
ns3::olsr::MessageHeader::Tc::Deserialize
uint32_t Deserialize(Buffer::Iterator start, uint32_t messageSize)
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
Definition:
olsr-header.cc:534
src
olsr
model
olsr-header.h
Generated on Sun Mar 3 2024 17:11:06 for ns-3 by
1.9.1