#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCPrivate.h>
#include <SystemConfiguration/SCValidation.h>
CFStringRef
SCDynamicStoreKeyCreateProxies(CFAllocatorRef allocator)
{
return SCDynamicStoreKeyCreateNetworkGlobalEntity(allocator,
kSCDynamicStoreDomainState,
kSCEntNetProxies);
}
CFDictionaryRef
SCDynamicStoreCopyProxies(SCDynamicStoreRef store)
{
CFDictionaryRef dict = NULL;
CFStringRef key;
SCDynamicStoreRef mySession = store;
CFDictionaryRef proxies = NULL;
if (!store) {
mySession = SCDynamicStoreCreate(NULL,
CFSTR("SCDynamicStoreCopyConsoleUser"),
NULL,
NULL);
if (!mySession) {
SCLog(_sc_verbose, LOG_INFO, CFSTR("SCDynamicStoreCreate() failed"));
return NULL;
}
}
key = SCDynamicStoreKeyCreateProxies(NULL);
dict = SCDynamicStoreCopyValue(mySession, key);
CFRelease(key);
if (!isA_CFDictionary(dict)) {
_SCErrorSet(kSCStatusNoKey);
goto done;
}
proxies = CFRetain(dict);
done :
if (!store && mySession) CFRelease(mySession);
if (dict) CFRelease(dict);
return proxies;
}