From MAILER-DAEMON Thu Feb 04 08:24:15 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nd1gt-0003Mx-QX
	for mharc-commit-inetutils@gnu.org; Thu, 04 Feb 2010 08:24:15 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nd1gs-0003MJ-HS
	for commit-inetutils@gnu.org; Thu, 04 Feb 2010 08:24:14 -0500
Received: from [199.232.76.173] (port=44018 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nd1gs-0003M2-2F
	for commit-inetutils@gnu.org; Thu, 04 Feb 2010 08:24:14 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <ams@gnu.org>) id 1Nd1gp-0005pi-Rs
	for commit-inetutils@gnu.org; Thu, 04 Feb 2010 08:24:13 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:34874
	helo=internal.in.savannah.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <ams@gnu.org>) id 1Nd1gp-0005pU-Dv
	for commit-inetutils@gnu.org; Thu, 04 Feb 2010 08:24:11 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal with esmtp (Exim 4.69) (envelope-from <ams@gnu.org>)
	id 1Nd1go-0008SJ-Mw
	for commit-inetutils@gnu.org; Thu, 04 Feb 2010 13:24:10 +0000
Received: from ams by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <ams@savannah.gnu.org>) id 1Nd1go-0001UR-Gb
	for commit-inetutils@gnu.org; Thu, 04 Feb 2010 13:24:10 +0000
To: commit-inetutils@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 700065918b9a33d08ceffbfe296a2d6220a70209
X-Git-Newrev: 90ba0564bb742bca412e9be6f799647aabddfb17
Message-Id: <E1Nd1go-0001UR-Gb@vcs-noshell.in.savannah.gnu.org>
From: "Alfred M. Szmidt" <ams@gnu.org>
Date: Thu, 04 Feb 2010 13:24:10 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_7-31-g90ba056
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Feb 2010 13:24:15 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  90ba0564bb742bca412e9be6f799647aabddfb17 (commit)
      from  700065918b9a33d08ceffbfe296a2d6220a70209 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=90ba0564bb742bca412e9be6f799647aabddfb17


commit 90ba0564bb742bca412e9be6f799647aabddfb17
Author: Alfred M. Szmidt <ams@gnu.org>
Date:   Thu Feb 4 14:30:15 2010 +0100

    New options --active and --passive.

diff --git a/ChangeLog b/ChangeLog
index 3883212..f5b45b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-04  Alfred M. Szmidt  <ams@gnu.org>
+
+	New options --active and --passive.
+
+	* ftp/main.c (OPT_PROMPT): New enum.
+	(argp_options) <prompt>: Removed short option (-p).  <active>: New
+	option; uses -A as short option.  <passive>: New option; uses -p
+	as short option.
+	(parse_opt): Handle --active and --passive, updated --prompt
+	accordingly.
+	(main) <passivemode>: Set initial value before argument parsing.
+
 2010-01-29  Alfred M. Szmidt  <ams@gnu.org>
 
 	* ping/Makefile.am (install-ping-hook): Clarify warning message
diff --git a/NEWS b/NEWS
index 7c7598a..55f55c0 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,14 @@ Version 1.7.90:
 
 * inetutils
 
+** ftp
+
+New options --active and --passive to enable/disable active transfer
+mode. The short option for --prompt has been removed, and is instead
+now used to enable passive transfer mode.
+
+** ifconfig
+
 New commands (up and down) to bring up/down an interface using
 ifconfig.
 
diff --git a/ftp/main.c b/ftp/main.c
index ae5d76b..b01bc22 100644
--- a/ftp/main.c
+++ b/ftp/main.c
@@ -92,6 +92,10 @@ static char *prompt = 0;
 const char args_doc[] = "[HOST [PORT]]";
 const char doc[] = "Remote file transfer.";
 
+enum {
+  OPT_PROMPT = CHAR_MAX + 1,
+};
+
 static struct argp_option argp_options[] = {
 #define GRP 0
   {"debug", 'd', NULL, 0, "set the SO_DEBUG option", GRP+1},
@@ -101,7 +105,9 @@ static struct argp_option argp_options[] = {
   {"no-login", 'n', NULL, 0, "do not automatically login to the remote system",
    GRP+1},
   {"trace", 't', NULL, 0, "enable packet tracing", GRP+1},
-  {"prompt", 'p', "PROMPT", OPTION_ARG_OPTIONAL, "print a command line PROMPT "
+  {"passive", 'p', NULL, 0, "enable passive mode transfer", GRP+1},
+  {"active", 'A', NULL, 0, "enable active mode transfer", GRP+1},
+  {"prompt", OPT_PROMPT, "PROMPT", OPTION_ARG_OPTIONAL, "print a command line PROMPT "
    "(optionally), even if not on a tty", GRP+1},
   {"verbose", 'v', NULL, 0, "verbose output", GRP+1},
 #undef GRP
@@ -138,10 +144,18 @@ parse_opt (int key, char *arg, struct argp_state *state)
       verbose++;
       break;
 
-    case 'p':		/* Print command line prompt.  */
+    case OPT_PROMPT:		/* Print command line prompt.  */
       prompt = arg ? arg : DEFAULT_PROMPT;
       break;
 
+    case 'p':		/* Enable passive transfer mode.  */
+      passivemode = 1;
+      break;
+
+    case 'A':	/* Enable active transfer mode.  */
+      passivemode = 0;
+      break;
+
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -168,6 +182,7 @@ main (int argc, char *argv[])
   doglob = 1;
   interactive = 1;
   autologin = 1;
+  passivemode = 0;		/* passive mode not active */
 
   /* Parse command line */
   iu_argp_init ("ftp", default_program_authors);
@@ -186,7 +201,6 @@ main (int argc, char *argv[])
 
   cpend = 0;			/* no pending replies */
   proxy = 0;			/* proxy not active */
-  passivemode = 0;		/* passive mode not active */
   crflag = 1;			/* strip c.r. on ascii gets */
   sendport = -1;		/* not using ports */
   /*

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog  |   12 ++++++++++++
 NEWS       |    8 ++++++++
 ftp/main.c |   20 +++++++++++++++++---
 3 files changed, 37 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



From MAILER-DAEMON Sat Feb 06 15:09:47 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NdqyR-0002wk-Dq
	for mharc-commit-inetutils@gnu.org; Sat, 06 Feb 2010 15:09:47 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NdqyP-0002wf-LQ
	for commit-inetutils@gnu.org; Sat, 06 Feb 2010 15:09:45 -0500
Received: from [199.232.76.173] (port=40643 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NdqyO-0002wX-9E
	for commit-inetutils@gnu.org; Sat, 06 Feb 2010 15:09:44 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <ams@gnu.org>) id 1NdqyM-0000Nz-RW
	for commit-inetutils@gnu.org; Sat, 06 Feb 2010 15:09:44 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:35891
	helo=internal.in.savannah.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <ams@gnu.org>) id 1NdqyM-0000Ns-B2
	for commit-inetutils@gnu.org; Sat, 06 Feb 2010 15:09:42 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal with esmtp (Exim 4.69) (envelope-from <ams@gnu.org>)
	id 1NdqyL-00076Z-VS
	for commit-inetutils@gnu.org; Sat, 06 Feb 2010 20:09:42 +0000
Received: from ams by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <ams@savannah.gnu.org>) id 1NdqyL-0004lU-QW
	for commit-inetutils@gnu.org; Sat, 06 Feb 2010 20:09:41 +0000
To: commit-inetutils@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 90ba0564bb742bca412e9be6f799647aabddfb17
X-Git-Newrev: c77421ed35e4a512154ee9b219e105f5e067e856
Message-Id: <E1NdqyL-0004lU-QW@vcs-noshell.in.savannah.gnu.org>
From: "Alfred M. Szmidt" <ams@gnu.org>
Date: Sat, 06 Feb 2010 20:09:41 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_7-32-gc77421e
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Feb 2010 20:09:45 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  c77421ed35e4a512154ee9b219e105f5e067e856 (commit)
      from  90ba0564bb742bca412e9be6f799647aabddfb17 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=c77421ed35e4a512154ee9b219e105f5e067e856


commit c77421ed35e4a512154ee9b219e105f5e067e856
Author: Alfred M. Szmidt <ams@gnu.org>
Date:   Sat Feb 6 21:14:31 2010 +0100

    Added two new items, broadcasted terminal client/server, and supdup
    client/server.  (silent change)

diff --git a/TODO b/TODO
index c8f4b33..64b809c 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,14 @@
 * General
 
+broadcasted terminals: provide a client/daemon that broadcasts a users
+  terminal on a port.  Ideally, there should be a single port, with a
+  command to list all avaiable broadcasts.
+
+supdup: A telnet client/daemon like program for the SUPDUP protocol;
+  there exists one already by it is ugly, and kinda a pain to get
+  running.  And I don't think there is an actual daemon program for
+  GNU systems at all (ITS has one though :-).
+
 ifconfig: when a unknown format option is passed to --format, ifconfig
   will output the name of the format twice.
 

-----------------------------------------------------------------------

Summary of changes:
 TODO |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



From MAILER-DAEMON Mon Feb 08 04:42:48 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NeQ8m-00016W-El
	for mharc-commit-inetutils@gnu.org; Mon, 08 Feb 2010 04:42:48 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NeQ8l-00016Q-Hw
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 04:42:47 -0500
Received: from [199.232.76.173] (port=58545 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NeQ8l-00016H-4T
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 04:42:47 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <gray@gnu.org.ua>) id 1NeQ8f-0007wl-E1
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 04:42:46 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:49545
	helo=internal.in.savannah.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <gray@gnu.org.ua>) id 1NeQ8f-0007wh-2j
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 04:42:41 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gray@gnu.org.ua>) id 1NeQ8e-0005jZ-Nk
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 09:42:40 +0000
Received: from gray by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <gray@savannah.gnu.org>) id 1NeQ8e-0008JI-JO
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 09:42:40 +0000
To: commit-inetutils@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: c77421ed35e4a512154ee9b219e105f5e067e856
X-Git-Newrev: 1c9891407d45e3214d8a47273f28c33856f7ad62
Message-Id: <E1NeQ8e-0008JI-JO@vcs-noshell.in.savannah.gnu.org>
From: Sergey Poznyakoff <gray@gnu.org.ua>
Date: Mon, 08 Feb 2010 09:42:40 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_7-33-g1c98914
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Feb 2010 09:42:47 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  1c9891407d45e3214d8a47273f28c33856f7ad62 (commit)
      from  c77421ed35e4a512154ee9b219e105f5e067e856 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=1c9891407d45e3214d8a47273f28c33856f7ad62


commit 1c9891407d45e3214d8a47273f28c33856f7ad62
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Mon Feb 8 11:40:05 2010 +0200

    Ifconfig: read format from files; implement the -s option.
    
    * ifconfig/flags.c (if_format_flags): Rename to if_list_flags.
    (if_format_flags): New function.
    (print_if_flags): Fix spelling of the 3rd argument.
    * ifconfig/flags.h (IF_FORMAT_FLAGS_BUFSIZE): New define.
    (if_format_flags): Rename to if_list_flags.
    (if_format_flags): New prototype.
    * ifconfig/ifconfig.h: Include obstack.h
    * ifconfig/options.c (formats)<netstat>: New format.
    (argp_options): New option: --short (-s).
    (parse_opt_set_default_format): Optimize.
    (parse_opt_set_default_format_from_file): New function.
    (parse_opt): Handle -s option.
    If argument to --format begins with a '@', it specifies a
    file to read format from.
    (parse_cmdline): Order interfaces alphabetically.
    * ifconfig/printif.c (put_flags_short): New function.
    (fh_flags): ${flags}{short} prints flags in short notation.

diff --git a/ChangeLog b/ChangeLog
index f5b45b0..7d3d83b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2010-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
+
+	Ifconfig: read format from files and implement the -s option.
+
+	* ifconfig/flags.c (if_format_flags): Rename to if_list_flags.
+	(if_format_flags): New function.
+	(print_if_flags): Fix spelling of the 3rd argument.
+	* ifconfig/flags.h (IF_FORMAT_FLAGS_BUFSIZE): New define.
+	(if_format_flags): Rename to if_list_flags.
+	(if_format_flags): New prototype.
+	* ifconfig/ifconfig.h: Include obstack.h
+	* ifconfig/options.c (formats)<netstat>: New format.
+	(argp_options): New option: --short (-s).
+	(parse_opt_set_default_format): Optimize.
+	(parse_opt_set_default_format_from_file): New function.
+	(parse_opt): Handle -s option.
+	If argument to --format begins with a '@', it specifies a
+	file to read format from.
+	(parse_cmdline): Order interfaces alphabetically.
+	* ifconfig/printif.c (put_flags_short): New function.
+	(fh_flags): ${flags}{short} prints flags in short notation.
+
 2010-02-04  Alfred M. Szmidt  <ams@gnu.org>
 
 	New options --active and --passive.
diff --git a/NEWS b/NEWS
index 55f55c0..db0416e 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,18 @@ now uses -a instead.
 
 New commands (multicast, allmulti) to set multicast flags.
 
+New option -s displays a short list of interfaces (similar to
+netstat -i).
+
+The --format option can be used to read format from a file.  To do so,
+prefix the file name with a '@' sign, e.g.:
+
+          ifconfig --format=@FILE
+
+The contents of this file is read literally, except that the lines
+beginning with a `#' sign are ignored (and can thus be used to introduce
+comments).
+
 * Man pages for the daemons are now in section 8 instead of 1.
 
 * There is now a man page for ping6 too.
diff --git a/ifconfig/flags.c b/ifconfig/flags.c
index c948cea..05371b2 100644
--- a/ifconfig/flags.c
+++ b/ifconfig/flags.c
@@ -233,7 +233,7 @@ cmpname (const void *a, const void *b)
 }
 
 char *
-if_format_flags (const char *prefix)
+if_list_flags (const char *prefix)
 {
   size_t len = 0;
   struct if_flag *fp;
@@ -377,11 +377,62 @@ if_nameztoflag (const char *name, int *prev)
   return if_nametoflag (name, strlen (name), prev);
 }
 
+struct if_flag_char
+{
+  int mask;
+  int ch;
+};
+
+/* Interface flag bits and the corresponding letters for short output.
+   Notice that the entries must be ordered alphabetically, by the letter name.
+   There are two lamentable exceptions:
+
+   1. The 'd' is misplaced.
+   2. The 'P' letter is ambiguous. Depending on its position in the output
+      line it may stand for IFF_PROMISC or IFF_POINTOPOINT.
+
+   That's the way netstat does it.
+*/
+static struct if_flag_char flag_char_tab[] = {
+  { IFF_ALLMULTI,    'A' },
+  { IFF_BROADCAST,   'B' },
+  { IFF_DEBUG,       'D' },
+  { IFF_LOOPBACK,    'L' },
+  { IFF_MULTICAST,   'M' },
+#ifdef HAVE_DYNAMIC
+  { IFF_DYNAMIC,     'd' },
+#endif
+  { IFF_PROMISC,     'P' },
+  { IFF_NOTRAILERS,  'N' },
+  { IFF_NOARP,       'O' },
+  { IFF_POINTOPOINT, 'P' },
+  { IFF_SLAVE,       's' },
+  { IFF_MASTER,      'm' },
+  { IFF_RUNNING,     'R' },
+  { IFF_UP,          'U' },
+  { 0 }
+};
+
+void
+if_format_flags (int flags, char *buf, size_t size)
+{
+  struct if_flag_char *fp;
+  size--;
+  for (fp = flag_char_tab; size && fp->mask; fp++)
+    if (fp->mask & flags)
+      {
+	*buf++ = fp->ch;
+	size--;
+      }
+  *buf = 0;
+}
+
+
 /* Print the flags in FLAGS, using AVOID as in if_flagtoname, and
-   SEPERATOR between individual flags.  Returns the number of
+   SEPARATOR between individual flags.  Returns the number of
    characters printed.  */
 int
-print_if_flags (int flags, const char *avoid, char seperator)
+print_if_flags (int flags, const char *avoid, char separator)
 {
   int f = 1;
   const char *name;
@@ -397,7 +448,7 @@ print_if_flags (int flags, const char *avoid, char seperator)
 	    {
 	      if (!first)
 		{
-		  putchar (seperator);
+		  putchar (separator);
 		  length++;
 		}
 	      length += printf ("%s", name);
@@ -411,7 +462,7 @@ print_if_flags (int flags, const char *avoid, char seperator)
     {
       if (!first)
 	{
-	  putchar (seperator);
+	  putchar (separator);
 	  length++;
 	}
       length += printf ("%#x", flags);
diff --git a/ifconfig/flags.h b/ifconfig/flags.h
index 713cf1c..f216fcd 100644
--- a/ifconfig/flags.h
+++ b/ifconfig/flags.h
@@ -52,6 +52,10 @@ int if_nameztoflag (const char *name, int *prev);
    characters printed.  */
 int print_if_flags (int flags, const char *avoid, char seperator);
 
-char *if_format_flags (const char *prefix);
+char *if_list_flags (const char *prefix);
+
+/* Size of the buffer for the if_format_flags call */
+#define IF_FORMAT_FLAGS_BUFSIZE 15
+void if_format_flags (int flags, char *buf, size_t size);
 
 #endif
diff --git a/ifconfig/ifconfig.h b/ifconfig/ifconfig.h
index 30a7081..c5c4b8c 100644
--- a/ifconfig/ifconfig.h
+++ b/ifconfig/ifconfig.h
@@ -30,6 +30,9 @@
 # include <progname.h>
 # include <error.h>
 # include <argp.h>
+# define obstack_chunk_alloc malloc
+# define obstack_chunk_free free
+# include <obstack.h>
 # include <libinetutils.h>
 
 /* XXX */
diff --git a/ifconfig/options.c b/ifconfig/options.c
index 106e79a..273f1c8 100644
--- a/ifconfig/options.c
+++ b/ifconfig/options.c
@@ -121,6 +121,17 @@ struct format formats[] = {
    "${newline}"
    "}"
   },
+  {"netstat",
+   "${first?}{Iface    MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg${newline}}"
+   "${format}{check-existence}"
+   "${name}${tab}{6}${mtu}{%6d} ${metric}{%3d}"
+   "${ifstat?}{"
+   " ${rxpackets}{%8lu} ${rxerrors}{%6lu} ${rxdropped}{%6lu} ${rxfifoerr}{%6lu}"
+   " ${txpackets}{%8lu} ${txerrors}{%6lu} ${txdropped}{%6lu} ${txfifoerr}{%6lu}"
+   "}{   - no statistics available -}"
+   "${tab}{76} ${flags?}{${flags}{short}}{[NO FLAGS]}"
+   "${newline}"
+  },
   /* Resembles the output of ifconfig shipped with unix systems like
      Solaris 2.7 or HPUX 10.20.  */
   {"unix",
@@ -198,6 +209,8 @@ static struct argp_option argp_options[] = {
     "shut the interface down" },
   { "flags", 'F', "FLAG[,FLAG...]", 0,
     "set interface flags" },
+  { "short", 's', NULL, 0,
+    "short output format" },
   { NULL }
 };
 
@@ -322,28 +335,75 @@ parse_opt_set_point_to_point (struct ifconfig *ifp, char *addr)
 }
 
 void
-parse_opt_set_default_format (const char *new_format)
+parse_opt_set_default_format (const char *format)
 {
-  struct format *frm = formats;
-  const char *format = new_format;
+  struct format *frm;
 
   if (!format)
     format = system_default_format ? system_default_format : "default";
 
-  while (frm->name)
+  for (frm = formats; frm->name; frm++)
     {
-      if (!strcmp (format ? format : "default", frm->name))
-	break;
-      frm++;
+      if (!strcmp (format, frm->name))
+	{
+	  default_format = frm->templ;
+	  return;
+	}
     }
 
-  /* If we didn't find the format, set the user specified one.  */
-  if (frm->name)
-    default_format = frm->templ;
-  else if (format)
-    default_format = format;
-  else
-    default_format = "default";
+  default_format = format;
+}
+
+static int
+is_comment_line (const char *p, size_t len)
+{
+  while (len--)
+    {
+      int c = *p++;
+      switch (c)
+	{
+	case ' ':
+	case '\t':
+	  continue;
+
+	case '#':
+	  return 1;
+
+	default:
+	  return 0;
+	}
+    }
+  return 0;
+}
+
+void
+parse_opt_set_default_format_from_file (const char *file)
+{
+  static struct obstack stk;
+  FILE *fp;
+  char *buf = NULL;
+  size_t size = 0;
+
+  fp = fopen (file, "r");
+  if (!fp)
+    error (EXIT_FAILURE, errno, "cannot open format file %s", file);
+
+  obstack_init (&stk);
+  while (getline (&buf, &size, fp) > 0)
+    {
+      size_t len = strlen (buf);
+
+      if (len >= 1 && buf[len-1] == '\n')
+	len--;
+
+      if (len == 0 || is_comment_line (buf, len))
+	continue;
+      obstack_grow (&stk, buf, len);
+    }
+  free (buf);
+  fclose (fp);
+  obstack_1grow (&stk, 0);
+  default_format = obstack_finish (&stk);
 }
 
 /* Must be reentrant!  */
@@ -404,6 +464,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
       parse_opt_set_mtu (ifp, arg);
       break;
 
+    case 's':
+      parse_opt_set_default_format ("netstat");
+      break;
+
     case 'v':
       verbose++;
       break;
@@ -413,7 +477,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
       break;
 
     case FORMAT_OPTION:		/* Output format.  */
-      parse_opt_set_default_format (arg);
+      if (arg && arg[0] == '@')
+	parse_opt_set_default_format_from_file (arg + 1);
+      else
+	parse_opt_set_default_format (arg);
       break;
 
     case UP_OPTION:
@@ -443,7 +510,7 @@ default_help_filter (int key, const char *text, void *input)
       break;
 
     case ARGP_KEY_HELP_EXTRA:
-      s = if_format_flags ("Known flags are: ");
+      s = if_list_flags ("Known flags are: ");
     }
   return s;
 }
@@ -459,6 +526,14 @@ static struct argp argp =
     default_help_filter
   };
 
+static int
+cmp_if_name (const void *a, const void *b)
+{
+  const struct ifconfig *ifa = a;
+  const struct ifconfig *ifb = b;
+
+  return strcmp (ifa->name, ifb->name);
+}
 
 void
 parse_cmdline (int argc, char *argv[])
@@ -506,5 +581,7 @@ parse_cmdline (int argc, char *argv[])
       /* XXX: We never do if_freenameindex (ifnx), because we are
 	 keeping the names for later instead using strdup
 	 (if->if_name) here.  */
+
+      qsort (ifs, nifs, sizeof (ifs[0]), cmp_if_name);
     }
 }
diff --git a/ifconfig/printif.c b/ifconfig/printif.c
index 67a4b28..f283d1e 100644
--- a/ifconfig/printif.c
+++ b/ifconfig/printif.c
@@ -334,6 +334,14 @@ put_flags (format_data_t form, int argc, char *argv[], short flags)
     }
 }
 
+void
+put_flags_short (format_data_t form, int argc, char *argv[], short flags)
+{
+  char buf[IF_FORMAT_FLAGS_BUFSIZE];
+  if_format_flags (flags, buf, sizeof buf);
+  put_string (form, buf);
+}
+
 /* Format handler can mangle form->format, so update it after calling
    here.  */
 void
@@ -757,6 +765,8 @@ fh_flags (format_data_t form, int argc, char *argv[])
 	{
 	  if (!strcmp (argv[0], "number"))
 	    put_int (form, argc - 1, &argv[1], form->ifr->ifr_flags);
+	  else if (!strcmp (argv[0], "short"))
+	    put_flags_short (form, argc - 1, &argv[1], form->ifr->ifr_flags);
 	  else if (!strcmp (argv[0], "string"))
 	    put_flags (form, argc - 1, &argv[1], form->ifr->ifr_flags);
 	}

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   22 ++++++++++
 NEWS                |   12 ++++++
 ifconfig/flags.c    |   61 ++++++++++++++++++++++++++--
 ifconfig/flags.h    |    6 ++-
 ifconfig/ifconfig.h |    3 +
 ifconfig/options.c  |  109 +++++++++++++++++++++++++++++++++++++++++++-------
 ifconfig/printif.c  |   10 +++++
 7 files changed, 201 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



