On (10/30/08 15:37), James Carlson wrote: > Part of the Rapid Spanning Tree protocol requires information about > the duplex setting on the ports attached to the bridge. To get this > information, I have at least two choices: one is to go through > libdladm to get the "duplex" property, which is unfortunately a text > string I have to parse, or I can go through kstats to get the integer > value. > > What's the future direction here? Is relying on libdladm (despite its > warts) the better way to go? Are kstats going to stay in place? > > (I'm planning to use libdladm despite the problems, but I'm curious > about the longer-term direction as well.)
that's a well-timed question. I was actually working on cleaning up some of the interfaces surrounding 'dladm show-ether' and ran into a similary issue with getting link state. See http://cr.opensolaris.org/~sowmini/show-ether-cleanup/ (Review comments invited!) So this presents a couple of choices: - use the dladm_ether_info() interface and use the returned le_attr[CURRENT] to get the info and/or - we could provide a separate set of libdladm interfaces to get the link_duplex_t info (but then we would have to do something similar for every property, in the interest of consistency). thoughts? For your immediate need, the webrev posted may suffice.. --Sowmini
