Re(4): MoreSCF & modem ports
Re(4): MoreSCF & modem ports
- Subject: Re(4): MoreSCF & modem ports
- From: Jens Bauer <email@hidden>
- Date: Wed, 12 Jun 2002 00:01:45 +0200
Hi Terence,
On Tue, 11 Jun, 2002, Terence Goggin <email@hidden> wrote:
>
Thanks for your comments... please see my notes inline :)
>
>
>>> -------------
>
>>>
>
>>> memset(&pppSettings, 0, sizeof(pppSettings));
>
>>> pppSettings.active = true;
>
>
>
> You might want to fill in some more info here.
>
>
Such as? I'm really only interested in configuring the DNS
>
settings so that the port has at least one DNS server available.
If you're not using PPP, you can leave it empty, but otherwise you're
filling in values that you probably don't really want: Timeouts would be
0, etc. -You should go for the Apple defaults, if you're not using it.
>
>>> memset(&ipv4Settings, 0, sizeof(ipv4Settings));
>
>
>
> And here. ;)
>
>
>
>>> dnsSettings.serverAddressesCount = 1;
>
>>> OTInetStringToHost(kDNSServer1, &DNSAddr);
>
>>> dnsSettings.serverAddresses = &DNSAddr;
>
>>> dnsSettings.searchDomainsCount = 0;
>
>>> dnsSettings.searchDomains = nil;
>
>
>
> Looks OK to me.
>
>
>
>
>
>>> modemSettings.connectionScript = CFSTR("");
>
>
>
> You want to give this one a modemscript name.
>
> Try the internal modem for a test. -You should ask the user though.
>
>
Can you suggest a default name I could use?
No, because I don't know which kind of modem your users have. ;)
>
We won't be using the script, so I don't really care what it's set to.
Look through the list of available scripts. But I guess you're not using
PPP at all, and then it would probably be better passing nil instead of
the modemSettings.
>
>>> modemSettings.dataCompressionErrorCorrection = true;
>
>>> modemSettings.speaker = false;
>
>>> modemSettings.pulseDial = false;
>
>>> modemSettings.waitForDialTone = true;
>
>
>
> You might want to set newSetID to nil
>
>
When I did that, it failed with the message:
>
MoreAssertQ failure: (err == noErr) == ( (newSetID == nil) ||
>
(*newSetID != nil) )
Are you sure ? -I'm not talking about passing nil, I'm talking about
initializing newSetID to nil.
-If it required newSetID to be nonzero, I think that's a boog.
>
>>> err = MoreSCOpen(false, false);
>
>
>
> You don't want to use MoreSCOpen yourself!
>
>
>
>>> if (err == noErr)
>
>
>
> You don't want this if either.
>
>
>
>>> {
>
>>> //then configure the PocketMac, man!!!!
>
>>> err = MoreSCMakeNewDialupSet(bsdName,
>
>
>
> bsdName can be nil.
>
>
Yes, but I don't need it to be. I do fill this in; I just didn't
>
include that part of the code. :)
>
>
>
>>> userVisibleName,
>
>>> &modemSettings,
>
>>> &pppSettings,
>
>>> nil, //&ipv4Settings,
>
>
>
> You most likely don't want to pass nil here, although it would probably
>
> be OK.
>
>
Again, all I'm interested in is the DNS stuff and Quinn's comments
>
in the source seem to suggest I can get away with even less than
>
I'm doing here.
Yes. You can pass a bunch of nil pointers. Try reducing the code further.
I don't remember exactly where you can pass nil pointers.
>
BTW, each time I run this, I get a newSetID of 2, which I assume
>
would indicate success.
Yep. :)
Love,
Jens
--
Jens Bauer, Faster Software.
-Let's make the World better, shall we ?
_______________________________________________
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.