Re: Configuring for DHCP, OS 9.x with MoreNetworkSetup
Re: Configuring for DHCP, OS 9.x with MoreNetworkSetup
- Subject: Re: Configuring for DHCP, OS 9.x with MoreNetworkSetup
- From: Quinn <email@hidden>
- Date: Tue, 13 May 2003 09:23:42 +0100
At 12:52 +0200 9/5/03, John Andersson wrote:
I want, from an installer I'm making, set TCP/IP to use DHCP over
Ethernet. I run this function to find the ethernet port:
if (!OTFindPort(&portRec, "enet"))
{
// Handle error
}
My problem is, that this seems to return the Airport port, if its
available (or selected in AppleTalk?). Is there a better word to
search for, or do I have to scan through ports and examine them
better?
Yeah, this is a known problem. When you look for a port in this way,
"enet" is actually a shortcut for "enet0" or, if that's not present,
"enet1". The problem relates to how port names are assigned. On a
machine with both AirPort and built-in Ethernet, the PCI port scanner
tends to find the AirPort card before the built-in Ethernet, and so
the AirPort becomes "enet0" and the Ethernet "enet1".
I have a couple of suggestions for how you might go about finding the
right port.
1. You can get the port's OTPortRef, break it down (using
OTGetDeviceTypeFromPortRef etc), and see if there's something you can
use to always distinguish the devices. I don't think this works
(partly because both devices are on kOTMotherboardBus), but it's
worth investigating.
2. Failing that, the guaranteed way to sort this out is to get the
device's MAC address and correlate that with the MAC addresses of all
the Ethernet devices in the Name Registry. Once you find the Name
Registry entry for the device, working out which one is Ethernet and
which one is AirPort is easy.
My other problem (on a computer where problem #1 does not exist) is
that after the setup is complete, TCP/IP sometimes doesnt work
(explorer cant load URL's).
I don't have an easy answer to this. The MNS code worked for me
during testing, and it works for you most of the time. The critical
thing is to find what triggers the problem, and isolate a
reproducible case. Then we can start debugging.
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.