From MAILER-DAEMON Mon Feb 08 15:38:48 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NeaNc-0003bB-1X
	for mharc-commit-inetutils@gnu.org; Mon, 08 Feb 2010 15:38:48 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NeaNa-0003Zm-Kn
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 15:38:46 -0500
Received: from [199.232.76.173] (port=38038 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NeaNZ-0003ZO-Sg
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 15:38:45 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <gray@gnu.org.ua>) id 1NeaNU-00070z-VS
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 15:38:45 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:46592
	helo=internal.in.savannah.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <gray@gnu.org.ua>) id 1NeaNU-0006ui-Au
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 15:38:40 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gray@gnu.org.ua>) id 1NeaNT-00059R-Ee
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 20:38:39 +0000
Received: from gray by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <gray@savannah.gnu.org>) id 1NeaNT-00055k-AS
	for commit-inetutils@gnu.org; Mon, 08 Feb 2010 20:38:39 +0000
To: commit-inetutils@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 1c9891407d45e3214d8a47273f28c33856f7ad62
X-Git-Newrev: e6013a6e9a42c4b3af939b2eb0811083ea713ddf
Message-Id: <E1NeaNT-00055k-AS@vcs-noshell.in.savannah.gnu.org>
From: Sergey Poznyakoff <gray@gnu.org.ua>
Date: Mon, 08 Feb 2010 20:38:39 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_7-34-ge6013a6
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Feb 2010 20:38:47 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  e6013a6e9a42c4b3af939b2eb0811083ea713ddf (commit)
      from  1c9891407d45e3214d8a47273f28c33856f7ad62 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=e6013a6e9a42c4b3af939b2eb0811083ea713ddf


