pub trait PortLookup: Send {
// Required method
fn by_eid(
&mut self,
eid: Eid,
source_port: Option<PortId>,
) -> Option<PortId>;
}
Expand description
A trait implemented by applications to determine the routing table.
Required Methods§
Sourcefn by_eid(&mut self, eid: Eid, source_port: Option<PortId>) -> Option<PortId>
fn by_eid(&mut self, eid: Eid, source_port: Option<PortId>) -> Option<PortId>
Returns the PortId
for a destination EID.
PortId
is an index into the array of ports
provided to Router::new
Return None
to drop the packet as unreachable. This lookup
is only called for outbound packets - packets destined for the local EID
will not be passed to this callback.
source_port
is the incoming interface of a forwarded packet,
or None
for locally generated packets.