ndn::util::NetworkInterface Class Reference

Represents one network interface attached to the host. More...

#include <network-interface.hpp>

Collaboration diagram for ndn::util::NetworkInterface:
[legend]

Public Member Functions

int getIndex () const
 Returns an opaque ID that uniquely identifies the interface on the system. More...
 
std::string getName () const
 Returns the name of the interface, unique on the system. More...
 
InterfaceType getType () const
 Returns the hardware type of the interface. More...
 
uint32_t getFlags () const
 Returns a bitset of platform-specific flags enabled on the interface. More...
 
InterfaceState getState () const
 Returns the current state of the interface. More...
 
uint32_t getMtu () const
 Returns the MTU (maximum transmission unit) of the interface. More...
 
ethernet::Address getEthernetAddress () const
 Returns the link-layer (Ethernet) address of the interface. More...
 
ethernet::Address getEthernetBroadcastAddress () const
 Returns the link-layer (Ethernet) broadcast address of the interface. More...
 
const std::set< NetworkAddress > & getNetworkAddresses () const
 Returns a list of all network-layer addresses present on the interface. More...
 
bool isLoopback () const
 Returns true if the interface is a loopback interface. More...
 
bool isPointToPoint () const
 Returns true if the interface is a point-to-point interface. More...
 
bool canBroadcast () const
 Returns true if the interface supports broadcast communication. More...
 
bool canMulticast () const
 Returns true if the interface supports multicast communication. More...
 
bool isUp () const
 Returns true if the interface is administratively up. More...
 

Data Fields

Signal< NetworkInterface, InterfaceState, InterfaceStateonStateChanged
 Fires when interface state changes. More...
 
Signal< NetworkInterface, uint32_t, uint32_t > onMtuChanged
 Fires when interface mtu changes. More...
 
Signal< NetworkInterface, NetworkAddressonAddressAdded
 Fires when a network-layer address is added to the interface. More...
 
Signal< NetworkInterface, NetworkAddressonAddressRemoved
 Fires when a network-layer address is removed from the interface. More...
 

Friends

class NetworkMonitor::Impl
 

Detailed Description

Represents one network interface attached to the host.

Each network interface has a unique index, a name, and a set of flags indicating its capabilities and current state. It may contain one hardware (Ethernet) address, and zero or more network-layer (IP) addresses. Specific signals are emitted when the interface data change.

Definition at line 70 of file network-interface.hpp.

Member Function Documentation

bool ndn::util::NetworkInterface::canBroadcast ( ) const
inline

Returns true if the interface supports broadcast communication.

Definition at line 181 of file network-interface.hpp.

bool ndn::util::NetworkInterface::canMulticast ( ) const
inline

Returns true if the interface supports multicast communication.

Definition at line 189 of file network-interface.hpp.

ethernet::Address ndn::util::NetworkInterface::getEthernetAddress ( ) const
inline

Returns the link-layer (Ethernet) address of the interface.

Definition at line 141 of file network-interface.hpp.

ethernet::Address ndn::util::NetworkInterface::getEthernetBroadcastAddress ( ) const
inline

Returns the link-layer (Ethernet) broadcast address of the interface.

Definition at line 149 of file network-interface.hpp.

uint32_t ndn::util::NetworkInterface::getFlags ( ) const
inline

Returns a bitset of platform-specific flags enabled on the interface.

Definition at line 117 of file network-interface.hpp.

int ndn::util::NetworkInterface::getIndex ( ) const
inline

Returns an opaque ID that uniquely identifies the interface on the system.

Definition at line 93 of file network-interface.hpp.

uint32_t ndn::util::NetworkInterface::getMtu ( ) const
inline

Returns the MTU (maximum transmission unit) of the interface.

Definition at line 133 of file network-interface.hpp.

std::string ndn::util::NetworkInterface::getName ( ) const
inline

Returns the name of the interface, unique on the system.

Definition at line 101 of file network-interface.hpp.

const std::set<NetworkAddress>& ndn::util::NetworkInterface::getNetworkAddresses ( ) const
inline

Returns a list of all network-layer addresses present on the interface.

Definition at line 157 of file network-interface.hpp.

InterfaceState ndn::util::NetworkInterface::getState ( ) const
inline

Returns the current state of the interface.

Definition at line 125 of file network-interface.hpp.

InterfaceType ndn::util::NetworkInterface::getType ( ) const
inline

Returns the hardware type of the interface.

Definition at line 109 of file network-interface.hpp.

bool ndn::util::NetworkInterface::isLoopback ( ) const
inline

Returns true if the interface is a loopback interface.

Definition at line 165 of file network-interface.hpp.

bool ndn::util::NetworkInterface::isPointToPoint ( ) const
inline

Returns true if the interface is a point-to-point interface.

Definition at line 173 of file network-interface.hpp.

bool ndn::util::NetworkInterface::isUp ( ) const
inline

Returns true if the interface is administratively up.

Definition at line 197 of file network-interface.hpp.

Friends And Related Function Documentation

friend class NetworkMonitor::Impl
friend

Definition at line 237 of file network-interface.hpp.

Field Documentation

Signal<NetworkInterface, NetworkAddress> ndn::util::NetworkInterface::onAddressAdded

Fires when a network-layer address is added to the interface.

Definition at line 83 of file network-interface.hpp.

Signal<NetworkInterface, NetworkAddress> ndn::util::NetworkInterface::onAddressRemoved

Fires when a network-layer address is removed from the interface.

Definition at line 87 of file network-interface.hpp.

Signal<NetworkInterface, uint32_t , uint32_t > ndn::util::NetworkInterface::onMtuChanged

Fires when interface mtu changes.

Definition at line 79 of file network-interface.hpp.

Signal<NetworkInterface, InterfaceState , InterfaceState > ndn::util::NetworkInterface::onStateChanged

Fires when interface state changes.

Definition at line 75 of file network-interface.hpp.