1993-03-21 12:45:37 +03:00
|
|
|
/*
|
1994-08-25 07:47:50 +04:00
|
|
|
* Copyright (c) 1985, 1989, 1993, 1994
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* 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. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. 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.
|
|
|
|
*
|
1994-08-29 07:09:05 +04:00
|
|
|
* from: @(#)ftp_var.h 8.3 (Berkeley) 4/2/94
|
|
|
|
* $Id: ftp_var.h,v 1.5 1994/08/29 03:09:17 mycroft Exp $
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FTP global variables.
|
|
|
|
*/
|
|
|
|
|
1994-08-25 07:47:50 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
|
|
|
|
#include "extern.h"
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Options and other state info.
|
|
|
|
*/
|
|
|
|
int trace; /* trace packets exchanged */
|
|
|
|
int hash; /* print # for each buffer transferred */
|
|
|
|
int sendport; /* use PORT cmd for each data connection */
|
|
|
|
int verbose; /* print messages coming back from server */
|
|
|
|
int connected; /* connected to server */
|
|
|
|
int fromatty; /* input is from a terminal */
|
|
|
|
int interactive; /* interactively prompt on m* cmds */
|
|
|
|
int debug; /* debugging level */
|
|
|
|
int bell; /* ring bell on cmd completion */
|
|
|
|
int doglob; /* glob local file names */
|
|
|
|
int autologin; /* establish user account on connection */
|
|
|
|
int proxy; /* proxy server connection active */
|
|
|
|
int proxflag; /* proxy connection exists */
|
|
|
|
int sunique; /* store files on server with unique name */
|
|
|
|
int runique; /* store local files with unique name */
|
|
|
|
int mcase; /* map upper to lower case for mget names */
|
|
|
|
int ntflag; /* use ntin ntout tables for name translation */
|
|
|
|
int mapflag; /* use mapin mapout templates on file names */
|
|
|
|
int code; /* return/reply code for ftp command */
|
|
|
|
int crflag; /* if 1, strip car. rets. on ascii gets */
|
|
|
|
char pasv[64]; /* passive port for proxy data connection */
|
1994-08-25 08:27:41 +04:00
|
|
|
int passivemode; /* passive mode enabled */
|
1993-03-21 12:45:37 +03:00
|
|
|
char *altarg; /* argv[1] with no shell-like preprocessing */
|
|
|
|
char ntin[17]; /* input translation table */
|
|
|
|
char ntout[17]; /* output translation table */
|
|
|
|
char mapin[MAXPATHLEN]; /* input map template */
|
|
|
|
char mapout[MAXPATHLEN]; /* output map template */
|
|
|
|
char typename[32]; /* name of file transfer type */
|
|
|
|
int type; /* requested file transfer type */
|
|
|
|
int curtype; /* current file transfer type */
|
|
|
|
char structname[32]; /* name of file transfer structure */
|
|
|
|
int stru; /* file transfer structure */
|
|
|
|
char formname[32]; /* name of file transfer format */
|
|
|
|
int form; /* file transfer format */
|
|
|
|
char modename[32]; /* name of file transfer mode */
|
|
|
|
int mode; /* file transfer mode */
|
|
|
|
char bytename[32]; /* local byte size in ascii */
|
|
|
|
int bytesize; /* local byte size in binary */
|
|
|
|
|
|
|
|
char *hostname; /* name of host connected to */
|
|
|
|
int unix_server; /* server is unix, can use binary for ascii */
|
|
|
|
int unix_proxy; /* proxy is unix, can use binary for ascii */
|
|
|
|
|
|
|
|
struct servent *sp; /* service spec for tcp/ftp */
|
|
|
|
|
|
|
|
jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
|
|
|
|
|
|
|
|
char line[200]; /* input line buffer */
|
|
|
|
char *stringbase; /* current scan point in line buffer */
|
|
|
|
char argbuf[200]; /* argument storage buffer */
|
|
|
|
char *argbase; /* current storage point in arg buffer */
|
|
|
|
int margc; /* count of arguments on input line */
|
|
|
|
char *margv[20]; /* args parsed from input line */
|
|
|
|
int cpend; /* flag: if != 0, then pending server reply */
|
|
|
|
int mflag; /* flag: if != 0, then active multi command */
|
|
|
|
|
|
|
|
int options; /* used during socket creation */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Format of command table.
|
|
|
|
*/
|
|
|
|
struct cmd {
|
|
|
|
char *c_name; /* name of command */
|
|
|
|
char *c_help; /* help string */
|
|
|
|
char c_bell; /* give bell when command completes */
|
|
|
|
char c_conn; /* must be connected to use command */
|
|
|
|
char c_proxy; /* proxy server may execute */
|
1994-08-25 07:47:50 +04:00
|
|
|
void (*c_handler) __P((int, char **)); /* function to call */
|
1993-03-21 12:45:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct macel {
|
|
|
|
char mac_name[9]; /* macro name */
|
|
|
|
char *mac_start; /* start of macro in macbuf */
|
|
|
|
char *mac_end; /* end of macro in macbuf */
|
|
|
|
};
|
|
|
|
|
|
|
|
int macnum; /* number of defined macros */
|
|
|
|
struct macel macros[16];
|
|
|
|
char macbuf[4096];
|