Re: [PATCH] ifconfig(8) flag to display IPv4 netmasks in dot-decimal format

2011-04-13 Thread Sergey Vinogradov

On 11.04.2011 19:17, Gary Jennejohn wrote:

On Mon, 11 Apr 2011 16:11:27 +0400
Sergey Vinogradovboo...@lazybytes.org  wrote:


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 msk0
msk0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST  metric 0 mtu 1500

options=c011aTXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,VLAN_HWTSO,LINKSTATE
  ether 00:16:e6:88:0f:89
  inet 10.10.0.1 netmask 0xff00 broadcast 10.10.0.255
  media: Ethernet autoselect (none)
  status: no carrier

% ifconfig -t msk0
msk0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST  metric 0 mtu 1500

options=c011aTXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,VLAN_HWTSO,LINKSTATE
  ether 00:16:e6:88:0f:89
  inet 10.10.0.1 netmask 255.255.255.0 broadcast 10.10.0.255
  media: Ethernet autoselect (none)
  status: no carrier

There was a discussion [1] in freebsd-hackers@ about adding such
functionality to ifconfig(8), which urged me write this patch. The
default behavior of ifconfig(8) is kept unmodified, so there shouldn't
be any compatibility breakages. At least, it works fine for me :)

[1]
http://lists.freebsd.org/pipermail/freebsd-hackers/2011-April/034997.html



Looks good, except I'd change this line to read like this:
+The
+.Fl t
+flag makes IPv4 netmasks being displayed in dotted decimal notation.
   ^ results in



Note taken, fix will appear in the next patch version (if any).

--
wbr,
Boo
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] ifconfig(8) flag to display IPv4 netmasks in dot-decimal format

2011-04-12 Thread J. Hellenthal
On Mon, Apr 11, 2011 at 04:11:27PM +0400, Sergey Vinogradov wrote:
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:


Sorry but as much as I would like to see this happen and change the
display of the netmask I just cannot seem to come to a genuine consensus
that justifies adding a '-t' flag or any flag for that matter just to
modify the output of one field in the display of ifconfig(8)

In general flags to programs usually should carry some sort of meaning
to what they are meant to do and I dont really see that for '-t' and
netmask display.

What I feel would be a better approach to this is checking the
environ(7) for some sort of variable that can be specified on a per-user
basis or the system as a whole. As to what that variable would be called
I could only suggest in a naming convention to be ``HUMANIZE'' or
something similiar and then ifconfig(8) could be the first consumer of
that variable and probably shortly following du(1)  df(1).

This variable could also be one that acts as BLOCKSIZE does to df(1)
output and also be available for consumption by other utilities that may
need fine tuning without breaking existing interfaces.

/STRONG-OPINION

-- 

Regards,

 J. Hellenthal



pgphAtxdZ2IbB.pgp
Description: PGP signature


Re: [PATCH] ifconfig(8) flag to display IPv4 netmasks in dot-decimal format

2011-04-12 Thread Pan Tsu
Sergey Vinogradov boo...@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.10xff00ff00

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.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] ifconfig(8) flag to display IPv4 netmasks in dot-decimal format

2011-04-11 Thread Gary Jennejohn
On Mon, 11 Apr 2011 16:11:27 +0400
Sergey Vinogradov boo...@lazybytes.org wrote:

 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 msk0
 msk0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
 
 options=c011aTXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,VLAN_HWTSO,LINKSTATE
  ether 00:16:e6:88:0f:89
  inet 10.10.0.1 netmask 0xff00 broadcast 10.10.0.255
  media: Ethernet autoselect (none)
  status: no carrier
 
 % ifconfig -t msk0
 msk0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
 
 options=c011aTXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,VLAN_HWTSO,LINKSTATE
  ether 00:16:e6:88:0f:89
  inet 10.10.0.1 netmask 255.255.255.0 broadcast 10.10.0.255
  media: Ethernet autoselect (none)
  status: no carrier
 
 There was a discussion [1] in freebsd-hackers@ about adding such 
 functionality to ifconfig(8), which urged me write this patch. The 
 default behavior of ifconfig(8) is kept unmodified, so there shouldn't 
 be any compatibility breakages. At least, it works fine for me :)
 
 [1] 
 http://lists.freebsd.org/pipermail/freebsd-hackers/2011-April/034997.html
 

Looks good, except I'd change this line to read like this:
+The
+.Fl t
+flag makes IPv4 netmasks being displayed in dotted decimal notation.
  ^ results in

-- 
Gary Jennejohn
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org