Re: Discovering the default gateway address
Re: Discovering the default gateway address
- Subject: Re: Discovering the default gateway address
- From: Kay Roepke <email@hidden>
- Date: Sun, 4 Feb 2007 12:46:28 +0100
On Feb 4, 2007, at 12:09 PM, Finlay Dobbie wrote:
I meant to word that with the connotation of a programmatic API for
reading say, the actual routing tables that the underlying kernel
uses to route, similar to the sysctl(3) options available, since I'm
not 100% clear on how tied together the System Configuration
framework is to the unix underpinnings of sysct(3).
I think you can safely assume that the current state that System
Configuration returns to you is an accurate representation of the
truth. Otherwise, things will be very broken.
I second that. IMHO the best way to go about is System Configuration,
although
it is a bit low-level (I'd probably just use NSTask and scutil, since
that's easy
to do). If you don't want to rely on the external program, read
scutil's source or
use BSD calls.
See <x-man-page://4/route> for details on how retrieve information
from the kernel's
routing database.
Of course you could pack all this up in a nice and easy ObjC
framework and post a link ;)
HTH,
-k
--
Kay Röpke
http://classdump.org/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden