Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
NetworkingHelper Class Reference

Public Member Functions

 NetworkingHelper (bool ipv4Enabled, bool ipv6Enabled)
 
bool storeContainerInterface (in_addr_t addr, const std::string &vethName)
 Constructs addresses for the container based on input address. Also stores the veth device used for the container. More...
 
bool ipv4 () const
 
in_addr_t ipv4Addr () const
 
std::string ipv4AddrStr () const
 
bool ipv6 () const
 
struct in6_addr ipv6Addr () const
 
std::string ipv6AddrStr () const
 
std::string vethName () const
 

Static Public Member Functions

static struct in6_addr in6addrCreate (const in_addr_t inaddr)
 Constructs an IPv6 address to be used by Dobby. More...
 

Private Attributes

bool mIpv4Enabled
 
in_addr_t mIpv4Addr
 
std::string mIpv4AddrStr
 
bool mIpv6Enabled
 
struct in6_addr mIpv6Addr
 
std::string mIpv6AddrStr
 
std::string mVethName
 

Member Function Documentation

◆ in6addrCreate()

struct in6_addr NetworkingHelper::in6addrCreate ( const in_addr_t  inaddr)
static

Constructs an IPv6 address to be used by Dobby.

Takes an IPv4 address type and merges it into IN6ADDR_BASE to make a unique IPv6 address.

The final address will be 2080:d0bb:1e::nnnn:nnnn, where the "n"s will be replaced by the IPv4 address binary.

Parameters
[in]inaddrIPv4 address to merge to the base address
Returns
IPv6 address

◆ storeContainerInterface()

bool NetworkingHelper::storeContainerInterface ( in_addr_t  addr,
const std::string &  vethName 
)

Constructs addresses for the container based on input address. Also stores the veth device used for the container.

Parameters
[in]addrIPv4 address to construct addresses from.
[in]vethNameName of the veth device reserved for the container.
Returns
true if successful, otherwise false

The documentation for this class was generated from the following files: