SystemConfiguration Help
SystemConfiguration Help
- Subject: SystemConfiguration Help
- From: Ryan McGann <email@hidden>
- Date: Sat, 23 Mar 2002 21:58:45 -0500
We'd like to use the SystemConfiguration framework to have our
application notified when one of three things happen:
the current networking set changes
the list of networking sets changes (a new set is created/a set is
deleted)
a set's name is changed.
I've looked over the MoreSCF code and some of the samples posted by DTS
using the SystemConfiguration framework, but I can'f figure out which
keys we need to pass to SCDynamicStoreSetNotificationKeys. Looking at
the scutil program, I came up with the code below, which is obviously
wrong since we don't get notified of any changes:
storeRef = ::SCDynamicStoreCreate( kCFAllocatorDefault,
CFSTR("com.symantec.test"),
NetworkSettingsChangedCallBack,
&context );
keysRef = ::CFArrayCreateMutable( kCFAllocatorDefault, 0,
&kCFTypeArrayCallBacks );
patternsRef = ::CFArrayCreateMutable( kCFAllocatorDefault, 0,
&kCFTypeArrayCallBacks );
// These are obviously not right, but what's correct?
keyRef = ::SCDynamicStoreKeyCreate(
kCFAllocatorDefault, CFSTR("/%@"), kSCPrefSets );
::CFArrayAppendValue( keysRef, keyRef );
::CFRelease( keyRef );
keyRef = ::SCDynamicStoreKeyCreate(
kCFAllocatorDefault,
CFSTR("/%@/%@/%@"),
kSCPrefSets,
kSCCompAnyRegex,
kSCPropUserDefinedName );
::CFArrayAppendValue( patternsRef, keyRef );
::CFRelease( keyRef );
if (! ::SCDynamicStoreSetNotificationKeys( storeRef, keysRef,
patternsRef ))
....
What's the magic combination of keys & regular expressions to pass to
SCDynamicStoreSetNotificationKeys so that we are notified of all the
conditions above?
Thanks,
Ryan McGann
----------------------------------------------------------------
Ryan McGann
Software Engineer, Macintosh Internet Security
Symantec Corporation
email@hidden
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.