sockstat tcp/udp switches
Brooks Davis
brooks at one-eyed-alien.net
Tue Nov 7 17:41:58 UTC 2006
On Mon, Nov 06, 2006 at 03:17:17PM -0800, Josh Carroll wrote:
> >I suggest you use /etc/protocols rather than hard code the protocols.
> >This will make the code future-proof. See getprotoent(3) for the
> >correct way to read /etc/protocols.
>
> Thanks Peter, that's a great idea. Below is a new patch that uses
> getprotoent(3). For now, to maintain backward compatibility, I've
> defined a default list of protocols (tcp, udp, divert), in the event
> -P is not specified. This should retain the normal command line
> behavior.
>
> Thanks again for the suggestion.
>
> Dmitry - with this change, diver is now the default but can also be
> specified as an argument to -P as well.
On other suggestion I'd have it to consider using strsep to parse the
string. I'm pretty the code will be smaller and more readable.
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20061107/a5d2259b/attachment.pgp
More information about the freebsd-hackers
mailing list