• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting own IP address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting own IP address


  • Subject: Re: Getting own IP address
  • From: "Peter Sichel" <email@hidden>
  • Date: Wed, 30 Apr 2003 09:39:54 -0400

>> Under OpenTransport/CFM, I get the following list:
>>
>> 24.95.76.171
>> 127.0.0.1
>>
>> Upon further research, it looks like I'm only querying 1 interface, and
>> its secondary addresses. I'll add the code to loop over all interfaces
>> shortly.
>
>I'm no expert, but can OT do that?

Mentat/TCP was designed as a source compatible
replacement for BSD Networking. It has always supported
multilink multihoming, multi-processing, etc.

The issue is what APIs Apple chose to publish. Under Mac OS 9
you can obtain interface information using the SIOCxxx ioctls,
or more simply Mentat's own Named Dispatch to request a formatted
report similar to ifconfig [similar to Quinn's DumpArpCache sample
code].

> 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.

The TCP/IP control panel and Preferences has an implicit "active
interface" point of view. On Mac OS X, the Mentat stack itself
is restricted to a single interface since its only purpose is
Classic compatibility. This means querying the classic stack
will not reveal the full network configuration of the machine.
You can verify this easily using IPNetTuner classic to examine
the ip_ipif_status report.

> How do I get the IPs in the order the user sees them within
> the Network preferences dialog?

The System Configuration Framework allows you to access
the Service Order information. If you are open to using
Cocoa, the System Configuration framework becomes easy to access.
CFDictionary, CFArray, and CFString can be simply type cast
to NSDictionary, NSArray, and NSString. If you prefer C++,
check out Quinn's MoreSCF sample code. [FYI: In my customers
testing, MoreSCFPortScanner.c still has some rare crashing bugs]

Kind Regards,

- Peter Sichel
Sustainable Softworks
_______________________________________________
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.

References: 
 >Re: Getting own IP address (From: Justin Walker <email@hidden>)

  • Prev by Date: Re: URLAccess kURLDisplayProgressFlag issue
  • Next by Date: Re: hang in CFStream code
  • Previous by thread: Re: Getting own IP address
  • Next by thread: Re: Getting own IP address
  • Index(es):
    • Date
    • Thread