Enumerating network interfaces and querying their properties
Is there a portable way to enumerate network interfaces and query their properties? I don't see anything in ASIO for that. Any recommendations for other libraries? So far the closest I've come is Python's netifaces library. (Maybe someone would like to fork the Python library's C source and bring it into Boost?) https://github.com/al45tair/netifaces I've got an app that configures a remote IoT device on the same segment and then opens UDP listeners to listen for a stream of data from the device. The user specifies the hostname or address of the device. I'd like to be able to restrict the listeners to just the interface that the device is connected to. I have two interfaces, one for the LAN and one for devices, and I don't want to listen on the LAN interface. So ideally I'd get the list of interfaces and their addresses and netmasks. I think I also need the routing table. I can then identify which interface will receive the incoming UDP stream.
participants (1)
-
Kenneth Porter