1 #include "ftp_locl.h" 2 RCSID("$Id$"); 3 4 /* 5 * Options and other state info. 6 */ 7 int trace; /* trace packets exchanged */ 8 int hash; /* print # for each buffer transferred */ 9 int sendport; /* use PORT cmd for each data connection */ 10 int verbose; /* print messages coming back from server */ 11 int connected; /* connected to server */ 12 int fromatty; /* input is from a terminal */ 13 int interactive; /* interactively prompt on m* cmds */ 14 int lineedit; /* use line-editing */ 15 int debug; /* debugging level */ 16 int bell; /* ring bell on cmd completion */ 17 int doglob; /* glob local file names */ 18 int doencrypt; /* try to use encryption */ 19 int autologin; /* establish user account on connection */ 20 int proxy; /* proxy server connection active */ 21 int proxflag; /* proxy connection exists */ 22 int sunique; /* store files on server with unique name */ 23 int runique; /* store local files with unique name */ 24 int mcase; /* map upper to lower case for mget names */ 25 int ntflag; /* use ntin ntout tables for name translation */ 26 int mapflag; /* use mapin mapout templates on file names */ 27 int code; /* return/reply code for ftp command */ 28 int crflag; /* if 1, strip car. rets. on ascii gets */ 29 char pasv[64]; /* passive port for proxy data connection */ 30 int passivemode; /* passive mode enabled */ 31 char *altarg; /* argv[1] with no shell-like preprocessing */ 32 char ntin[17]; /* input translation table */ 33 char ntout[17]; /* output translation table */ 34 char mapin[MaxPathLen]; /* input map template */ 35 char mapout[MaxPathLen]; /* output map template */ 36 char typename[32]; /* name of file transfer type */ 37 int type; /* requested file transfer type */ 38 int curtype; /* current file transfer type */ 39 char structname[32]; /* name of file transfer structure */ 40 int stru; /* file transfer structure */ 41 char formname[32]; /* name of file transfer format */ 42 int form; /* file transfer format */ 43 char modename[32]; /* name of file transfer mode */ 44 int mode; /* file transfer mode */ 45 char bytename[32]; /* local byte size in ascii */ 46 int bytesize; /* local byte size in binary */ 47 48 char *hostname; /* name of host connected to */ 49 int unix_server; /* server is unix, can use binary for ascii */ 50 int unix_proxy; /* proxy is unix, can use binary for ascii */ 51 52 jmp_buf toplevel; /* non-local goto stuff for cmd scanner */ 53 54 char line[200]; /* input line buffer */ 55 char *stringbase; /* current scan point in line buffer */ 56 char argbuf[200]; /* argument storage buffer */ 57 char *argbase; /* current storage point in arg buffer */ 58 int margc; /* count of arguments on input line */ 59 char **margv; /* args parsed from input line */ 60 int margvlen; /* how large margv is currently */ 61 int cpend; /* flag: if != 0, then pending server reply */ 62 int mflag; /* flag: if != 0, then active multi command */ 63 64 int options; /* used during socket creation */ 65 int use_kerberos; /* use Kerberos authentication */ 66 67 /* 68 * Format of command table. 69 */ 70 71 int macnum; /* number of defined macros */ 72 struct macel macros[16]; 73 char macbuf[4096]; 74 75 char username[32]; 76 77 /* these are set in ruserpassword */ 78 char myhostname[MaxHostNameLen]; 79 char *mydomain; 80