155682Smarkm/* 255682Smarkm * Copyright (c) 1985, 1989, 1993, 1994 355682Smarkm * The Regents of the University of California. All rights reserved. 455682Smarkm * 555682Smarkm * Redistribution and use in source and binary forms, with or without 655682Smarkm * modification, are permitted provided that the following conditions 755682Smarkm * are met: 855682Smarkm * 1. Redistributions of source code must retain the above copyright 955682Smarkm * notice, this list of conditions and the following disclaimer. 1055682Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1155682Smarkm * notice, this list of conditions and the following disclaimer in the 1255682Smarkm * documentation and/or other materials provided with the distribution. 1355682Smarkm * 3. All advertising materials mentioning features or use of this software 1455682Smarkm * must display the following acknowledgement: 1555682Smarkm * This product includes software developed by the University of 1655682Smarkm * California, Berkeley and its contributors. 1755682Smarkm * 4. Neither the name of the University nor the names of its contributors 1855682Smarkm * may be used to endorse or promote products derived from this software 1955682Smarkm * without specific prior written permission. 2055682Smarkm * 2155682Smarkm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2255682Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2355682Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2455682Smarkm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2555682Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2655682Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2755682Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2855682Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2955682Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3055682Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3155682Smarkm * SUCH DAMAGE. 3255682Smarkm * 3355682Smarkm * @(#)ftp_var.h 8.4 (Berkeley) 10/9/94 3455682Smarkm */ 3555682Smarkm 3655682Smarkm/* 3755682Smarkm * FTP global variables. 3855682Smarkm */ 3955682Smarkm 4055682Smarkm#ifdef HAVE_SYS_PARAM_H 4155682Smarkm#include <sys/param.h> 4255682Smarkm#endif 4355682Smarkm#include <setjmp.h> 4455682Smarkm 4555682Smarkm/* 4655682Smarkm * Options and other state info. 4755682Smarkm */ 4855682Smarkmextern int trace; /* trace packets exchanged */ 4955682Smarkmextern int hash; /* print # for each buffer transferred */ 5055682Smarkmextern int sendport; /* use PORT cmd for each data connection */ 5155682Smarkmextern int verbose; /* print messages coming back from server */ 5255682Smarkmextern int connected; /* connected to server */ 5355682Smarkmextern int fromatty; /* input is from a terminal */ 5455682Smarkmextern int interactive; /* interactively prompt on m* cmds */ 5572445Sassarextern int lineedit; /* use line-editing */ 5655682Smarkmextern int debug; /* debugging level */ 5755682Smarkmextern int bell; /* ring bell on cmd completion */ 5855682Smarkmextern int doglob; /* glob local file names */ 5955682Smarkmextern int autologin; /* establish user account on connection */ 60178825Sdfrextern int doencrypt; 6155682Smarkmextern int proxy; /* proxy server connection active */ 6255682Smarkmextern int proxflag; /* proxy connection exists */ 6355682Smarkmextern int sunique; /* store files on server with unique name */ 6455682Smarkmextern int runique; /* store local files with unique name */ 6555682Smarkmextern int mcase; /* map upper to lower case for mget names */ 6655682Smarkmextern int ntflag; /* use ntin ntout tables for name translation */ 6755682Smarkmextern int mapflag; /* use mapin mapout templates on file names */ 6855682Smarkmextern int code; /* return/reply code for ftp command */ 6955682Smarkmextern int crflag; /* if 1, strip car. rets. on ascii gets */ 7055682Smarkmextern char pasv[64]; /* passive port for proxy data connection */ 7155682Smarkmextern int passivemode; /* passive mode enabled */ 7255682Smarkmextern char *altarg; /* argv[1] with no shell-like preprocessing */ 7355682Smarkmextern char ntin[17]; /* input translation table */ 7455682Smarkmextern char ntout[17]; /* output translation table */ 7555682Smarkmextern char mapin[MaxPathLen]; /* input map template */ 7655682Smarkmextern char mapout[MaxPathLen]; /* output map template */ 7755682Smarkmextern char typename[32]; /* name of file transfer type */ 7855682Smarkmextern int type; /* requested file transfer type */ 7955682Smarkmextern int curtype; /* current file transfer type */ 8055682Smarkmextern char structname[32]; /* name of file transfer structure */ 8155682Smarkmextern int stru; /* file transfer structure */ 8255682Smarkmextern char formname[32]; /* name of file transfer format */ 8355682Smarkmextern int form; /* file transfer format */ 8455682Smarkmextern char modename[32]; /* name of file transfer mode */ 8555682Smarkmextern int mode; /* file transfer mode */ 8655682Smarkmextern char bytename[32]; /* local byte size in ascii */ 8755682Smarkmextern int bytesize; /* local byte size in binary */ 8855682Smarkm 8955682Smarkmextern char *hostname; /* name of host connected to */ 9055682Smarkmextern int unix_server; /* server is unix, can use binary for ascii */ 9155682Smarkmextern int unix_proxy; /* proxy is unix, can use binary for ascii */ 9255682Smarkm 9355682Smarkmextern jmp_buf toplevel; /* non-local goto stuff for cmd scanner */ 9455682Smarkm 9555682Smarkmextern char line[200]; /* input line buffer */ 9655682Smarkmextern char *stringbase; /* current scan point in line buffer */ 9755682Smarkmextern char argbuf[200]; /* argument storage buffer */ 9855682Smarkmextern char *argbase; /* current storage point in arg buffer */ 9955682Smarkmextern int margc; /* count of arguments on input line */ 10055682Smarkmextern char **margv; /* args parsed from input line */ 10155682Smarkmextern int margvlen; /* how large margv is currently */ 10255682Smarkmextern int cpend; /* flag: if != 0, then pending server reply */ 10355682Smarkmextern int mflag; /* flag: if != 0, then active multi command */ 10455682Smarkm 10555682Smarkmextern int options; /* used during socket creation */ 10672445Sassarextern int use_kerberos; /* use Kerberos authentication */ 10755682Smarkm 10855682Smarkm/* 10955682Smarkm * Format of command table. 11055682Smarkm */ 11155682Smarkmstruct cmd { 11255682Smarkm char *c_name; /* name of command */ 11355682Smarkm char *c_help; /* help string */ 11455682Smarkm char c_bell; /* give bell when command completes */ 11555682Smarkm char c_conn; /* must be connected to use command */ 11655682Smarkm char c_proxy; /* proxy server may execute */ 11755682Smarkm void (*c_handler) (int, char **); /* function to call */ 11855682Smarkm}; 11955682Smarkm 12055682Smarkmstruct macel { 12155682Smarkm char mac_name[9]; /* macro name */ 12255682Smarkm char *mac_start; /* start of macro in macbuf */ 12355682Smarkm char *mac_end; /* end of macro in macbuf */ 12455682Smarkm}; 12555682Smarkm 12655682Smarkmextern int macnum; /* number of defined macros */ 12755682Smarkmextern struct macel macros[16]; 12855682Smarkmextern char macbuf[4096]; 12955682Smarkm 13055682Smarkm 131