commit e6013a6e9a42c4b3af939b2eb0811083ea713ddf
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Mon Feb 8 22:38:58 2010 +0200

    Ifconfig: add more format functions; implement --format=help.
    
    * ifconfig/if_index.c (if_nametoindex): Fix return value.
    * ifconfig/ifconfig.c (main): Rewrite loop.
    * ifconfig/options.c (formats): Add docstrings.
    Add "help" format.
    (format_find): New function.
    * ifconfig/options.h (format)<docstr>: New member.
    (format_find): New prototype.
    * ifconfig/printif.c (format_handles): New functions:
    format?, docstr?, defn, foreachformat, verbose?, rep.
    (put_flags): Minor change.
    (format_handler, fh_exists_query, fh_error): Rewrite the loop.
    (fh_format_query, fh_docstr)
    (fh_defn, fh_foreachformat)
    (fh_rep, fh_verbose_query): New functions.
    (fh_format): Rewrite using format_find.
    * ifconfig/printif.h (fh_format_query, fh_docstr)
    (fh_defn, fh_foreachformat)
    (fh_rep, fh_verbose_query): New prototypes.
    * NEWS: Update.

diff --git a/ChangeLog b/ChangeLog
index 7d3d83b..4a6bc2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,29 @@
 2010-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
 
+	Ifconfig: add more format functions; implement --format=help.
+
+	* ifconfig/if_index.c (if_nametoindex): Fix return value.
+	* ifconfig/ifconfig.c (main): Rewrite loop.
+	* ifconfig/options.c (formats): Add docstrings.
+	Add "help" format.
+	(format_find): New function.
+	* ifconfig/options.h (format)<docstr>: New member.
+	(format_find): New prototype.
+	* ifconfig/printif.c (format_handles): New functions:
+	format?, docstr?, defn, foreachformat, verbose?, rep.
+	(put_flags): Minor change.
+	(format_handler, fh_exists_query, fh_error): Rewrite the loop.
+	(fh_format_query, fh_docstr)
+	(fh_defn, fh_foreachformat)
+	(fh_rep, fh_verbose_query): New functions.
+	(fh_format): Rewrite using format_find.
+	* ifconfig/printif.h (fh_format_query, fh_docstr)
+	(fh_defn, fh_foreachformat)
+	(fh_rep, fh_verbose_query): New prototypes.
+	* NEWS: Update.
+
+2010-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
+
 	Ifconfig: read format from files and implement the -s option.
 
 	* ifconfig/flags.c (if_format_flags): Rename to if_list_flags.
