Veethree D7 SDK
Loading...
Searching...
No Matches
vsdk::comms::network_manager Class Reference

Detailed Description

The network_manager class.

This class is responsible for managing network interfaces available for the target.

#include <network_manager.h>

Static Public Member Functions

static std::vector< interface > get_interfaces ()
 Return all the network interfaces available for the target.
static interface get_interface (std::string_view iface)
 Return the interface information identified by iface.

Detailed Description

The network_manager class.

This class is responsible for managing network interfaces available for the target.

Member Function Documentation

◆ get_interface()

interface vsdk::comms::network_manager::get_interface ( std::string_view iface)
static

Return the interface information identified by iface.

Parameters
ifaceThe interface name, e.g. eth0.
Returns
A vsdk::comms::interface struct with iface info.
Exceptions
std::runtime_error

Sample code:

void fn()
{
using namespace vsdk::comms;
using namespace vsdk;
auto const iface = network_manager::get_interface("eth0");
utils::print("name {}, ip {}\n", iface.name(), iface.ip());
}
static interface get_interface(std::string_view iface)
Return the interface information identified by iface.
Add include this file to your file so you have access to fmtlib header-only implementation.
void print(fmt::format_string< Args... > fmt, Args &&...args) noexcept
Exception-safe fmt::print wrapper.
Definition fmt_wrapper.h:26
Any entities that belong to the comms library.
Definition can_adapter.h:12
Any entities that belong to the Veethree SDK libraries.
Definition can_adapter.h:12
The network_manager interface.

◆ get_interfaces()

std::vector< interface > vsdk::comms::network_manager::get_interfaces ( )
static

Return all the network interfaces available for the target.

Returns
A std::vector<vsdk::comms::interface> with all interfaces.
Exceptions
std::runtime_error

Sample code:

void fn()
{
using namespace vsdk::comms;
using namespace vsdk;
for (auto& const iface : network_manager::get_interfaces())
{
utils::print("name {}, ip {}\n", iface.name(), iface.ip());
}
}
static std::vector< interface > get_interfaces()
Return all the network interfaces available for the target.

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