version 1.31, 1999/06/29 14:33:23 |
version 1.32, 1999/12/08 12:57:06 |
|
|
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ |
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ |
|
|
/* |
/* |
|
* Copyright (C) 1997 and 1998 WIDE Project. |
|
* 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 project 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 PROJECT 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 PROJECT 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. |
|
*/ |
|
|
|
/* |
* Copyright (c) 1985, 1989, 1993, 1994 |
* Copyright (c) 1985, 1989, 1993, 1994 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
* |
* |
|
|
} |
} |
pswitch(0); |
pswitch(0); |
} |
} |
fprintf(ttyout, "Gate ftp: %s, server %s, port %d.\n", onoff(gatemode), |
fprintf(ttyout, "Gate ftp: %s, server %s, port %s.\n", onoff(gatemode), |
*gateserver ? gateserver : "(none)", ntohs(gateport)); |
*gateserver ? gateserver : "(none)", gateport); |
fprintf(ttyout, "Passive mode: %s.\n", onoff(passivemode)); |
fprintf(ttyout, "Passive mode: %s.\n", onoff(passivemode)); |
fprintf(ttyout, "Mode: %s; Type: %s; Form: %s; Structure: %s.\n", |
fprintf(ttyout, "Mode: %s; Type: %s; Form: %s; Structure: %s.\n", |
modename, typename, formname, structname); |
modename, typename, formname, structname); |
|
|
} |
} |
fprintf(ttyout, "Hash mark printing: %s; Mark count: %d; Progress bar: %s.\n", |
fprintf(ttyout, "Hash mark printing: %s; Mark count: %d; Progress bar: %s.\n", |
onoff(hash), mark, onoff(progress)); |
onoff(hash), mark, onoff(progress)); |
fprintf(ttyout, "Use of PORT cmds: %s.\n", onoff(sendport)); |
fprintf(ttyout, "Use of PORT/LPRT cmds: %s.\n", onoff(sendport)); |
#ifndef SMALL |
#ifndef SMALL |
fprintf(ttyout, "Command line editing: %s.\n", onoff(editing)); |
fprintf(ttyout, "Command line editing: %s.\n", onoff(editing)); |
#endif /* !SMALL */ |
#endif /* !SMALL */ |
|
|
} |
} |
|
|
/* |
/* |
* Toggle PORT cmd use before each data connection. |
* Toggle PORT/LPRT cmd use before each data connection. |
*/ |
*/ |
/*VARARGS*/ |
/*VARARGS*/ |
void |
void |
|
|
char *argv[]; |
char *argv[]; |
{ |
{ |
|
|
code = togglevar(argc, argv, &sendport, "Use of PORT cmds"); |
code = togglevar(argc, argv, &sendport, "Use of PORT/LPRT cmds"); |
} |
} |
|
|
/* |
/* |
|
|
gatemode = 0; |
gatemode = 0; |
else { |
else { |
if (argc == 3) { |
if (argc == 3) { |
|
#if 0 |
char *ep; |
char *ep; |
long port; |
long port; |
|
|
|
|
return; |
return; |
} |
} |
gateport = htons(port); |
gateport = htons(port); |
|
#else |
|
gateport = strdup(argv[2]); |
|
#endif |
} |
} |
strncpy(gsbuf, argv[1], sizeof(gsbuf) - 1); |
strncpy(gsbuf, argv[1], sizeof(gsbuf) - 1); |
gsbuf[sizeof(gsbuf) - 1] = '\0'; |
gsbuf[sizeof(gsbuf) - 1] = '\0'; |
|
|
"Disabling gate-ftp mode - no gate-ftp server defined.\n"); |
"Disabling gate-ftp mode - no gate-ftp server defined.\n"); |
gatemode = 0; |
gatemode = 0; |
} else { |
} else { |
fprintf(ttyout, "Gate ftp: %s, server %s, port %d.\n", |
fprintf(ttyout, "Gate ftp: %s, server %s, port %s.\n", |
onoff(gatemode), |
onoff(gatemode), |
*gateserver ? gateserver : "(none)", ntohs(gateport)); |
*gateserver ? gateserver : "(none)", gateport); |
} |
} |
code = gatemode; |
code = gatemode; |
} |
} |