Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
IPC Plugin. More...
#include <IpcPlugin.h>
Public Member Functions | |
IpcPlugin (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. More... | |
std::string | name () const override |
Should return the name of the plugin. More... | |
unsigned | hookHints () const override |
Set the bit flags for which hooks we're going to use. More... | |
bool | postInstallation () override |
OCI Hook - Run in host namespace. | |
std::vector< std::string > | getDependencies () const override |
Should return the names of the plugins this plugin depends on. More... | |
Public Member Functions inherited from RdkPluginBase | |
virtual bool | preCreation () |
virtual bool | createRuntime () |
virtual bool | createContainer () |
virtual bool | postStart () |
virtual bool | postHalt () |
virtual bool | postStop () |
Private Member Functions | |
bool | addSocketAndEnv (const std::shared_ptr< DobbyRdkPluginUtils > utils, const std::string &rootfsPath, std::shared_ptr< rt_dobby_schema > containerConfig, std::string busStr, const std::string &socketPath, const std::string &envVar) const |
Adds the bind mount of the socket. More... | |
std::string | socketPathFromAddressSimple (const std::string &address) const |
Utility function to extract the socket path from the dbus address string. More... | |
Private Attributes | |
const std::string | mName |
std::shared_ptr< rt_dobby_schema > | mContainerConfig |
const std::string | mRootfsPath |
const std::shared_ptr< DobbyRdkPluginUtils > | mUtils |
const std::string | mDbusRunDir |
const std::string | mDbusSystemSocketPath |
const std::string | mDbusSessionSocketPath |
const std::string | mDbusDebugSocketPath |
const std::string | mDbusSystemEnvVar |
const std::string | mDbusSessionEnvVar |
const std::string | mDbusDebugEnvVar |
Additional Inherited Members | |
Public Types inherited from IDobbyRdkPlugin | |
enum | HintFlags : unsigned { PostInstallationFlag = (1 << 0) , PreCreationFlag = (1 << 1) , CreateRuntimeFlag = (1 << 2) , CreateContainerFlag = (1 << 3) , PostStartFlag = (1 << 5) , PostHaltFlag = (1 << 6) , PostStopFlag = (1 << 7) , Unknown = 0 } |
Bit flags that should be returned by hookHints. More... | |
IPC Plugin.
Gives access to dbus inside container
IpcPlugin::IpcPlugin | ( | 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.
Do not change the parameters for this constructor - must match C methods created by REGISTER_RDK_PLUGIN macro
Note plugin name is not case sensitive
|
private |
Adds the bind mount of the socket.
This also creates the mount point and sets the environment variables for the dbus code running inside the container.
|
overridevirtual |
Should return the names of the plugins this plugin depends on.
This can be used to determine the order in which the plugins should be processed when running hooks.
Reimplemented from RdkPluginBase.
|
overridevirtual |
Set the bit flags for which hooks we're going to use.
This plugin uses all the hooks so set all the flags
Implements IDobbyRdkPlugin.
|
inlineoverridevirtual |
Should return the name of the plugin.
Implements IDobbyRdkPlugin.
|
private |
Utility function to extract the socket path from the dbus address string.
This uses basic string operations
[in] | address | The dbus address trying to parse |