23#ifndef BRIDGEINTERFACE_H
24#define BRIDGEINTERFACE_H
26#include <DobbyRdkPluginUtils.h>
27#include "NetworkingHelper.h"
48 bool createBridge(
const std::shared_ptr<Netlink> &netlink);
50 bool up(
const std::shared_ptr<Netlink> &netlink);
51 bool down(
const std::shared_ptr<Netlink> &netlink);
52 bool setAddresses(
const std::shared_ptr<Netlink> &netlink);
54 const std::shared_ptr<Netlink> &netlink,
57 const std::shared_ptr<Netlink> &netlink,
60 const std::shared_ptr<Netlink> &netlink,
63 bool disableStp(
const std::shared_ptr<DobbyRdkPluginUtils> &utils);
65 bool attachLink(
const std::shared_ptr<Netlink> &netlink,
66 const std::string &name);
67 std::array<uint8_t, 6>
macAddress(
const std::shared_ptr<Netlink> &netlink);
69 const std::array<uint8_t, 6>& address);
72bool netlinkFlagsWorkaround(
short int mask,
short int flags);
73bool netlinkForwardingWorkaround(
const std::shared_ptr<DobbyRdkPluginUtils> &utils,
75bool netlinkRouteLocalNetWorkaround(
const std::shared_ptr<DobbyRdkPluginUtils> &utils,
A set of functions to setup and bring down a bridge device. The main reason to use these functions se...
bool setMACAddress(const std::shared_ptr< Netlink > &netlink, const std::array< uint8_t, 6 > &address)
Sets the MAC address of the interface.
Definition BridgeInterface.cpp:251
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.
Definition BridgeInterface.cpp:158
bool down(const std::shared_ptr< Netlink > &netlink)
Brings the Dobby bridge device down.
Definition BridgeInterface.cpp:101
bool setAddresses(const std::shared_ptr< Netlink > &netlink)
Sets the ip addresses for the bridge device.
Definition BridgeInterface.cpp:201
bool disableStp(const std::shared_ptr< DobbyRdkPluginUtils > &utils)
Disables Spanning Tree Protocol in sysfs file.
Definition BridgeInterface.cpp:222
bool destroyBridge(const std::shared_ptr< Netlink > &netlink)
Destroys the Dobby bridge device.
Definition BridgeInterface.cpp:63
std::array< uint8_t, 6 > macAddress(const std::shared_ptr< Netlink > &netlink)
Gets the MAC address of the interface.
Definition BridgeInterface.cpp:237
bool createBridge(const std::shared_ptr< Netlink > &netlink)
Creates the Dobby bridge device.
Definition BridgeInterface.cpp:48
bool up(const std::shared_ptr< Netlink > &netlink)
Brings the Dobby bridge device up.
Definition BridgeInterface.cpp:80
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.
Definition BridgeInterface.cpp:181
bool setIfaceForwarding(const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netlink > &netlink, bool enable)
Sets forwarding on the Dobby bridge device.
Definition BridgeInterface.cpp:124
bool attachLink(const std::shared_ptr< Netlink > &netlink, const std::string &name)
Attaches an interface to the bridge.
Definition BridgeInterface.cpp:267