Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::rdm::FakeNetworkManager Class Reference

Detailed Description

An implementation of NetworkManagerInterface which simulates a network configuration.

Inheritance diagram for ola::rdm::FakeNetworkManager:
Inheritance graph
[legend]
Collaboration diagram for ola::rdm::FakeNetworkManager:
Collaboration graph
[legend]

Public Member Functions

 FakeNetworkManager (const std::vector< ola::network::Interface > &interfaces, const int32_t ipv4_default_route_if_index, const ola::network::IPV4Address ipv4_default_route, const std::string &hostname, const std::string &domain_name, const std::vector< ola::network::IPV4Address > &name_servers)
 Create a new FakeNetworkManager. More...
 
const ola::network::InterfacePickerGetInterfacePicker () const
 
rdm_dhcp_status GetDHCPStatus (const ola::network::Interface &iface) const
 
bool GetIPV4DefaultRoute (int32_t *if_index, ola::network::IPV4Address *default_route) const
 
const std::string GetHostname () const
 
const std::string GetDomainName () const
 
bool GetNameServers (std::vector< ola::network::IPV4Address > *name_servers) const
 

Constructor & Destructor Documentation

◆ FakeNetworkManager()

ola::rdm::FakeNetworkManager::FakeNetworkManager ( const std::vector< ola::network::Interface > &  interfaces,
const int32_t  ipv4_default_route_if_index,
const ola::network::IPV4Address  ipv4_default_route,
const std::string &  hostname,
const std::string &  domain_name,
const std::vector< ola::network::IPV4Address > &  name_servers 
)

Create a new FakeNetworkManager.

Parameters
interfacesthe interfaces to return
ipv4_default_route_if_indexthe interface that has the default gateway
ipv4_default_routethe default gateway
hostnamethe hostname
domain_namethe domain name
name_serversthe name servers to return.

Member Function Documentation

◆ GetDHCPStatus()

rdm_dhcp_status ola::rdm::FakeNetworkManager::GetDHCPStatus ( const ola::network::Interface iface) const
virtual

Get the DHCP status of an interface

Parameters
ifacethe interface to check the DHCP status of
Returns
One of DHCP_STATUS_ACTIVE, DHCP_STATUS_INACTIVE or DHCP_STATUS_UNKNOWN.

Implements ola::rdm::NetworkManagerInterface.

◆ GetDomainName()

const string ola::rdm::FakeNetworkManager::GetDomainName ( ) const
virtual

Get the domain name

Implements ola::rdm::NetworkManagerInterface.

◆ GetHostname()

const string ola::rdm::FakeNetworkManager::GetHostname ( ) const
virtual

Get the hostname

Implements ola::rdm::NetworkManagerInterface.

◆ GetInterfacePicker()

const InterfacePicker * ola::rdm::FakeNetworkManager::GetInterfacePicker ( ) const
virtual

Get the interface picker

Implements ola::rdm::NetworkManagerInterface.

◆ GetIPV4DefaultRoute()

bool ola::rdm::FakeNetworkManager::GetIPV4DefaultRoute ( int32_t *  if_index,
ola::network::IPV4Address default_route 
) const
virtual

Get the IPv4 default route

Parameters
[out]if_indexthe index of the interface the machine's default is on
[out]default_routethe machine's default route as an IPV4Address object
Returns
true if we managed to fetch the default route, false otherwise
Note
if it manages to fetch the route information and there isn't a route, it will return the special wildcard address, which can be tested for with IsWildcard().

Implements ola::rdm::NetworkManagerInterface.

◆ GetNameServers()

bool ola::rdm::FakeNetworkManager::GetNameServers ( std::vector< ola::network::IPV4Address > *  name_servers) const
virtual

Get name servers

Implements ola::rdm::NetworkManagerInterface.


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