commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_7-22-gc705eeb


From: Alfred M. Szmidt
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_7-22-gc705eeb
Date: Tue, 12 Jan 2010 22:13: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  c705eebed68fbc17382ab15e6c16a9de47bc510e (commit)
       via  95ea74e024592d3850eaeb0f06d987c2fb0e95c2 (commit)
       via  ce4a6a972b0884dc0f40777c5ac22e3b99de14a1 (commit)
      from  c3687e644ff20c7e62f0f235c0efca039c0312b9 (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=c705eebed68fbc17382ab15e6c16a9de47bc510e


commit c705eebed68fbc17382ab15e6c16a9de47bc510e
Author: Alfred M. Szmidt <address@hidden>
Date:   Tue Jan 12 23:19:32 2010 +0100

    Removed blank lines at EOF.  (silent change)

diff --git a/src/rexecd.c b/src/rexecd.c
index e2e014b..ab6000d 100644
--- a/src/rexecd.c
+++ b/src/rexecd.c
@@ -386,4 +386,3 @@ getstr (const char *err)
 
   return buf;
 }
-
diff --git a/src/rshd.c b/src/rshd.c
index 747e72b..6d25d6f 100644
--- a/src/rshd.c
+++ b/src/rshd.c
@@ -1265,4 +1265,3 @@ topdomain (const char *h)
     }
   return maybe;
 }
-

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=95ea74e024592d3850eaeb0f06d987c2fb0e95c2


commit 95ea74e024592d3850eaeb0f06d987c2fb0e95c2
Author: Alfred M. Szmidt <address@hidden>
Date:   Tue Jan 12 23:18:27 2010 +0100

    Moved single file programs to src/.

diff --git a/ChangeLog b/ChangeLog
index c0ac290..bd44e95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,103 @@
 2010-01-12  Alfred M. Szmidt  <address@hidden>
 
+       Moved single file programs to src/.
+
+       * libinetutils/Makefile.am (noinst_HEADERS): Added tftpsubs.h
+       shishi_def.h to list.
+       * libinetutils/Makefile.am (INCLUDES): Removed
+       -I$(top_srcdir)/headers from list.  Added
+       -I$(top_srcdir)/libinetutils to list.
+       * Makefile.am: File removed.
+       * headers/shishi_def.h: File renamed to ..
+       * libinetutils/shishi_def.h: ... this.
+       * headers/tftpsubs.h: File renamed to ...
+       * libinetutils/tftpsubs.h: ... this.
+
+       * src/.gitignore: New file.
+       * src/Makefile.am: New file.
+
+       * man/Makefile.am (hostname.1, inetd.8, logger.1, rcp.1, rexec.1)
+       (rexecd.8, rlogin.1, rlogind.8, rsh.1, rshd.8, syslogd.8, tftp.1)
+       (tftpd.8, traceroute.1, uucpd.8): Look for main program file in
+       src/.
+       (mapped_name): Added rewrite rules for hostname, inetd, logger,
+       rcp, rexec, rexecd, rlogin, rlogind, rsh, rshd, syslogd, tftp,
+       tftpd, traceroute, and uucpd.
+       * configure.ac (AC_CONFIG_SRCDIR): Look for src/inetd.c.
+       (AC_CONFIG_FILES): Removed hostname/Makefile, inetd/Makefile,
+       logger/Makefile, rcp/Makefile, rexec/Makefile, rexecd/Makefile,
+       rlogin/Makefile, rlogind/Makefile, rsh/Makefile, rshd/Makefile,
+       syslogd/Makefile, tftp/Makefile, tftpd/Makefile,
+       traceroute/Makefile, and uucpd/Makefile from list.  Added
+       src/Makefile to list.  Sorted list (in the order: libraries,
+       programs, documentation, tests, misc.).
+       * Makefile.am (SUBDIRS): Removed hostname, inetd, logger, rcp,
+       rexec, rexecd, rlogin, rlogind, rsh, rshd, syslogd, tftp, tftpd,
+       traceroute, and uucpd from list.  Added src to list.  Sorted
+       list (in the order: libraries, programs, documentation, tests).
+
+       * hostname/.gitignore, hostname/Makefile.am: Files removed.
+       * hostname/hostname.c: File renamed to ...
+       * src/hostname.c: ... this.
+
+       * inetd/.gitignore, inetd/Makefile.am: Files removed.
+       * inetd/inetd.c: File renamed to ...
+       * src/inetd.c: ... this.
+
+       * logger/.gitignore, logger/Makefile.am: Files removed.
+       * logger/logger.c: File renamed to ...
+       * src/logger.c: ... this.
+
+       * rcp/.gitignore, rcp/Makefile.am: Files removed.
+       * rcp/rcp.c: File renamed to ...
+       * src/rcp.c: ... this.
+
+       * rexec/.gitignore, rexec/Makefile.am: Files removed.
+       * rexec/rexec.c: File renamed to ...
+       * src/rexec.c: ... this.
+
+       * rexecd/.gitignore, rexecd/Makefile.am: Files removed.
+       * rexecd/rexecd.c: File renamed to ...
+       * src/rexecd.c: ... this.
+
+       * rlogin/.gitignore, rlogin/Makefile.am: Files removed.
+       * rlogin/rlogin.c: File renamed to ...
+       * src/rlogin.c: ... this.
+
+       * rlogind/.gitignore, rlogind/Makefile.am: Files removed.
+       * rlogind/rlogind.c: File renamed to ...
+       * src/rlogind.c: ... this.
+
+       * rsh/.gitignore, rsh/Makefile.am: Files removed.
+       * rsh/rsh.c: File renamed to ...
+       * src/rsh.c: ... this.
+
+       * rshd/.gitignore, rshd/Makefile.am: Files removed.
+       * rshd/rshd.c: File renamed to ...
+       * src/rshd.c: ... this.
+
+       * syslogd/.gitignore, syslogd/Makefile.am: Files removed.
+       * syslogd/syslogd.c: File renamed to ...
+       * src/syslogd.c: ... this.
+
+       * tftp/.gitignore, tftp/Makefile.am: Files removed.
+       * tftp/tftp.c: File renamed to ...
+       * src/tftp.c: ... this.
+
+       * tftpd/.gitignore, tftpd/Makefile.am: Files removed.
+       * tftpd/tftpd.c: File renamed to ...
+       * src/tftpd.c: ... this.
+
+       * traceroute/.gitignore, traceroute/Makefile.am: Files removed.
+       * traceroute/traceroute.c: File renamed to ...
+       * src/traceroute.c: ... this.
+
+       * uucpd/.gitignore, uucpd/Makefile.am: Files removed.
+       * uucpd/uucpd.c: File renamed to ...
+       * src/uucpd.c: ... this.
+
+2010-01-12  Alfred M. Szmidt  <address@hidden>
+
        Merged tftp/extern.h and tftp/main.c into tftp/tftp.c.
 
        * tftp/Makefile.am (tftp_SOURCES): Removed main.c from list.
diff --git a/Makefile.am b/Makefile.am
index 5e81999..4b41a6c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,10 +23,11 @@ ACLOCAL_AMFLAGS = -I m4 -I am
 
 EXTRA_DIST = README-alpha paths ChangeLog.0
 
-SUBDIRS = lib headers libinetutils libtelnet \
-       hostname inetd telnetd libls ftpd rshd rlogind uucpd rexecd syslogd \
-       tftpd talkd telnet ftp rsh rcp rlogin tftp logger whois talk \
-       libicmp ping doc ifconfig traceroute rexec tests man
+SUBDIRS = lib \
+       libinetutils libtelnet libicmp libls \
+       src telnet telnetd ftp ftpd talk talkd whois ping ifconfig \
+       doc man \
+       tests
 
 DISTCLEANFILES = pathdefs.make paths.defs
 
diff --git a/configure.ac b/configure.ac
index 61fdc49..cfb8ef1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ AC_PREREQ(2.59)
 
 AC_INIT([GNU inetutils], [1.7.90], address@hidden)
 
