nl::Inet::InterfaceIteratorBasis

#include <src/inet/InetInterface.h>

Iterator basis for derived iterators for the list of system network interfaces or for the list of system network interface IP addresses.

Summary

Inheritance

Direct Known Subclasses:
  nl::Inet::InterfaceAddressIterator
  nl::Inet::InterfaceIterator

Protected attributes

addrsList
struct ifaddrs *
curAddr
struct ifaddrs *
curIntf
struct netif *

Protected functions

InterfaceIteratorBasis(void)
Conventional default constructor.
~InterfaceIteratorBasis(void)
Non-virtual destructor.

Public functions

GetInterface(void)
InterfaceId
Extract the indicator of the network interface at the cursor.
HasCurrent(void) const
bool
Test whether the cursor is not yet positioned beyond the end.
SupportsMulticast(void)
bool
Inspect whether the current interface supports multicast.

Protected attributes

addrsList

struct ifaddrs * addrsList

curAddr

struct ifaddrs * curAddr

curIntf

struct netif * curIntf

Protected functions

InterfaceIteratorBasis

 InterfaceIteratorBasis(
  void
)

Conventional default constructor.

Starts the cursor at the first network interface. On some platforms, this constructor may allocate resources recycled by the destructor.

On LwIP, this constructor must be called with the LwIP stack lock acquired.

~InterfaceIteratorBasis

 ~InterfaceIteratorBasis(
  void
)

Non-virtual destructor.

Recycles any resources allocated by the constructor.

On LwIP, this destructor must be called with the LwIP stack lock acquired.

Public functions

GetInterface

InterfaceId GetInterface(
  void
)

Extract the indicator of the network interface at the cursor.

On LwIP, this method must be called with the LwIP stack lock acquired.

Details
Return Values
INET_NULL_INTERFACEID
if advanced beyond the end of the list.
id
the indicator of the current interface.

HasCurrent

bool HasCurrent(
  void
) const 

Test whether the cursor is not yet positioned beyond the end.

Advances the internal cursor either to the next network interface or to the distinguished position corresponding to no further interfaces.

Details
Returns
false if positioned beyond the end, else true.

On LwIP, this method must be called with the LwIP stack lock acquired.

SupportsMulticast

bool SupportsMulticast(
  void
)

Inspect whether the current interface supports multicast.

On LwIP, this method must be called with the LwIP stack lock acquired.

Details
Returns
false if the current interface does not support multicast or the cursor has advanced beyond the end of the list, else true.