nidas  v1.2-1520
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
nidas::util::Inet4NetworkInterface Class Reference

#include <Inet4NetworkInterface.h>

Public Member Functions

 Inet4NetworkInterface ()
 
 Inet4NetworkInterface (const std::string &name, Inet4Address addr, Inet4Address brdcastAddr, Inet4Address netmask, int mtu, int index, short flags)
 
const std::string & getName () const
 The name of the interface: like "lo", "eth0", etc. More...
 
int getIndex () const
 The index of the interface. More...
 
Inet4Address getAddress () const
 The IPV4 address of the interface. More...
 
Inet4Address getBroadcastAddress () const
 The IPV4 broadcast address of the interface. More...
 
Inet4Address getNetMask () const
 The IPV4 network mask of the interface. More...
 
int getMTU () const
 The mtu of the interface. More...
 
short getFlags () const
 The interface flags. More...
 

Static Public Member Functions

static Inet4NetworkInterface getInterface (const Inet4Address &addr) throw (nidas::util::IOException)
 Return an Inet4NetworkInterface corresponding to the given address. More...
 

Private Attributes

std::string _name
 
int _index
 
Inet4Address _addr
 
Inet4Address _baddr
 
Inet4Address _netmask
 
int _mtu
 
short _flags
 

Constructor & Destructor Documentation

nidas::util::Inet4NetworkInterface::Inet4NetworkInterface ( )
inline
nidas::util::Inet4NetworkInterface::Inet4NetworkInterface ( const std::string &  name,
Inet4Address  addr,
Inet4Address  brdcastAddr,
Inet4Address  netmask,
int  mtu,
int  index,
short  flags 
)
inline

Member Function Documentation

Inet4Address nidas::util::Inet4NetworkInterface::getAddress ( ) const
inline
Inet4Address nidas::util::Inet4NetworkInterface::getBroadcastAddress ( ) const
inline

The IPV4 broadcast address of the interface.

References _baddr.

short nidas::util::Inet4NetworkInterface::getFlags ( ) const
inline

The interface flags.

Use macros like IFF_UP, IFF_BROADCAST, IFF_POINTOPOINT, IFF_MULTICAST, IFF_LOOPBACK from net/if.h to check for capabilities. See man netdevice.

References _flags.

Referenced by nidas::util::SocketImpl::joinGroup(), nidas::util::listMulticastInterfaces(), nidas::core::StatusListener::run(), and nidas::core::DSMServerStat::run().

int nidas::util::Inet4NetworkInterface::getIndex ( ) const
inline
Inet4NetworkInterface Inet4NetworkInterface::getInterface ( const Inet4Address addr)
throw (nidas::util::IOException
)
static

Return an Inet4NetworkInterface corresponding to the given address.

If the address does not match the address of an interface on this host, then the Inet4NetworkInterface returned will have a getIndex() value of -1. This static method will throw an IOException if a temporary TCP Socket cannot be created on this host, or if the system call to fetch its interfaces fails.

References _index, nidas::util::Socket::close(), DLOG, getAddress(), nidas::util::Socket::getInterfaces(), and getName().

Referenced by nidas::core::Project::findDSM(), nidas::util::MulticastSocket::getInterface(), and nidas::util::SocketImpl::receive().

int nidas::util::Inet4NetworkInterface::getMTU ( ) const
inline

The mtu of the interface.

References _mtu.

const std::string& nidas::util::Inet4NetworkInterface::getName ( ) const
inline
Inet4Address nidas::util::Inet4NetworkInterface::getNetMask ( ) const
inline

The IPV4 network mask of the interface.

References _netmask.

Member Data Documentation

Inet4Address nidas::util::Inet4NetworkInterface::_addr
private

Referenced by getAddress().

Inet4Address nidas::util::Inet4NetworkInterface::_baddr
private

Referenced by getBroadcastAddress().

short nidas::util::Inet4NetworkInterface::_flags
private

Referenced by getFlags().

int nidas::util::Inet4NetworkInterface::_index
private

Referenced by getIndex(), and getInterface().

int nidas::util::Inet4NetworkInterface::_mtu
private

Referenced by getMTU().

std::string nidas::util::Inet4NetworkInterface::_name
private

Referenced by getName().

Inet4Address nidas::util::Inet4NetworkInterface::_netmask
private

Referenced by getNetMask().


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