Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Loading...
Searching...
No Matches
Functions
TapInterface Namespace Reference

Functions

bool platformSupportsTapInterface ()
 Returns true if the platform has the TUN/TAP device driver and therefore can create tap devices.
 
bool createTapInterface (const std::shared_ptr< Netlink > &netlink)
 Creates the Dobby tap device.
 
bool destroyTapInterface (const std::shared_ptr< Netlink > &netlink)
 Destroys the Dobby tap device if it exists.
 
bool isValid ()
 
const std::string name ()
 
bool up (const std::shared_ptr< Netlink > &netlink)
 Brings an interface up.
 
bool down (const std::shared_ptr< Netlink > &netlink)
 Takes an interface down.
 
std::array< uint8_t, 6 > macAddress (const std::shared_ptr< Netlink > &netlink)
 Gets the MAC address of the tap device.
 
bool setMACAddress (const std::shared_ptr< Netlink > &netlink, const std::array< uint8_t, 6 > &address)
 Sets the MAC address of the tap device.
 

Detailed Description

A set of function to create and destruct Tap devices.

Function Documentation

◆ createTapInterface()

bool TapInterface::createTapInterface ( const std::shared_ptr< Netlink > &  netlink)

Creates the Dobby tap device.

Remarks
Based on implementation in iproute2 source code (iptuntap.c)
Returns
true on success, false on failure.

◆ destroyTapInterface()

bool TapInterface::destroyTapInterface ( const std::shared_ptr< Netlink > &  netlink)

Destroys the Dobby tap device if it exists.

Returns
true on success, false on failure.

◆ down()

bool TapInterface::down ( const std::shared_ptr< Netlink > &  netlink)

Takes an interface down.

Parameters
[in]netlinkInstance of the Netlink class.
Returns
true on success, false on failure.

◆ macAddress()

std::array< uint8_t, 6 > TapInterface::macAddress ( const std::shared_ptr< Netlink > &  netlink)

Gets the MAC address of the tap device.

Parameters
[in]netlinkInstance of the Netlink class.
Returns
true on success, false on failure.

◆ platformSupportsTapInterface()

bool TapInterface::platformSupportsTapInterface ( )

Returns true if the platform has the TUN/TAP device driver and therefore can create tap devices.

Returns
true if supported.

◆ setMACAddress()

bool TapInterface::setMACAddress ( const std::shared_ptr< Netlink > &  netlink,
const std::array< uint8_t, 6 > &  address 
)

Sets the MAC address of the tap device.

Parameters
[in]netlinkInstance of the Netlink class.
[in]addressMAC address to be set
Returns
true on success, false on failure.

◆ up()

bool TapInterface::up ( const std::shared_ptr< Netlink > &  netlink)

Brings an interface up.

Parameters
[in]netlinkInstance of the Netlink class.
Returns
true on success, false on failure.