diff --git a/NEWS b/NEWS
index db0416e..28e72fb 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,13 @@ The contents of this file is read literally, except that the lines
 beginning with a `#' sign are ignored (and can thus be used to introduce
 comments).
 
+To obtain a list of the available built-in output formats, use
+
+         ifconfig --format=help
+
+When used with the --verbose option, --format=help also displays
+format definitions.
+
 * Man pages for the daemons are now in section 8 instead of 1.
 
 * There is now a man page for ping6 too.
diff --git a/ifconfig/if_index.c b/ifconfig/if_index.c
index 1baa1ea..e2737c2 100644
--- a/ifconfig/if_index.c
+++ b/ifconfig/if_index.c
@@ -49,12 +49,13 @@ if_nametoindex (const char *ifname)
     int fd = socket (AF_INET, SOCK_DGRAM, 0);
     if (fd >= 0)
       {
+	int rc;
 	struct ifreq ifr;
 	strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
 	ifr.ifr_name[IFNAMSIZ - 1] = '\0';
-	result = ioctl (fd, SIOCGIFINDEX, &ifr);
+	rc = ioctl (fd, SIOCGIFINDEX, &ifr);
 	close (fd);
-	if (result == 0)
+	if (rc == 0)
 	  return ifr.ifr_index;
       }
   }
diff --git a/ifconfig/ifconfig.c b/ifconfig/ifconfig.c
index 988355a..28a1d69 100644
--- a/ifconfig/ifconfig.c
+++ b/ifconfig/ifconfig.c
@@ -69,15 +69,13 @@ main (int argc, char *argv[])
       exit (1);
     }
 
-  ifp = ifs;
-  while (ifp - ifs < nifs)
+  for (ifp = ifs; ifp < ifs + nifs; ifp++)
     {
       err = configure_if (sfd, ifp);
       if (err)
 	break;
-      ifp++;
     }
 
   close (sfd);
-  return (err);
+  return err;
 }
diff --git a/ifconfig/options.c b/ifconfig/options.c
index 273f1c8..1d46dbc 100644
--- a/ifconfig/options.c
+++ b/ifconfig/options.c
@@ -62,10 +62,15 @@ static struct ifconfig ifconfig_initializer = {
 struct format formats[] = {
   /* This is the default output format if no system_default_format is
      specified.  */
-  {"default", "${format}{gnu}"},
+  {"default",
+   "Default format.  Equivalent to \"gnu\".",
+   "${format}{gnu}"},
   /* This is the standard GNU output.  */
-  {"gnu", "${first?}{}{${\\n}}${format}{gnu-one-entry}"},
+  {"gnu",
+   "Standard GNU output format.",
+   "${first?}{}{${\\n}}${format}{gnu-one-entry}"},
   {"gnu-one-entry",
+   "Same as GNU, but without additional newlines between the entries.",
    "${format}{check-existence}"
    "${ifdisplay?}{"
    "${name} (${index}):${\\n}"
@@ -83,6 +88,7 @@ struct format formats[] = {
   },
   /* Resembles the output of ifconfig 1.39 (1999-03-19) in net-tools 1.52.  */
   {"net-tools",
+   "Similar to the output of net-tools.  Default for GNU/Linux.",
    "${format}{check-existence}"
    "${ifdisplay?}{"
    "${name}${exists?}{hwtype?}{${hwtype?}{${tab}{10}Link encap:${hwtype}}"
@@ -122,6 +128,7 @@ struct format formats[] = {
    "}"
   },
   {"netstat",
+   "Terse output, similar to that of \"netstat -i\".",
    "${first?}{Iface    MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg${newline}}"
    "${format}{check-existence}"
    "${name}${tab}{6}${mtu}{%6d} ${metric}{%3d}"
@@ -135,6 +142,7 @@ struct format formats[] = {
   /* Resembles the output of ifconfig shipped with unix systems like
      Solaris 2.7 or HPUX 10.20.  */
   {"unix",
+   "Traditional UNIX interface listing.  Default for Solaris and HPUX.",
    "${format}{check-existence}"
    "${ifdisplay?}{"
    "${name}: flags=${flags}{number}<${flags}{string}{,}>"
@@ -149,6 +157,7 @@ struct format formats[] = {
   },
   /* Resembles the output of ifconfig shipped with OSF 4.0g.  */
   {"osf",
+   "OSF-style output.",
    "${format}{check-existence}"
    "${ifdisplay?}{"
    "${name}: flags=${flags}{number}{%x}<${flags}{string}{,}>${\\n}"
@@ -160,9 +169,24 @@ struct format formats[] = {
   },
   /* If interface does not exist, print error message and exit. */
   {"check-existence",
+   "If interface does not exist, print error message and exit.",
    "${index?}{}"
    "{${error}{${progname}: error: interface `${name}' does not exist${\\n}}"
    "${exit}{1}}"},
+  {"help",
+   "Display this help output.",
+   "${foreachformat}{"
+   "${name}:${tab}{17}${docstr}"
+   "${verbose?}{"
+   "${newline}"
+   "${rep}{79}{-}"
+   "${newline}"
+   "${defn}"
+   "${newline}"
+   "}"
+   "${newline}"
+   "}"
+   "${exit}{0}"},
   {0, 0}
 };
 
@@ -221,6 +245,19 @@ const char *program_authors[] =
     NULL
   };
 
