Expand description
The Interface Manager
The NetStack is generic over a “Profile”, which is how it handles
any external interfaces of the current program or device.
Different profiles may support a various number of external interfaces. The simplest profile is the “Null Profile”, Which supports no external interfaces, meaning that messages may only be routed locally.
The next simplest profile is one that only supports zero or one active interfaces, for example if a device is directly connected to a PC using USB. In this case, routing is again simple: if messages are not intended for the local device, they should be routed out of the one external interface. Similarly, if we support an interface, but it is not connected (e.g. the USB cable is unplugged), all packets with external destinations will fail to send.
For more complex devices, a profile with multiple (bounded or unbounded) interfaces, and more complex routing capabilities, may be selected.
Unlike Sockets, which might be various and diverse on all systems, a system is expected to have one statically-known profile, which may manage various and diverse interfaces.
In general when sending a message, the NetStack will check if the
message is definitively for the local device (e.g. Net ID = 0, Node ID = 0),
and if not the NetStack will pass the message to the Interface Manager. If
the profile can route this packet, it informs the NetStack it has
done so. If the Interface Manager realizes that the packet is still for us
(e.g. matching a Net ID and Node ID of the local device), it may bounce the
message back to the NetStack to locally route.
Modules§
- interface_
impls - Interface Implementations
- profiles
- Profiles describe how a single device interacts with the outside world
- utils
Enums§
- Deregister
Error - An error when deregistering an interface
- Interface
Send Error - Interface
State - Register
Sink Error - SetState
Error
Traits§
- Const
Init - Interface
- Interfaces define how messages are transported over the wire
- Interface
Sink - The “Sink” side of the interface.
- Profile