git: ifconfig(8): Add '-f' option to print in more formats

Aaron LI aly at crater.dragonflybsd.org
Fri Jun 26 07:55:31 PDT 2020


commit 51a3d09e9966badabd8cb22a3721055a7ff47e20
Author: Aaron LI <aly at aaronly.me>
Date:   Fri Jun 26 14:02:58 2020 +0800

    ifconfig(8): Add '-f' option to print in more formats
    
    * Add the '-f' option to control the output formats of addresses,
      inet (IPv4) subnet masks, inet6 (IPv6) prefix length, Ethernet (MAC)
      address.  The following output formats are supported:
    
      - address: numeric (default), host, FQDN
      - inet (IPv4) subnet masks: CIDR, dotted-quad, and traditional hex
        output (default)
      - inet6 (IPv6) prefix length: CIDR, traditional integer format
        (default)
      - ether (MAC address): colon-separated (default), dash-separated
    
    * The 'IFCONFIG_FORMAT' environment variable has the same usage as the
      '-f' option and can be overrided by the latter.
    
    * Some minor cleanups.
    
    Obtained from FreeBSD (revisions 301059 and 301185; review D2856), but
    with my own minor modifications.

Summary of changes:
 sbin/ifconfig/af_inet.c  | 40 ++++++++++++++++++---
 sbin/ifconfig/af_inet6.c | 23 +++++++++----
 sbin/ifconfig/af_link.c  | 15 +++++---
 sbin/ifconfig/ifconfig.8 | 90 ++++++++++++++++++++++++++++++++++++++++++++----
 sbin/ifconfig/ifconfig.c | 80 +++++++++++++++++++++++++++++++++++++++---
 sbin/ifconfig/ifconfig.h |  1 +
 6 files changed, 224 insertions(+), 25 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/51a3d09e9966badabd8cb22a3721055a7ff47e20


-- 
DragonFly BSD source repository


More information about the Commits mailing list