Re: Getting own IP address
Re: Getting own IP address
- Subject: Re: Getting own IP address
- From: "Matt Slot" <email@hidden>
- Date: Wed, 30 Apr 2003 17:59:49 -0400
Justin Walker (email@hidden) wrote:
>
I believe that Internet sharing, with Airport support checked on the
>
Prefs panel, generates the 10.0.2/24 addresses automatically.
Alright, using Manual/0.0.0.0 for the Airport interface works fine with
Internet Sharing creating the 10.0.2/24, and doesn't leave an extra IP
in my list.
>
There's a difference between what the low-level APIs give you and what
>
the "high-level" APIs give you. The BSD stuff, like SIOCGIFCONF (why
>
are you using the "O" version?), gives you interface information
>
more-or-less as it comes across it while pawing through kernel data
>
structures.
I'm trying to use as many compatible APIs as possible, since I really
want this code to work on a wide variety of platforms. OSIOCGIFCONF
is the compatibility constant that only gives me IPv4 sockaddr's,
which will suffice until the code is transitioned to IPv6.
>
You might also try looking at the NET_RT_IFLIST command in
>
sysctl(2). W. Richard Stevens's "Unix Network Programming, V1, 2nd Ed"
>
is an invaluable aid (if you haven't already seen it).
Stuck with the 1st Edition, and a google search didn't turn up much.
Is this the best / most compatible way to get this information? From
what I see, it's not available on Linux.
>
I'm no expert, but can OT do that? I know that OT has an implicit
>
"active interface" point of view, since it only supports one such, so I
>
don't know whether there's a way to get at all active interfaces.
Yes, OT is returning all the interfaces appropriately, including the
Airport / Internet Sharing address.
>
I think you will have to use the SystemConfiguration APIs, and do some
>
work to determine what the proper order is.
Alright, thanks.
Matt
+--------------------------+-----------------------------------+
| Matt Slot | Ambrosia Software, Inc. |
| Bitwise Operator |
http://www.AmbrosiaSW.com/ |
+--------------------------+-----------------------------------+
_______________________________________________
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.