• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Internet Sharing & SCF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Internet Sharing & SCF


  • Subject: Internet Sharing & SCF
  • From: Ryan McGann <email@hidden>
  • Date: Mon, 14 Oct 2002 02:20:53 -0700

I'm trying to use the SCF to be notified when Internet Sharing is turned on/off. I've installed handlers to be notified when the IPv4 address changes for any interface, but it's never called even though Internet Sharing will assign an (sometimes additional) IPv4 address to an interface. The callback is called when I disable or enable a specific service in the System Preferences networking panel however. Is there a better/different way to be notified when Internet Sharing is enabled/disabled in Jaguar?

Here's the code:
...
CFMutableArrayRef keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
CFMutableArrayRef patterns = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);

key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainState,
kSCEntNetIPv4);
CFArrayAppendValue(keys, key);
CFRelease(key);

key = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
kSCDynamicStoreDomainState,
kSCCompAnyRegex,
kSCEntNetIPv4);
CFArrayAppendValue(patterns, key);
CFRelease(key);

if (!SCDynamicStoreSetNotificationKeys(store, keys, patterns)) {
fprintf(stderr, "error = %s\n", SCErrorString(SCError()));
CFRelease(store);
CFRelease(keys);
CFRelease(patterns);
return 0;
}

Thanks,
Ryan

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.

  • Prev by Date: Page Faults in OSX using Open Transport
  • Next by Date: Changing the MTU
  • Previous by thread: CFSocketConnectToAddress() error code?
  • Next by thread: Changing the MTU
  • Index(es):
    • Date
    • Thread