Back in early April, I posted a message -
http://www.opensolaris.org/jive/thread.jspa?messageID=31285稵
- suggesting a new command line tool called ifgrep.
I was thinking a bit about it last week and got bored enough on the weekend
to spend a few hours coding it up.
If you'd like to try it out, you can download the source code from here:
http://www.opensolaris.org/os/community/networking/files/ifgrep.c
To compile it is easy "cc ifgrep.c -o ifgrep -lsocket -lnsl"
It's functionality is a merge of that available in ps and pgrep. For
example:
ifgrep -f inet -o name,addr,flags
ifgrep -f inet -o name=,addr=
The default output is equivalent to "ifgrep -o name=".
In writing it, I'm also experimenting with a different approach (for me)
to writing command line tools that use getopt.
Although the code is CDDL'd, if you're outside Sun and would like to
contribute a patch that you'd like me to add, I believe you'd need to
go through the normal hoops that require copyright assignment before
I could accept it. However, please feel free to tell me what you do or
do not like about it (output formatting, missing functionality,
functionality
that doesn't work as expected, etc)
Last but not least, this is just something I hacked up over the weekend,
there are currently no plans to include it in Solaris so please don't expect
it to show up anytime soon.
Darren
p.s. I tried with "-lxnet" but required functions are not present there.
_______________________________________________
networking-discuss mailing list
[email protected]