-AC_CONFIG_SRCDIR([inetd/inetd.c])
+AC_CONFIG_SRCDIR([src/inetd.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_CONFIG_HEADER([config.h:config.hin])
 AC_CANONICAL_SYSTEM # FIXME: Why not just _HOST?
@@ -812,40 +812,25 @@ esac
 
 AC_CONFIG_FILES([
 Makefile
+lib/Makefile
 libinetutils/Makefile 
 libtelnet/Makefile
 libicmp/Makefile
-ping/Makefile
+libls/Makefile
+src/Makefile
+telnet/Makefile
+telnetd/Makefile
 ftp/Makefile
 ftpd/Makefile
-hostname/Makefile
-inetd/Makefile
-rcp/Makefile
-rexec/Makefile
-rexecd/Makefile
-rlogin/Makefile
-rlogind/Makefile
-rsh/Makefile
-rshd/Makefile
-logger/Makefile
-syslogd/Makefile
 talk/Makefile
 talkd/Makefile
-telnet/Makefile
-telnetd/Makefile
-tftp/Makefile
-tftpd/Makefile
-uucpd/Makefile
 whois/Makefile
-lib/Makefile
-libls/Makefile
+ping/Makefile
 ifconfig/Makefile
 ifconfig/system/Makefile
-traceroute/Makefile
-confpaths.h:confpaths.h.in
-headers/Makefile
 doc/Makefile
-tests/Makefile
 man/Makefile
+tests/Makefile
+confpaths.h:confpaths.h.in
 ])
 AC_OUTPUT
diff --git a/headers/Makefile.am b/headers/Makefile.am
deleted file mode 100644
index 4ee15aa..0000000
--- a/headers/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-noinst_HEADERS = tftpsubs.h shishi_def.h
diff --git a/hostname/.gitignore b/hostname/.gitignore
deleted file mode 100644
index ecd88ae..0000000
--- a/hostname/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-hostname
diff --git a/hostname/Makefile.am b/hostname/Makefile.am
deleted file mode 100644
index b34c251..0000000
--- a/hostname/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @hostname_BUILD@
-
-EXTRA_PROGRAMS = hostname
-
-hostname_SOURCES = hostname.c
-
-INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/libinetutils
-
-LDADD = -L$(top_builddir)/lib ../lib/libgnu.a
diff --git a/inetd/.gitignore b/inetd/.gitignore
deleted file mode 100644
index 4c730e4..0000000
--- a/inetd/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-inetd
-
diff --git a/inetd/Makefile.am b/inetd/Makefile.am
deleted file mode 100644
index d5f6a54..0000000
--- a/inetd/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @inetd_BUILD@
-
-EXTRA_PROGRAMS = inetd
-
-inetd_SOURCES = inetd.c
-
address@hidden@
-
-INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libinetutils
-AM_CPPFLAGS = $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) \
-           $(PATHDEF_INETDPID)
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a
diff --git a/libinetutils/Makefile.am b/libinetutils/Makefile.am
index a45b859..07e0566 100644
--- a/libinetutils/Makefile.am
+++ b/libinetutils/Makefile.am
@@ -19,7 +19,7 @@
 
 noinst_LIBRARIES = libinetutils.a
 
-noinst_HEADERS = argcv.h libinetutils.h
+noinst_HEADERS = argcv.h libinetutils.h tftpsubs.h shishi_def.h
 
 EXTRA_DIST = logwtmp.c
 
@@ -46,4 +46,4 @@ libinetutils_a_LIBADD = daemon.o $(top_builddir)/lib/libgnu.a
 
 AM_CPPFLAGS = $(PATHDEF_WTMPX) $(PATHDEF_TTY_PFX) $(PATHDEF_DEVNULL) 
$(PATHDEF_HEQUIV) 
 
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/lib -I../lib
+INCLUDES = -I$(top_srcdir)/libinetutils -I$(top_srcdir)/lib -I../lib
diff --git a/headers/shishi_def.h b/libinetutils/shishi_def.h
similarity index 100%
rename from headers/shishi_def.h
rename to libinetutils/shishi_def.h
diff --git a/headers/tftpsubs.h b/libinetutils/tftpsubs.h
similarity index 100%
rename from headers/tftpsubs.h
rename to libinetutils/tftpsubs.h
diff --git a/logger/.gitignore b/logger/.gitignore
deleted file mode 100644
index ff0edb1..0000000
--- a/logger/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-logger
-
diff --git a/logger/Makefile.am b/logger/Makefile.am
deleted file mode 100644
index 8466354..0000000
--- a/logger/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-# 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @logger_BUILD@
-
-INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libinetutils
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a
-
-EXTRA_PROGRAMS = logger
-
-logger_SOURCES = logger.c
diff --git a/man/Makefile.am b/man/Makefile.am
index 0be8462..2b0e189 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -131,33 +131,33 @@ ftp.1: ftp.h2m $(top_srcdir)/ftp/main.c 
$(top_srcdir)/configure.ac
 
 ftpd.8: ftpd.h2m $(top_srcdir)/ftpd/ftpd.c $(top_srcdir)/configure.ac
 
-hostname.1: hostname.h2m $(top_srcdir)/hostname/hostname.c 
$(top_srcdir)/configure.ac
+hostname.1: hostname.h2m $(top_srcdir)/src/hostname.c 
$(top_srcdir)/configure.ac
 
 ifconfig.1: ifconfig.h2m $(top_srcdir)/ifconfig/options.c 
$(top_srcdir)/configure.ac
 
-inetd.8: inetd.h2m $(top_srcdir)/inetd/inetd.c $(top_srcdir)/configure.ac
+inetd.8: inetd.h2m $(top_srcdir)/src/inetd.c $(top_srcdir)/configure.ac
 
-logger.1: logger.h2m $(top_srcdir)/logger/logger.c $(top_srcdir)/configure.ac
+logger.1: logger.h2m $(top_srcdir)/src/logger.c $(top_srcdir)/configure.ac
 
 ping.1: ping.h2m $(top_srcdir)/ping/ping.c $(top_srcdir)/configure.ac
 
 ping6.1: ping6.h2m $(top_srcdir)/ping/ping6.c $(top_srcdir)/configure.ac
 
-rcp.1: rcp.h2m $(top_srcdir)/rcp/rcp.c $(top_srcdir)/configure.ac
+rcp.1: rcp.h2m $(top_srcdir)/src/rcp.c $(top_srcdir)/configure.ac
 
-rexec.1: rexec.h2m $(top_srcdir)/rexec/rexec.c $(top_srcdir)/configure.ac
+rexec.1: rexec.h2m $(top_srcdir)/src/rexec.c $(top_srcdir)/configure.ac
 
-rexecd.8: rexecd.h2m $(top_srcdir)/rexecd/rexecd.c $(top_srcdir)/configure.ac
+rexecd.8: rexecd.h2m $(top_srcdir)/src/rexecd.c $(top_srcdir)/configure.ac
 
-rlogin.1: rlogin.h2m $(top_srcdir)/rlogin/rlogin.c $(top_srcdir)/configure.ac
+rlogin.1: rlogin.h2m $(top_srcdir)/src/rlogin.c $(top_srcdir)/configure.ac
 
-rlogind.8: rlogind.h2m $(top_srcdir)/rlogind/rlogind.c 
$(top_srcdir)/configure.ac
+rlogind.8: rlogind.h2m $(top_srcdir)/src/rlogind.c $(top_srcdir)/configure.ac
 
-rsh.1: rsh.h2m $(top_srcdir)/rsh/rsh.c $(top_srcdir)/configure.ac
+rsh.1: rsh.h2m $(top_srcdir)/src/rsh.c $(top_srcdir)/configure.ac
 
-rshd.8: rshd.h2m $(top_srcdir)/rshd/rshd.c $(top_srcdir)/configure.ac
+rshd.8: rshd.h2m $(top_srcdir)/src/rshd.c $(top_srcdir)/configure.ac
 
-syslogd.8: syslogd.h2m $(top_srcdir)/syslogd/syslogd.c 
$(top_srcdir)/configure.ac
+syslogd.8: syslogd.h2m $(top_srcdir)/src/syslogd.c $(top_srcdir)/configure.ac
 
 talk.1: talk.h2m $(top_srcdir)/talk/talk.c $(top_srcdir)/configure.ac
 
@@ -167,13 +167,13 @@ telnet.1: telnet.h2m $(top_srcdir)/telnet/main.c 
$(top_srcdir)/configure.ac
 
 telnetd.8: telnetd.h2m $(top_srcdir)/telnetd/telnetd.c 
$(top_srcdir)/configure.ac
 
-tftp.1: tftp.h2m $(top_srcdir)/tftp/main.c $(top_srcdir)/configure.ac
+tftp.1: tftp.h2m $(top_srcdir)/src/tftp.c $(top_srcdir)/configure.ac
 
-tftpd.8: tftpd.h2m $(top_srcdir)/tftpd/tftpd.c $(top_srcdir)/configure.ac
+tftpd.8: tftpd.h2m $(top_srcdir)/src/tftpd.c $(top_srcdir)/configure.ac
 
-traceroute.1: traceroute.h2m $(top_srcdir)/traceroute/traceroute.c 
$(top_srcdir)/configure.ac
+traceroute.1: traceroute.h2m $(top_srcdir)/src/traceroute.c 
$(top_srcdir)/configure.ac
 
-uucpd.8: uucpd.h2m $(top_srcdir)/uucpd/uucpd.c $(top_srcdir)/configure.ac
+uucpd.8: uucpd.h2m $(top_srcdir)/src/uucpd.c $(top_srcdir)/configure.ac
 
 whois.1: whois.h2m $(top_srcdir)/whois/whois.c $(top_srcdir)/configure.ac
 
@@ -183,7 +183,23 @@ whois.1: whois.h2m $(top_srcdir)/whois/whois.c 
$(top_srcdir)/configure.ac
 .h2m.8:
        make man TOOL=$* SECTION=8
 
-mapped_name = `echo ../$(TOOL)/$(TOOL) | sed s,../ping6/ping6,../ping/ping6,`
+mapped_name = `echo ../$(TOOL)/$(TOOL) \
+| sed s,../ping6/ping6,../ping/ping6,\
+| sed s,../hostname/hostname,../src/hostname,\
+| sed s,../inetd/inetd,../src/inetd,\
+| sed s,../logger/logger,../src/logger,\
+| sed s,../rcp/rcp,../src/rcp,\
+| sed s,../rexec/rexec,../src/rexec,\
+| sed s,../rexecd/rexecd,../src/rexecd,\
+| sed s,../rlogin/rlogin,../src/rlogin,\
+| sed s,../rlogind/rlogind,../src/rlogind,\
+| sed s,../rsh/rsh,../src/rsh,\
+| sed s,../rshd/rshd,../src/rshd,\
+| sed s,../syslogd/syslogd,../src/syslogd,\
+| sed s,../tftp/tftp,../src/tftp,\
+| sed s,../tftpd/tftpd,../src/tftpd,\
+| sed s,../traceroute/traceroute,../src/traceroute,\
+| sed s,../uucpd/uucpd,../src/uucpd,`
 
 .PHONY: man
 man:
diff --git a/rcp/.gitignore b/rcp/.gitignore
deleted file mode 100644
index bcd4589..0000000
--- a/rcp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rcp
diff --git a/rcp/Makefile.am b/rcp/Makefile.am
deleted file mode 100644
index 9bb37cd..0000000
--- a/rcp/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @rcp_BUILD@
-
-EXTRA_PROGRAMS = rcp
-
-rcp_SOURCES = rcp.c
-
address@hidden@
-
-AM_CPPFLAGS = $(PATHDEF_RSH) $(PATHDEF_CP) $(PATHDEF_BSHELL)
-INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libinetutils
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a \
-         $(LIBUTIL) @LIBCRYPT@ @LIBAUTH@
-
-SUIDMODE = -o root -m 4775
-
-install-rcp-hook:
-       address@hidden(INSTALL_PROGRAM) $(bin_PROGRAMS) $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed 
'$(transform)'` ; \
-       if test $$? -ne 0; then \
-               echo 'INSTALL-ERROR:'; \
-               echo 'INSTALL-ERROR: THIS PROGRAM($(bin_PROGRAMS)) MUST BE 
INSTALLED SETUID ROOT'; \
-               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) $(bin_PROGRAMS) 
$(SUIDMODE) $(DESTDIR)$(bindir)/$(bin_PROGRAMS)'; \
-               echo 'INSTALL-ERROR:'; \
-       fi
-
-install-exec-hook: @rcp_INSTALL_HOOK@
-
diff --git a/rexec/.gitignore b/rexec/.gitignore
deleted file mode 100644
index 86ca246..0000000
--- a/rexec/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rexec
diff --git a/rexec/Makefile.am b/rexec/Makefile.am
deleted file mode 100644
index 3e10273..0000000
--- a/rexec/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @rexec_BUILD@
-
-EXTRA_PROGRAMS = rexec
-
-rexec_SOURCES = rexec.c
-
-noinst_HEADERS = 
-
address@hidden@
-
-INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libinetutils
-AM_CPPFLAGS = $(PATHDEF_DEFPATH) $(PATHDEF_BSHELL)
-
-LIBCRYPT = @LIBCRYPT@
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a $(LIBCRYPT)
diff --git a/rexecd/.gitignore b/rexecd/.gitignore
deleted file mode 100644
index 506012f..0000000
--- a/rexecd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rexecd
diff --git a/rexecd/Makefile.am b/rexecd/Makefile.am
deleted file mode 100644
index 6365ea4..0000000
--- a/rexecd/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @rexecd_BUILD@
-
-EXTRA_PROGRAMS = rexecd
-
-rexecd_SOURCES = rexecd.c
-
address@hidden@
-
-AM_CPPFLAGS = $(PATHDEF_DEFPATH) $(PATHDEF_BSHELL)
-INCLUDES=-I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libinetutils
-
-LIBCRYPT = @LIBCRYPT@
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a $(LIBCRYPT)
diff --git a/rlogin/.gitignore b/rlogin/.gitignore
deleted file mode 100644
index adb6904..0000000
--- a/rlogin/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rlogin
diff --git a/rlogin/Makefile.am b/rlogin/Makefile.am
deleted file mode 100644
index 1703877..0000000
--- a/rlogin/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @rlogin_BUILD@
-
-EXTRA_PROGRAMS = rlogin
-
-rlogin_SOURCES = rlogin.c
-
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/lib -I../lib 
-I$(top_srcdir)/libinetutils
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a $(LIBUTIL) @LIBCRYPT@ 
@LIBAUTH@
-
-SUIDMODE = -o root -m 4775
-
-install-rlogin-hook:
-       address@hidden(INSTALL_PROGRAM) $(bin_PROGRAMS) $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed 
'$(transform)'` ; \
-       if test $$? -ne 0; then \
-               echo 'INSTALL-ERROR:'; \
-               echo 'INSTALL-ERROR: THIS PROGRAM($(bin_PROGRAMS)) MUST BE 
INSTALLED SETUID ROOT'; \
-               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) $(bin_PROGRAMS) 
$(SUIDMODE) $(DESTDIR)$(bindir)/$(bin_PROGRAMS)'; \
-               echo 'INSTALL-ERROR:'; \
-       fi
-
-install-exec-hook: @rlogin_INSTALL_HOOK@
-
-
diff --git a/rlogind/.gitignore b/rlogind/.gitignore
deleted file mode 100644
index 0c675f9..0000000
--- a/rlogind/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rlogind
diff --git a/rlogind/Makefile.am b/rlogind/Makefile.am
deleted file mode 100644
index 498c1bc..0000000
--- a/rlogind/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @rlogind_BUILD@
-
-EXTRA_PROGRAMS = rlogind
-
-rlogind_SOURCES = rlogind.c
-
address@hidden@
-
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/libinetutils 
-I$(top_srcdir)/lib -I../lib 
-
-AM_CPPFLAGS = $(PATHDEF_DEV) $(PATHDEF_LOGIN)
-
-LIBUTIL = @LIBUTIL@
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a $(LIBUTIL) @LIBCRYPT@ 
@LIBAUTH@
diff --git a/rsh/.gitignore b/rsh/.gitignore
deleted file mode 100644
index 4e063ef..0000000
--- a/rsh/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rsh
diff --git a/rsh/Makefile.am b/rsh/Makefile.am
deleted file mode 100644
index f1ede38..0000000
--- a/rsh/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @rsh_BUILD@
-
-EXTRA_PROGRAMS = rsh
-
-rsh_SOURCES = rsh.c
-
address@hidden@
-
-AM_CPPFLAGS = $(PATHDEF_RLOGIN)
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/lib -I../lib  
-I$(top_srcdir)/libinetutils
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a \
-         $(LIBUTIL) @LIBCRYPT@ @LIBAUTH@
-
-SUIDMODE = -o root -m 4775
-
-install-rsh-hook:
-       address@hidden(INSTALL_PROGRAM) $(bin_PROGRAMS) $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed 
'$(transform)'` ; \
-       if test $$? -ne 0; then \
-               echo 'INSTALL-ERROR:'; \
-               echo 'INSTALL-ERROR: THIS PROGRAM($(bin_PROGRAMS)) MUST BE 
INSTALLED SETUID ROOT'; \
-               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) $(bin_PROGRAMS) 
$(SUIDMODE) $(DESTDIR)$(bindir)/$(bin_PROGRAMS)'; \
-               echo 'INSTALL-ERROR:'; \
-       fi
-
-install-exec-hook: @rsh_INSTALL_HOOK@
-
diff --git a/rshd/.gitignore b/rshd/.gitignore
deleted file mode 100644
index 0c8f0c6..0000000
--- a/rshd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-rshd
diff --git a/rshd/Makefile.am b/rshd/Makefile.am
deleted file mode 100644
index bec2948..0000000
--- a/rshd/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @rshd_BUILD@
-
-EXTRA_PROGRAMS = rshd
-
-rshd_SOURCES = rshd.c
-
address@hidden@
-
-AM_CPPFLAGS = $(PATHDEF_BSHELL) $(PATHDEF_NOLOGIN) $(PATHDEF_DEFPATH)
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/libinetutils 
-I$(top_srcdir)/lib -I../lib 
-
-LDADD = -L../libinetutils -linetutils  ../lib/libgnu.a \
-        $(LIBUTIL) @LIBCRYPT@ @LIBAUTH@
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..a41cd45
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,15 @@
+hostname
+inetd
+logger
+rcp
+rexec
+rexecd
+rlogin
+rlogind
+rsh
+rshd
+syslogd
+tftp
+tftpd
+traceroute
+uucpd
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..c77e63d
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,139 @@
+#
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# This file is part of GNU Inetutils.
+#
+# GNU Inetutils is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# GNU Inetutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see `http://www.gnu.org/licenses/'.
+
+inetdaemondir = @inetdaemondir@
+
+# Initialise variables.
+inetdaemon_PROGRAMS =
+bin_PROGRAMS =
+EXTRA_PROGRAMS =
+
+
+bin_PROGRAMS += @hostname_BUILD@
+hostname_SOURCES = hostname.c
+EXTRA_PROGRAMS += hostname
+
+bin_PROGRAMS += @logger_BUILD@
+logger_SOURCES = logger.c
+EXTRA_PROGRAMS += logger
+
+bin_PROGRAMS += @rcp_BUILD@
+rcp_SOURCES = rcp.c
+EXTRA_PROGRAMS += rcp
+
+bin_PROGRAMS += @rexec_BUILD@
+rexec_SOURCES = rexec.c
+EXTRA_PROGRAMS += rexec
+
+bin_PROGRAMS += @rlogin_BUILD@
+rlogin_SOURCES = rlogin.c
+EXTRA_PROGRAMS += rlogin
+
+bin_PROGRAMS += @rsh_BUILD@
+rsh_SOURCES = rsh.c
+EXTRA_PROGRAMS += rsh
+
+bin_PROGRAMS += @tftp_BUILD@
+tftp_SOURCES = tftp.c
+EXTRA_PROGRAMS += tftp
+
+bin_PROGRAMS += @traceroute_BUILD@
+traceroute_SOURCES = traceroute.c
+EXTRA_PROGRAMS += traceroute
+
+inetdaemon_PROGRAMS += @inetd_BUILD@
+inetd_SOURCES = inetd.c
+EXTRA_PROGRAMS += inetd
+
+inetdaemon_PROGRAMS += @rexecd_BUILD@
+rexecd_SOURCES = rexecd.c
+EXTRA_PROGRAMS += rexecd
+
+inetdaemon_PROGRAMS += @rlogind_BUILD@
+rlogind_SOURCES = rlogind.c
+EXTRA_PROGRAMS += rlogind
+
+inetdaemon_PROGRAMS += @rshd_BUILD@
+rshd_SOURCES = rshd.c
+EXTRA_PROGRAMS += rshd
+
+inetdaemon_PROGRAMS += @syslogd_BUILD@
+syslogd_SOURCES = syslogd.c
+EXTRA_PROGRAMS += syslogd
+
+inetdaemon_PROGRAMS += @tftpd_BUILD@
+tftpd_SOURCES = tftpd.c
+EXTRA_PROGRAMS += tftpd
+
+inetdaemon_PROGRAMS += @uucpd_BUILD@
+uucpd_SOURCES = uucpd.c
+EXTRA_PROGRAMS += uucpd
+
+INCLUDES = -I$(top_srcdir)/lib \
+       -I$(top_srcdir)/libinetutils \
+       -I$(top_srcdir)/libicmp
+
+LDADD = -L$(top_builddir)/libicmp -licmp \
+       -L$(top_builddir)/libinetutils -linetutils \
+       -L$(top_builddir)/lib ../lib/libgnu.a \
+       @LIBAUTH@ @LIBCRYPT@ @LIBUTIL@
+
+AM_CPPFLAGS = $(PATHDEF_BSHELL) $(PATHDEF_CONSOLE) $(PATHDEF_CP) 
$(PATHDEF_DEFPATH) $(PATHDEF_DEV) $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) 
$(PATHDEF_INETDPID) $(PATHDEF_KLOG) $(PATHDEF_LOG) $(PATHDEF_LOGCONF) 
$(PATHDEF_LOGIN) $(PATHDEF_LOGPID) $(PATHDEF_NOLOGIN) $(PATHDEF_RLOGIN) 
$(PATHDEF_RSH) $(PATHDEF_TTY) $(PATHDEF_UTMP) $(PATHDEF_UUCICO)
+
+SUIDMODE = -o root -m 4775
+
+install-exec-hook: @traceroute_INSTALL_HOOK@ @rsh_INSTALL_HOOK@ 
@rlogin_INSTALL_HOOK@ @rcp_INSTALL_HOOK@
+
+install-traceroute-hook:
+       address@hidden(INSTALL_PROGRAM) traceroute $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo traceroute|sed 
'$(transform)'` ; \
+       if test $$? -ne 0; then \
+               echo 'INSTALL-ERROR:'; \
+               echo 'INSTALL-ERROR: THIS PROGRAM(traceroute) MUST BE INSTALLED 
SETUID ROOT'; \
+               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) 'traceroute' 
$(SUIDMODE) $(DESTDIR)$(bindir)/'traceroute; \
+               echo 'INSTALL-ERROR:'; \
+       fi
+
+install-rsh-hook:
+       address@hidden(INSTALL_PROGRAM) rsh $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo rsh|sed '$(transform)'` ; 
\
+       if test $$? -ne 0; then \
+               echo 'INSTALL-ERROR:'; \
+               echo 'INSTALL-ERROR: THIS PROGRAM(rsh) MUST BE INSTdALLED 
SETUID ROOT'; \
+               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) rsh $(SUIDMODE) 
$(DESTDIR)$(bindir)/rsh'; \
+               echo 'INSTALL-ERROR:'; \
+       fi
+
+install-rlogin-hook:
+       address@hidden(INSTALL_PROGRAM) rlogin $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo rlogin|sed 
'$(transform)'` ; \
+       if test $$? -ne 0; then \
+               echo 'INSTALL-ERROR:'; \
+               echo 'INSTALL-ERROR: THIS PROGRAM(rlogin) MUST BE INSTALLED 
SETUID ROOT'; \
+               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) rlogin $(SUIDMODE) 
$(DESTDIR)$(bindir)/rlogin'; \
+               echo 'INSTALL-ERROR:'; \
+       fi
+
+install-rcp-hook:
+       address@hidden(INSTALL_PROGRAM) rcp $(SUIDMODE) 
$(AM_INSTALL_PROGRAM_FLAGS) $(DESTDIR)$(bindir)/`echo rcp|sed '$(transform)'` ; 
\
+       if test $$? -ne 0; then \
+               echo 'INSTALL-ERROR:'; \
+               echo 'INSTALL-ERROR: THIS PROGRAM(rcp) MUST BE INSTALLED SETUID 
ROOT'; \
+               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) rcp $(SUIDMODE) 
$(DESTDIR)$(bindir)/rcp'; \
+               echo 'INSTALL-ERROR:'; \
+       fi
+
address@hidden@
diff --git a/hostname/hostname.c b/src/hostname.c
similarity index 100%
rename from hostname/hostname.c
rename to src/hostname.c
diff --git a/inetd/inetd.c b/src/inetd.c
similarity index 99%
rename from inetd/inetd.c
rename to src/inetd.c
index ad735c1..72e232f 100644
--- a/inetd/inetd.c
+++ b/src/inetd.c
@@ -49,12 +49,12 @@
 
 /*
  * Inetd - Internet super-server
- *  
+ *
  * This program invokes all internet services as needed.  Connection-oriented
  * services are invoked each time a connection is made, by creating a process.
  * This process is passed the connection as file descriptor 0 and is expected
  * to do a getpeername to find out the source host and port.
- *  
+ *
  * Datagram oriented services are invoked when a datagram
  * arrives; a process is created and passed a pending message
  * on file descriptor 0.  Datagram servers may either connect
@@ -63,13 +63,13 @@
  * processing all arriving datagrams and, eventually, timing
  * out.         The first type of server is said to be ``multi-threaded'';
  * the second type of server ``single-threaded''.
- *  
+ *
  * Inetd uses a configuration file which is read at startup
  * and, possibly, at some later time in response to a hangup signal.
  * The configuration file is ``free format'' with fields given in the
  * order shown below.  Continuation lines for an entry must being with
  * a space or tab.  All fields must be present in each entry.
- *  
+ *
  *     service name                    must be in /etc/services or must
  *                                     name a tcpmux service
  *     socket type                     stream/dgram/raw/rdm/seqpacket
@@ -79,7 +79,7 @@
  *     user                            user to run daemon as
  *     server program                  full path name
  *     server program arguments        arguments starting with argv[0]
- *  
+ *
  * TCP services without official port numbers are handled with the
  * RFC1078-based tcpmux internal service. Tcpmux listens on port 1 for
  * requests. When a connection is made from a foreign host, the service
@@ -94,7 +94,7 @@
  * special server code in them. Services that use tcpmux are "nowait"
  * because they do not have a well-known port and hence cannot listen
  * for new requests.
- *  
+ *
  * Comment lines are indicated by a `#' in column 1.
  */
 
@@ -333,7 +333,7 @@ struct biltin *
 bi_lookup (const struct servtab *sep)
 {
   struct biltin *bi;
-  
+
   for (bi = biltins; bi->bi_service; bi++)
     if (bi->bi_socktype == sep->se_socktype
        && strcmp (bi->bi_service, sep->se_service) == 0)
@@ -556,7 +556,7 @@ setup (struct servtab *sep)
 {
   int err;
   int on = 1;
-  
+
  tryagain:
   sep->se_fd = socket (sep->se_family, sep->se_socktype, 0);
   if (sep->se_fd < 0)
@@ -570,7 +570,7 @@ setup (struct servtab *sep)
          sep->se_family = AF_INET;
          goto tryagain;
        }
-         
+
       if (debug)
        fprintf (stderr, "socket failed on %s/%s: %s\n",
                 sep->se_service, sep->se_proto, strerror (errno));
@@ -590,19 +590,19 @@ setup (struct servtab *sep)
                      (char *) &val, sizeof (val)) < 0)
        syslog (LOG_ERR, "setsockopt (IPV6_V6ONLY): %m");
     }
-#endif      
+#endif
   if (strncmp (sep->se_proto, "tcp", 3) == 0 && (options & SO_DEBUG))
     {
       if (setsockopt (sep->se_fd, SOL_SOCKET, SO_DEBUG,
                      (char *) &on, sizeof (on)) < 0)
        syslog (LOG_ERR, "setsockopt (SO_DEBUG): %m");
     }
-  
+
   err = setsockopt (sep->se_fd, SOL_SOCKET, SO_REUSEADDR,
                    (char *) &on, sizeof (on));
   if (err < 0)
     syslog (LOG_ERR, "setsockopt (SO_REUSEADDR): %m");
-      
+
   err = bind (sep->se_fd, (struct sockaddr *) &sep->se_ctrladdr,
              sizeof (sep->se_ctrladdr));
   if (err < 0)
@@ -637,7 +637,7 @@ setup (struct servtab *sep)
 {
   int err;
   const int on = 1;
-  
+
   sep->se_fd = socket (sep->se_family, sep->se_socktype, 0);
   if (sep->se_fd < 0)
     {
@@ -679,7 +679,7 @@ setup (struct servtab *sep)
       return 1;
     }
   return 0;
-}  
+}
 #endif
 
 void
@@ -738,7 +738,7 @@ enter (struct servtab *cp)
   struct servtab *sep;
   SIGSTATUS sigstatus;
   int i;
-    
+
   /* Checking/Removing duplicates */
   for (sep = servtab; sep; sep = sep->se_next)
     if (memcmp (&sep->se_ctrladdr, &cp->se_ctrladdr,
@@ -774,7 +774,7 @@ enter (struct servtab *cp)
        print_service ("REDO", sep);
       return sep;
     }
-      
+
   if (debug)
     print_service ("ADD ", cp);
 
@@ -793,7 +793,7 @@ enter (struct servtab *cp)
   dupmem ((void**)&sep->se_argv, sep->se_argc * sizeof (sep->se_argv[0]));
   for (i = 0; i < sep->se_argc; i++)
     dupstr (&sep->se_argv[i]);
-  
+
   sep->se_fd = -1;
   signal_block (&sigstatus);
   sep->se_next = servtab;
@@ -829,7 +829,7 @@ expand_enter (struct servtab *sep)
   struct addrinfo *result, *rp;
   struct protoent *proto;
   struct servtab *cp;
-  
+
   /* Make sure that tcp6 etc also work.  */
   if (strncmp (sep->se_proto, "tcp", 3) == 0)
     proto = getprotobyname ("tcp");
@@ -837,7 +837,7 @@ expand_enter (struct servtab *sep)
     proto = getprotobyname ("udp");
   else
     proto = getprotobyname (sep->se_proto);
-  
+
   if (!proto)
     {
       syslog (LOG_ERR, "%s: Unknown protocol", sep->se_proto);
@@ -862,19 +862,19 @@ expand_enter (struct servtab *sep)
        errmsg = strerror (errno);
       else
        errmsg = gai_strerror (err);
-      
+
       syslog (LOG_ERR, "%s/%s: getaddrinfo: %s",
              sep->se_service, sep->se_proto, errmsg);
       return 1;
     }
-  
+
   for (rp = result; rp != NULL; rp = rp->ai_next)
     {
       memcpy (&sep->se_ctrladdr, rp->ai_addr, rp->ai_addrlen);
       cp = enter (sep);
       servent_setup (cp);
     }
-    
+
   freeaddrinfo (result);
 
   return 0;
@@ -884,7 +884,7 @@ int
 expand_enter (struct servtab *sep)
 {
   struct servent *sp;
-  
+
   sp = getservbyname (sep->se_service, sep->se_proto);
   if (sp == 0)
     {
@@ -892,7 +892,7 @@ expand_enter (struct servtab *sep)
       char *p;
       unsigned long val;
       unsigned short port;
-      
+
       val = strtoul (sep->se_service, &p, 0);
       if (*p || (port = val) != val)
        {
@@ -935,7 +935,7 @@ expand_enter (struct servtab *sep)
          memcpy (&sep->se_ctrladdr.sin_addr.s_addr, *p, host->h_length);
          cp = enter (sep);
          servent_setup (cp);
-       }  
+       }
     }
   return 0;
 }
@@ -1026,7 +1026,7 @@ getconfigent (FILE *fconfig, const char *file, size_t 
*line)
     return next_node_sep (sep);
 
   memset ((caddr_t) sep, 0, sizeof *sep);
-  
+
   while (1)
     {
       argcv_free (argc, argv);
@@ -1080,7 +1080,7 @@ getconfigent (FILE *fconfig, const char *file, size_t 
*line)
            }
          else
              node = NULL;
-         
+
          service = argv[INETD_SERVICE];
         }
       else
@@ -1164,7 +1164,7 @@ getconfigent (FILE *fconfig, const char *file, size_t 
*line)
 #endif
       {
        char *p, *q;
-       
+
        p = strchr(argv[INETD_WAIT], '.');
        if (p)
          *p++ = 0;
@@ -1185,7 +1185,7 @@ getconfigent (FILE *fconfig, const char *file, size_t 
*line)
                      file, (unsigned long) *line, p);
          }
       }
-      
+
       if (ISMUX (sep))
        {
          /*
@@ -1313,7 +1313,7 @@ fix_tcpmux ()
   struct servtab *sep;
   int need_tcpmux = 0;
   int has_tcpmux = 0;
-  
+
   for (sep = servtab; sep; sep = sep->se_next)
     {
       if (sep->se_checked)
@@ -1338,10 +1338,10 @@ fix_tcpmux ()
       memset (&serv, 0, sizeof (serv));
 
       serv.se_service = newstr ("tcpmux");
-      serv.se_socktype = SOCK_STREAM;    
-      serv.se_proto = newstr ("tcp");    
+      serv.se_socktype = SOCK_STREAM;
+      serv.se_proto = newstr ("tcp");
       serv.se_checked = 1;
-      serv.se_user = newstr ("root");  
+      serv.se_user = newstr ("root");
       serv.se_bi = bi_lookup (&serv);
       if (!serv.se_bi)
        {
@@ -1353,9 +1353,9 @@ fix_tcpmux ()
          return;
        }
       serv.se_wait = serv.se_bi->bi_wait;
-      serv.se_server = newstr ("internal");            
-      serv.se_fd = -1;                 
-      serv.se_type = NORM_TYPE;                
+      serv.se_server = newstr ("internal");
+      serv.se_fd = -1;
+      serv.se_type = NORM_TYPE;
 #ifdef IPV6
       serv.se_family = AF_INET6;
       serv.se_v4mapped = 1;
@@ -1430,7 +1430,7 @@ config (int signo)
   free (linebuf);
   linebuf = NULL;
   linebufsize = 0;
-  
+
   fix_tcpmux ();
 }
 
@@ -1872,7 +1872,7 @@ prepenv (int ctrl, struct sockaddr_in sa_client)
 }
 
 
-  
+
 int
 main (int argc, char *argv[], char *envp[])
 {
@@ -1882,7 +1882,7 @@ main (int argc, char *argv[], char *envp[])
   pid_t pid;
 
   set_program_name (argv[0]);
-  
+
   Argv = argv;
   if (envp == 0 || *envp == 0)
     envp = argv;
diff --git a/logger/logger.c b/src/logger.c
similarity index 99%
rename from logger/logger.c
rename to src/logger.c
index d0cb2d7..886f890 100644
--- a/logger/logger.c
+++ b/src/logger.c
@@ -63,7 +63,7 @@ int
 decode (char *name, CODE *codetab, const char *what)
 {
   CODE *cp;
-  
+
   if (isdigit (*name))
     {
       char *p;
@@ -74,7 +74,7 @@ decode (char *name, CODE *codetab, const char *what)
        error (EXIT_FAILURE, 0, "%s: invalid %s number", what, name);
       return c;
     }
-    
+
   for (cp = codetab; cp->c_name; cp++)
     {
       if (strcasecmp (name, cp->c_name) == 0)
@@ -89,7 +89,7 @@ parse_level (char *str)
 {
   char *p;
   int fac, pri = 0;
-  
+
   p = strchr (str, '.');
   if (p)
     *p++ = 0;
@@ -116,7 +116,7 @@ open_socket ()
   union logger_sockaddr sockaddr;
   socklen_t socklen;
   int family;
-  
+
   if (host[0] == '/')
     {
       size_t len = strlen (host);
@@ -170,7 +170,7 @@ open_socket ()
   fd = socket (family, SOCK_DGRAM, 0);
   if (fd < 0)
     error (EXIT_FAILURE, errno, "cannot create socket");
-  
+
   if (family == PF_INET)
     {
       struct sockaddr_in s;
@@ -188,7 +188,7 @@ open_socket ()
       if (bind(fd, (struct sockaddr*) &s, sizeof(s)) < 0)
        error (EXIT_FAILURE, errno, "cannot bind to source address");
     }
-  
+
   if (connect (fd, &sockaddr.sa, socklen))
     error (EXIT_FAILURE, errno, "cannot connect");
 }
@@ -201,7 +201,7 @@ send_to_syslog (const char *msg)
   time_t now = time (NULL);
   size_t len;
   ssize_t rc;
-  
+
   if (logflags & LOG_PID)
     rc = asprintf (&pbuf, "<%d>%.15s %s[%s]: %s",
                   pri, ctime (&now) + 4, tag, pidstr, msg);
@@ -216,7 +216,7 @@ send_to_syslog (const char *msg)
     {
       struct iovec iov[2], *ioptr;
       size_t msglen = strlen (msg);
-      
+
       ioptr = iov;
       ioptr->iov_base = (char*) msg;
       ioptr->iov_len = msglen;
@@ -272,7 +272,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'S':
       source = arg;
       break;
-      
+
     case 'i':
       logflags |= LOG_PID;
       if (arg)
@@ -321,7 +321,7 @@ main (int argc, char *argv[])
 {
   int index;
   char *buf = NULL;
-  
+
   set_program_name (argv[0]);
   iu_argp_init ("logger", program_authors);
   argp_parse (&argp, argc, argv, 0, &index, NULL);
@@ -343,13 +343,13 @@ main (int argc, char *argv[])
     }
 
   open_socket ();
-  
+
   if (argc > 0)
     {
       int i;
       size_t len = 0;
       char *p;
-      
+
       for (i = 0; i < argc; i++)
        len += strlen (argv[i]) + 1;
 
@@ -368,7 +368,7 @@ main (int argc, char *argv[])
   else
     {
       size_t size = 0;
-      
+
       while (getline (&buf, &size, stdin) > 0)
        send_to_syslog (buf);
     }
diff --git a/rcp/rcp.c b/src/rcp.c
similarity index 99%
rename from rcp/rcp.c
rename to src/rcp.c
index fa1c4ee..ce7e058 100644
--- a/rcp/rcp.c
+++ b/src/rcp.c
@@ -180,7 +180,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
       use_kerberos = 0;
       break;
 #endif
-       
+
 #ifdef KERBEROS
     case 'k':
       dest_realm = arg;
@@ -259,7 +259,7 @@ main (int argc, char *argv[])
   char *targ;
   const char *shell;
   int index, rc;
-  
+
   set_program_name (argv[0]);
 
   from_option = to_option = 0;
@@ -314,7 +314,7 @@ main (int argc, char *argv[])
 
   if (argc < 2)
     error (1, 0, "not enough arguments");
-  
+
   if (argc > 2)
     targetshouldbedirectory = 1;
 
diff --git a/rexec/rexec.c b/src/rexec.c
similarity index 100%
rename from rexec/rexec.c
rename to src/rexec.c
diff --git a/rexecd/rexecd.c b/src/rexecd.c
similarity index 100%
rename from rexecd/rexecd.c
rename to src/rexecd.c
diff --git a/rlogin/rlogin.c b/src/rlogin.c
similarity index 99%
rename from rlogin/rlogin.c
rename to src/rlogin.c
index 70d0efa..8b80596 100644
--- a/rlogin/rlogin.c
+++ b/src/rlogin.c
@@ -336,7 +336,7 @@ main (int argc, char *argv[])
   char term[1024];
 
   set_program_name (argv[0]);
-  
+
   /* Traditionnaly, if a symbolic link was made to the rlogin binary
      rlogin --> hostname
      hostname will be use as the name of the server to login too.  */
diff --git a/rlogind/rlogind.c b/src/rlogind.c
similarity index 99%
rename from rlogind/rlogind.c
rename to src/rlogind.c
index 34eb76e..d247b6a 100644
--- a/rlogind/rlogind.c
+++ b/src/rlogind.c
@@ -354,11 +354,11 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'p':
       port = strtoul (arg, NULL, 10);
       break;
-      
+
     case 'r':
       reverse_required = 1;
       break;
-      
+
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -376,11 +376,11 @@ main (int argc, char *argv[])
   int index;
 
   set_program_name (argv[0]);
-  
+
   /* Parse command line */
   iu_argp_init ("rlogind", program_authors);
   argp_parse (&argp, argc, argv, 0, &index, NULL);
-  
+
   openlog ("rlogind", LOG_PID | LOG_CONS, LOG_AUTH);
   argc -= index;
   if (argc > 0)
diff --git a/rsh/rsh.c b/src/rsh.c
similarity index 99%
rename from rsh/rsh.c
rename to src/rsh.c
index 3bdc4b8..97c6621 100644
--- a/rsh/rsh.c
+++ b/src/rsh.c
@@ -176,7 +176,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'l':
       user = arg;
       break;
-      
+
 #if defined(KERBEROS) || defined(SHISHI)
     case 'K':
       use_kerberos = 0;
diff --git a/rshd/rshd.c b/src/rshd.c
similarity index 99%
rename from rshd/rshd.c
rename to src/rshd.c
index 173f0d5..747e72b 100644
--- a/rshd/rshd.c
+++ b/src/rshd.c
@@ -213,7 +213,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'L':
       log_success = 1;
       break;
-      
+
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -240,7 +240,7 @@ main (int argc, char *argv[])
   set_program_name (argv[0]);
   iu_argp_init ("rshd", default_program_authors);
   argp_parse (&argp, argc, argv, 0, &index, NULL);
-  
+
   openlog ("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
 
   argc -= index;
@@ -694,7 +694,7 @@ doit (int sockfd, struct sockaddr_in *fromp)
 
     /* verify checksum */
 
-    /* Doesn't give socket port ? 
+    /* Doesn't give socket port ?
        if (getsockname (STDIN_FILENO, (struct sockaddr *)&sock, &socklen) < 0)
        {
        syslog (LOG_ERR, "Can't get sock name");
diff --git a/syslogd/syslogd.c b/src/syslogd.c
similarity index 100%
rename from syslogd/syslogd.c
rename to src/syslogd.c
diff --git a/tftp/tftp.c b/src/tftp.c
similarity index 100%
rename from tftp/tftp.c
rename to src/tftp.c
diff --git a/tftpd/tftpd.c b/src/tftpd.c
similarity index 99%
rename from tftpd/tftpd.c
rename to src/tftpd.c
index ec8f539..07a8e34 100644
--- a/tftpd/tftpd.c
+++ b/src/tftpd.c
@@ -138,7 +138,7 @@ static struct argp_option options[] = {
     "nonexistent relative filenames" },
   { NULL }
 };
-  
+
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
 {
@@ -151,7 +151,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'n':
       suppress_naks = 1;
       break;
-      
+
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -179,7 +179,7 @@ main (int argc, char *argv[])
   set_program_name (argv[0]);
   iu_argp_init ("tftpd", default_program_authors);
   argp_parse (&argp, argc, argv, 0, &index, NULL);
-  
+
   openlog ("tftpd", LOG_PID, LOG_FTP);
 
   if (index < argc)
diff --git a/traceroute/traceroute.c b/src/traceroute.c
similarity index 98%
rename from traceroute/traceroute.c
rename to src/traceroute.c
index e12c30e..d847d1c 100644
--- a/traceroute/traceroute.c
+++ b/src/traceroute.c
@@ -186,7 +186,7 @@ main (int argc, char **argv)
   trace_t trace;
 
   set_program_name (argv[0]);
-  
+
   /* Parse command line */
   iu_argp_init ("traceroute", program_authors);
   argp_parse (&argp, argc, argv, 0, NULL, NULL);
@@ -281,7 +281,7 @@ do_try (trace_t * trace, const int hop,
                }
              else
                {
-                 if (tries == 0 || prev_addr != trace->from.sin_addr.s_addr)
+                 if (tries == 0 || prev_addr != trace->from.sin_addr.s_addr)
                    printf (" %s (%s) ",
                            inet_ntoa (trace->from.sin_addr),
                            get_hostname (&trace->from.sin_addr));
@@ -302,7 +302,7 @@ get_hostname (struct in_addr *addr)
 {
   if (opt_resolve_hostnames)
     {
-      struct hostent *info = 
+      struct hostent *info =
        gethostbyaddr ((char *) addr, sizeof (*addr), AF_INET);
       if (info != NULL)
        return info->h_name;
@@ -328,7 +328,7 @@ trace_init (trace_t * t, const struct sockaddr_in to,
       if (t->udpfd < 0)
         error (EXIT_FAILURE, errno, "socket");
 
-      if (setsockopt (t->udpfd, IPPROTO_IP, IP_TTL, ttlp, 
+      if (setsockopt (t->udpfd, IPPROTO_IP, IP_TTL, ttlp,
                      sizeof (t->ttl)) < 0)
         error (EXIT_FAILURE, errno, "setsockopt");
     }
@@ -401,18 +401,18 @@ trace_read (trace_t * t)
            || (ic->icmp_type == ICMP_DEST_UNREACH
                && ic->icmp_code != ICMP_PORT_UNREACH))
          return -1;
-       
+
        /* check whether it's for us */
         port = (unsigned short *) &ic->icmp_ip + 11;
        if (*port != t->to.sin_port)
          return -1;
-       
+
        if (ic->icmp_code == ICMP_PORT_UNREACH)
          /* FIXME: Ugly hack. */
          stop = 1;
       }
       break;
-      
+
     case TRACE_ICMP:
       if (ic->icmp_type != ICMP_TIME_EXCEEDED
          && ic->icmp_type != ICMP_ECHOREPLY)
@@ -449,7 +449,7 @@ trace_write (trace_t * t)
   int len;
 
   assert (t);
-  
+
   switch (t->type)
     {
     case TRACE_UDP:
@@ -467,19 +467,19 @@ trace_write (trace_t * t)
                 error (EXIT_FAILURE, errno, "sendto");
              }
          }
-       
+
        if (gettimeofday (&t->tsent, NULL) < 0)
           error (EXIT_FAILURE, errno, "gettimeofday");
       }
       break;
-      
+
     case TRACE_ICMP:
       {
        icmphdr_t hdr;
        /* FIXME: We could use the pid as the icmp seqno/ident. */
        if (icmp_echo_encode ((u_char *) &hdr, sizeof (hdr), pid, pid))
          return -1;
-       
+
        len = sendto (t->icmpfd, (char *) &hdr, sizeof (hdr),
                      0, (struct sockaddr *) &t->to, sizeof (t->to));
        if (len < 0)
@@ -492,14 +492,14 @@ trace_write (trace_t * t)
                 error (EXIT_FAILURE, errno, "sendto");
              }
          }
-       
+
        if (gettimeofday (&t->tsent, NULL) < 0)
           error (EXIT_FAILURE, errno, "gettimeofday");
       }
       break;
-      
+
       /* FIXME: type according to RFC 1393 */
-      
+
     default:
       break;
     }
diff --git a/uucpd/uucpd.c b/src/uucpd.c
similarity index 100%
rename from uucpd/uucpd.c
rename to src/uucpd.c
diff --git a/syslogd/.gitignore b/syslogd/.gitignore
deleted file mode 100644
index e9bfd1e..0000000
--- a/syslogd/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-syslogd
-
diff --git a/syslogd/Makefile.am b/syslogd/Makefile.am
deleted file mode 100644
index 1054a24..0000000
--- a/syslogd/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @syslogd_BUILD@
-
-EXTRA_PROGRAMS = syslogd
-
-syslogd_SOURCES = syslogd.c
-
address@hidden@
-
-AM_CPPFLAGS = $(PATHDEF_LOG) $(PATHDEF_KLOG) $(PATHDEF_LOGCONF) \
-              $(PATHDEF_LOGPID) $(PATHDEF_CONSOLE) $(PATHDEF_UTMP)
-
-INCLUDES = -I$(top_srcdir)/libinetutils -I$(top_srcdir)/lib -I../lib 
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a
diff --git a/tftp/.gitignore b/tftp/.gitignore
deleted file mode 100644
index 63cfc22..0000000
--- a/tftp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tftp
diff --git a/tftp/Makefile.am b/tftp/Makefile.am
deleted file mode 100644
index e514e80..0000000
--- a/tftp/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/libinetutils 
-I$(top_srcdir)/lib -I../lib
-
-bin_PROGRAMS = @tftp_BUILD@
-
-EXTRA_PROGRAMS = tftp
-
-tftp_SOURCES = tftp.c
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a
diff --git a/tftpd/.gitignore b/tftpd/.gitignore
deleted file mode 100644
index 8cb2e41..0000000
--- a/tftpd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tftpd
diff --git a/tftpd/Makefile.am b/tftpd/Makefile.am
deleted file mode 100644
index 436f7ca..0000000
--- a/tftpd/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @tftpd_BUILD@
-
-INCLUDES = -I$(top_srcdir)/headers -I$(top_srcdir)/lib -I../lib 
-I$(top_srcdir)/libinetutils
-
-EXTRA_PROGRAMS = tftpd
-
-tftpd_SOURCES = tftpd.c
-
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a
diff --git a/traceroute/.gitignore b/traceroute/.gitignore
deleted file mode 100644
index 92de28b..0000000
--- a/traceroute/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-traceroute
diff --git a/traceroute/Makefile.am b/traceroute/Makefile.am
deleted file mode 100644
index 41d6e61..0000000
--- a/traceroute/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-bin_PROGRAMS = @traceroute_BUILD@
-
-EXTRA_PROGRAMS = traceroute
-
-traceroute_SOURCES = traceroute.c
-
-INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libicmp 
-I$(top_srcdir)/libinetutils
-
-LDADD = -L../libicmp -licmp ../lib/libgnu.a
-
-SUIDMODE = -o root -m 4775
-
-install-traceroute-hook:
-       address@hidden program in $(bin_PROGRAMS); do \
-       $(INSTALL_PROGRAM) $$program $(SUIDMODE) $(AM_INSTALL_PROGRAM_FLAGS) 
$(DESTDIR)$(bindir)/`echo $$program|sed '$(transform)'` ; \
-       if test $$? -ne 0; then \
-               echo 'INSTALL-ERROR:'; \
-               echo 'INSTALL-ERROR: THIS PROGRAM('$$program') MUST BE 
INSTALLED SETUID ROOT'; \
-               echo 'INSTALL-ERROR: $(INSTALL_PROGRAM) '$$program' $(SUIDMODE) 
$(DESTDIR)$(bindir)/'$$program; \
-               echo 'INSTALL-ERROR:'; \
-       fi \
-       done
-
-install-exec-hook: @traceroute_INSTALL_HOOK@
diff --git a/uucpd/.gitignore b/uucpd/.gitignore
deleted file mode 100644
index aade85e..0000000
--- a/uucpd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-uucpd
diff --git a/uucpd/Makefile.am b/uucpd/Makefile.am
deleted file mode 100644
index 5e3426c..0000000
--- a/uucpd/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Inetutils.
-#
-# GNU Inetutils is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or (at
-# your option) any later version.
-#
-# GNU Inetutils is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see `http://www.gnu.org/licenses/'.
-
-inetdaemondir = @inetdaemondir@
-
-inetdaemon_PROGRAMS = @uucpd_BUILD@
-
-EXTRA_PROGRAMS = uucpd
-
-uucpd_SOURCES = uucpd.c
-
-LIBUTIL = @LIBUTIL@
-LIBCRYPT = @LIBCRYPT@
-
address@hidden@
-
-AM_CPPFLAGS = $(PATHDEF_UUCICO) $(PATHDEF_TTY)
-INCLUDES = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/libinetutils
-LDADD = -L../libinetutils -linetutils ../lib/libgnu.a $(LIBUTIL) $(LIBCRYPT)

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


commit ce4a6a972b0884dc0f40777c5ac22e3b99de14a1
Author: Alfred M. Szmidt <address@hidden>
Date:   Tue Jan 12 23:16:39 2010 +0100

    Merged tftp/extern.h and tftp/main.c into tftp/tftp.c.

diff --git a/ChangeLog b/ChangeLog
index 6291244..c0ac290 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2010-01-12  Alfred M. Szmidt  <address@hidden>
+
+       Merged tftp/extern.h and tftp/main.c into tftp/tftp.c.
+
+       * tftp/Makefile.am (tftp_SOURCES): Removed main.c from list.
+       (noinst_HEADERS): Variable removed.
+       * tftp/extern.h, tftp/main.c: Files removed.
+       * tftp/tftp.c: Include <sys/file.h>, <arpa/inet.h>, <fcntl.h>,
+       <netdb.h>, <stdlib.h>, <argp.h>, <libinetutils.h>, "xalloc.h", and
+       "progname.h".  Don't include "extern.h".
+       (TIMEOUT, HELPINDENT, RESOLVE_OK, RESOLVE_FAIL)
+       (RESOLVE_NOT_RESOLVED): New macros.
+       (cmd): New structure.
+       (intr, get, help, modecmd, put, quit, setascii, setbinary)
+       (setpeer, setrexmt, settimeout, settrace, setverbose, status)
+       (command, getusage, makeargv, putusage, settftpmode, getcmd, tail)
+       (recvfile, send_file): New forward declarations.
+       (peeraddr, f, port, trace, verbose, connected, mode, line, margc)
+       (margv, prompt, toplevel, sp, vhelp, thelp, chelp, qhelp, hhelp)
+       (shelp, rhelp, mhelp, sthelp, xhelp, ihelp, ashelp, bnhelp)
+       (cmdtab, args_doc, doc, argp_options, host_port_argv)
+       (hostport_argc, toplevel, argp, hostname, modes, rexmtval)
+       (maxtimeout): New variables.
+       (parse_opt, main, resolve_name, get_args, setpeer, modecmd)
+       (setbinary, setascii, setftpmode, put, putusage, get, getusage)
+       (setrexmt, settimeout, status, intr, tail, command, getcmd)
+       (makeargv, quit, help, settrace, setverbose): New functions.
+
 2010-01-08  Simon Josefsson  <address@hidden>
 
        * README-alpha: Explain more.
diff --git a/tftp/Makefile.am b/tftp/Makefile.am
index 472da61..e514e80 100644
--- a/tftp/Makefile.am
+++ b/tftp/Makefile.am
@@ -23,8 +23,6 @@ bin_PROGRAMS = @tftp_BUILD@
 
 EXTRA_PROGRAMS = tftp
 
-tftp_SOURCES = main.c tftp.c
-
-noinst_HEADERS = extern.h
+tftp_SOURCES = tftp.c
 
 LDADD = -L../libinetutils -linetutils ../lib/libgnu.a
