A Discrete-Event Network Simulator
API
ns3::olsr::MessageHeader::Hello Struct Reference

HELLO Message Format. More...

#include "olsr-header.h"

+ Collaboration diagram for ns3::olsr::MessageHeader::Hello:

Classes

struct  LinkMessage
 Link message item. More...
 

Public Member Functions

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. More...
 
Time GetHTime () const
 Get the HELLO emission interval. More...
 
uint32_t GetSerializedSize () const
 Returns the expected size of the header. More...
 
void Print (std::ostream &os) const
 This method is used to print the content of a Hello message. More...
 
void Serialize (Buffer::Iterator start) const
 This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. More...
 
void SetHTime (Time time)
 Set the HELLO emission interval. More...
 

Public Attributes

uint8_t hTime
 HELLO emission interval (coded) More...
 
std::vector< LinkMessagelinkMessages
 Link messages container. More...
 
Willingness willingness
 The willingness of a node to carry and forward traffic for other nodes. More...
 

Detailed Description

HELLO Message Format.

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |          Reserved             |     Htime     |  Willingness  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Link Code   |   Reserved    |       Link Message Size       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Neighbor Interface Address                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Neighbor Interface Address                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 :                             .  .  .                           :
 :                                                               :
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Link Code   |   Reserved    |       Link Message Size       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Neighbor Interface Address                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                  Neighbor Interface Address                   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 :                                                               :
   (etc.)

Definition at line 385 of file olsr-header.h.

Member Function Documentation

◆ Deserialize()

uint32_t ns3::olsr::MessageHeader::Hello::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.

Parameters
startan iterator which points to where the header should read from.
messageSizethe message size.
Returns
the number of bytes read.

Definition at line 455 of file olsr-header.cc.

References IPV4_ADDRESS_SIZE, ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode, ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses, NS_ASSERT, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), ns3::Buffer::Iterator::ReadU8(), and two-ray-to-three-gpp-ch-calibration::start.

+ Here is the call graph for this function:

◆ GetHTime()

Time ns3::olsr::MessageHeader::Hello::GetHTime ( ) const
inline

Get the HELLO emission interval.

Returns
The HELLO emission interval.

Definition at line 412 of file olsr-header.h.

References ns3::olsr::EmfToSeconds(), and ns3::Seconds().

Referenced by OlsrHelloTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::olsr::MessageHeader::Hello::GetSerializedSize ( ) const

Returns the expected size of the header.

Returns
the expected size of the header.

Definition at line 383 of file olsr-header.cc.

References IPV4_ADDRESS_SIZE, and ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses.

◆ Print()

void ns3::olsr::MessageHeader::Hello::Print ( std::ostream &  os) const

This method is used to print the content of a Hello message.

Parameters
osoutput stream

Definition at line 396 of file olsr-header.cc.

References ns3::olsr::EmfToSeconds(), ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode, and ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses.

+ Here is the call graph for this function:

◆ Serialize()

void ns3::olsr::MessageHeader::Hello::Serialize ( Buffer::Iterator  start) const

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet.

Parameters
startan iterator which points to where the header should be written.

Definition at line 424 of file olsr-header.cc.

References IPV4_ADDRESS_SIZE, ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode, ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses, two-ray-to-three-gpp-ch-calibration::start, ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteHtonU32(), ns3::Buffer::Iterator::WriteU16(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

◆ SetHTime()

void ns3::olsr::MessageHeader::Hello::SetHTime ( Time  time)
inline

Set the HELLO emission interval.

Parameters
timeThe HELLO emission interval.

Definition at line 403 of file olsr-header.h.

References ns3::Time::GetSeconds(), and ns3::olsr::SecondsToEmf().

Referenced by OlsrHelloTestCase::DoRun(), and ns3::olsr::RoutingProtocol::SendHello().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ hTime

uint8_t ns3::olsr::MessageHeader::Hello::hTime

HELLO emission interval (coded)

Definition at line 397 of file olsr-header.h.

◆ linkMessages

◆ willingness

Willingness ns3::olsr::MessageHeader::Hello::willingness

The willingness of a node to carry and forward traffic for other nodes.

Definition at line 417 of file olsr-header.h.

Referenced by OlsrHelloTestCase::DoRun(), ns3::olsr::RoutingProtocol::LinkSensing(), ns3::olsr::RoutingProtocol::PopulateNeighborSet(), and ns3::olsr::RoutingProtocol::SendHello().


The documentation for this struct was generated from the following files: