Created
March 2, 2023 10:56
-
-
Save pronebird/d69135268c1c603a8c367f47b135f929 to your computer and use it in GitHub Desktop.
NetworkExtension NWPath private extension to obtain interface name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NetworkExtension | |
extension NetworkExtension.NWPath { | |
var interfaceName: String? { | |
let interface = self.value(forKeyPath: "_internalPath.direct") as? nw_interface_t | |
return interface.map { String(cString: nw_interface_get_name($0)) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment