Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看到我可以通过 SCNetworkInterfaceGetBSDName() 获取网络接口的 BSD 名称。但是,我的程序已经知道 BSD 名称,那么有没有办法根据其 BSD 名称获取接口的 SCNetworkInterfaceRef 数据?
它应该可以使用所有接口SCNetworkInterfaceCopyAll(),然后对其进行迭代,直到找到为其SCNetworkInterfaceGetBSDName()提供目标 BSD 名称的接口。
SCNetworkInterfaceCopyAll()
SCNetworkInterfaceGetBSDName()