20 #ifndef THUNDERPLUGIN_H
21 #define THUNDERPLUGIN_H
23 #include <Netfilter.h>
24 #if defined (DOBBY_BUILD)
25 #include <RdkPluginBase.h>
27 #include <Dobby/rdkPlugins/RdkPluginBase.h>
30 #include <sys/types.h>
31 #include <netinet/in.h>
56 ThunderPlugin(std::shared_ptr<rt_dobby_schema> &containerConfig,
57 const std::shared_ptr<DobbyRdkPluginUtils> &utils,
58 const std::string &rootfsPath);
63 inline std::string
name()
const override
83 Netfilter::RuleSet constructRules() const;
86 in_port_t port) const;
89 const std::
string &vethName,
91 uint32_t connLimit) const;
94 const std::
string &vethName,
95 in_port_t port) const;
96 bool isNatNetworkMode() const;
99 const std::
string mName;
100 std::shared_ptr<rt_dobby_schema> mContainerConfig;
101 const std::
string mRootfsPath;
105 in_port_t mThunderPort;
109 const
bool mEnableConnLimit;
110 const std::
string mSocketDirectory;
111 const std::
string mSocketPath;
Class for useful utility methods for plugins such as adding mounts and environment variables.
Definition: DobbyRdkPluginUtils.h:78
Class that can read / write iptables rule sets.
Definition: Netfilter.h:45
Basic object that provides the default overrides for a plugin.
Definition: RdkPluginBase.h:34
Plugin used to map in the wpeframework (aka thunder) server.
Definition: ThunderPlugin.h:54
bool createRuntime() final
Definition: ThunderPlugin.cpp:258
std::string name() const override
Should return the name of the plugin.
Definition: ThunderPlugin.h:63
bool postInstallation() final
Dobby Hook - run in host namespace once when container bundle is downloaded.
Definition: ThunderPlugin.cpp:113
bool preCreation() final
Definition: ThunderPlugin.cpp:175
bool postHalt() final
Definition: ThunderPlugin.cpp:294
std::string constructDNATRule(const std::string &containerIp, in_port_t port) const
Constructs a DNAT PREROUTING rule to send anything from the container on the given port to localhost ...
Definition: ThunderPlugin.cpp:416
unsigned hookHints() const final
Set the bit flags for which hooks we're going to use.
Definition: ThunderPlugin.cpp:96
std::string constructCONNLIMITRule(const std::string &containerIp, const std::string &vethName, in_port_t port, uint32_t connLimit) const
Constructs an INPUT REJECT rule to reject connection if exceed the limit.
Definition: ThunderPlugin.cpp:453
std::string constructACCEPTRule(const std::string &containerIp, const std::string &vethName, in_port_t port) const
Constructs a INPUT ACCEPT rule to allow packets from the container over the dobby0 bridge to localhos...
Definition: ThunderPlugin.cpp:494
ThunderPlugin(std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath)
Constructor - called when plugin is loaded by PluginLauncher.
Definition: ThunderPlugin.cpp:44
std::vector< std::string > getDependencies() const override
Should return the names of the plugins this plugin depends on.
Definition: ThunderPlugin.cpp:340