From owner-freebsd-current@FreeBSD.ORG Tue Apr 12 12:26:48 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7201F106566C for ; Tue, 12 Apr 2011 12:26:48 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2922A8FC0A for ; Tue, 12 Apr 2011 12:26:47 +0000 (UTC) Received: by yie12 with SMTP id 12so2996220yie.13 for ; Tue, 12 Apr 2011 05:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=/Rt05+ZPA3Qsvsw1gd5wHYfSueSb8Ai0DgUnXkUN1RM=; b=wvZDwaS2SVTEDitPSZtV6YW//YBDS5u7xSo+8sYKLT35rTD1MuWuX4xcJuhvjDyG3J qlhIjCFZ6Q0Q69HuiZUJcJpznTskU29cJIMRgfkdm+lHteM9l6Nmv/KfCTKqdXf4NHTV Be/vdcJRi2Lf2eSwiOwk7FK7KCkRnk4Vn1bpQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=IlURnTuSPn4MA53JtRmz32n9u2ES+2vLiJi4bNgYSLY+dsBzz/nURKCOIq64ZrvZWu E0MGL5qcs4fipTq1o7UVScugjPfUT3BPlbY6sPnK88B9CT9nmADJMG+mn4KMaQBR1Jqe 7xwbySROpbWM+/NYvBK+Wm5R5XtVVzaNH2GcQ= Received: by 10.151.6.6 with SMTP id j6mr5548215ybi.322.1302609323735; Tue, 12 Apr 2011 04:55:23 -0700 (PDT) Received: from localhost (zeller.torservers.net [74.120.12.135]) by mx.google.com with ESMTPS id b4sm1596780ybn.8.2011.04.12.04.55.20 (version=SSLv3 cipher=OTHER); Tue, 12 Apr 2011 04:55:21 -0700 (PDT) From: Pan Tsu To: Sergey Vinogradov References: <4DA2EFEF.3010004@lazybytes.org> Date: Tue, 12 Apr 2011 15:55:11 +0400 In-Reply-To: <4DA2EFEF.3010004@lazybytes.org> (Sergey Vinogradov's message of "Mon, 11 Apr 2011 16:11:27 +0400") Message-ID: <86oc4blm5c.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-current@freebsd.org Subject: Re: [PATCH] ifconfig(8) flag to display IPv4 netmasks in dot-decimal format X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 12:26:48 -0000 Sergey Vinogradov 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.