How to find BSD name for PPP interface
How to find BSD name for PPP interface
- Subject: How to find BSD name for PPP interface
- From: "Peter Sichel" <email@hidden>
- Date: Mon, 29 Jan 2007 09:06:42 -0500
Hello,
I am trying to correlate a user entry for a PPP interface in the Network
Preferences panel (System Configuration Framework) with a BSD interface
name I can attach my NKE to.
Currently I get the service order (list of serviceID's) using
SCDynamicStoreCopyValue with key "Setup:/Network/Global/IPv4", and then
iterate each serviceID to retrieve the
interface type (kSCPropNetInterfaceType)
interface subtype (kSCPropNetInterfaceSubType)
device name (kSCPropNetInterfaceDeviceName)
user name (kSCPropUserDefinedName)
In the case of an Ethernet or AirPort interface, this is easy. The
device name is the BSD name such as "en0" or "en1".
For a PPP interface, the interface type is "PPP", the device name might
be "modem", and the interface subtype "PPPSerial". Up till now, I've
just guessed the first such PPP interface in the network service order
will be "ppp0", and subsequent interfaces increment the device index
("ppp1", "ppp2", etc.). This works well enough for the 90% case of
using a built-in modem or PPPoE, but as users become interested in load
balancing between multiple PPP links or running their own PPP server
(pppd), I'm starting to question whether this assumption is good enough.
How should I correlate a serviceID for a PPP interface to a
corresponding BSD name? I'm guessing I might look at "State:/Network/
Interface/ppp0/IPv4" but what key (if any) will indicate the
corresponding serviceID?
I'd appreciate any insight, thanks.
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden