Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jan 2013 15:17:03 -0800
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Andre Oppermann <andre@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>, "freebsd-net@freebsd.org" <net@freebsd.org>
Subject:   Re: [PATCH] Allow tcpdrop to use non-space separators
Message-ID:  <CA%2BhQ2%2BhdmYe8nQa9aYiP9sJ-WxaiCz6JqCvLeKBoGSRMYO09fw@mail.gmail.com>
In-Reply-To: <5108572D.1090905@freebsd.org>
References:  <201301291205.41301.jhb@freebsd.org> <5108572D.1090905@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 29, 2013 at 3:11 PM, Andre Oppermann <andre@freebsd.org> wrote:

> On 29.01.2013 18:05, John Baldwin wrote:
>
>> A common use case I have at work is to find a busted connection using
>> netstat
>> -n or sockstat and then want to tcpdrop it.  However, tcpdrop requires
>> spaces
>> between the address and port so I can't simply cut and paste from one
>> terminal
>> window into another to generate the tcpdrop command.  This patch adds
>> support
>> for having a decimal (netstat output) or colon (sockstat output) between
>> the
>> address and port instead of a space.  It is careful to look for the last
>> of
>> these tokens to avoid parsing part of the address as the port.
>>
>
> Excellent.  Can netstat be changed from decimal to colon output as well?
> The decimal output is completely outdated and probably from a time when
> not even dinosaurs were [created|evolved] yet.  Colon output for port
> numbers is *the* standard all around.


i was going to say i'd really love to have the parsing code in some kind of
library function. I find myself writing this code again and again (and
presumably
i am not the only one) each time with new bugs and features...

i know that non-standard library functions are a pain when porting software
(see humanize_* stuff) but better than duplication.

cheers
luigi

>
>>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2BhdmYe8nQa9aYiP9sJ-WxaiCz6JqCvLeKBoGSRMYO09fw>