|
Open Model Railroad Network (OpenMRN)
|
Routing table for gateways and routers in OpenLCB. More...
#include <RoutingLogic.hxx>
Classes | |
| struct | EventSet |
| The per-port event information. More... | |
Public Member Functions | |
| void | remove_port (Port *port) |
| Clears all entries in the routing table related to a given port, as the given port is being removed. | |
| void | add_node_id_to_route (Port *port, Address source) |
| Declares that a given node ID is reachable via a specific port. | |
| Port * | lookup_port_for_address (Address dest) |
| Looks up which port an addressed packet should be sent to. | |
| void | register_consumer (Port *port, EventId event) |
| Declares that there is a consumer for the given event ID on the given port. | |
| void | register_consumer_range (Port *port, EventId encoded_range) |
| Declares that there is a consumer for the given event ID range on the given port. | |
| void | register_producer (Port *port, EventId event) |
| Declares that there is a producer for the given event ID on the given port. | |
| void | register_producer_range (Port *port, EventId encoded_range) |
| Declares that there is a producer for the given event ID range on the given port. | |
| bool | check_pcer (Port *port, EventId event) |
| Checks if a given PCER message should be forwarded to the given port. | |
Private Attributes | |
| OSMutex | lock_ |
| Protects all internal data structures. | |
| std::unordered_map< Address, Port * > | addressRoutingTable_ |
| Stores all known addresses and which port they route to. | |
| std::map< Port *, EventSet > | eventRoutingTable_ |
| Stores per-port event information. | |
Routing table for gateways and routers in OpenLCB.
The routing table contains which direction to send addressed packets as well as filters for the event IDs that have listeners in a given port.
Definition at line 65 of file RoutingLogic.hxx.
|
inline |
Definition at line 68 of file RoutingLogic.hxx.
|
inline |
Definition at line 71 of file RoutingLogic.hxx.
|
inline |
Declares that a given node ID is reachable via a specific port.
Used with the source node IDs of all the incoming packets.
| port | is where the incoming packet came from (i.e. the port on which source is reachable. |
| source | is the node handle where the packet came from. |
Definition at line 105 of file RoutingLogic.hxx.
|
inline |
Checks if a given PCER message should be forwarded to the given port.
| port | is the port to query. |
| event | is the event ID from the PCER message. |
Definition at line 185 of file RoutingLogic.hxx.
|
inline |
Looks up which port an addressed packet should be sent to.
| dest | is the address of the destination node that needs to be contacted. |
Definition at line 118 of file RoutingLogic.hxx.
|
inline |
Declares that there is a consumer for the given event ID on the given port.
| port | is where the consumer identified from has come from. |
| event | is the event ID for which there is a consumer identified on that port. |
Definition at line 133 of file RoutingLogic.hxx.
|
inline |
Declares that there is a consumer for the given event ID range on the given port.
| port | is there the consumer range identified has come from. |
| encoded_range | is the range of consumer encoded via the OpenLCB method. |
Definition at line 145 of file RoutingLogic.hxx.
|
inline |
Declares that there is a producer for the given event ID on the given port.
| port | is where the producer identified from has come from. |
| event | is the event ID for which there is a producer identified on that port. |
Definition at line 159 of file RoutingLogic.hxx.
|
inline |
Declares that there is a producer for the given event ID range on the given port.
| port | is there the producer range identified has come from. |
| encoded_range | is the range of producer encoded via the OpenLCB method. |
Definition at line 172 of file RoutingLogic.hxx.
|
inline |
Clears all entries in the routing table related to a given port, as the given port is being removed.
| port | describes the target port to be removed. |
Definition at line 80 of file RoutingLogic.hxx.
|
private |
Stores all known addresses and which port they route to.
Definition at line 222 of file RoutingLogic.hxx.
|
private |
Stores per-port event information.
Definition at line 233 of file RoutingLogic.hxx.
|
private |
Protects all internal data structures.
Definition at line 219 of file RoutingLogic.hxx.