#include <next_hop.hpp>
Public Types | |
using | Packet = PendingPacket< GbcPdu, const MacAddress & > |
Public Member Functions | |
NextHop (NextHop &&)=default | |
NextHop & | operator= (NextHop &&)=default |
bool | discarded () const |
bool | buffered () const |
bool | valid () const |
const MacAddress & | mac () 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 |
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.
using vanetza::geonet::NextHop::Packet = PendingPacket<GbcPdu, const MacAddress&> |
Definition at line 21 of file next_hop.hpp.
|
strongprivate |
Definition at line 81 of file next_hop.hpp.
vanetza::geonet::NextHop::NextHop | ( | ) |
Definition at line 8 of file next_hop.cpp.
void vanetza::geonet::NextHop::buffer | ( | ) |
Set the NextHop state to buffered.
Definition at line 55 of file next_hop.cpp.
bool vanetza::geonet::NextHop::buffered | ( | ) | const |
Test if forwarding decided to buffer the packet.
Definition at line 17 of file next_hop.cpp.
void vanetza::geonet::NextHop::discard | ( | ) |
Set the NextHop state to discarded.
Definition at line 50 of file next_hop.cpp.
bool vanetza::geonet::NextHop::discarded | ( | ) | const |
Test if forwarding decision is to discard the packet.
Definition at line 12 of file next_hop.cpp.
const MacAddress & vanetza::geonet::NextHop::mac | ( | ) | const |
Access stored link-layer address.
The returned address is only meaningful if NextHop is valid.
Definition at line 27 of file next_hop.cpp.
bool vanetza::geonet::NextHop::process | ( | ) | && |
Invoke further packet processing.
It is safe to call this method though packet has been discarded or buffered.
Definition at line 32 of file next_hop.cpp.
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.
packet | the packet to be transmitted |
destination | link-layer destination address |
Definition at line 43 of file next_hop.cpp.
bool vanetza::geonet::NextHop::valid | ( | ) | const |
Test if stored packet and link-layer address are valid.
Definition at line 22 of file next_hop.cpp.
|
private |
Definition at line 84 of file next_hop.hpp.
|
private |
Definition at line 85 of file next_hop.hpp.
|
private |
Definition at line 83 of file next_hop.hpp.