121741Sdist /* 262012Sbostic * Copyright (c) 1985, 1989, 1993 362012Sbostic * The Regents of the University of California. All rights reserved. 421741Sdist * 542665Sbostic * %sccs.include.redist.c% 633737Sbostic * 7*66670Spendry * @(#)ftp_var.h 8.2 (Berkeley) 04/02/94 821741Sdist */ 910298Ssam 1010298Ssam /* 1110298Ssam * FTP global variables. 1210298Ssam */ 1310298Ssam 14*66670Spendry #include <sys/param.h> 15*66670Spendry #include <setjmp.h> 16*66670Spendry 17*66670Spendry #include "extern.h" 18*66670Spendry 1910298Ssam /* 2010298Ssam * Options and other state info. 2110298Ssam */ 2210298Ssam int trace; /* trace packets exchanged */ 2311652Ssam int hash; /* print # for each buffer transferred */ 2411652Ssam int sendport; /* use PORT cmd for each data connection */ 2510298Ssam int verbose; /* print messages coming back from server */ 2610298Ssam int connected; /* connected to server */ 2710298Ssam int fromatty; /* input is from a terminal */ 2810298Ssam int interactive; /* interactively prompt on m* cmds */ 2910298Ssam int debug; /* debugging level */ 3010298Ssam int bell; /* ring bell on cmd completion */ 3111349Ssam int doglob; /* glob local file names */ 3210298Ssam int autologin; /* establish user account on connection */ 3326049Sminshall int proxy; /* proxy server connection active */ 3426049Sminshall int proxflag; /* proxy connection exists */ 3526049Sminshall int sunique; /* store files on server with unique name */ 3626049Sminshall int runique; /* store local files with unique name */ 3726049Sminshall int mcase; /* map upper to lower case for mget names */ 3826049Sminshall int ntflag; /* use ntin ntout tables for name translation */ 3926049Sminshall int mapflag; /* use mapin mapout templates on file names */ 4026049Sminshall int code; /* return/reply code for ftp command */ 4126049Sminshall int crflag; /* if 1, strip car. rets. on ascii gets */ 4226049Sminshall char pasv[64]; /* passive port for proxy data connection */ 4326049Sminshall char *altarg; /* argv[1] with no shell-like preprocessing */ 4426049Sminshall char ntin[17]; /* input translation table */ 4526049Sminshall char ntout[17]; /* output translation table */ 4626049Sminshall char mapin[MAXPATHLEN]; /* input map template */ 4726049Sminshall char mapout[MAXPATHLEN]; /* output map template */ 4810298Ssam char typename[32]; /* name of file transfer type */ 4938033Skarels int type; /* requested file transfer type */ 5038033Skarels int curtype; /* current file transfer type */ 5110298Ssam char structname[32]; /* name of file transfer structure */ 5210298Ssam int stru; /* file transfer structure */ 5310298Ssam char formname[32]; /* name of file transfer format */ 5410298Ssam int form; /* file transfer format */ 5510298Ssam char modename[32]; /* name of file transfer mode */ 5610298Ssam int mode; /* file transfer mode */ 5711220Ssam char bytename[32]; /* local byte size in ascii */ 5811220Ssam int bytesize; /* local byte size in binary */ 5910298Ssam 6010298Ssam char *hostname; /* name of host connected to */ 6138033Skarels int unix_server; /* server is unix, can use binary for ascii */ 6238033Skarels int unix_proxy; /* proxy is unix, can use binary for ascii */ 6310298Ssam 6410298Ssam struct servent *sp; /* service spec for tcp/ftp */ 6510298Ssam 6610298Ssam jmp_buf toplevel; /* non-local goto stuff for cmd scanner */ 6710298Ssam 6810298Ssam char line[200]; /* input line buffer */ 6910298Ssam char *stringbase; /* current scan point in line buffer */ 7010298Ssam char argbuf[200]; /* argument storage buffer */ 7110298Ssam char *argbase; /* current storage point in arg buffer */ 7210298Ssam int margc; /* count of arguments on input line */ 7310298Ssam char *margv[20]; /* args parsed from input line */ 7426049Sminshall int cpend; /* flag: if != 0, then pending server reply */ 7526049Sminshall int mflag; /* flag: if != 0, then active multi command */ 7610298Ssam 7710298Ssam int options; /* used during socket creation */ 7810298Ssam 7910298Ssam /* 8010298Ssam * Format of command table. 8110298Ssam */ 8210298Ssam struct cmd { 8310298Ssam char *c_name; /* name of command */ 8410298Ssam char *c_help; /* help string */ 8510298Ssam char c_bell; /* give bell when command completes */ 8611652Ssam char c_conn; /* must be connected to use command */ 8726049Sminshall char c_proxy; /* proxy server may execute */ 88*66670Spendry void (*c_handler) __P((int, char **)); /* function to call */ 8910298Ssam }; 9010298Ssam 9126049Sminshall struct macel { 9226049Sminshall char mac_name[9]; /* macro name */ 9326049Sminshall char *mac_start; /* start of macro in macbuf */ 9426049Sminshall char *mac_end; /* end of macro in macbuf */ 9526049Sminshall }; 9626049Sminshall 9726049Sminshall int macnum; /* number of defined macros */ 9826497Sminshall struct macel macros[16]; 9926049Sminshall char macbuf[4096]; 100