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]
