22 #include "gateway/gateway.h" 25 #include "iptableentry.h" 26 #include "softwarecontainererror.h" 27 #include "networkgatewayfunctions.h" 42 LOG_DECLARE_CLASS_CONTEXT(
"NETG",
"Network gateway");
45 static constexpr
const char *ID =
"network";
48 static const constexpr
int FAILURE = -1;
49 static const constexpr
int SUCCESS = 0;
50 static const constexpr
int NO_LINK = 1;
51 static const constexpr
int BAD_LINKUP = 2;
52 static const constexpr
int BAD_LINKDOWN = 3;
60 const std::string bridgeDevice,
61 const std::string gateway,
62 const uint8_t maskBits,
63 std::shared_ptr<ContainerAbstractInterface> container);
90 bool setDefaultGateway();
123 virtual bool isBridgeAvailable();
127 std::string m_gateway;
128 std::string m_bridgeDevice;
130 std::vector<IPTableEntry> m_entries;
132 bool m_interfaceInitialized;
134 int32_t m_containerID;
144 m_message(
"NetworkGateway exception")
153 virtual const char *what()
const throw()
155 return m_message.c_str();
159 std::string m_message;
Sets up and manages network access and routing to the container.
bool activateGateway() override
Implements Gateway::activateGateway.
Gateway base class for SoftwareContainer.
Sets up and manages network access and routing to the container.
bool teardownGateway() override
Implements Gateway::teardownGateway.
NetworkGateway(const int32_t id, const std::string bridgeDevice, const std::string gateway, const uint8_t maskBits, std::shared_ptr< ContainerAbstractInterface > container)
Creates a network gateway.
Developers guide to adding a config item:
bool readConfigElement(const json_t *element) override
Gateway specific parsing of config elements.
Handles various network operations over netlink.