Leosac  0.8.0
Open Source Access Control
Leosac::NetworkConfig Class Reference

Class that helps configuring the network. More...

#include <networkconfig.hpp>

+ Collaboration diagram for Leosac::NetworkConfig:

Public Member Functions

 NetworkConfig (const Kernel &k, const boost::property_tree::ptree &cfg)
 
 ~NetworkConfig ()=default
 
 NetworkConfig (const NetworkConfig &other)=delete
 
NetworkConfigoperator= (const NetworkConfig &other)=delete
 
void reload ()
 
void setEnabled (bool state)
 
void setDHCP (bool enabled)
 
void setCustomIP (bool enabled)
 

Private Attributes

boost::property_tree::ptree config_
 Network configuration. More...
 
bool _enabled
 
std::string _interface
 
bool _dhcpEnabled
 
std::string _netmask
 
std::string _ip
 
std::string _defaultIp
 
std::string _gateway
 
const Kernelkernel_
 

Static Private Attributes

static constexpr const char * NetCfgFile = "interfaces"
 

Detailed Description

Class that helps configuring the network.

See also
Network Configuration for end-user documentation.

Definition at line 40 of file networkconfig.hpp.

Constructor & Destructor Documentation

◆ NetworkConfig() [1/2]

NetworkConfig::NetworkConfig ( const Kernel k,
const boost::property_tree::ptree &  cfg 
)
explicit

Definition at line 35 of file networkconfig.cpp.

◆ ~NetworkConfig()

Leosac::NetworkConfig::~NetworkConfig ( )
default

◆ NetworkConfig() [2/2]

Leosac::NetworkConfig::NetworkConfig ( const NetworkConfig other)
delete

Member Function Documentation

◆ operator=()

NetworkConfig& Leosac::NetworkConfig::operator= ( const NetworkConfig other)
delete

◆ reload()

void NetworkConfig::reload ( )

Definition at line 64 of file networkconfig.cpp.

◆ setCustomIP()

void NetworkConfig::setCustomIP ( bool  enabled)

Definition at line 98 of file networkconfig.cpp.

◆ setDHCP()

void NetworkConfig::setDHCP ( bool  enabled)

Definition at line 88 of file networkconfig.cpp.

◆ setEnabled()

void NetworkConfig::setEnabled ( bool  state)

Definition at line 83 of file networkconfig.cpp.

Member Data Documentation

◆ _defaultIp

std::string Leosac::NetworkConfig::_defaultIp
private

Definition at line 73 of file networkconfig.hpp.

◆ _dhcpEnabled

bool Leosac::NetworkConfig::_dhcpEnabled
private

Definition at line 70 of file networkconfig.hpp.

◆ _enabled

bool Leosac::NetworkConfig::_enabled
private

Definition at line 68 of file networkconfig.hpp.

◆ _gateway

std::string Leosac::NetworkConfig::_gateway
private

Definition at line 74 of file networkconfig.hpp.

◆ _interface

std::string Leosac::NetworkConfig::_interface
private

Definition at line 69 of file networkconfig.hpp.

◆ _ip

std::string Leosac::NetworkConfig::_ip
private

Definition at line 72 of file networkconfig.hpp.

◆ _netmask

std::string Leosac::NetworkConfig::_netmask
private

Definition at line 71 of file networkconfig.hpp.

◆ config_

boost::property_tree::ptree Leosac::NetworkConfig::config_
private

Network configuration.

Definition at line 66 of file networkconfig.hpp.

◆ kernel_

const Kernel& Leosac::NetworkConfig::kernel_
private

Definition at line 76 of file networkconfig.hpp.

◆ NetCfgFile

constexpr const char* Leosac::NetworkConfig::NetCfgFile = "interfaces"
staticconstexprprivate

Definition at line 42 of file networkconfig.hpp.


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