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 Ipv4Address & | Addr () const |
| Returns the interface address. | |
| const Ipv4Address & | Addr (const Ipv4Address &addr) |
| Sets and returns the interface address. | |
| const Ipv4Address & | Mask () const |
| Returns the interface netmask. | |
| const Ipv4Address & | Mask (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. | |
Simple class to hold the name and IPv4 address of a local interface.
| 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.
| bool Dwm::LocalInterface::IsUp | ( | ) | const |
Returns true if the interface is administratively 'up'.
This says nothing about the link state.
| 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.