Dear all, here comes the two final patches for our FTP client. Now I dare claim the client to be a competitive and contemporary utility for all users.
Today the patches install user commands related to address family selection, and the Texinfo source is updated to reflect the new capabilities of our FTP client. These should be easily reviewed for ACKing. Best regards, Mats
From faa916c08a33b508648932f43696446fcdde9419 Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson <[email protected]> Date: Fri, 6 May 2011 20:09:08 +0200 Subject: [PATCH 1/2] ftp: Commands for address family selection. --- ChangeLog | 8 ++++++++ ftp/cmds.c | 36 ++++++++++++++++++++++++++++++++++++ ftp/cmdtab.c | 6 ++++++ ftp/extern.h | 3 +++ 4 files changed, 53 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4a39a6..5e1a6db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-05-06 Mats Erik Andersson <[email protected]> + * ftp/extern.h (setipany,setipv4,setipv6): New prototypes. + * ftp/cmdtab.c (ipanyhelp,ipv4help,ipv6help): New help texts. + (cmdtab): Register commands `ipany', `ipv4', and `ipv6'. + * ftp/cmds.c (status): Report address family. + (setipany,setipv4,setipv6): New functions. + +2011-05-06 Mats Erik Andersson <[email protected]> + * src/syslogd.c (fprintlog): Deallocate pointers F_HNAME or F_FNAME when F_TYPE is invalidated as F_UNUSED. (cfline): Likewise. diff --git a/ftp/cmds.c b/ftp/cmds.c index 39b6294..4a97f26 100644 --- a/ftp/cmds.c +++ b/ftp/cmds.c @@ -1053,6 +1053,9 @@ status (int argc, char **argv) printf ("Connected to %s.\n", hostname); else printf ("Not connected.\n"); + printf ("Connection addressing: %s\n", + (usefamily == AF_UNSPEC) ? "any" + : (usefamily == AF_INET6) ? "IPv6" : "IPv4"); if (!proxy) { pswitch (1); @@ -1158,6 +1161,39 @@ setverbose (int argc, char **argv) } /* + * Allow any address family. + */ +void +setipany (int argc, char **argv) +{ + usefamily = AF_UNSPEC; + printf ("Selecting addresses: %s.\n", "any"); + code = usefamily; +} + +/* + * Restrict to IPv4 addresses. + */ +void +setipv4 (int argc, char **argv) +{ + usefamily = AF_INET; + printf ("Selecting addresses: %s.\n", "IPv4"); + code = usefamily; +} + +/* + * Restrict to IPv6 addresses. + */ +void +setipv6 (int argc, char **argv) +{ + usefamily = AF_INET6; + printf ("Selecting addresses: %s.\n", "IPv6"); + code = usefamily; +} + +/* * Toggle use of EPRT/EPRT for IPv4. */ void diff --git a/ftp/cmdtab.c b/ftp/cmdtab.c index 8910cf0..65d2096 100644 --- a/ftp/cmdtab.c +++ b/ftp/cmdtab.c @@ -80,6 +80,9 @@ char globhelp[] = "toggle metacharacter expansion of local file names"; char hashhelp[] = "toggle printing `#' for each buffer transferred"; char helphelp[] = "print local help information"; char idlehelp[] = "get (set) idle timer on remote side"; +char ipanyhelp[] = "allow all address families"; +char ipv4help[] = "select only IPv4 addresses"; +char ipv6help[] = "select only IPv6 addresses"; char lcdhelp[] = "change local working directory"; char lshelp[] = "list contents of remote directory"; char macdefhelp[] = "define a macro"; @@ -154,6 +157,9 @@ static struct cmd cmdtab[] = { {"help", helphelp, 0, 0, 1, help}, {"idle", idlehelp, 0, 1, 1, site_idle}, {"image", binaryhelp, 0, 1, 1, setbinary}, + {"ipany", ipanyhelp, 0, 0, 0, setipany}, + {"ipv4", ipv4help, 0, 0, 0, setipv4}, + {"ipv6", ipv6help, 0, 0, 0, setipv6}, {"lcd", lcdhelp, 0, 0, 0, lcd}, {"ls", lshelp, 1, 1, 1, ls}, {"macdef", macdefhelp, 0, 0, 0, macdef}, diff --git a/ftp/extern.h b/ftp/extern.h index 1c4719f..39bff6f 100644 --- a/ftp/extern.h +++ b/ftp/extern.h @@ -132,6 +132,9 @@ void setform (int, char **); void setftmode (int, char **); void setglob (int, char **); void sethash (int, char **); +void setipany (int, char **); +void setipv4 (int, char **); +void setipv6 (int, char **); void setnmap (int, char **); void setntrans (int, char **); void setpassive (int, char **); -- 1.7.4.4
From c23204251c56d6d860e4909cbef9e4094b6082b7 Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson <[email protected]> Date: Fri, 6 May 2011 20:22:28 +0200 Subject: [PATCH 2/2] inetutils.texi: Add IPv6 ability for FTP client. --- ChangeLog | 5 +++++ doc/inetutils.texi | 31 +++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e1a6db..f7a4468 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-05-06 Mats Erik Andersson <[email protected]> + * doc/inetutils.texi (ftp invocation): Document new capabilities + related to the recent IPv6 code. A single old misprint. + +2011-05-06 Mats Erik Andersson <[email protected]> + * ftp/extern.h (setipany,setipv4,setipv6): New prototypes. * ftp/cmdtab.c (ipanyhelp,ipv4help,ipv6help): New help texts. (cmdtab): Register commands `ipany', `ipv4', and `ipv6'. diff --git a/doc/inetutils.texi b/doc/inetutils.texi index 19e5f88..de80015 100644 --- a/doc/inetutils.texi +++ b/doc/inetutils.texi @@ -794,8 +794,20 @@ ftp [@var{option}@dots{}] [@var{host} [@var{port}]] @end example @table @option +@item -4 +@itemx --ipv4 +@opindex -4 +@opindex --ipv4 +Initially set addressing to IPv4 only. + +@item -6 +@itemx --ipv6 +@opindex -6 +@opindex --ipv6 +Initially set addressing to IPv6 only. + @item -A -@itemx --acctive +@itemx --active @opindex -A @opindex --active Enable active mode transfer. @@ -961,6 +973,9 @@ the current working directory on the remote machine is used. If no local file is specified, or @var{local-file} is @samp{-}, output comes to the terminal. +@item epsv4 +Toggle the use of EPSV/EPRT for IPv4 addressing. Default is off. + @item form @var{format} Set the file transfer form to @var{format}. The default format is @samp{file}. @@ -1007,6 +1022,15 @@ Set the inactivity timer on the remote server to @var{seconds} seconds. If seconds is omitted, the current inactivity timer is printed. +@item ipv4 +Select IPv4 as the only addressing scheme. + +@item ipv6 +Select IPv6 as the only addressing scheme. + +@item ipany +Allow IPv4 as well as IPv6 addressing. + @item lcd [@var{directory}] Change the working directory on the local machine. If no directory is specified, the user's home directory is used. @@ -1175,7 +1199,10 @@ sends that address to the remote server, who connects back to it. Passive mode is useful when using @command{ftp} through a gateway router or host that controls the directionality of traffic. (Note that though @command{ftp} servers are required to support the -@code{PASV} command by RFC 1123, some do not.) +@code{PASV} command by RFC 1123, some do not.) If @command{epsv4} +has been set to on, the client will attempt @code{EPSV} before +@code{PASV} for IPv4. As a last resort @code{LPSV} is attempted. +With IPv6 only @code{EPSV} and @code{LPSV} are possible. @item prompt Toggle interactive prompting. Interactive prompting occurs during -- 1.7.4.4
signature.asc
Description: Digital signature
