libDwm-0.9.45
Dwm::LocalInterface Class Reference

Simple class to hold the name and IPv4 address of a local interface. More...

#include <DwmLocalInterfaces.hh>

Public Member Functions

 LocalInterface ()
 Constructor.
 
const std::string & Name () const
 Returns the interface name.
 
const std::string & Name (const std::string &name)
 Sets and returns the interface name.
 
const Ipv4AddressAddr () const
 Returns the interface address.
 
const Ipv4AddressAddr (const Ipv4Address &addr)
 Sets and returns the interface address.
 
const Ipv4AddressMask () const
 Returns the interface netmask.
 
const Ipv4AddressMask (const Ipv4Address &mask)
 Sets and returns the interface netmask.
 
int Mtu () const
 Returns the MTU.
 
int Mtu (int mtu)
 Sets and returns the MTU.
 
bool IsUp () const
 Returns true if the interface is administratively 'up'.
 
bool IsRunning () const
 
bool AddAlias (const Ipv4Address &address, const Ipv4Address &netmask)
 Adds an alias with the given address and netmask.
 
bool RemoveAlias (const Ipv4Address &address, const Ipv4Address &netmask)
 Removes an alias with the given address and netmask.
 
const std::set< LocalInterfaceAlias > & Aliases () const
 Returns a const reference to the aliases.
 
std::set< LocalInterfaceAlias > & Aliases ()
 Returns a mutable reference to the aliases.
 

Friends

std::ostream & operator<< (std::ostream &os, const LocalInterface &li)
 Prints a LocalInterface to an ostream.
 

Detailed Description

Simple class to hold the name and IPv4 address of a local interface.

Member Function Documentation

◆ AddAlias()

bool Dwm::LocalInterface::AddAlias ( const Ipv4Address & address,
const Ipv4Address & netmask )

Adds an alias with the given address and netmask.

Returns true on success, false on failure.

◆ IsUp()

bool Dwm::LocalInterface::IsUp ( ) const

Returns true if the interface is administratively 'up'.

This says nothing about the link state.

◆ RemoveAlias()

bool Dwm::LocalInterface::RemoveAlias ( const Ipv4Address & address,
const Ipv4Address & netmask )

Removes an alias with the given address and netmask.

Returns true on success, false on failure.


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