Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Functions to set up networking for containers. More...
Functions | |
bool | setupBridgeDevice (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netfilter > &netfilter, const std::vector< std::string > &extIfaces) |
Called from host namespace. | |
bool | createNetns (const std::string &containerId) |
bool | setupVeth (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::string &rootfsPath, const std::string &containerId, const NetworkType networkType) |
Called from host namespace. | |
bool | removeVethPair (const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::string &vethName, const NetworkType networkType, const std::string &containerId) |
Remove iptables entries for the container's veth and bring the veth pair down. | |
bool | removeBridgeDevice (const std::shared_ptr< Netfilter > &netfilter, const std::vector< std::string > &extIfaces) |
Clear out the iptables rules set for the bridge device and brings the interface down. | |
void | addResolvMount (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< rt_dobby_schema > &cfg) |
Adds a mount to /etc/resolv.conf. | |
void | addNetworkNamespace (const std::shared_ptr< rt_dobby_schema > &cfg) |
Adds the 'network' namespace to the OCI config. | |
Functions to set up networking for containers.
void NetworkSetup::addNetworkNamespace | ( | const std::shared_ptr< rt_dobby_schema > & | cfg | ) |
Adds the 'network' namespace to the OCI config.
[in] | cfg | Pointer to bundle config struct |
void NetworkSetup::addResolvMount | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< rt_dobby_schema > & | cfg | ||
) |
Adds a mount to /etc/resolv.conf.
[in] | utils | Instance of DobbyRdkPluginUtils. |
[in] | cfg | Pointer to bundle config struct. |
bool NetworkSetup::removeBridgeDevice | ( | const std::shared_ptr< Netfilter > & | netfilter, |
const std::vector< std::string > & | extIfaces | ||
) |
Clear out the iptables rules set for the bridge device and brings the interface down.
[in] | netfilter | Instance of Netfilter. |
[in] | extIfaces | External interfaces on the device |
bool NetworkSetup::removeVethPair | ( | const std::shared_ptr< Netfilter > & | netfilter, |
const std::shared_ptr< NetworkingHelper > & | helper, | ||
const std::string & | vethName, | ||
const NetworkType | networkType, | ||
const std::string & | containerId | ||
) |
Remove iptables entries for the container's veth and bring the veth pair down.
[in] | netfilter | Instance of Netfilter. |
[in] | helper | Instance of NetworkingHelper. |
[in] | vethName | Name of the container's veth interface. |
[in] | networkType | Container's network type. |
bool NetworkSetup::setupBridgeDevice | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< Netfilter > & | netfilter, | ||
const std::vector< std::string > & | extIfaces | ||
) |
Called from host namespace.
This function will create the bridge device and configure it. Only run if the bridge device hasn't already been created by another container starting.
[in] | utils | Instance of DobbyRdkPluginUtils. |
[in] | netfilter | Instance of Netfilter. |
[in] | extIfaces | External interfaces on the device. |
bool NetworkSetup::setupVeth | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< Netfilter > & | netfilter, | ||
const std::shared_ptr< NetworkingHelper > & | helper, | ||
const std::string & | rootfsPath, | ||
const std::string & | containerId, | ||
const NetworkType | networkType | ||
) |
Called from host namespace.
This function does the following:
[in] | utils | Instance of DobbyRdkPluginUtils. |
[in] | netfilter | Instance of Netfilter. |
[in] | helper | Instance of NetworkingHelper. |
[in] | rootfsPath | Path to the rootfs on the host. |
[in] | containerId | The id of the container. |
[in] | networkType | Network type. |