Im my code i am trying to use SCNetworkSetGetServiceOrder to get network service order. like below
Ethernet
FireWire
Wi-Fi
Bluetooth PAN
Thunderbolt Bridge
i am using below code
-(void)getserviceorder
{
CFArrayRef interfaces;
CFIndex interfaceCount;
CFIndex interfaceIndex;
CFMutableArrayRef result;
CFArrayRef *portArray;
portArray = NULL;
result = NULL;
interfaces = NULL;
if (SCNetworkInterfaceCopyAll != NULL) {
interfaces = SCNetworkInterfaceCopyAll();
interfaceCount = CFArrayGetCount(interfaces);
for (interfaceIndex = 0; interfaceIndex < interfaceCount;
interfaceIndex++) {
SCNetworkInterfaceRef thisInterface;
SCNetworkSetRef set = CFArrayGetValueAtIndex(interfaces,interfaceIndex);
assert(thisInterface != NULL);
NSLog(@"SCNetworkSetGetServiceOrder is %@",SCNetworkSetGetServiceOrder(set));
}
CFRelease(interfaces);
}
But it always returns null. Is this proper way or how can i use SCNetworkSetGetServiceOrder method to get the service order. What should be the value of (SCNetworkSetRef set)
, which is the parameter of SCNetworkSetGetServiceOrder
method . where can i learn more about this