Configure the network (enable network interfaces, set IP addresses, add new network interfaces, ...)
More...
#include "service/plugins/INetwork.h"
Configure the network (enable network interfaces, set IP addresses, add new network interfaces, ...)
This class is the high level interface that must be implemented by network plugin. The core service depends on it and not on its implementation(s) to respect the Dependency Inversion Principle. The network plugin must be capable of applying network commands (based on "ip" tool for example) and configuring the network layer (understand update some network-related files in the filesystem with new values).
- Note
- Copy contructor, copy-assignment operator, move constructor and move assignment operator are defined to be compliant with the "Rule of five".
- See also
- https://en.cppreference.com/w/cpp/language/rule_of_three
- Author
- Boubacar DIENE bouba.nosp@m.car..nosp@m.diene.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Date
- April 2020
◆ INetwork() [1/3]
| service::plugins::network::INetwork::INetwork |
( |
| ) |
|
|
default |
◆ ~INetwork()
| virtual service::plugins::network::INetwork::~INetwork |
( |
| ) |
|
|
virtualdefault |
Class destructor made virtual because it is used as base class by derived classes in network plugin
◆ INetwork() [2/3]
| service::plugins::network::INetwork::INetwork |
( |
const INetwork & |
| ) |
|
|
delete |
◆ INetwork() [3/3]
| service::plugins::network::INetwork::INetwork |
( |
INetwork && |
| ) |
|
|
delete |
◆ applyInterfaceCommands()
| virtual void service::plugins::network::INetwork::applyInterfaceCommands |
( |
const std::vector< std::string > & |
interfaceCommands | ) |
const |
|
pure virtual |
Apply "interface commands" i.e network commands more or less related to setting up a network interface (Add a new interface using "ip tuntap" or label for example, set IP addresses, set interfaces up, add an interface to a network bridge, ...).
- Parameters
-
| interfaceCommands | Thee list of interface commands to apply |
- See also
- ConfigData
Implemented in service::plugins::network::Network.
◆ applyLayerCommands()
Apply "layer commands" i.e commands that simply consist in writing a given value to a specific network-related file (IP forwarding: /proc/sys/net/ipv4/ip_forward is a common example)
- Parameters
-
| layerCommands | The list of layer commands to apply |
- See also
- ConfigData
Implemented in service::plugins::network::Network.
◆ hasInterface()
| virtual bool service::plugins::network::INetwork::hasInterface |
( |
const std::string & |
interfaceName | ) |
const |
|
pure virtual |
Check if the network interface whose name is "interfaceName" exists.
- Parameters
-
| interfaceName | The network interface to check |
- Returns
- true if the interface exists, false otherwise
Implemented in service::plugins::network::Network.
◆ operator=() [1/2]
Class copy-assignment operator
◆ operator=() [2/2]
Class move-assignment operator
The documentation for this interface was generated from the following file: