networkservice
Rule.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 __PLUGINS_FIREWALL_RULE_H__
30 #define __PLUGINS_FIREWALL_RULE_H__
31 
32 #include <memory>
33 
35 
36 #include "service/plugins/IRule.h"
37 
39 
57 class Rule : public IRule {
58 
59 public:
68  explicit Rule(const std::string& name,
69  const std::vector<std::string>& commands,
70  const utils::command::IExecutor& executor);
71 
78  ~Rule() override;
79 
81  Rule(const Rule&) = delete;
82 
84  Rule& operator=(const Rule&) = delete;
85 
87  Rule(Rule&&) = delete;
88 
90  Rule& operator=(Rule&&) = delete;
91 
93  void applyCommands() const override;
94 
95 private:
96  struct Internal;
97  std::unique_ptr<Internal> m_internal;
98 };
99 
100 }
101 
102 #endif
void applyCommands() const override
A helper class to execute shell commands securely. This class is a high level interface added to ease...
Definition: IExecutor.h:51
Rule & operator=(const Rule &)=delete
Represents a single firewall rule.
Definition: IRule.h:57
std::unique_ptr< Internal > m_internal
Definition: Rule.h:96
Definition: Rule.h:38
Represents a single firewall rule.
Definition: Rule.h:57
Rule(const std::string &name, const std::vector< std::string > &commands, const utils::command::IExecutor &executor)