+struct format *
+format_find (const char *name)
+{
+  struct format *frm;
+
+  for (frm = formats; frm->name; frm++)
+    {
+      if (strcmp (frm->name, name) == 0)
+	return frm;
+    }
+  return NULL;
+}
+
 struct ifconfig *
 parse_opt_new_ifs (char *name)
 {
diff --git a/ifconfig/options.h b/ifconfig/options.h
index 5e2a6ab..7e403f5 100644
--- a/ifconfig/options.h
+++ b/ifconfig/options.h
@@ -57,6 +57,7 @@ struct ifconfig
 struct format
 {
   const char *name;
+  const char *docstr;
   const char *templ;
 };
 
@@ -72,6 +73,7 @@ extern int nifs;
 extern int verbose;
 
 void usage (int err);
+struct format *format_find (const char *name);
 void parse_opt_set_address (struct ifconfig *ifp, char *addr);
 void parse_opt_set_brdaddr (struct ifconfig *ifp, char *addr);
 void parse_opt_set_dstaddr (struct ifconfig *ifp, char *addr);
diff --git a/ifconfig/printif.c b/ifconfig/printif.c
index f283d1e..d3278af 100644
--- a/ifconfig/printif.c
+++ b/ifconfig/printif.c
@@ -65,9 +65,15 @@ struct format_handle format_handles[] = {
   SYSTEM_FORMAT_HANDLER
 #endif
   {"", fh_nothing},
+  {"format?", fh_format_query},
+  {"docstr", fh_docstr},
+  {"defn", fh_defn},
+  {"foreachformat", fh_foreachformat},
+  {"verbose?", fh_verbose_query},
   {"newline", fh_newline},
   {"\\n", fh_newline},
   {"\\t", fh_tabulator},
+  {"rep", fh_rep},
   {"first?", fh_first},
   {"ifdisplay?", fh_ifdisplay_query},
   {"tab", fh_tab},
@@ -304,7 +310,7 @@ put_flags (format_data_t form, int argc, char *argv[], short flags)
     {
       if (f & flags)
 	{
-	  name = if_flagtoname (f, "" /* XXX: avoid */ );
+	  name = if_flagtoname (f, NULL);
 	  if (name)
 	    {
 	      if (!first)
@@ -348,24 +354,21 @@ void
 format_handler (const char *name, format_data_t form, int argc, char *argv[])
 {
   struct format_handle *fh;
-  fh = format_handles;
 
-  while (fh->name != NULL)
+  for (fh = format_handles; fh->name; fh++)
     {
       if (!strcmp (fh->name, name))
-	break;
-      fh++;
+	{
+	  if (fh->handler)
+	    (fh->handler) (form, argc, argv);
+	  return;
+	}
     }
 
-  if (fh->handler)
-    (fh->handler) (form, argc, argv);
-  else
-    {
-      *column += printf ("(");
-      put_string (form, name);
-      *column += printf (" unknown)");
-      had_output = 1;
-    }
+  *column += printf ("(");
+  put_string (form, name);
+  *column += printf (" unknown)");
+  had_output = 1;
 }
 
 void
@@ -374,6 +377,60 @@ fh_nothing (format_data_t form, int argc, char *argv[])
 }
 
 void
+fh_format_query (format_data_t form, int argc, char *argv[])
+{
+  if (argc < 1)
+    return;
+  select_arg (form, argc, argv, format_find (argv[0]) ? 1 : 2);
+}
+
+void
+fh_docstr (format_data_t form, int argc, char *argv[])
+{
+  const char *name;
+  struct format *frm;
+
+  name = (argc == 0) ? form->name : argv[0];
+  frm = format_find (name);
+  if (!frm)
+    error (EXIT_FAILURE, errno, "unknown format: `%s'", name);
+  put_string (form, frm->docstr);
+}
+
+void
+fh_defn (format_data_t form, int argc, char *argv[])
+{
+  const char *name;
+  struct format *frm;
+
+  name = (argc == 0) ? form->name : argv[0];
+
+  frm = format_find (name);
+  if (!frm)
+    error (EXIT_FAILURE, errno, "unknown format: `%s'", name);
+  put_string (form, frm->templ);
+}
+
+void
+fh_foreachformat (format_data_t form, int argc, char *argv[])
+{
+  struct format *frm;
+  const char *save_name;
+
+  if (argc == 0)
+    return;
+
+  save_name = form->name;
+  for (frm = formats; frm->name; frm++)
+    {
+      form->name = frm->name;
+      form->format = argv[0];
+      print_interfaceX (form, 0);
+    }
+  form->name = save_name;
+}
+
+void
 fh_newline (format_data_t form, int argc, char *argv[])
 {
   put_char (form, '\n');
@@ -386,6 +443,24 @@ fh_tabulator (format_data_t form, int argc, char *argv[])
 }
 
 void
+fh_rep (format_data_t form, int argc, char *argv[])
+{
+  unsigned int count;
+  char *p;
+
+  if (argc < 2)
+    return;
+  count = strtoul (argv[0], &p, 10);
+  if (*p)
+    error (EXIT_FAILURE, 0, "invalid repeat count");
+  while (count--)
+    {
+      form->format = argv[1];
+      print_interfaceX (form, 0);
+    }
+}
+
+void
 fh_first (format_data_t form, int argc, char *argv[])
 {
   select_arg (form, argc, argv, form->first ? 0 : 1);
@@ -410,6 +485,12 @@ fh_ifdisplay_query (format_data_t form, int argc, char *argv[])
   select_arg (form, argc, argv, n);
 }
 
+void
+fh_verbose_query (format_data_t form, int argc, char *argv[])
+{
+  select_arg (form, argc, argv, verbose ? 0 : 1);
+}
+
 /* A tab implementation, which fills with spaces up to requested column or next
    tabstop.  */
 void
@@ -456,34 +537,33 @@ fh_join (format_data_t form, int argc, char *argv[])
 void
 fh_exists_query (format_data_t form, int argc, char *argv[])
 {
-  struct format_handle *fh;
-  fh = format_handles;
-
   if (argc > 0)
     {
-      while (fh->name != NULL)
+      struct format_handle *fh;
+      int sel = 2; /* assume 2nd arg by default */
+
+      for (fh = format_handles; fh->name; fh++)
 	{
 	  if (!strcmp (fh->name, argv[0]))
-	    break;
-	  fh++;
+	    {
+	      sel = 1; /* select 1st argument */
+	      break;
+	    }
 	}
-      select_arg (form, argc, argv, (fh->name != NULL) ? 1 : 2);
+      select_arg (form, argc, argv, sel);
     }
 }
 
 void
 fh_format (format_data_t form, int argc, char *argv[])
 {
-  int i = 0;
+  int i;
 
-  while (i < argc)
+  for (i = 0; i < argc; i++)
     {
-      struct format *frm = formats;
-
-      while (frm->name && strcmp (argv[i], frm->name))
-	frm++;
+      struct format *frm = format_find (argv[i]);
 
-      if (frm->name)
+      if (frm)
 	{
 	  /* XXX: Avoid infinite recursion by appending name to a list
 	     during the next call (but removing it afterwards, and
@@ -491,22 +571,22 @@ fh_format (format_data_t form, int argc, char *argv[])
 	     already.  */
 	  form->format = frm->templ;
 	  print_interfaceX (form, 0);
+	  break;
 	}
-      i++;
     }
 }
 
 void
 fh_error (format_data_t form, int argc, char *argv[])
 {
-  int i = 0;
+  int i;
   FILE *s = ostream;
   int *c = column;
 
   ostream = stderr;
   column = &column_stderr;
-  while (i < argc)
-    select_arg (form, argc, argv, i++);
+  for (i = 0; i < argc; i++)
+    select_arg (form, argc, argv, i);
   ostream = s;
   column = c;
 }
diff --git a/ifconfig/printif.h b/ifconfig/printif.h
index b4391ce..fea738f 100644
--- a/ifconfig/printif.h
+++ b/ifconfig/printif.h
@@ -74,8 +74,14 @@ void format_handler (const char *name, format_data_t form, int argc,
 		     char *argv[]);
 
 void fh_nothing (format_data_t form, int argc, char *argv[]);
+void fh_format_query (format_data_t form, int argc, char *argv[]);
+void fh_docstr (format_data_t form, int argc, char *argv[]);
+void fh_defn (format_data_t form, int argc, char *argv[]);
+void fh_foreachformat (format_data_t form, int argc, char *argv[]);
+void fh_verbose_query (format_data_t form, int argc, char *argv[]);
 void fh_newline (format_data_t form, int argc, char *argv[]);
 void fh_tabulator (format_data_t form, int argc, char *argv[]);
+void fh_rep (format_data_t form, int argc, char *argv[]);
 void fh_first (format_data_t form, int argc, char *argv[]);
 void fh_ifdisplay_query (format_data_t form, int argc, char *argv[]);
 void fh_tab (format_data_t form, int argc, char *argv[]);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   24 +++++++++
 NEWS                |    7 +++
 ifconfig/if_index.c |    5 +-
 ifconfig/ifconfig.c |    6 +--
 ifconfig/options.c  |   41 ++++++++++++++-
 ifconfig/options.h  |    2 +
 ifconfig/printif.c  |  144 +++++++++++++++++++++++++++++++++++++++-----------
 ifconfig/printif.h  |    6 ++
 8 files changed, 195 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



From MAILER-DAEMON Sat Feb 13 11:24:23 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NgKn9-0002Pb-Sy
	for mharc-commit-inetutils@gnu.org; Sat, 13 Feb 2010 11:24:23 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NgKn8-0002PK-TD
	for commit-inetutils@gnu.org; Sat, 13 Feb 2010 11:24:22 -0500
Received: from [140.186.70.92] (port=54212 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NgKn8-0002P1-5c
	for commit-inetutils@gnu.org; Sat, 13 Feb 2010 11:24:22 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NgKn7-00078M-G1
	for commit-inetutils@gnu.org; Sat, 13 Feb 2010 11:24:22 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:56023
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NgKn7-00078I-Af
	for commit-inetutils@gnu.org; Sat, 13 Feb 2010 11:24:21 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NgKn7-0004w1-5J
	for commit-inetutils@gnu.org; Sat, 13 Feb 2010 16:24:21 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NgKn7-00028U-15
	for commit-inetutils@gnu.org; Sat, 13 Feb 2010 16:24:21 +0000
To: commit-inetutils@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e6013a6e9a42c4b3af939b2eb0811083ea713ddf
X-Git-Newrev: f343d647ec1949845a0e593fe713f92de6f97c97
Message-Id: <E1NgKn7-00028U-15@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sat, 13 Feb 2010 16:24:21 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_7-36-gf343d64
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 13 Feb 2010 16:24:23 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  f343d647ec1949845a0e593fe713f92de6f97c97 (commit)
       via  0bf96a35853a18662e359cbf7c8d188e1cf98d30 (commit)
      from  e6013a6e9a42c4b3af939b2eb0811083ea713ddf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=f343d647ec1949845a0e593fe713f92de6f97c97


commit f343d647ec1949845a0e593fe713f92de6f97c97
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Feb 13 17:24:52 2010 +0100

    Fix typo in the TODO file.

diff --git a/TODO b/TODO
index 64b809c..315c804 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,7 @@
 
 broadcasted terminals: provide a client/daemon that broadcasts a users
   terminal on a port.  Ideally, there should be a single port, with a
-  command to list all avaiable broadcasts.
+  command to list all available broadcasts.
 
 supdup: A telnet client/daemon like program for the SUPDUP protocol;
   there exists one already by it is ugly, and kinda a pain to get

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=0bf96a35853a18662e359cbf7c8d188e1cf98d30


commit 0bf96a35853a18662e359cbf7c8d188e1cf98d30
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Feb 13 17:23:33 2010 +0100

    Don't check for `sa_family_t'.
    
    * configure.ac: Don't check for the `sa_family_t' type.  It is already
    done by gnulib.

diff --git a/ChangeLog b/ChangeLog
index 4a6bc2f..0651b48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-13  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+	* configure.ac: Don't check for the `sa_family_t' type.  It is already
+	done by gnulib.
+
 2010-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
 
 	Ifconfig: add more format functions; implement --format=help.
diff --git a/configure.ac b/configure.ac
index d234487..331b7bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -515,13 +515,6 @@ AC_CHECK_TYPE(sig_atomic_t, , AC_DEFINE([sig_atomic_t], int, [FIXME]),
   [IU_FLUSHLEFT([#include <sys/types.h>
                  #include <signal.h> ])])
 
-AC_CHECK_TYPE(sa_family_t, , AC_DEFINE([sa_family_t], unsigned int, [FIXME]),
-  [IU_FLUSHLEFT([#include <sys/types.h>
-                 #ifdef HAVE_SOCKET_H
-                 #include <socket.h>
-                 #endif
-                 #include <sys/socket.h> ])])
-
 dnl Check for termio-related types and defines
 AC_CHECK_TYPES(cc_t, , ,
  [IU_FLUSHLEFT([#if defined(HAVE_TERMIOS_H)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog    |    5 +++++
 TODO         |    2 +-
 configure.ac |    7 -------
 3 files changed, 6 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



