libnpupnp  4.1.0
An almost compatible successor for the Portable UPnP reference library
Classes | Public Member Functions | Static Public Member Functions | List of all members
NetIF::Interfaces Class Reference

Represent the system's network interfaces. Singleton class. More...

#include <netif.h>

Classes

struct  Filter
 Argument to the select() method: flags which we want or don't. More...
 

Public Member Functions

bool refresh ()
 Read the state from the system again.
 
InterfacefindByName (const char *nm) const
 Find interface by name or friendlyname.
 
InterfacefindByName (const std::string &nm) const
 Find interface by name or friendlyname.
 
std::vector< Interfaceselect (const Filter &f) const
 Return Interface objects satisfying the criteria in f.
 
std::ostream & print (std::ostream &)
 Print out, a bit like "ip addr" output.
 
const InterfaceinterfaceForAddress (const IPAddr &addr, IPAddr &hostaddr)
 Find the interface to which the input address' subnet belongs to among all the system interfaces. More...
 

Static Public Member Functions

static InterfacestheInterfaces ()
 Return the Interfaces singleton after possibly building it by querying the system.
 
static const InterfaceinterfaceForAddress (const IPAddr &addr, const std::vector< Interface > &vifs, IPAddr &hostaddr)
 Find the interface to which the input address' subnet belongs to in a vector of Interface. More...
 
static void setlogfp (FILE *fp)
 

Detailed Description

Represent the system's network interfaces. Singleton class.

Member Function Documentation

◆ interfaceForAddress() [1/2]

static const Interface* NetIF::Interfaces::interfaceForAddress ( const IPAddr addr,
const std::vector< Interface > &  vifs,
IPAddr hostaddr 
)
static

Find the interface to which the input address' subnet belongs to in a vector of Interface.

Parameters
addrthe address we're looking for
vifsthe interfaces to search
[out]hostaddrthe found interface address.
Returns
both the interface and the address inside the interface.

◆ interfaceForAddress() [2/2]

const Interface* NetIF::Interfaces::interfaceForAddress ( const IPAddr addr,
IPAddr hostaddr 
)

Find the interface to which the input address' subnet belongs to among all the system interfaces.

Parameters
addrthe address we're looking for
[out]hostaddrthe found interface address.
Returns
Both the interface and the address inside the interface.

◆ setlogfp()

static void NetIF::Interfaces::setlogfp ( FILE *  fp)
static

debug


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