Re: TCPIP Load only when needed
Re: TCPIP Load only when needed
- Subject: Re: TCPIP Load only when needed
- From: Quinn <email@hidden>
- Date: Tue, 21 May 2002 15:06:55 +0100
At 8:58 +1200 15/5/02, David Nock wrote:
> At 11:11 +1300 7/3/02, David Nock wrote:
>> We need to be able to check the status and and possibly modify the status
of the 'Load only when needed' option within the TCPIP settings.
Does anyone have any pointers/code to do this?
You can do this using Network Setup. It's probably easiest if you
use MoreNetworkSetup to read the configuration (NSHGetConfiguration)
and then look at the relevant field (fTCPv4.fUnloadAttr) in the
> result.
Hi Quinn,
Finally I've had the time to have a look at what you suggested above. Have
run into some errors compiling the sample app in MoreNetworkSetup archive.
/****************************************************************/
Error : illegal implicit conversion from 'unsigned char **' to
'void **'
NetworkSetupHelpers.c line 221 err = MNSGetPref(ref, entity,
kOTCfgUserVisibleNamePref, &entityName, &junkSize);
Project: NetworkSetupTest.mcp, Target: PPC, Source File:
NetworkSetupHelpers.c
Error : illegal implicit conversion from 'char **' to
'void **'
NetworkSetupHelpers.c line 4009 err = MNSGetPref(ref, entityID,
kOTCfgTCPInterfacesPref, &buffer, &prefSize);
Project: NetworkSetupTest.mcp, Target: PPC, Source File:
NetworkSetupHelpers.c
Error : illegal implicit conversion from 'struct CfgSetsVector **' to
'void **'
MoreNetworkSetup.c line 571 &vectorPrefData, &vectorPrefSize);
Project: NetworkSetupTest.mcp, Target: PPC, Source File: MoreNetworkSetup.c
/****************************************************************/
There are standard "C++ has stricter pointer checking than C"
problems. I've fixed all of these in the latest versions of
MoreIsBetter, but some of the samples that are derived from MIB
haven't been updated in a while.
Back to my original problem:
I've had a read over the relevant code but I am getting myself lost. (it's
been a while since I've done any serious C programming, let alone tackle
OpenTransport).
Do I need to iterate over the configurations to tell what is the active
config set? Is there a quick way to retrieve the info I need from the active
TCPIP set?
Here's what I recommend:
1. call NSHGetConfigurationList to build a configuration list
2. call NSHCountConfigurationList to get its size
3. iterate over the list looking for an entry whose "selected" field is true
4. pass that configuration to NSHGetConfiguration to get the current settings
5. modify the configuration as you like
6. pass the modified configuration to NSHSetConfiguration to write your changes
That's the basics. If you hit specific problems I'd be happy to help
out on the list.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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.