nidas
v1.2-1520
|
#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 |
|
inline |
|
inline |
|
inline |
The IPV4 address of the interface.
References _addr.
Referenced by nidas::core::MultipleUDPSockets::addClient(), getInterface(), nidas::util::SocketImpl::getInterface(), nidas::util::listMulticastInterfaces(), nidas::util::SocketImpl::receive(), and nidas::core::DSMServerStat::run().
|
inline |
The IPV4 broadcast address of the interface.
References _baddr.
|
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().
|
inline |
The index of the interface.
References _index.
Referenced by nidas::core::Project::findDSM(), nidas::util::listMulticastInterfaces(), and nidas::util::SocketImpl::receive().
|
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().
|
inline |
The mtu of the interface.
References _mtu.
|
inline |
The name of the interface: like "lo", "eth0", etc.
References _name.
Referenced by nidas::core::Project::findDSM(), getInterface(), nidas::util::listMulticastInterfaces(), nidas::util::SocketImpl::receive(), and nidas::core::StatusListener::run().
|
inline |
The IPV4 network mask of the interface.
References _netmask.
|
private |
Referenced by getAddress().
|
private |
Referenced by getBroadcastAddress().
|
private |
Referenced by getFlags().
|
private |
Referenced by getIndex(), and getInterface().
|
private |
Referenced by getMTU().
|
private |
Referenced by getName().
|
private |
Referenced by getNetMask().