diff --git a/tftp/extern.h b/tftp/extern.h
deleted file mode 100644
index 3ad4a16..0000000
--- a/tftp/extern.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-  2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-  Inc.
-
-  This file is part of GNU Inetutils.
-
-  GNU Inetutils is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or (at
-  your option) any later version.
-
-  GNU Inetutils is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-
-/*
- * Copyright (c) 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-void recvfile (int, char *, char *);
-void send_file (int, char *, char *);
-extern jmp_buf toplevel;
diff --git a/tftp/main.c b/tftp/main.c
deleted file mode 100644
index 6b76457..0000000
--- a/tftp/main.c
+++ /dev/null
@@ -1,809 +0,0 @@
-/*
-  Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-  2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-  Inc.
-
-  This file is part of GNU Inetutils.
-
-  GNU Inetutils is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or (at
-  your option) any later version.
-
-  GNU Inetutils is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-
-/*
- * Copyright (c) 1983, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* Many bug fixes are from Jim Guyton <address@hidden> */
-
-/*
- * TFTP User Program -- Command Interface.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-
-#include <netinet/in.h>
-
-#include <arpa/inet.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <argp.h>
-#include <libinetutils.h>
-
-#include "xalloc.h"
-#include "extern.h"
-#include "progname.h"
-
-#define TIMEOUT                5       /* secs between rexmt's */
-
-struct sockaddr_in peeraddr;
-int f;
-short port;
-int trace;
-int verbose;
-int connected;
-char mode[32];
-char line[200];
-int margc;
-char *margv[20];
-char *prompt = "tftp";
-jmp_buf toplevel;
-void intr ();
-struct servent *sp;
-
-void get (int, char **);
-void help (int, char **);
-void modecmd (int, char **);
-void put (int, char **);
-void quit (int, char **);
-void setascii (int, char **);
-void setbinary (int, char **);
-void setpeer (int, char **);
-void setrexmt (int, char **);
-void settimeout (int, char **);
-void settrace (int, char **);
-void setverbose (int, char **);
-void status (int, char **);
-
-static void command (void);
-
-static void getusage (char *);
-static void makeargv (void);
-static void putusage (char *);
-static void settftpmode (char *);
-
-#define HELPINDENT (sizeof("connect"))
-
-struct cmd
-{
-  char *name;
-  char *help;
-  void (*handler) (int, char **);
-};
-
-char vhelp[] = "toggle verbose mode";
-char thelp[] = "toggle packet tracing";
-char chelp[] = "connect to remote tftp";
-char qhelp[] = "exit tftp";
-char hhelp[] = "print help information";
-char shelp[] = "send file";
-char rhelp[] = "receive file";
-char mhelp[] = "set file transfer mode";
-char sthelp[] = "show current status";
-char xhelp[] = "set per-packet retransmission timeout";
-char ihelp[] = "set total retransmission timeout";
-char ashelp[] = "set mode to netascii";
-char bnhelp[] = "set mode to octet";
-
-struct cmd cmdtab[] = {
-  {"connect", chelp, setpeer},
-  {"mode", mhelp, modecmd},
-  {"put", shelp, put},
-  {"get", rhelp, get},
-  {"quit", qhelp, quit},
-  {"verbose", vhelp, setverbose},
-  {"trace", thelp, settrace},
-  {"status", sthelp, status},
-  {"binary", bnhelp, setbinary},
-  {"ascii", ashelp, setascii},
-  {"rexmt", xhelp, setrexmt},
-  {"timeout", ihelp, settimeout},
-  {"?", hhelp, help},
-  {0}
-};
-
-struct cmd *getcmd ();
-char *tail ();
-
-
-const char args_doc[] = "[HOST [PORT]]";
-const char doc[] = "Trivial file transfer protocol client";
-
-static struct argp_option argp_options[] = {
-  {"verbose", 'v', NULL, 0, "verbose output"},
-  {NULL}
-};
-
-char *hostport_argv[3] = { "connect" };
-int hostport_argc = 1;
-
-static error_t
-parse_opt (int key, char *arg, struct argp_state *state)
-{
-  switch (key)
-    {
-    case 'v':          /* Verbose.  */
-      verbose++;
-      break;
-
-    case ARGP_KEY_ARG:
-      if (state->arg_num >= 2 || hostport_argc >= 3)
-       /* Too many arguments. */
-       argp_usage (state);
-      hostport_argv[hostport_argc++] = arg;
-      break;
-
-    default:
-      return ARGP_ERR_UNKNOWN;
-    }
-
-  return 0;
-}
-
-static struct argp argp = {argp_options, parse_opt, args_doc, doc};
-
-int
-main (int argc, char *argv[])
-{
-  struct sockaddr_in sin;
-
-  set_program_name (argv[0]);
-  iu_argp_init ("tftp", default_program_authors);
-  argp_parse (&argp, argc, argv, 0, NULL, NULL);
-
-  sp = getservbyname ("tftp", "udp");
-  if (sp == 0)
-    {
-      fprintf (stderr, "tftp: udp/tftp: unknown service\n");
-      exit (1);
-    }
-  f = socket (AF_INET, SOCK_DGRAM, 0);
-  if (f < 0)
-    {
-      perror ("tftp: socket");
-      exit (3);
-    }
-  memset (&sin, 0, sizeof (sin));
-  sin.sin_family = AF_INET;
-  if (bind (f, (struct sockaddr *) &sin, sizeof (sin)) < 0)
-    {
-      perror ("tftp: bind");
-      exit (1);
-    }
-  strcpy (mode, "netascii");
-  signal (SIGINT, intr);
-  if (hostport_argc > 1)
-    {
-      if (setjmp (toplevel) != 0)
-       exit (0);
-      setpeer (hostport_argc, hostport_argv);
-    }
-  if (setjmp (toplevel) != 0)
-    putchar ('\n');
-  command ();
-}
-
-char *hostname;
-
-#define RESOLVE_OK            0
-#define RESOLVE_FAIL         -1
-#define RESOLVE_NOT_RESOLVED  1
-
-/* Resolve NAME. Fill in peeraddr, hostname and set connected on success.
-   Return value: RESOLVE_OK success
-                 RESOLVE_FAIL error
-                RESOLVE_NOT_RESOLVED name is not resolved and ALLOW_NULL
-                is true */
-static int
-resolve_name (char *name, int allow_null)
-{
-  struct hostent *hp = gethostbyname (name);
-  if (hp == NULL)
-    {
-      if (allow_null)
-       return RESOLVE_NOT_RESOLVED;
-      fprintf (stderr, "tftp: %s: ", name);
-      herror ((char *) NULL);
-      return RESOLVE_FAIL;
-    }
-  else if (hp->h_length != sizeof peeraddr.sin_addr)
-    {
-      fprintf (stderr, "tftp: resolving %s returns unexpected length", name);
-      return RESOLVE_FAIL;
-    }
-  memcpy (&peeraddr.sin_addr, hp->h_addr, hp->h_length);
-  peeraddr.sin_family = hp->h_addrtype;
-  connected = 1;
-  free (hostname);
-  hostname = xstrdup (hp->h_name);
-  return RESOLVE_OK;
-}
-
-/* Prompt for more arguments from the user with PROMPT, putting the results
-   into ARGC & ARGV, with an initial argument of ARG0.  Global variables
-   LINE, MARGC, and MARGV are changed.  */
-static void
-get_args (char *arg0, char *prompt, int *argc, char ***argv)
-{
-  size_t arg0_len = strlen (arg0);
-
-  strcpy (line, arg0);
-  strcat (line, " ");
-
-  printf ("%s", prompt);
-  fgets (line + arg0_len + 1, sizeof line - arg0_len - 1, stdin);
-
-  makeargv ();
-  *argc = margc;
-  *argv = margv;
-}
-
-void
-setpeer (int argc, char *argv[])
-{
-  if (argc < 2)
-    get_args ("Connect", "(to) ", &argc, &argv);
-
-  if (argc < 2 || argc > 3)
-    {
-      printf ("usage: %s host-name [port]\n", argv[0]);
-      return;
-    }
-
-  switch (resolve_name (argv[1], 1))
-    {
-    case RESOLVE_OK:
-      break;
-
-    case RESOLVE_FAIL:
-      return;
-
-    case RESOLVE_NOT_RESOLVED:
-      peeraddr.sin_family = AF_INET;
-      peeraddr.sin_addr.s_addr = inet_addr (argv[1]);
-      if (peeraddr.sin_addr.s_addr == -1)
-       {
-         connected = 0;
-         printf ("%s: unknown host\n", argv[1]);
-         return;
-       }
-      hostname = xstrdup (argv[1]);
-    }
-
-  port = sp->s_port;
-  if (argc == 3)
-    {
-      port = atoi (argv[2]);
-      if (port < 0)
-       {
-         printf ("%s: bad port number\n", argv[2]);
-         connected = 0;
-         return;
-       }
-      port = htons (port);
-    }
-  connected = 1;
-}
-
-struct modes
-{
-  char *m_name;
-  char *m_mode;
-} modes[] =
-  {
-    {"ascii", "netascii"},
-    {"netascii", "netascii"},
-    {"binary", "octet"},
-    {"image", "octet"},
-    {"octet", "octet"},
-    {0, 0}
-  };
-
-void
-modecmd (int argc, char *argv[])
-{
-  register struct modes *p;
-  char *sep;
-
-  if (argc < 2)
-    {
-      printf ("Using %s mode to transfer files.\n", mode);
-      return;
-    }
-  if (argc == 2)
-    {
-      for (p = modes; p->m_name; p++)
-       if (strcmp (argv[1], p->m_name) == 0)
-         break;
-      if (p->m_name)
-       {
-         settftpmode (p->m_mode);
-         return;
-       }
-      printf ("%s: unknown mode\n", argv[1]);
-      /* drop through and print usage message */
-    }
-
-  printf ("usage: %s [", argv[0]);
-  sep = " ";
-  for (p = modes; p->m_name; p++)
-    {
-      printf ("%s%s", sep, p->m_name);
-      if (*sep == ' ')
-       sep = " | ";
-    }
-  printf (" ]\n");
-  return;
-}
-
-void
-setbinary (int argc, char *argv[])
-{
-  settftpmode ("octet");
-}
-
-void
-setascii (int argc, char *argv[])
-{
-  settftpmode ("netascii");
-}
-
-static void
-settftpmode (char *newmode)
-{
-  strcpy (mode, newmode);
-  if (verbose)
-    printf ("mode set to %s\n", mode);
-}
-
-/*
- * Send file(s).
- */
-void
-put (int argc, char *argv[])
-{
-  int fd;
-  register int n;
-  register char *cp, *targ;
-
-  if (argc < 2)
-    get_args ("send", "(file) ", &argc, &argv);
-
-  if (argc < 2)
-    {
-      putusage (argv[0]);
-      return;
-    }
-  targ = argv[argc - 1];
-  if (strchr (argv[argc - 1], ':'))
-    {
-      char *cp;
-
-      for (n = 1; n < argc - 1; n++)
-       if (strchr (argv[n], ':'))
-         {
-           putusage (argv[0]);
-           return;
-         }
-      cp = argv[argc - 1];
-      targ = strchr (cp, ':');
-      *targ++ = 0;
-      if (resolve_name (cp, 0) != RESOLVE_OK)
-       return;
-    }
-  if (!connected)
-    {
-      printf ("No target machine specified.\n");
-      return;
-    }
-  if (argc < 4)
-    {
-      cp = argc == 2 ? tail (targ) : argv[1];
-      fd = open (cp, O_RDONLY);
-      if (fd < 0)
-       {
-         fprintf (stderr, "tftp: ");
-         perror (cp);
-         return;
-       }
-      if (verbose)
-       printf ("putting %s to %s:%s [%s]\n", cp, hostname, targ, mode);
-      peeraddr.sin_port = port ? port : sp->s_port;
-      send_file (fd, targ, mode);
-      return;
-    }
-  /* this assumes the target is a directory */
-  /* on a remote unix system.  hmmmm.  */
-  cp = strchr (targ, '\0');
-  *cp++ = '/';
-  for (n = 1; n < argc - 1; n++)
-    {
-      strcpy (cp, tail (argv[n]));
-      fd = open (argv[n], O_RDONLY);
-      if (fd < 0)
-       {
-         fprintf (stderr, "tftp: ");
-         perror (argv[n]);
-         continue;
-       }
-      if (verbose)
-       printf ("putting %s to %s:%s [%s]\n", argv[n], hostname, targ, mode);
-      peeraddr.sin_port = port ? port : sp->s_port;
-      send_file (fd, targ, mode);
-    }
-}
-
-static void
-putusage (char *s)
-{
-  printf ("usage: %s file ... host:target, or\n", s);
-  printf ("       %s file ... target (when already connected)\n", s);
-}
-
-/*
- * Receive file(s).
- */
-void
-get (int argc, char *argv[])
-{
-  int fd;
-  register int n;
-  register char *cp;
-  char *src;
-
-  if (argc < 2)
-    get_args ("get", "(files) ", &argc, &argv);
-
-  if (argc < 2)
-    {
-      getusage (argv[0]);
-      return;
-    }
-  if (!connected)
-    {
-      for (n = 1; n < argc; n++)
-       if (strchr (argv[n], ':') == 0)
-         {
-           getusage (argv[0]);
-           return;
-         }
-    }
-  for (n = 1; n < argc; n++)
-    {
-      src = strchr (argv[n], ':');
-      if (src == NULL)
-       src = argv[n];
-      else
-       {
-         *src++ = 0;
-         if (resolve_name (argv[n], 0) != RESOLVE_OK)
-           continue;
-       }
-
-      if (argc < 4)
-       {
-         cp = argc == 3 ? argv[2] : tail (src);
-         fd = creat (cp, 0644);
-         if (fd < 0)
-           {
-             fprintf (stderr, "tftp: ");
-             perror (cp);
-             return;
-           }
-         if (verbose)
-           printf ("getting from %s:%s to %s [%s]\n",
-                   hostname, src, cp, mode);
-         peeraddr.sin_port = port ? port : sp->s_port;
-         recvfile (fd, src, mode);
-         break;
-       }
-      cp = tail (src);         /* new .. jdg */
-      fd = creat (cp, 0644);
-      if (fd < 0)
-       {
-         fprintf (stderr, "tftp: ");
-         perror (cp);
-         continue;
-       }
-      if (verbose)
-       printf ("getting from %s:%s to %s [%s]\n", hostname, src, cp, mode);
-      peeraddr.sin_port = port ? port : sp->s_port;
-      recvfile (fd, src, mode);
-    }
-}
-
-static void
-getusage (char *s)
-{
-  printf ("usage: %s host:file host:file ... file, or\n", s);
-  printf ("       %s file file ... file if connected\n", s);
-}
-
-int rexmtval = TIMEOUT;
-
-void
-setrexmt (int argc, char *argv[])
-{
-  int t;
-
-  if (argc < 2)
-    get_args ("Rexmt-timeout", "(value) ", &argc, &argv);
-
-  if (argc != 2)
-    {
-      printf ("usage: %s value\n", argv[0]);
-      return;
-    }
-  t = atoi (argv[1]);
-  if (t < 0)
-    printf ("%s: bad value\n", argv[1]);
-  else
-    rexmtval = t;
-}
-
-int maxtimeout = 5 * TIMEOUT;
-
-void
-settimeout (int argc, char *argv[])
-{
-  int t;
-
-  if (argc < 2)
-    get_args ("Maximum-timeout", "(value) ", &argc, &argv);
-
-  if (argc != 2)
-    {
-      printf ("usage: %s value\n", argv[0]);
-      return;
-    }
-  t = atoi (argv[1]);
-  if (t < 0)
-    printf ("%s: bad value\n", argv[1]);
-  else
-    maxtimeout = t;
-}
-
-void
-status (int argc, char *argv[])
-{
-  if (connected)
-    printf ("Connected to %s.\n", hostname);
-  else
-    printf ("Not connected.\n");
-  printf ("Mode: %s Verbose: %s Tracing: %s\n", mode,
-         verbose ? "on" : "off", trace ? "on" : "off");
-  printf ("Rexmt-interval: %d seconds, Max-timeout: %d seconds\n",
-         rexmtval, maxtimeout);
-}
-
-void
-intr ()
-{
-  signal (SIGALRM, SIG_IGN);
-  alarm (0);
-  longjmp (toplevel, -1);
-}
-
-char *
-tail (char *filename)
-{
-  register char *s;
-
-  while (*filename)
-    {
-      s = strrchr (filename, '/');
-      if (s == NULL)
-       break;
-      if (s[1])
-       return (s + 1);
-      *s = '\0';
-    }
-  return filename;
-}
-
-/*
- * Command parser.
- */
-static void
-command ()
-{
-  register struct cmd *c;
-
-  for (;;)
-    {
-      printf ("%s> ", prompt);
-      if (fgets (line, sizeof line, stdin) == 0)
-       {
-         if (feof (stdin))
-           exit (0);
-         else
-           continue;
-       }
-      if (line[0] == 0)
-       continue;
-      makeargv ();
-      if (margc == 0)
-       continue;
-      c = getcmd (margv[0]);
-      if (c == (struct cmd *) -1)
-       {
-         printf ("?Ambiguous command\n");
-         continue;
-       }
-      if (c == 0)
-       {
-         printf ("?Invalid command\n");
-         continue;
-       }
-      (*c->handler) (margc, margv);
-    }
-}
-
-struct cmd *
-getcmd (register char *name)
-{
-  register char *p, *q;
-  register struct cmd *c, *found;
-  register int nmatches, longest;
-
-  longest = 0;
-  nmatches = 0;
-  found = 0;
-  for (c = cmdtab; (p = c->name) != NULL; c++)
-    {
-      for (q = name; *q == *p++; q++)
-       if (*q == 0)            /* exact match? */
-         return (c);
-
-      if (!*q)
-       {                       /* the name was a prefix */
-         if (q - name > longest)
-           {
-             longest = q - name;
-             nmatches = 1;
-             found = c;
-           }
-         else if (q - name == longest)
-           nmatches++;
-       }
-    }
-  if (nmatches > 1)
-    return (struct cmd *) -1;
-  return found;
-}
-
-/*
- * Slice a string up into argc/argv.
- */
-static void
-makeargv ()
-{
-  register char *cp;
-  register char **argp = margv;
-
-  margc = 0;
-  for (cp = line; *cp;)
-    {
-      while (isspace (*cp))
-       cp++;
-      if (*cp == '\0')
-       break;
-      *argp++ = cp;
-      margc += 1;
-      while (*cp != '\0' && !isspace (*cp))
-       cp++;
-      if (*cp == '\0')
-       break;
-      *cp++ = '\0';
-    }
-  *argp++ = 0;
-}
-
-void
-quit (int argc, char *argv[])
-{
-  exit (0);
-}
-
-/*
- * Help command.
- */
-void
-help (int argc, char *argv[])
-{
-  register struct cmd *c;
-
-  if (argc == 1)
-    {
-      printf ("Commands may be abbreviated.  Commands are:\n\n");
-      for (c = cmdtab; c->name; c++)
-       printf ("%-*s\t%s\n", (int) HELPINDENT, c->name, c->help);
-      return;
-    }
-
-  while (--argc > 0)
-    {
-      register char *arg;
-
-      arg = *++argv;
-      c = getcmd (arg);
-      if (c == (struct cmd *) -1)
-       printf ("?Ambiguous help command %s\n", arg);
-      else if (c == (struct cmd *) 0)
-       printf ("?Invalid help command %s\n", arg);
-      else
-       printf ("%s\n", c->help);
-    }
-}
-
-void
-settrace (int argc, char **argv)
-{
-  trace = !trace;
-  printf ("Packet tracing %s.\n", trace ? "on" : "off");
-}
-
-void
-setverbose (int argc, char **argv)
-{
-  verbose = !verbose;
-  printf ("Verbose mode %s.\n", verbose ? "on" : "off");
-}
diff --git a/tftp/tftp.c b/tftp/tftp.c
index 17ffea0..8c92ea0 100644
--- a/tftp/tftp.c
+++ b/tftp/tftp.c
@@ -49,16 +49,13 @@
 
 /* Many bug fixes are from Jim Guyton <address@hidden> */
 
