libnpupnp: NetIF::Interfaces Class Reference

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.
Interface * | findByName (const char *nm) const
| Find interface by name or friendlyname.
Interface * | findByName (const std::string &nm) const
| Find interface by name or friendlyname.
std::vector< Interface > | select (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 Interface * | interfaceForAddress (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 Interfaces * | theInterfaces ()
| Return the Interfaces singleton after possibly building it by querying the system.
static const Interface * | interfaceForAddress (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

  | addr | the address we're looking for
  | vifs | the interfaces to search
  [out] | hostaddr | the 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

  | addr | the address we're looking for
  [out] | hostaddr | the 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:

- /home/dockes/projets/mpdupnp/npupnp/src/inc/netif.h