Modules | |
Emulated interfaces | |
NetEmu interface implementations | |
Classes | |
class | senf::emu::Interface |
Interface API base class More... | |
class | senf::emu::Receiver |
Interface API base class for receive capable interfaces. More... | |
class | senf::emu::Transmitter |
Interface API base class for transmit capable interfaces. More... | |
class | senf::emu::WiredInterface |
Wired interface base class. More... | |
class | senf::emu::WiredReceiver |
Wired receiver base class. More... | |
class | senf::emu::WiredTransmitter |
Wired transmitter base class. More... | |
class | senf::emu::HardwareInterface |
Hardware interface base class. More... | |
class | senf::emu::WirelessInterface |
Interface API base class specialization for wireless interfaces. More... | |
class | senf::emu::WirelessReceiver |
Receive capable wireless interface base class. More... | |
class | senf::emu::WirelessTransmitter |
Transmit capable wireless interface base class. More... | |
The NetEmu library includes a flexible group of classes to model network interfaces, emulated and hardware (non-emulated).
The Interfaces are grouped around a series of base classes providing a generic interface API.
The interfaces will not directly derive from these classes. Instead they will derive from either WirelessInterface, WirelessTransmitter and WirelessReceiver or WiredInterface, WiredReceiver and WiredTransmitter.
For emulated interfaces, there is an additional set of interfaces: EmulatedInterface, EmulatedReceiver and EmulatedTransmitter. Again, implementations don't directly derive from these classes but from either EmulatedWirelessInterface, EmulatedWirelessReceiver and/or EmulatedWirelessTransmitter or from EmulatedWiredInterface, EmulatedWiredReceiver and/or EmulatedWiredTransmitter.
Applications utilizing the NetEmu interface classes will often need additional application specific modules to be added to each interface. To simplify this task (especially when using a larger number of dynamically configured interfaces), the concept of interface decoration is introduced. A decorated interface is an arbitrary interface which has been extended with additional modules in it's input and/or output chain. These modules are presented to NetEmu in the form of two PPI groups (or single modules): One group or module for the input, one for the output. The interface decoration is applied in two steps: First the type of decoration is defined:
This decoration can then be applied to any type of interface
When applying a decoration to an interface, receive only interface types will ignore the output group while transmit only interfaces will ignore the input group. All decorated interfaces implement the generic decorated interface API: \li senf::emu::InterfaceDecorator is implemented by every decorated interface \li senf::emu::ReceiverDecorator is implemented by receive enabled interfaces \li senf::emu::TransmitterDecorator is implemented by transmit enabled interfaces. In addition to the generic InterfaceDecorator API, there is a derived decorator base-class for each type of interface. This type is accessible as the \c Decorator member of the corresponding interface class: \li senf::emu::Interface::Decorator generic decorator API \li senf::emu::WirelessInterface::Decorator decorator API for wireless interfaces \li senf::emu::EmulatedWLANInterface::Decorator decorator API for EmulatedWLANInterface's The Receiver/Transmitter and EmulatedInterface classes to \e not have \c Decorator members to not make the inheritance hierarchy to complex. The only difference between those different Decorator classes is the return type of the \c interface() member which returns the wrapped interface reference. When defining a decoration, both the input and output module/group are optional. Thus every interface can always be decorated and the Interface::Decorator type is a very good candidate for a generic interface type (since it allows decorated or un- (null-) decorated interfaces to be referenced). Depending on the application requirements, use the correct base-class (e.g. WirelessInterface::Decorator to manage arbitrary decorated wireless interfaces).