-/*
- * TFTP User Program -- Protocol Machines
- */
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/file.h>
 #ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
@@ -73,15 +70,23 @@
 #include <netinet/in.h>
 
 #include <arpa/tftp.h>
+#include <arpa/inet.h>
 
 #include <errno.h>
+#include <fcntl.h>
+#include <netdb.h>
 #include <setjmp.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <argp.h>
 
-#include "extern.h"
+#include <libinetutils.h>
+
+#include "xalloc.h"
+#include "progname.h"
 #include "tftpsubs.h"
 
 extern struct sockaddr_in peeraddr;    /* filled in by main */
@@ -104,6 +109,735 @@ static void stopclock (void);
 static void timer (int);
 static void tpacket (const char *, struct tftphdr *, int);
 
+#define TIMEOUT                5       /* secs between rexmt's */
+
+struct sockaddr_in peeraddr;
+int f;
+short port;
+int trace;
+int verbose;
+int connected;
+char mode[32];
+char line[200];
+int margc;
+char *margv[20];
+char *prompt = "tftp";
+jmp_buf toplevel;
+void intr ();
+struct servent *sp;
+
+void get (int, char **);
+void help (int, char **);
+void modecmd (int, char **);
+void put (int, char **);
+void quit (int, char **);
+void setascii (int, char **);
+void setbinary (int, char **);
+void setpeer (int, char **);
+void setrexmt (int, char **);
+void settimeout (int, char **);
+void settrace (int, char **);
+void setverbose (int, char **);
+void status (int, char **);
+
+static void command (void);
+
+static void getusage (char *);
+static void makeargv (void);
+static void putusage (char *);
+static void settftpmode (char *);
+
+#define HELPINDENT (sizeof("connect"))
+
+struct cmd
+{
+  char *name;
+  char *help;
+  void (*handler) (int, char **);
+};
+
+char vhelp[] = "toggle verbose mode";
+char thelp[] = "toggle packet tracing";
+char chelp[] = "connect to remote tftp";
+char qhelp[] = "exit tftp";
+char hhelp[] = "print help information";
+char shelp[] = "send file";
+char rhelp[] = "receive file";
+char mhelp[] = "set file transfer mode";
+char sthelp[] = "show current status";
+char xhelp[] = "set per-packet retransmission timeout";
+char ihelp[] = "set total retransmission timeout";
+char ashelp[] = "set mode to netascii";
+char bnhelp[] = "set mode to octet";
+
+struct cmd cmdtab[] = {
+  {"connect", chelp, setpeer},
+  {"mode", mhelp, modecmd},
+  {"put", shelp, put},
+  {"get", rhelp, get},
+  {"quit", qhelp, quit},
+  {"verbose", vhelp, setverbose},
+  {"trace", thelp, settrace},
+  {"status", sthelp, status},
+  {"binary", bnhelp, setbinary},
+  {"ascii", ashelp, setascii},
+  {"rexmt", xhelp, setrexmt},
+  {"timeout", ihelp, settimeout},
+  {"?", hhelp, help},
+  {0}
+};
+
+struct cmd *getcmd ();
+char *tail ();
+
+
+const char args_doc[] = "[HOST [PORT]]";
+const char doc[] = "Trivial file transfer protocol client";
+
+static struct argp_option argp_options[] = {
+  {"verbose", 'v', NULL, 0, "verbose output"},
+  {NULL}
+};
+
+char *hostport_argv[3] = { "connect" };
+int hostport_argc = 1;
+
+void recvfile (int, char *, char *);
+void send_file (int, char *, char *);
+
+static error_t
+parse_opt (int key, char *arg, struct argp_state *state)
+{
+  switch (key)
+    {
+    case 'v':          /* Verbose.  */
+      verbose++;
+      break;
+
+    case ARGP_KEY_ARG:
+      if (state->arg_num >= 2 || hostport_argc >= 3)
+       /* Too many arguments. */
+       argp_usage (state);
+      hostport_argv[hostport_argc++] = arg;
+      break;
+
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+
+  return 0;
+}
+
+static struct argp argp = {argp_options, parse_opt, args_doc, doc};
+
+int
+main (int argc, char *argv[])
+{
+  struct sockaddr_in sin;
+
+  set_program_name (argv[0]);
+  iu_argp_init ("tftp", default_program_authors);
+  argp_parse (&argp, argc, argv, 0, NULL, NULL);
+
+  sp = getservbyname ("tftp", "udp");
+  if (sp == 0)
+    {
+      fprintf (stderr, "tftp: udp/tftp: unknown service\n");
+      exit (1);
+    }
+  f = socket (AF_INET, SOCK_DGRAM, 0);
+  if (f < 0)
+    {
+      perror ("tftp: socket");
+      exit (3);
+    }
+  memset (&sin, 0, sizeof (sin));
+  sin.sin_family = AF_INET;
+  if (bind (f, (struct sockaddr *) &sin, sizeof (sin)) < 0)
+    {
+      perror ("tftp: bind");
+      exit (1);
+    }
+  strcpy (mode, "netascii");
+  signal (SIGINT, intr);
+  if (hostport_argc > 1)
+    {
+      if (setjmp (toplevel) != 0)
+       exit (0);
+      setpeer (hostport_argc, hostport_argv);
+    }
+  if (setjmp (toplevel) != 0)
+    putchar ('\n');
+  command ();
+}
+
+char *hostname;
+
+#define RESOLVE_OK            0
+#define RESOLVE_FAIL         -1
+#define RESOLVE_NOT_RESOLVED  1
+
+/* Resolve NAME. Fill in peeraddr, hostname and set connected on success.
+   Return value: RESOLVE_OK success
+                 RESOLVE_FAIL error
+                RESOLVE_NOT_RESOLVED name is not resolved and ALLOW_NULL
+                is true */
+static int
+resolve_name (char *name, int allow_null)
+{
+  struct hostent *hp = gethostbyname (name);
+  if (hp == NULL)
+    {
+      if (allow_null)
+       return RESOLVE_NOT_RESOLVED;
+      fprintf (stderr, "tftp: %s: ", name);
+      herror ((char *) NULL);
+      return RESOLVE_FAIL;
+    }
+  else if (hp->h_length != sizeof peeraddr.sin_addr)
+    {
+      fprintf (stderr, "tftp: resolving %s returns unexpected length", name);
+      return RESOLVE_FAIL;
+    }
+  memcpy (&peeraddr.sin_addr, hp->h_addr, hp->h_length);
+  peeraddr.sin_family = hp->h_addrtype;
+  connected = 1;
+  free (hostname);
+  hostname = xstrdup (hp->h_name);
+  return RESOLVE_OK;
+}
+
+/* Prompt for more arguments from the user with PROMPT, putting the results
+   into ARGC & ARGV, with an initial argument of ARG0.  Global variables
+   LINE, MARGC, and MARGV are changed.  */
+static void
+get_args (char *arg0, char *prompt, int *argc, char ***argv)
+{
+  size_t arg0_len = strlen (arg0);
+
+  strcpy (line, arg0);
+  strcat (line, " ");
+
+  printf ("%s", prompt);
+  fgets (line + arg0_len + 1, sizeof line - arg0_len - 1, stdin);
+
+  makeargv ();
+  *argc = margc;
+  *argv = margv;
+}
+
+void
+setpeer (int argc, char *argv[])
+{
+  if (argc < 2)
+    get_args ("Connect", "(to) ", &argc, &argv);
+
+  if (argc < 2 || argc > 3)
+    {
+      printf ("usage: %s host-name [port]\n", argv[0]);
+      return;
+    }
+
+  switch (resolve_name (argv[1], 1))
+    {
+    case RESOLVE_OK:
+      break;
+
+    case RESOLVE_FAIL:
+      return;
+
+    case RESOLVE_NOT_RESOLVED:
+      peeraddr.sin_family = AF_INET;
+      peeraddr.sin_addr.s_addr = inet_addr (argv[1]);
+      if (peeraddr.sin_addr.s_addr == -1)
+       {
+         connected = 0;
+         printf ("%s: unknown host\n", argv[1]);
+         return;
+       }
+      hostname = xstrdup (argv[1]);
+    }
+
+  port = sp->s_port;
+  if (argc == 3)
+    {
+      port = atoi (argv[2]);
+      if (port < 0)
+       {
+         printf ("%s: bad port number\n", argv[2]);
+         connected = 0;
+         return;
+       }
+      port = htons (port);
+    }
+  connected = 1;
+}
+
+struct modes
+{
+  char *m_name;
+  char *m_mode;
+} modes[] =
+  {
+    {"ascii", "netascii"},
+    {"netascii", "netascii"},
+    {"binary", "octet"},
+    {"image", "octet"},
+    {"octet", "octet"},
+    {0, 0}
+  };
+
+void
+modecmd (int argc, char *argv[])
+{
+  register struct modes *p;
+  char *sep;
+
+  if (argc < 2)
+    {
+      printf ("Using %s mode to transfer files.\n", mode);
+      return;
+    }
+  if (argc == 2)
+    {
+      for (p = modes; p->m_name; p++)
+       if (strcmp (argv[1], p->m_name) == 0)
+         break;
+      if (p->m_name)
+       {
+         settftpmode (p->m_mode);
+         return;
+       }
+      printf ("%s: unknown mode\n", argv[1]);
+      /* drop through and print usage message */
+    }
+
+  printf ("usage: %s [", argv[0]);
+  sep = " ";
+  for (p = modes; p->m_name; p++)
+    {
+      printf ("%s%s", sep, p->m_name);
+      if (*sep == ' ')
+       sep = " | ";
+    }
+  printf (" ]\n");
+  return;
+}
+
+void
+setbinary (int argc, char *argv[])
+{
+  settftpmode ("octet");
+}
+
+void
+setascii (int argc, char *argv[])
+{
+  settftpmode ("netascii");
+}
+
+static void
+settftpmode (char *newmode)
+{
+  strcpy (mode, newmode);
+  if (verbose)
+    printf ("mode set to %s\n", mode);
+}
+
+/*
+ * Send file(s).
+ */
+void
+put (int argc, char *argv[])
+{
+  int fd;
+  register int n;
+  register char *cp, *targ;
+
+  if (argc < 2)
+    get_args ("send", "(file) ", &argc, &argv);
+
+  if (argc < 2)
+    {
+      putusage (argv[0]);
+      return;
+    }
+  targ = argv[argc - 1];
+  if (strchr (argv[argc - 1], ':'))
+    {
+      char *cp;
+
+      for (n = 1; n < argc - 1; n++)
+       if (strchr (argv[n], ':'))
+         {
+           putusage (argv[0]);
+           return;
+         }
+      cp = argv[argc - 1];
+      targ = strchr (cp, ':');
+      *targ++ = 0;
+      if (resolve_name (cp, 0) != RESOLVE_OK)
+       return;
+    }
+  if (!connected)
+    {
+      printf ("No target machine specified.\n");
+      return;
+    }
+  if (argc < 4)
+    {
+      cp = argc == 2 ? tail (targ) : argv[1];
+      fd = open (cp, O_RDONLY);
+      if (fd < 0)
+       {
+         fprintf (stderr, "tftp: ");
+         perror (cp);
+         return;
+       }
+      if (verbose)
+       printf ("putting %s to %s:%s [%s]\n", cp, hostname, targ, mode);
+      peeraddr.sin_port = port ? port : sp->s_port;
+      send_file (fd, targ, mode);
+      return;
+    }
+  /* this assumes the target is a directory */
+  /* on a remote unix system.  hmmmm.  */
+  cp = strchr (targ, '\0');
+  *cp++ = '/';
+  for (n = 1; n < argc - 1; n++)
+    {
+      strcpy (cp, tail (argv[n]));
+      fd = open (argv[n], O_RDONLY);
+      if (fd < 0)
+       {
+         fprintf (stderr, "tftp: ");
+         perror (argv[n]);
+         continue;
+       }
+      if (verbose)
+       printf ("putting %s to %s:%s [%s]\n", argv[n], hostname, targ, mode);
+      peeraddr.sin_port = port ? port : sp->s_port;
+      send_file (fd, targ, mode);
+    }
+}
+
+static void
+putusage (char *s)
+{
+  printf ("usage: %s file ... host:target, or\n", s);
+  printf ("       %s file ... target (when already connected)\n", s);
+}
+
+/*
+ * Receive file(s).
+ */
+void
+get (int argc, char *argv[])
+{
+  int fd;
+  register int n;
+  register char *cp;
+  char *src;
+
+  if (argc < 2)
+    get_args ("get", "(files) ", &argc, &argv);
+
+  if (argc < 2)
+    {
+      getusage (argv[0]);
+      return;
+    }
+  if (!connected)
+    {
+      for (n = 1; n < argc; n++)
+       if (strchr (argv[n], ':') == 0)
+         {
+           getusage (argv[0]);
+           return;
+         }
+    }
+  for (n = 1; n < argc; n++)
+    {
+      src = strchr (argv[n], ':');
+      if (src == NULL)
+       src = argv[n];
+      else
+       {
+         *src++ = 0;
+         if (resolve_name (argv[n], 0) != RESOLVE_OK)
+           continue;
+       }
+
+      if (argc < 4)
+       {
+         cp = argc == 3 ? argv[2] : tail (src);
+         fd = creat (cp, 0644);
+         if (fd < 0)
+           {
+             fprintf (stderr, "tftp: ");
+             perror (cp);
+             return;
+           }
+         if (verbose)
+           printf ("getting from %s:%s to %s [%s]\n",
+                   hostname, src, cp, mode);
+         peeraddr.sin_port = port ? port : sp->s_port;
+         recvfile (fd, src, mode);
+         break;
+       }
+      cp = tail (src);         /* new .. jdg */
+      fd = creat (cp, 0644);
+      if (fd < 0)
+       {
+         fprintf (stderr, "tftp: ");
+         perror (cp);
+         continue;
+       }
+      if (verbose)
+       printf ("getting from %s:%s to %s [%s]\n", hostname, src, cp, mode);
+      peeraddr.sin_port = port ? port : sp->s_port;
+      recvfile (fd, src, mode);
+    }
+}
+
+static void
+getusage (char *s)
+{
+  printf ("usage: %s host:file host:file ... file, or\n", s);
+  printf ("       %s file file ... file if connected\n", s);
+}
+
+int rexmtval = TIMEOUT;
+
+void
+setrexmt (int argc, char *argv[])
+{
+  int t;
+
+  if (argc < 2)
+    get_args ("Rexmt-timeout", "(value) ", &argc, &argv);
+
+  if (argc != 2)
+    {
+      printf ("usage: %s value\n", argv[0]);
+      return;
+    }
+  t = atoi (argv[1]);
+  if (t < 0)
+    printf ("%s: bad value\n", argv[1]);
+  else
+    rexmtval = t;
+}
+
+int maxtimeout = 5 * TIMEOUT;
+
+void
+settimeout (int argc, char *argv[])
+{
+  int t;
+
+  if (argc < 2)
+    get_args ("Maximum-timeout", "(value) ", &argc, &argv);
+
+  if (argc != 2)
+    {
+      printf ("usage: %s value\n", argv[0]);
+      return;
+    }
+  t = atoi (argv[1]);
+  if (t < 0)
+    printf ("%s: bad value\n", argv[1]);
+  else
+    maxtimeout = t;
+}
+
+void
+status (int argc, char *argv[])
+{
+  if (connected)
+    printf ("Connected to %s.\n", hostname);
+  else
+    printf ("Not connected.\n");
+  printf ("Mode: %s Verbose: %s Tracing: %s\n", mode,
+         verbose ? "on" : "off", trace ? "on" : "off");
+  printf ("Rexmt-interval: %d seconds, Max-timeout: %d seconds\n",
+         rexmtval, maxtimeout);
+}
+
+void
+intr ()
+{
+  signal (SIGALRM, SIG_IGN);
+  alarm (0);
+  longjmp (toplevel, -1);
+}
+
+char *
+tail (char *filename)
+{
+  register char *s;
+
+  while (*filename)
+    {
+      s = strrchr (filename, '/');
+      if (s == NULL)
+       break;
+      if (s[1])
+       return (s + 1);
+      *s = '\0';
+    }
+  return filename;
+}
+
+/*
+ * Command parser.
+ */
+static void
+command ()
+{
+  register struct cmd *c;
+
+  for (;;)
+    {
+      printf ("%s> ", prompt);
+      if (fgets (line, sizeof line, stdin) == 0)
+       {
+         if (feof (stdin))
+           exit (0);
+         else
+           continue;
+       }
+      if (line[0] == 0)
+       continue;
+      makeargv ();
+      if (margc == 0)
+       continue;
+      c = getcmd (margv[0]);
+      if (c == (struct cmd *) -1)
+       {
+         printf ("?Ambiguous command\n");
+         continue;
+       }
+      if (c == 0)
+       {
+         printf ("?Invalid command\n");
+         continue;
+       }
+      (*c->handler) (margc, margv);
+    }
+}
+
+struct cmd *
+getcmd (register char *name)
+{
+  register char *p, *q;
+  register struct cmd *c, *found;
+  register int nmatches, longest;
+
+  longest = 0;
+  nmatches = 0;
+  found = 0;
+  for (c = cmdtab; (p = c->name) != NULL; c++)
+    {
+      for (q = name; *q == *p++; q++)
+       if (*q == 0)            /* exact match? */
+         return (c);
+
+      if (!*q)
+       {                       /* the name was a prefix */
+         if (q - name > longest)
+           {
+             longest = q - name;
+             nmatches = 1;
+             found = c;
+           }
+         else if (q - name == longest)
+           nmatches++;
+       }
+    }
+  if (nmatches > 1)
+    return (struct cmd *) -1;
+  return found;
+}
+
+/*
+ * Slice a string up into argc/argv.
+ */
+static void
+makeargv ()
+{
+  register char *cp;
+  register char **argp = margv;
+
+  margc = 0;
+  for (cp = line; *cp;)
+    {
+      while (isspace (*cp))
+       cp++;
+      if (*cp == '\0')
+       break;
+      *argp++ = cp;
+      margc += 1;
+      while (*cp != '\0' && !isspace (*cp))
+       cp++;
+      if (*cp == '\0')
+       break;
+      *cp++ = '\0';
+    }
+  *argp++ = 0;
+}
+
+void
+quit (int argc, char *argv[])
+{
+  exit (0);
+}
+
+/*
+ * Help command.
+ */
+void
+help (int argc, char *argv[])
+{
+  register struct cmd *c;
+
+  if (argc == 1)
+    {
+      printf ("Commands may be abbreviated.  Commands are:\n\n");
+      for (c = cmdtab; c->name; c++)
+       printf ("%-*s\t%s\n", (int) HELPINDENT, c->name, c->help);
+      return;
+    }
+
+  while (--argc > 0)
+    {
+      register char *arg;
+
+      arg = *++argv;
+      c = getcmd (arg);
+      if (c == (struct cmd *) -1)
+       printf ("?Ambiguous help command %s\n", arg);
+      else if (c == (struct cmd *) 0)
+       printf ("?Invalid help command %s\n", arg);
+      else
+       printf ("%s\n", c->help);
+    }
+}
+
+void
+settrace (int argc, char **argv)
+{
+  trace = !trace;
+  printf ("Packet tracing %s.\n", trace ? "on" : "off");
+}
+
+void
+setverbose (int argc, char **argv)
+{
+  verbose = !verbose;
+  printf ("Verbose mode %s.\n", verbose ? "on" : "off");
+}
+
 /*
  * Send the requested file.
  */

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

Summary of changes:
 ChangeLog                              |  126 ++++
 Makefile.am                            |    9 +-
 configure.ac                           |   33 +-
 headers/Makefile.am                    |   20 -
 hostname/.gitignore                    |    1 -
 hostname/Makefile.am                   |   27 -
 inetd/.gitignore                       |    2 -
 inetd/Makefile.am                      |   34 -
 libinetutils/Makefile.am               |    4 +-
 {headers => libinetutils}/shishi_def.h |    0
 {headers => libinetutils}/tftpsubs.h   |    0
 logger/.gitignore                      |    2 -
 logger/Makefile.am                     |   27 -
 man/Makefile.am                        |   48 +-
 rcp/.gitignore                         |    1 -
 rcp/Makefile.am                        |   46 --
 rexec/.gitignore                       |    1 -
 rexec/Makefile.am                      |   34 -
 rexecd/.gitignore                      |    1 -
 rexecd/Makefile.am                     |   35 -
 rlogin/.gitignore                      |    1 -
 rlogin/Makefile.am                     |   42 --
 rlogind/.gitignore                     |    1 -
 rlogind/Makefile.am                    |   36 -
 rsh/.gitignore                         |    1 -
 rsh/Makefile.am                        |   46 --
 rshd/.gitignore                        |    1 -
 rshd/Makefile.am                       |   34 -
 src/.gitignore                         |   15 +
 src/Makefile.am                        |  139 ++++
 {hostname => src}/hostname.c           |    0
 {inetd => src}/inetd.c                 |   78 +-
 {logger => src}/logger.c               |   26 +-
 {rcp => src}/rcp.c                     |    6 +-
 {rexec => src}/rexec.c                 |    0
 {rexecd => src}/rexecd.c               |    1 -
 {rlogin => src}/rlogin.c               |    2 +-
 {rlogind => src}/rlogind.c             |    8 +-
 {rsh => src}/rsh.c                     |    2 +-
 {rshd => src}/rshd.c                   |    7 +-
 {syslogd => src}/syslogd.c             |    0
 src/tftp.c                             | 1220 ++++++++++++++++++++++++++++++++
 {tftpd => src}/tftpd.c                 |    6 +-
 {traceroute => src}/traceroute.c       |   28 +-
 {uucpd => src}/uucpd.c                 |    0
 syslogd/.gitignore                     |    2 -
 syslogd/Makefile.am                    |   35 -
 tftp/.gitignore                        |    1 -
 tftp/Makefile.am                       |   30 -
 tftp/extern.h                          |   52 --
 tftp/main.c                            |  809 ---------------------
 tftp/tftp.c                            |  486 -------------
 tftpd/.gitignore                       |    1 -
 tftpd/Makefile.am                      |   30 -
 traceroute/.gitignore                  |    1 -
 traceroute/Makefile.am                 |   42 --
 uucpd/.gitignore                       |    1 -
 uucpd/Makefile.am                      |   35 -
 58 files changed, 1629 insertions(+), 2047 deletions(-)
 delete mode 100644 headers/Makefile.am
 delete mode 100644 hostname/.gitignore
 delete mode 100644 hostname/Makefile.am
 delete mode 100644 inetd/.gitignore
 delete mode 100644 inetd/Makefile.am
 rename {headers => libinetutils}/shishi_def.h (100%)
 rename {headers => libinetutils}/tftpsubs.h (100%)
 delete mode 100644 logger/.gitignore
 delete mode 100644 logger/Makefile.am
 delete mode 100644 rcp/.gitignore
 delete mode 100644 rcp/Makefile.am
 delete mode 100644 rexec/.gitignore
 delete mode 100644 rexec/Makefile.am
 delete mode 100644 rexecd/.gitignore
 delete mode 100644 rexecd/Makefile.am
 delete mode 100644 rlogin/.gitignore
 delete mode 100644 rlogin/Makefile.am
 delete mode 100644 rlogind/.gitignore
 delete mode 100644 rlogind/Makefile.am
 delete mode 100644 rsh/.gitignore
 delete mode 100644 rsh/Makefile.am
 delete mode 100644 rshd/.gitignore
 delete mode 100644 rshd/Makefile.am
 create mode 100644 src/.gitignore
 create mode 100644 src/Makefile.am
 rename {hostname => src}/hostname.c (100%)
 rename {inetd => src}/inetd.c (99%)
 rename {logger => src}/logger.c (99%)
 rename {rcp => src}/rcp.c (99%)
 rename {rexec => src}/rexec.c (100%)
 rename {rexecd => src}/rexecd.c (99%)
 rename {rlogin => src}/rlogin.c (99%)
 rename {rlogind => src}/rlogind.c (99%)
 rename {rsh => src}/rsh.c (99%)
 rename {rshd => src}/rshd.c (99%)
 rename {syslogd => src}/syslogd.c (100%)
 create mode 100644 src/tftp.c
 rename {tftpd => src}/tftpd.c (99%)
 rename {traceroute => src}/traceroute.c (98%)
 rename {uucpd => src}/uucpd.c (100%)
 delete mode 100644 syslogd/.gitignore
 delete mode 100644 syslogd/Makefile.am
 delete mode 100644 tftp/.gitignore
 delete mode 100644 tftp/Makefile.am
 delete mode 100644 tftp/extern.h
 delete mode 100644 tftp/main.c
 delete mode 100644 tftp/tftp.c
 delete mode 100644 tftpd/.gitignore
 delete mode 100644 tftpd/Makefile.am
 delete mode 100644 traceroute/.gitignore
 delete mode 100644 traceroute/Makefile.am
 delete mode 100644 uucpd/.gitignore
 delete mode 100644 uucpd/Makefile.am


hooks/post-receive
-- 
GNU Inetutils 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]