Why isn't there an API for network configuration and related stuff ? Any OS
should provide these interfaces for developers to write code that they want.
Asking developers to use some system utility is restricting them to do what
the utility offers.

What if i want to enhance the functionality of ifconfig? how do i do that?
or what if i want to write something that is better then ifconfig?

On Thu, Oct 1, 2009 at 9:37 PM, James Carlson <[email protected]>wrote:

> Vivek S wrote:
> > Yeah, i have gone through ifconfig source and your steps are similar to
> > what there is in inetplumb() function that plumbs an interface. But
> > then...are the dlpi functions public? i dont think so...i didnt find any
> > header that declares these methods on my system.
>
> libdlpi is public on OpenSolaris and was recently made public on Solaris
> 10, but you don't really need to use it for something this simple.  Just
> use open(2) on the device nodes.
>
> Given an interface named "foo0", you would try opening "/dev/foo0"
> first.  That's a "Style 1" driver path name.  If that doesn't work, then
> try "/dev/foo" (removing the trailing decimal digits).  That's a "Style
> 2" driver path name.  These paths are the same on most all systems that
> support DLPIv2, including old Solaris, HP/UX, and probably many others.
>
> For extra credit, you can try opening "/dev/net/foo0" first, before
> doing either of the two above.  That's the vanity naming system, a
> fairly new Solaris feature.  If the node exists, then it's the right one
> to use.
>
> But a repeat warning here: you're driving in the wrong direction.  Turn
> back now.  ;-}
>
> Note that "plumbing" an interface named something like "bar0:5" is
> entirely different.  The ifconfig interface makes it look as though
> these are plumbed in the same way as regular interfaces, but they're
> not.  If *that* is what you're after, then you'll need to do something
> different.
>
> --
> James Carlson         42.703N 71.076W         <[email protected]>
>
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to