Artem Kachitchkine writes:
> 
> > I was thinking of something like [<addr>]::macprops 
> > along the lines of the ::ire dcmd- something
> > that we can pass to customers who are not mac_proplist (or even GLDv3)
> > power-users.  Of course, we would first need to add a mac module for
> > mdb itself (none currently exists).
> 
> Yeah, that's what I also suggested earlier. Creating a new module is a 
> no brainer. I just need to find out if it's possible for dcmds to call 
> other dcmds/walkers - reimplementing ::modhash and ::list would be kinda 
> silly.

It would.  Fortunately, it's easy to reuse existing walkers and dcmds
from inside mdb.  See the mdb_pwalk() call in th_trace() (recently
added to $SRC/cmd/mdb/common/modules/ip.c) for an example of a dcmd
that calls a walker.  Then see its callback function,
th_hash_summary(), for an example of a nested walk on a modent.

You can use mdb_walk_dcmd() and mdb_call_dcmd() to do more elaborate
things.

-- 
James Carlson, Solaris Networking              <james.d.carlson at sun.com>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

Reply via email to