Date: Tue, 7 Nov 2006 11:41:51 -0600 From: Brooks Davis <brooks@one-eyed-alien.net> To: Josh Carroll <josh.carroll@psualum.com> Cc: freebsd-hackers@freebsd.org Subject: Re: sockstat tcp/udp switches Message-ID: <20061107174151.GA51473@lor.one-eyed-alien.net> In-Reply-To: <8cb6106e0611061517k62c9193fnbbfc8e36db328282@mail.gmail.com> References: <20061102094748.G75543@mignon.ki.iif.hu> <8cb6106e0611021507n6315b629kad8cbbf901343c2@mail.gmail.com> <20061103021803.GC8508@kobe.laptop> <8cb6106e0611021834h17737556y4bb2fda39a4bfa0c@mail.gmail.com> <20061103024621.GB16445@kobe.laptop> <20061103024837.GB79357@lor.one-eyed-alien.net> <20061103025442.GB16543@kobe.laptop> <8cb6106e0611031550y1381b67agdc74144b89de763b@mail.gmail.com> <20061104062439.GD854@turion.vk2pj.dyndns.org> <8cb6106e0611061517k62c9193fnbbfc8e36db328282@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > Thanks again for the suggestion. >=20 > 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 --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFUMVeXY6L6fI4GtQRArq0AKDlkJuD3gXlr4hnSahB+3nMFGLN6wCgmt7q rhd4fr+GA+Ag78mHGH4xToY= =lQ65 -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061107174151.GA51473>