How do I get the Network Status on MacOS?
I tried changing the second argument of SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetEthernet) in various ways, but all results were nil.
And I also tried SCNetworkInterfaceGetConfiguration(interface) and got the result below:
Optional({
JoinModeFallback = (
DoNothing
);
PowerEnabled = 1;
RememberJoinedNetworks = 1;
Version = 3000;
})
but it has no status which I wanted.
I would like to programmatically get the status as Connected information in the following image, which can be found in System Preferences > Network.
