23#include <DobbyRdkPluginUtils.h>
24#include "NetworkingPluginCommon.h"
30#define TOTAL_ADDRESS_POOL_SIZE 250
37 IPAllocator(
const std::shared_ptr<DobbyRdkPluginUtils> &utils);
42 in_addr_t
allocateIpAddress(
const std::string &containerId,
const std::string &vethName);
55 const std::shared_ptr<DobbyRdkPluginUtils> mUtils;
56 const in_addr_t mBeginAddress;
57 const in_addr_t mEndAddress;
59 std::vector<ContainerNetworkInfo> mAllocatedIps;
Class for useful utility methods for plugins such as adding mounts and environment variables.
Definition DobbyRdkPluginUtils.h:79
Definition IPAllocator.h:35
bool getNetworkInfo(const std::string &filePath, ContainerNetworkInfo &networkInfo) const
Retrieves the networking information (veth, ip) from a file from the store.
Definition IPAllocator.cpp:179
static std::string ipAddressToString(const in_addr_t &ipAddress)
Convert an IP address to string. Note - doesn't do any byte-order modifications.
Definition IPAllocator.cpp:306
bool getContainerIpsFromDisk()
Synchronise the in-memory pool of allocated IPs with the disk store.
Definition IPAllocator.cpp:221
bool deallocateIpAddress(const std::string &containerId)
Releases a previously allocated IP address back to the pool so it can be re-used by other containers.
Definition IPAllocator.cpp:122
static in_addr_t stringToIpAddress(const std::string &ipAddressStr)
Convert an string to an IP address. Note - doesn't do any byte-order modifications.
Definition IPAllocator.cpp:288
bool getContainerNetworkInfo(const std::string &containerId, ContainerNetworkInfo &networkInfo) const
Retrieves the networking information (veth, ip) for a given container.
Definition IPAllocator.cpp:165
in_addr_t allocateIpAddress(const std::string &vethName)
Allocated an IP address for the currently running container with the specified veth.
Definition IPAllocator.cpp:62
Definition DobbyRdkPluginUtils.h:55