#include <evo/net_interface.h>
Query network adapter interfaces from OS.
- Use Iter to iterate through interfaces and addresses
- The same interface may be returned multiple times with different address (IPv4, IPv6, etc)
- Destroying this invalidates all iterators using it
- Example
int main() {
addr.format(ipstr.
clear());
c.
out << iter->name <<
'\t' << ipstr <<
NL;
}
}
}
◆ Iter
◆ SysItem
◆ NetworkInterfaces()
Constructor queries OS for interfaces.
- Use Iter to iterate through interfaces, which will reference allocated interface data
- Parameters
-
family | Filter by address family, AF_UNSPEC for all |
active | Find active interfaces, false for all interfaces |
◆ ~NetworkInterfaces()
Destructor frees interface data.
- Any iterators referencing interface data are invalidated
The documentation for this class was generated from the following file: