A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
olsr
model
olsr-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 INESC Porto
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: Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
19
*/
20
21
#ifndef OLSR_HEADER_H
22
#define OLSR_HEADER_H
23
24
#include <stdint.h>
25
#include <vector>
26
#include "ns3/header.h"
27
#include "ns3/ipv4-address.h"
28
#include "ns3/nstime.h"
29
30
31
namespace
ns3
{
32
namespace
olsr
{
33
34
double
EmfToSeconds
(uint8_t emf);
35
uint8_t
SecondsToEmf
(
double
seconds);
36
75
class
PacketHeader
:
public
Header
76
{
77
public
:
78
PacketHeader
();
79
virtual
~PacketHeader
();
80
85
void
SetPacketLength
(uint16_t length)
86
{
87
m_packetLength
= length;
88
}
89
94
uint16_t
GetPacketLength
()
const
95
{
96
return
m_packetLength
;
97
}
98
103
void
SetPacketSequenceNumber
(uint16_t seqnum)
104
{
105
m_packetSequenceNumber
= seqnum;
106
}
107
112
uint16_t
GetPacketSequenceNumber
()
const
113
{
114
return
m_packetSequenceNumber
;
115
}
116
117
private
:
118
uint16_t
m_packetLength
;
119
uint16_t
m_packetSequenceNumber
;
120
121
public
:
126
static
TypeId
GetTypeId
(
void
);
127
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
128
virtual
void
Print
(std::ostream &os)
const
;
129
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
130
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
131
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
132
};
133
157
class
MessageHeader
:
public
Header
158
{
159
public
:
163
enum
MessageType
164
{
165
HELLO_MESSAGE
= 1,
166
TC_MESSAGE
= 2,
167
MID_MESSAGE
= 3,
168
HNA_MESSAGE
= 4,
169
};
170
171
MessageHeader
();
172
virtual
~MessageHeader
();
173
178
void
SetMessageType
(
MessageType
messageType)
179
{
180
m_messageType
= messageType;
181
}
186
MessageType
GetMessageType
()
const
187
{
188
return
m_messageType
;
189
}
190
195
void
SetVTime
(
Time
time)
196
{
197
m_vTime
=
SecondsToEmf
(time.
GetSeconds
());
198
}
203
Time
GetVTime
()
const
204
{
205
return
Seconds
(
EmfToSeconds
(
m_vTime
));
206
}
207
212
void
SetOriginatorAddress
(
Ipv4Address
originatorAddress)
213
{
214
m_originatorAddress
= originatorAddress;
215
}
220
Ipv4Address
GetOriginatorAddress
()
const
221
{
222
return
m_originatorAddress
;
223
}
224
229
void
SetTimeToLive
(uint8_t timeToLive)
230
{
231
m_timeToLive
= timeToLive;
232
}
237
uint8_t
GetTimeToLive
()
const
238
{
239
return
m_timeToLive
;
240
}
241
246
void
SetHopCount
(uint8_t hopCount)
247
{
248
m_hopCount
= hopCount;
249
}
254
uint8_t
GetHopCount
()
const
255
{
256
return
m_hopCount
;
257
}
258
263
void
SetMessageSequenceNumber
(uint16_t messageSequenceNumber)
264
{
265
m_messageSequenceNumber
= messageSequenceNumber;
266
}
271
uint16_t
GetMessageSequenceNumber
()
const
272
{
273
return
m_messageSequenceNumber
;
274
}
275
276
private
:
277
MessageType
m_messageType
;
278
uint8_t
m_vTime
;
279
Ipv4Address
m_originatorAddress
;
280
uint8_t
m_timeToLive
;
281
uint8_t
m_hopCount
;
282
uint16_t
m_messageSequenceNumber
;
283
uint16_t
m_messageSize
;
284
285
public
:
290
static
TypeId
GetTypeId
(
void
);
291
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
292
virtual
void
Print
(std::ostream &os)
const
;
293
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
294
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
295
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
296
313
struct
Mid
314
{
315
std::vector<Ipv4Address>
interfaceAddresses
;
316
320
void
Print
(std::ostream &os)
const
;
325
uint32_t
GetSerializedSize
(
void
)
const
;
333
void
Serialize
(
Buffer::Iterator
start
)
const
;
343
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
344
};
345
376
struct
Hello
377
{
381
struct
LinkMessage
382
{
383
uint8_t
linkCode
;
384
std::vector<Ipv4Address>
neighborInterfaceAddresses
;
385
};
386
387
uint8_t
hTime
;
388
393
void
SetHTime
(
Time
time)
394
{
395
this->hTime =
SecondsToEmf
(time.
GetSeconds
());
396
}
397
402
Time
GetHTime
()
const
403
{
404
return
Seconds
(
EmfToSeconds
(this->hTime));
405
}
406
407
uint8_t
willingness
;
408
std::vector<LinkMessage>
linkMessages
;
409
414
void
Print
(std::ostream &os)
const
;
419
uint32_t
GetSerializedSize
(
void
)
const
;
427
void
Serialize
(
Buffer::Iterator
start
)
const
;
437
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
438
};
439
458
struct
Tc
459
{
460
std::vector<Ipv4Address>
neighborAddresses
;
461
uint16_t
ansn
;
462
467
void
Print
(std::ostream &os)
const
;
472
uint32_t
GetSerializedSize
(
void
)
const
;
480
void
Serialize
(
Buffer::Iterator
start
)
const
;
490
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
491
};
492
493
514
struct
Hna
515
{
519
struct
Association
520
{
521
Ipv4Address
address
;
522
Ipv4Mask
mask
;
523
};
524
525
std::vector<Association>
associations
;
526
531
void
Print
(std::ostream &os)
const
;
536
uint32_t
GetSerializedSize
(
void
)
const
;
544
void
Serialize
(
Buffer::Iterator
start
)
const
;
554
uint32_t
Deserialize
(
Buffer::Iterator
start
, uint32_t messageSize);
555
};
556
557
private
:
561
struct
562
{
563
Mid
mid
;
564
Hello
hello
;
565
Tc
tc
;
566
Hna
hna
;
567
}
m_message
;
568
569
public
:
574
Mid
&
GetMid
()
575
{
576
if
(
m_messageType
== 0)
577
{
578
m_messageType
=
MID_MESSAGE
;
579
}
580
else
581
{
582
NS_ASSERT
(
m_messageType
==
MID_MESSAGE
);
583
}
584
return
m_message
.mid;
585
}
586
591
Hello
&
GetHello
()
592
{
593
if
(
m_messageType
== 0)
594
{
595
m_messageType
=
HELLO_MESSAGE
;
596
}
597
else
598
{
599
NS_ASSERT
(
m_messageType
==
HELLO_MESSAGE
);
600
}
601
return
m_message
.hello;
602
}
603
608
Tc
&
GetTc
()
609
{
610
if
(
m_messageType
== 0)
611
{
612
m_messageType
=
TC_MESSAGE
;
613
}
614
else
615
{
616
NS_ASSERT
(
m_messageType
==
TC_MESSAGE
);
617
}
618
return
m_message
.tc;
619
}
620
625
Hna
&
GetHna
()
626
{
627
if
(
m_messageType
== 0)
628
{
629
m_messageType
=
HNA_MESSAGE
;
630
}
631
else
632
{
633
NS_ASSERT
(
m_messageType
==
HNA_MESSAGE
);
634
}
635
return
m_message
.hna;
636
}
637
638
643
const
Mid
&
GetMid
()
const
644
{
645
NS_ASSERT
(
m_messageType
==
MID_MESSAGE
);
646
return
m_message
.mid;
647
}
648
653
const
Hello
&
GetHello
()
const
654
{
655
NS_ASSERT
(
m_messageType
==
HELLO_MESSAGE
);
656
return
m_message
.hello;
657
}
658
663
const
Tc
&
GetTc
()
const
664
{
665
NS_ASSERT
(
m_messageType
==
TC_MESSAGE
);
666
return
m_message
.tc;
667
}
668
673
const
Hna
&
GetHna
()
const
674
{
675
NS_ASSERT
(
m_messageType
==
HNA_MESSAGE
);
676
return
m_message
.hna;
677
}
678
679
680
};
681
682
683
static
inline
std::ostream&
operator<<
(std::ostream& os,
const
PacketHeader
& packet)
684
{
685
packet.
Print
(os);
686
return
os;
687
}
688
689
static
inline
std::ostream&
operator<<
(std::ostream& os,
const
MessageHeader
& message)
690
{
691
message.
Print
(os);
692
return
os;
693
}
694
695
typedef
std::vector<MessageHeader>
MessageList
;
696
697
static
inline
std::ostream&
operator<<
(std::ostream& os,
const
MessageList
& messages)
698
{
699
os <<
"["
;
700
for
(std::vector<MessageHeader>::const_iterator messageIter = messages.begin ();
701
messageIter != messages.end (); messageIter++)
702
{
703
messageIter->Print (os);
704
if
(messageIter + 1 != messages.end ())
705
{
706
os <<
", "
;
707
}
708
}
709
os <<
"]"
;
710
return
os;
711
}
712
713
714
}
715
}
// namespace olsr, ns3
716
717
#endif
/* OLSR_HEADER_H */
718
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::olsr::MessageHeader::GetHopCount
uint8_t GetHopCount() const
Get the hop count.
Definition:
olsr-header.h:254
ns3::olsr::MessageHeader::GetTimeToLive
uint8_t GetTimeToLive() const
Get the time to live.
Definition:
olsr-header.h:237
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:295
ns3::olsr::MessageHeader::m_messageSequenceNumber
uint16_t m_messageSequenceNumber
The message sequence number.
Definition:
olsr-header.h:282
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::olsr::PacketHeader::m_packetLength
uint16_t m_packetLength
The packet length.
Definition:
olsr-header.h:118
ns3::olsr::MessageHeader::TC_MESSAGE
Definition:
olsr-header.h:166
ns3::olsr::MessageHeader::Hello::LinkMessage
Link message item.
Definition:
olsr-header.h:381
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:438
ns3::olsr::MessageHeader
This header can store HELP, TC, MID and HNA messages.
Definition:
olsr-header.h:157
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:355
ns3::olsr::MessageHeader::Tc
TC Message Format
Definition:
olsr-header.h:458
ns3::olsr::MessageHeader::GetMid
Mid & GetMid()
Set the message type to MID and return the message content.
Definition:
olsr-header.h:574
ns3::olsr::MessageHeader::Tc::GetSerializedSize
uint32_t GetSerializedSize(void) const
Returns the expected size of the header.
Definition:
olsr-header.cc:426
ns3::Ipv4Mask
a class to represent an Ipv4 address mask
Definition:
ipv4-address.h:258
ns3::olsr::MessageHeader::m_message
struct ns3::olsr::MessageHeader::@69 m_message
Structure holding the message content.
ns3::olsr::operator<<
static std::ostream & operator<<(std::ostream &os, const PacketHeader &packet)
Definition:
olsr-header.h:683
ns3::olsr::PacketHeader::SetPacketSequenceNumber
void SetPacketSequenceNumber(uint16_t seqnum)
Set the packet sequence number.
Definition:
olsr-header.h:103
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::olsr::MessageHeader::HELLO_MESSAGE
Definition:
olsr-header.h:165
ns3::olsr::MessageHeader::mid
Mid mid
MID message (optional).
Definition:
olsr-header.h:563
ns3::Time::GetSeconds
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition:
nstime.h:355
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:386
ns3::olsr::MessageHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
olsr-header.cc:220
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:67
ns3::olsr::MessageHeader::Mid::GetSerializedSize
uint32_t GetSerializedSize(void) const
Returns the expected size of the header.
Definition:
olsr-header.cc:289
ns3::olsr::PacketHeader::GetPacketLength
uint16_t GetPacketLength() const
Get the packet total length.
Definition:
olsr-header.h:94
ns3::olsr::MessageHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
olsr-header.cc:189
ns3::olsr::MessageHeader::Hna::Association::mask
Ipv4Mask mask
IPv4 netmask.
Definition:
olsr-header.h:522
ns3::olsr::MessageHeader::Hello::SetHTime
void SetHTime(Time time)
Set the HELLO emission interval.
Definition:
olsr-header.h:393
ns3::olsr::MessageHeader::m_hopCount
uint8_t m_hopCount
The hop count.
Definition:
olsr-header.h:281
ns3::olsr::PacketHeader::PacketHeader
PacketHeader()
Definition:
olsr-header.cc:105
ns3::olsr::PacketHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
olsr-header.cc:124
ns3::olsr::MessageHeader::GetTc
Tc & GetTc()
Set the message type to TC and return the message content.
Definition:
olsr-header.h:608
ns3::olsr::MessageHeader::Hello::linkMessages
std::vector< LinkMessage > linkMessages
Link messages container.
Definition:
olsr-header.h:408
ns3::olsr::MessageHeader::Hello::hTime
uint8_t hTime
HELLO emission interval (coded)
Definition:
olsr-header.h:387
ns3::olsr::PacketHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
olsr-header.cc:150
ns3::olsr::MessageHeader::Tc::ansn
uint16_t ansn
Advertised Neighbor Sequence Number.
Definition:
olsr-header.h:461
ns3::olsr::MessageHeader::Hna::Print
void Print(std::ostream &os) const
This method is used to print the content of a MID message.
Definition:
olsr-header.cc:484
ns3::olsr::MessageHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
olsr-header.cc:183
ns3::olsr::MessageHeader::m_messageType
MessageType m_messageType
The message type.
Definition:
olsr-header.h:277
ns3::olsr::MessageHeader::SetHopCount
void SetHopCount(uint8_t hopCount)
Set the hop count.
Definition:
olsr-header.h:246
ns3::olsr::MessageHeader::hello
Hello hello
HELLO message (optional).
Definition:
olsr-header.h:564
ns3::olsr::MessageHeader::SetMessageType
void SetMessageType(MessageType messageType)
Set the message type.
Definition:
olsr-header.h:178
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::olsr::MessageHeader::tc
Tc tc
TC message (optional).
Definition:
olsr-header.h:565
ns3::olsr::MessageHeader::Hna::GetSerializedSize
uint32_t GetSerializedSize(void) const
Returns the expected size of the header.
Definition:
olsr-header.cc:478
ns3::olsr::MessageHeader::SetVTime
void SetVTime(Time time)
Set the validity time.
Definition:
olsr-header.h:195
ns3::olsr::MessageHeader::GetHna
const Hna & GetHna() const
Get the HNA message.
Definition:
olsr-header.h:673
ns3::olsr::MessageHeader::Mid::interfaceAddresses
std::vector< Ipv4Address > interfaceAddresses
Interface Address container.
Definition:
olsr-header.h:315
ns3::olsr::MessageHeader::Tc::neighborAddresses
std::vector< Ipv4Address > neighborAddresses
Neighbor address container.
Definition:
olsr-header.h:460
ns3::olsr::MessageHeader::SetTimeToLive
void SetTimeToLive(uint8_t timeToLive)
Set the time to live.
Definition:
olsr-header.h:229
ns3::olsr::PacketHeader::m_packetSequenceNumber
uint16_t m_packetSequenceNumber
The packet sequence number.
Definition:
olsr-header.h:119
ns3::olsr::MessageHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
olsr-header.cc:252
ns3::olsr::PacketHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
olsr-header.cc:142
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:313
ns3::olsr::MessageHeader::Hna::Association
Association item structure.
Definition:
olsr-header.h:519
ns3::olsr::MessageHeader::MessageType
MessageType
Message type.
Definition:
olsr-header.h:163
ns3::olsr::MessageHeader::Print
virtual void Print(std::ostream &os) const
Definition:
olsr-header.cc:214
ns3::olsr::MessageHeader::m_originatorAddress
Ipv4Address m_originatorAddress
The originator address.
Definition:
olsr-header.h:279
ns3::olsr::PacketHeader::SetPacketLength
void SetPacketLength(uint16_t length)
Set the packet total length.
Definition:
olsr-header.h:85
ns3::olsr::MessageHeader::GetHna
Hna & GetHna()
Set the message type to HNA and return the message content.
Definition:
olsr-header.h:625
ns3::olsr::PacketHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
olsr-header.cc:130
ns3::olsr::MessageHeader::m_vTime
uint8_t m_vTime
The validity time.
Definition:
olsr-header.h:278
ns3::olsr::MessageHeader::MessageHeader
MessageHeader()
Definition:
olsr-header.cc:163
ns3::olsr::MessageHeader::GetVTime
Time GetVTime() const
Get the validity time.
Definition:
olsr-header.h:203
ns3::olsr::MessageHeader::MID_MESSAGE
Definition:
olsr-header.h:167
ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode
uint8_t linkCode
Link code.
Definition:
olsr-header.h:383
ns3::olsr::MessageHeader::GetMessageType
MessageType GetMessageType() const
Get the message type.
Definition:
olsr-header.h:186
ns3::olsr::MessageHeader::~MessageHeader
virtual ~MessageHeader()
Definition:
olsr-header.cc:168
ns3::olsr::MessageHeader::GetOriginatorAddress
Ipv4Address GetOriginatorAddress() const
Get the originator address.
Definition:
olsr-header.h:220
ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses
std::vector< Ipv4Address > neighborInterfaceAddresses
Neighbor interface address container.
Definition:
olsr-header.h:384
ns3::olsr::MessageHeader::SetOriginatorAddress
void SetOriginatorAddress(Ipv4Address originatorAddress)
Set the originator address.
Definition:
olsr-header.h:212
ns3::olsr::MessageHeader::GetHello
const Hello & GetHello() const
Get the HELLO message.
Definition:
olsr-header.h:653
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::olsr::MessageHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
olsr-header.cc:173
ns3::olsr::MessageHeader::Hello::willingness
uint8_t willingness
The willingness of a node to carry and forward traffic for other nodes.
Definition:
olsr-header.h:407
ns3::olsr::MessageHeader::Hna::associations
std::vector< Association > associations
Association container.
Definition:
olsr-header.h:525
ns3::olsr::MessageHeader::Hna::Association::address
Ipv4Address address
IPv4 Address.
Definition:
olsr-header.h:521
ns3::olsr::MessageHeader::Hello::GetHTime
Time GetHTime() const
Get the HELLO emission interval.
Definition:
olsr-header.h:402
ns3::olsr::MessageHeader::m_timeToLive
uint8_t m_timeToLive
The time to live.
Definition:
olsr-header.h:280
ns3::olsr::PacketHeader::GetPacketSequenceNumber
uint16_t GetPacketSequenceNumber() const
Get the packet sequence number.
Definition:
olsr-header.h:112
ns3::olsr::MessageList
std::vector< MessageHeader > MessageList
Definition:
olsr-header.h:695
olsr
Definition:
olsr.py:1
ns3::olsr::PacketHeader
The basic layout of any packet in OLSR is as follows (omitting IP and UDP headers): ...
Definition:
olsr-header.h:75
ns3::olsr::MessageHeader::Hna
HNA (Host Network Association) Message Format
Definition:
olsr-header.h:514
ns3::olsr::MessageHeader::hna
Hna hna
HNA message (optional).
Definition:
olsr-header.h:566
ns3::olsr::MessageHeader::GetMessageSequenceNumber
uint16_t GetMessageSequenceNumber() const
Get the message sequence number.
Definition:
olsr-header.h:271
ns3::olsr::MessageHeader::GetHello
Hello & GetHello()
Set the message type to HELLO and return the message content.
Definition:
olsr-header.h:591
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:40
ns3::olsr::MessageHeader::Hello
HELLO Message Format
Definition:
olsr-header.h:376
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:490
ns3::olsr::MessageHeader::Hello::GetSerializedSize
uint32_t GetSerializedSize(void) const
Returns the expected size of the header.
Definition:
olsr-header.cc:335
ns3::olsr::MessageHeader::GetTc
const Tc & GetTc() const
Get the TC message.
Definition:
olsr-header.h:663
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1014
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:453
ns3::olsr::MessageHeader::GetMid
const Mid & GetMid() const
Get the MID message.
Definition:
olsr-header.h:643
ns3::olsr::MessageHeader::Tc::Print
void Print(std::ostream &os) const
This method is used to print the content of a MID message.
Definition:
olsr-header.cc:432
ns3::olsr::MessageHeader::Mid
MID Message Format
Definition:
olsr-header.h:313
ns3::olsr::MessageHeader::m_messageSize
uint16_t m_messageSize
The message size.
Definition:
olsr-header.h:283
ns3::olsr::PacketHeader::~PacketHeader
virtual ~PacketHeader()
Definition:
olsr-header.cc:109
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::MessageHeader::HNA_MESSAGE
Definition:
olsr-header.h:168
ns3::olsr::PacketHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
olsr-header.cc:114
ns3::olsr::MessageHeader::SetMessageSequenceNumber
void SetMessageSequenceNumber(uint16_t messageSequenceNumber)
Set the message sequence number.
Definition:
olsr-header.h:263
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:91
ns3::olsr::PacketHeader::Print
virtual void Print(std::ostream &os) const
Definition:
olsr-header.cc:136
ns3::olsr::MessageHeader::Hello::Print
void Print(std::ostream &os) const
This method is used to print the content of a MID message.
Definition:
olsr-header.cc:349
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
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:502
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:301
Generated on Wed Nov 7 2018 10:02:08 for ns-3 by
1.8.14