Vanetza
 
Loading...
Searching...
No Matches
vanetza::geonet::NextHop Class Reference

#include <next_hop.hpp>

Public Types

using Packet = PendingPacket< GbcPdu, const MacAddress & >
 

Public Member Functions

 NextHop (NextHop &&)=default
 
NextHopoperator= (NextHop &&)=default
 
bool discarded () const
 
bool buffered () const
 
bool valid () const
 
const MacAddressmac () const
 
void transmit (Packet &&packet, const MacAddress &destination)
 
void discard ()
 
void buffer ()
 
bool process () &&
 

Private Types

enum class  State { Valid , Discarded , Buffered }
 

Private Attributes

State m_state
 
MacAddress m_destination
 
Packet m_packet
 

Detailed Description

NextHop is the result of GeoNet forwarding algorithms. It may convey a destination link-layer address or one of the states "discarded" and "buffered".

Definition at line 18 of file next_hop.hpp.

Member Typedef Documentation

◆ Packet

Definition at line 21 of file next_hop.hpp.

Member Enumeration Documentation

◆ State

enum class vanetza::geonet::NextHop::State
strongprivate

Definition at line 81 of file next_hop.hpp.

Constructor & Destructor Documentation

◆ NextHop()

vanetza::geonet::NextHop::NextHop ( )

Definition at line 8 of file next_hop.cpp.

Member Function Documentation

◆ buffer()

void vanetza::geonet::NextHop::buffer ( )

Set the NextHop state to buffered.

Definition at line 55 of file next_hop.cpp.

◆ buffered()

bool vanetza::geonet::NextHop::buffered ( ) const

Test if forwarding decided to buffer the packet.

Returns
true if packet got buffered

Definition at line 17 of file next_hop.cpp.

◆ discard()

void vanetza::geonet::NextHop::discard ( )

Set the NextHop state to discarded.

Definition at line 50 of file next_hop.cpp.

◆ discarded()

bool vanetza::geonet::NextHop::discarded ( ) const

Test if forwarding decision is to discard the packet.

Returns
true if discarded

Definition at line 12 of file next_hop.cpp.

◆ mac()

const MacAddress & vanetza::geonet::NextHop::mac ( ) const

Access stored link-layer address.

The returned address is only meaningful if NextHop is valid.

Returns
link-layer address

Definition at line 27 of file next_hop.cpp.

◆ process()

bool vanetza::geonet::NextHop::process ( ) &&

Invoke further packet processing.

It is safe to call this method though packet has been discarded or buffered.

Returns
true if a valid packet (after previous transmit()) has been processed

Definition at line 32 of file next_hop.cpp.

◆ transmit()

void vanetza::geonet::NextHop::transmit ( Packet &&  packet,
const MacAddress destination 
)

Prepare for immediate packet transmission (not discarded, not buffered).

valid() will return true after invocation of this method.

Parameters
packetthe packet to be transmitted
destinationlink-layer destination address

Definition at line 43 of file next_hop.cpp.

◆ valid()

bool vanetza::geonet::NextHop::valid ( ) const

Test if stored packet and link-layer address are valid.

Returns
if valid

Definition at line 22 of file next_hop.cpp.

Member Data Documentation

◆ m_destination

MacAddress vanetza::geonet::NextHop::m_destination
private

Definition at line 84 of file next_hop.hpp.

◆ m_packet

Packet vanetza::geonet::NextHop::m_packet
private

Definition at line 85 of file next_hop.hpp.

◆ m_state

State vanetza::geonet::NextHop::m_state
private

Definition at line 83 of file next_hop.hpp.


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