nl::Inet::InterfaceIterator

#include <src/inet/InetInterface.h>

Iterator for the list of system network interfaces.

Summary

Use objects of this class to iterate the list of system network interfaces.

On LwIP systems, it is recommended that the LwIP stack lock be acquired and not released over the entire lifetime of an object of this class.

On some platforms, network interfaces without any IP addresses attached are not iterated.

Constructors and Destructors

InterfaceIterator(void)
Conventional default constructor.
~InterfaceIterator(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.
Next(void)
bool
Advance the cursor to the next network interface.
SupportsMulticast(void)
bool
Inspect whether the current interface supports multicast.

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.

InterfaceIterator

 InterfaceIterator(
  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.

Next

bool Next(
  void
)

Advance the cursor to the next network interface.

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

Details
Returns
false if advanced 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.

~InterfaceIterator

 ~InterfaceIterator(
  void
)

Non-virtual destructor.

Recycles any resources allocated by the constructor.

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