Re: MoreSCF 1.1 and Cross-Development
Re: MoreSCF 1.1 and Cross-Development
- Subject: Re: MoreSCF 1.1 and Cross-Development
- From: Allan Nathanson <email@hidden>
- Date: Tue, 23 Oct 2007 09:33:09 -0400
On Oct 23, 2007, at 8:47 AM, Quinn wrote:
At 13:48 +0200 23/10/07, John Andersson wrote:
By the way, is there any sample code to give me an idea to use
SCNetworkConfiguration in a proper way?
Alas, I don't know of any. I got half way through writing a sample
like this but it's not in a good enough state to give away.
Perhaps Allan has something?
Most of the APIs should be fairly easy to use :
* the preferences contain "sets"
* each "set" can have zero or more "services"
* each "service" can have zero or more "protocols"
* each "protocol" has a configuration dictionary (and the keys/values
are defined in <SystemConfiguration/SCSchemaDefinitions.h>
* each "service" is associated with one "interface"
* each "interface" has a configuration dictionary
* "interface"s may be layered (e.g. a "PPP" interface layered on top
of a "modem")
What has tripped up many developers :
* if you want to make changes to an "interface" configuration, please
make sure that you are using the SCNetworkInterfaceRef derived from a
SCNetworkServiceRef (the interface configuration are stored per-set/
per-service and I need that association to know where to make the
changes).
* you can't create a network service over a "modem" interface. You
need to start with the "modem", layer "PPP" on top (w/
SCNetworkInterfaceCreateWithInterface), and create the service with
the PPP->modem interface.
* watch your usage of CFRetain/CFRelease
If not, you may get some joy from the Leopard Darwin drop.
Speaking of Darwin drops, if you rummage around in the Darwin source
for SCF you'll find some useful code. You can play around with this
by running scutil as shown below:
$ ENABLE_EXPERIMENTAL_SCUTIL_COMMANDS=1 scutil --net
To all :
The "experimental" commands are just that. PLEASE PLEASE PLEASE don't
rely on this command being available in any future release. If the
command sticks around, expect the syntax to change. I'm saying this
now because I most certainly have plans for big changes!
The source for all of this stuff is in the files beginning with
"net" in the following location.
<http://www.opensource.apple.com/darwinsource/Current/configd-137.3/scutil.tproj/
>
[This link requires an APSL <http://www.opensource.apple.com/apsl/>
account.]
Feedback, bug reports, and enhancement requests are always welcome :-)
- Allan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden