|
| IPAllocator (const std::shared_ptr< DobbyRdkPluginUtils > &utils) |
|
in_addr_t | allocateIpAddress (const std::string &vethName) |
| Allocated an IP address for the currently running container with the specified veth.
|
|
in_addr_t | allocateIpAddress (const std::string &containerId, const std::string &vethName) |
| Allocated an IP address with the specified veth.
|
|
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.
|
|
bool | getContainerNetworkInfo (const std::string &containerId, ContainerNetworkInfo &networkInfo) const |
| Retrieves the networking information (veth, ip) for a given container.
|
|
|
static in_addr_t | stringToIpAddress (const std::string &ipAddressStr) |
| Convert an string to an IP address. Note - doesn't do any byte-order modifications.
|
|
static std::string | ipAddressToString (const in_addr_t &ipAddress) |
| Convert an IP address to string. Note - doesn't do any byte-order modifications.
|
|
◆ allocateIpAddress() [1/2]
in_addr_t IPAllocator::allocateIpAddress |
( |
const std::string & |
containerId, |
|
|
const std::string & |
vethName |
|
) |
| |
Allocated an IP address with the specified veth.
- Parameters
-
[in] | containerId | Name of the container to associate the IP with |
[in] | vethName | Name of the veth interface used by the container |
- Returns
- Allocated IP address. -1 on error
◆ allocateIpAddress() [2/2]
in_addr_t IPAllocator::allocateIpAddress |
( |
const std::string & |
vethName | ) |
|
Allocated an IP address for the currently running container with the specified veth.
- Parameters
-
[in] | vethName | Name of the veth interface used by the container |
- Returns
- Allocated IP address. -1 on error
◆ deallocateIpAddress()
bool IPAllocator::deallocateIpAddress |
( |
const std::string & |
containerId | ) |
|
Releases a previously allocated IP address back to the pool so it can be re-used by other containers.
- Parameters
-
[in] | containerId | Name of the container to deallocate the IP for |
- Returns
- True on success, false on error
◆ getContainerIpsFromDisk()
bool IPAllocator::getContainerIpsFromDisk |
( |
| ) |
|
|
private |
Synchronise the in-memory pool of allocated IPs with the disk store.
- Returns
- True on success
◆ getContainerNetworkInfo()
bool IPAllocator::getContainerNetworkInfo |
( |
const std::string & |
containerId, |
|
|
ContainerNetworkInfo & |
networkInfo |
|
) |
| const |
Retrieves the networking information (veth, ip) for a given container.
- Parameters
-
[in] | containerId | Name of the container to retrieve the information about |
[out] | networkInfo | Struct to store the container network info in |
- Returns
- True on success, false on failure
◆ getNetworkInfo()
bool IPAllocator::getNetworkInfo |
( |
const std::string & |
filePath, |
|
|
ContainerNetworkInfo & |
networkInfo |
|
) |
| const |
|
private |
Retrieves the networking information (veth, ip) from a file from the store.
- Parameters
-
[in] | filePath | Path to the file to parse for information about the container network |
[out] | networkInfo | Struct to store the container network info in |
- Returns
- True on success, false on failure
◆ ipAddressToString()
std::string IPAllocator::ipAddressToString |
( |
const in_addr_t & |
ipAddress | ) |
|
|
static |
Convert an IP address to string. Note - doesn't do any byte-order modifications.
- Parameters
-
[in] | ipAddress | IP Address to convert |
- Returns
- IP address string
◆ stringToIpAddress()
in_addr_t IPAllocator::stringToIpAddress |
( |
const std::string & |
ipAddr | ) |
|
|
static |
Convert an string to an IP address. Note - doesn't do any byte-order modifications.
- Parameters
-
[in] | ipAddr | IP Address to convert |
- Returns
- IP address integer
The documentation for this class was generated from the following files:
- rdkPlugins/Networking/include/IPAllocator.h
- rdkPlugins/Networking/source/IPAllocator.cpp