Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
Functions
InterContainerRouting Namespace Reference

Used to add iptables firewall rules to allow a container to either expose a port to another container or to access a port on another container. More...

Functions

bool addRules (const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::shared_ptr< DobbyRdkPluginUtils > &utils, rt_defs_plugins_networking_data_inter_container_element *const *portConfigs, size_t numPortConfigs)
 Adds the necessary iptables firewall rules to enable routing of packets to / from one container to another.
 
bool removeRules (const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::shared_ptr< DobbyRdkPluginUtils > &utils, rt_defs_plugins_networking_data_inter_container_element *const *portConfigs, size_t numPortConfigs)
 Removes the inter container port forwarding rules from iptables.
 

Detailed Description

Used to add iptables firewall rules to allow a container to either expose a port to another container or to access a port on another container.

See also
the plugin's README.md for more details on usage.

This adds the necessary rules to iptables when the container is started and deletes them again when the container is stopped. All the rules are tagged (via an iptables comment) with the name of the container, this should ensure rules are correctly added and removed.

Function Documentation

◆ addRules()

bool InterContainerRouting::addRules ( const std::shared_ptr< Netfilter > &  netfilter,
const std::shared_ptr< NetworkingHelper > &  helper,
const std::shared_ptr< DobbyRdkPluginUtils > &  utils,
rt_defs_plugins_networking_data_inter_container_element *const *  portConfigs,
size_t  numPortConfigs 
)

Adds the necessary iptables firewall rules to enable routing of packets to / from one container to another.

Parameters
[in]netfilterInstance of Netfilter class.
[in]helperInstance of NetworkingHelper.
[in]utilsInstance of DobbyRdkPluginUtils.
[in]portConfigslibocispec structs containing ports to setup, both incoming and outgoing.
[in]numPortConfigsThe number of portConfigs.
Returns
true on success, otherwise false.

◆ removeRules()

bool InterContainerRouting::removeRules ( const std::shared_ptr< Netfilter > &  netfilter,
const std::shared_ptr< NetworkingHelper > &  helper,
const std::shared_ptr< DobbyRdkPluginUtils > &  utils,
rt_defs_plugins_networking_data_inter_container_element *const *  portConfigs,
size_t  numPortConfigs 
)

Removes the inter container port forwarding rules from iptables.

Parameters
[in]netfilterInstance of Netfilter class.
[in]helperInstance of NetworkingHelper.
[in]utilsInstance of DobbyRdkPluginUtils.
[in]portConfigslibocispec structs containing ports to setup, both incoming and outgoing.
[in]numPortConfigsThe number of portConfigs.
Returns
true on success, otherwise false.