Post

Replies

Boosts

Views

Activity

Enumerating available interfaces for use with NWEthernetChannel
We need to enumerate the available network interfaces(NWInterface) which can be used to initialize a NWEthernetChannel. Note that this is for creating a custom network protocol. So we don't expect these interfaces to have any Internet connectivity. In fact, we want to be able to enumerate the interfaces even when the cable is disconnected. So we cannot use use the method described in this thread - which only works for interfaces which have a cable connection: Getting NWInterface for ... - https://developer.apple.com/forums/thread/128215 Alternatively, is there a way to get an NWInterface from a SCNetworkInterfaceRef (obtained via SCNetworkServiceCopyAll() - SCNetworkServiceGetInterface())? There is the undocumented nw_interface_create_with_name() - but I'm not sure if that's a good idea. Thanks. Devendra.
9
0
2.9k
Apr ’21