Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
A set of functions to setup and bring down a bridge device. The main reason to use these functions separately rather than direct calls to a netlink object from NetworkSetup.cpp is to provide workarounds for libnl versions 3.3.x - 3.4.x. More...
Functions | |
bool | createBridge (const std::shared_ptr< Netlink > &netlink) |
Creates the Dobby bridge device. | |
bool | destroyBridge (const std::shared_ptr< Netlink > &netlink) |
Destroys the Dobby bridge device. | |
bool | up (const std::shared_ptr< Netlink > &netlink) |
Brings the Dobby bridge device up. | |
bool | down (const std::shared_ptr< Netlink > &netlink) |
Brings the Dobby bridge device down. | |
bool | setAddresses (const std::shared_ptr< Netlink > &netlink) |
Sets the ip addresses for the bridge device. | |
bool | setIfaceForwarding (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netlink > &netlink, bool enable) |
Sets forwarding on the Dobby bridge device. | |
bool | setIfaceRouteLocalNet (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netlink > &netlink, bool enable) |
Sets the route_localnet on the Dobby bridge device. | |
bool | setIfaceAcceptRa (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netlink > &netlink, int value) |
Sets the accept_ra on the Dobby bridge device. | |
bool | disableStp (const std::shared_ptr< DobbyRdkPluginUtils > &utils) |
Disables Spanning Tree Protocol in sysfs file. | |
bool | attachLink (const std::shared_ptr< Netlink > &netlink, const std::string &name) |
Attaches an interface to the bridge. | |
std::array< uint8_t, 6 > | macAddress (const std::shared_ptr< Netlink > &netlink) |
Gets the MAC address of the interface. | |
bool | setMACAddress (const std::shared_ptr< Netlink > &netlink, const std::array< uint8_t, 6 > &address) |
Sets the MAC address of the interface. | |
A set of functions to setup and bring down a bridge device. The main reason to use these functions separately rather than direct calls to a netlink object from NetworkSetup.cpp is to provide workarounds for libnl versions 3.3.x - 3.4.x.
bool BridgeInterface::attachLink | ( | const std::shared_ptr< Netlink > & | netlink, |
const std::string & | name | ||
) |
Attaches an interface to the bridge.
[in] | netlink | Instance of the Netlink class |
[in] | name | The name of the interface to attach. |
bool BridgeInterface::createBridge | ( | const std::shared_ptr< Netlink > & | netlink | ) |
Creates the Dobby bridge device.
[in] | netlink | Instance of the Netlink class. |
bool BridgeInterface::destroyBridge | ( | const std::shared_ptr< Netlink > & | netlink | ) |
Destroys the Dobby bridge device.
[in] | netlink | Instance of the Netlink class. |
bool BridgeInterface::disableStp | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils | ) |
Disables Spanning Tree Protocol in sysfs file.
[in] | utils | Instance of DobbyRdkPluginUtils |
bool BridgeInterface::down | ( | const std::shared_ptr< Netlink > & | netlink | ) |
Brings the Dobby bridge device down.
Uses a workaround function if needed (libnl v3.3.x-3.4.0).
[in] | netlink | Instance of the Netlink class. |
std::array< uint8_t, 6 > BridgeInterface::macAddress | ( | const std::shared_ptr< Netlink > & | netlink | ) |
Gets the MAC address of the interface.
[in] | netlink | Instance of the Netlink class |
bool BridgeInterface::setAddresses | ( | const std::shared_ptr< Netlink > & | netlink | ) |
Sets the ip addresses for the bridge device.
This is the equivalent of the following on the command line
ifconfig <BRIDGE_NAME> <address> netmask <netmask> ifconfig <BRIDGE_NAME> inet6 add <address>/<netmask>
[in] | netlink | Instance of the Netlink class |
bool BridgeInterface::setIfaceAcceptRa | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< Netlink > & | netlink, | ||
int | value | ||
) |
Sets the accept_ra on the Dobby bridge device.
[in] | utils | Instance of the DobbyRdkPluginUtils class. |
[in] | netlink | Instance of the Netlink class. |
[in] | value | value to set to accept_ra. |
bool BridgeInterface::setIfaceForwarding | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< Netlink > & | netlink, | ||
bool | enable | ||
) |
Sets forwarding on the Dobby bridge device.
Uses a workaround function if needed (libnl v3.3.x-3.4.0).
[in] | utils | Instance of the DobbyRdkPluginUtils class. |
[in] | netlink | Instance of the Netlink class. |
[in] | enable | true to enable, false to disable. |
bool BridgeInterface::setIfaceRouteLocalNet | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< Netlink > & | netlink, | ||
bool | enable | ||
) |
Sets the route_localnet on the Dobby bridge device.
Uses a workaround function if needed (libnl v3.3.x-3.4.0).
[in] | utils | Instance of the DobbyRdkPluginUtils class. |
[in] | netlink | Instance of the Netlink class. |
[in] | enable | true to enable, false to disable. |
bool BridgeInterface::setMACAddress | ( | const std::shared_ptr< Netlink > & | netlink, |
const std::array< uint8_t, 6 > & | address | ||
) |
Sets the MAC address of the interface.
[in] | netlink | Instance of the Netlink class |
[in] | address | The mac address to set. |
bool BridgeInterface::up | ( | const std::shared_ptr< Netlink > & | netlink | ) |
Brings the Dobby bridge device up.
Uses a workaround function if needed (libnl v3.3.x-3.4.0).
[in] | netlink | Instance of the Netlink class. |