Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2011 15:55:11 +0400
From:      Pan Tsu <inyaoo@gmail.com>
To:        Sergey Vinogradov <boogie@lazybytes.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: [PATCH] ifconfig(8) flag to display IPv4 netmasks in dot-decimal format
Message-ID:  <86oc4blm5c.fsf@gmail.com>
In-Reply-To: <4DA2EFEF.3010004@lazybytes.org> (Sergey Vinogradov's message of "Mon, 11 Apr 2011 16:11:27 %2B0400")
References:  <4DA2EFEF.3010004@lazybytes.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Sergey Vinogradov <boogie@lazybytes.org> writes:

> Hi,
> I've written a tiny-tiny patch, which adds the '-t' flag to
> ifconfig(8). It modifies the output to display IPv4 netmasks in dotted
> decimal notation:
[...]
> % ifconfig -t msk0
[...]
>         inet 10.10.0.1 netmask 255.255.255.0 broadcast 10.10.0.255

Isn't netstat(8) a better place for such an option? domask() already
converts netmask to CIDR notation if possible, e.g. `netstat -ni'

   10.10.0.1/24
   10.10.0.1&0xff00ff00

Unfortunately, Network column is always truncated to 13 characters even
with -W flag while it can be up to 26 characters long with `-n' flag or
more with a symbolic network name.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86oc4blm5c.fsf>