Vanetza
 
Loading...
Searching...
No Matches
vanetza::btp::PortDispatcher Class Referenceabstract
Inheritance diagram for vanetza::btp::PortDispatcher:

Classes

class  PromiscuousHook
 

Public Member Functions

void set_interactive_handler (port_type, IndicationInterface *)
 
void set_non_interactive_handler (port_type, IndicationInterface *)
 
void add_promiscuous_hook (PromiscuousHook *hook)
 
void remove_promiscuous_hook (PromiscuousHook *)
 
void indicate (const geonet::DataIndication &, std::unique_ptr< UpPacket >) override
 
virtual void indicate (const DataIndication &, std::unique_ptr< UpPacket >)=0
 

Public Attributes

Hook< const geonet::DataIndication &, const btp::DataIndication * > hook_undispatched
 

Private Types

typedef std::unordered_map< port_type, IndicationInterface * > port_map
 
typedef std::list< PromiscuousHook * > hook_list
 

Private Attributes

port_map m_interactive_handlers
 
port_map m_non_interactive_handlers
 
hook_list m_promiscuous_hooks
 

Detailed Description

Definition at line 18 of file port_dispatcher.hpp.

Member Typedef Documentation

◆ hook_list

typedef std::list<PromiscuousHook*> vanetza::btp::PortDispatcher::hook_list
private

Definition at line 75 of file port_dispatcher.hpp.

◆ port_map

typedef std::unordered_map<port_type, IndicationInterface*> vanetza::btp::PortDispatcher::port_map
private

Definition at line 74 of file port_dispatcher.hpp.

Member Function Documentation

◆ add_promiscuous_hook()

void vanetza::btp::PortDispatcher::add_promiscuous_hook ( PromiscuousHook hook)

Add a hook listening for all incoming BTP packets

Parameters
hookA hook implementing the promiscuous hook interface
Note
Each registered hook is invoked only once per indication

Definition at line 35 of file port_dispatcher.cpp.

◆ indicate()

void vanetza::btp::PortDispatcher::indicate ( const geonet::DataIndication gn_ind,
std::unique_ptr< UpPacket >  packet 
)
override

Definition at line 64 of file port_dispatcher.cpp.

◆ remove_promiscuous_hook()

void vanetza::btp::PortDispatcher::remove_promiscuous_hook ( PromiscuousHook hook)

Remove promiscuous hook

Parameters
hookpointer to previously added hook

Definition at line 45 of file port_dispatcher.cpp.

◆ set_interactive_handler()

void vanetza::btp::PortDispatcher::set_interactive_handler ( port_type  port,
IndicationInterface handler 
)

Register a handler for incoming BTP-A (interactive) packets

Parameters
portBTP-A destination port
interfaceHandler for given destination port
Note
Use a nullptr as handler to disable dispatching of destination port
Only one handler can be registered per port

Definition at line 50 of file port_dispatcher.cpp.

◆ set_non_interactive_handler()

void vanetza::btp::PortDispatcher::set_non_interactive_handler ( port_type  port,
IndicationInterface handler 
)

Register a handler for incoming BTP-B (non-interactive) packets

Parameters
portBTP-B destination port
interfaceHandler for given destination port
Note
Use a nullptr as handler to disable dispatching of destination port
Only one handler can be registered per port

Definition at line 57 of file port_dispatcher.cpp.

Member Data Documentation

◆ hook_undispatched

Hook<const geonet::DataIndication&, const btp::DataIndication*> vanetza::btp::PortDispatcher::hook_undispatched

Hook invoked for all indicated but undispatched packets

Note
BTP data indication can be nullptr

Definition at line 71 of file port_dispatcher.hpp.

◆ m_interactive_handlers

port_map vanetza::btp::PortDispatcher::m_interactive_handlers
private

Definition at line 77 of file port_dispatcher.hpp.

◆ m_non_interactive_handlers

port_map vanetza::btp::PortDispatcher::m_non_interactive_handlers
private

Definition at line 78 of file port_dispatcher.hpp.

◆ m_promiscuous_hooks

hook_list vanetza::btp::PortDispatcher::m_promiscuous_hooks
private

Definition at line 79 of file port_dispatcher.hpp.


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