networkservice
INetwork.h
Go to the documentation of this file.
1 //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
2 // //
3 // MIT License //
4 // //
5 // Copyright (c) 2020 Boubacar DIENE //
6 // //
7 // This file is part of NetworkService project //
8 // //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy //
10 // of this software and associated documentation files (the "Software"), to deal //
11 // in the Software without restriction, including without limitation the rights //
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //
13 // copies of the Software, and to permit persons to whom the Software is //
14 // furnished to do so, subject to the following conditions: //
15 // //
16 // The above copyright notice and this permission notice shall be included in all //
17 // copies or substantial portions of the Software. //
18 // //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //
25 // SOFTWARE. //
26 // //
27 //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
28 
29 #ifndef __SERVICE_PLUGINS_INETWORK_H__
30 #define __SERVICE_PLUGINS_INETWORK_H__
31 
32 #include <string>
33 #include <vector>
34 
35 #include "IConfigData.h"
36 
37 namespace service::plugins::network {
38 
62 class INetwork {
63 
64 public:
66  INetwork() = default;
67 
70  virtual ~INetwork() = default;
71 
73  INetwork(const INetwork&) = delete;
74 
76  INetwork& operator=(const INetwork&) = delete;
77 
79  INetwork(INetwork&&) = delete;
80 
82  INetwork& operator=(INetwork&&) = delete;
83 
92  [[nodiscard]] virtual bool
93  hasInterface(const std::string& interfaceName) const = 0;
94 
105  virtual void applyInterfaceCommands(
106  const std::vector<std::string>& interfaceCommands) const = 0;
107 
117  virtual void applyLayerCommands(
118  const std::vector<
120  layerCommands) const = 0;
121 };
122 
123 }
124 
125 #endif
INetwork & operator=(const INetwork &)=delete
virtual bool hasInterface(const std::string &interfaceName) const =0
Check if the network interface whose name is "interfaceName" exists.
Configure the network (enable network interfaces, set IP addresses, add new network interfaces...
Definition: INetwork.h:62
virtual void applyInterfaceCommands(const std::vector< std::string > &interfaceCommands) const =0
Apply "interface commands" i.e network commands more or less related to setting up a network interfac...
virtual void applyLayerCommands(const std::vector< service::plugins::config::ConfigData::Network::LayerCommand > &layerCommands) const =0
Apply "layer commands" i.e commands that simply consist in writing a given value to a specific networ...