121741Sdist /* 266672Spendry * Copyright (c) 1985, 1989, 1993, 1994 362012Sbostic * The Regents of the University of California. All rights reserved. 421741Sdist * 542665Sbostic * %sccs.include.redist.c% 633737Sbostic * 7*67794Smckusick * @(#)ftp_var.h 8.4 (Berkeley) 10/09/94 821741Sdist */ 910298Ssam 1010298Ssam /* 1110298Ssam * FTP global variables. 1210298Ssam */ 1310298Ssam 1466670Spendry #include <sys/param.h> 1566670Spendry #include <setjmp.h> 1666670Spendry 1766670Spendry #include "extern.h" 1866670Spendry 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 */ 43*67794Smckusick int passivemode; /* passive mode enabled */ 4426049Sminshall char *altarg; /* argv[1] with no shell-like preprocessing */ 4526049Sminshall char ntin[17]; /* input translation table */ 4626049Sminshall char ntout[17]; /* output translation table */ 4726049Sminshall char mapin[MAXPATHLEN]; /* input map template */ 4826049Sminshall char mapout[MAXPATHLEN]; /* output map template */ 4910298Ssam char typename[32]; /* name of file transfer type */ 5038033Skarels int type; /* requested file transfer type */ 5138033Skarels int curtype; /* current file transfer type */ 5210298Ssam char structname[32]; /* name of file transfer structure */ 5310298Ssam int stru; /* file transfer structure */ 5410298Ssam char formname[32]; /* name of file transfer format */ 5510298Ssam int form; /* file transfer format */ 5610298Ssam char modename[32]; /* name of file transfer mode */ 5710298Ssam int mode; /* file transfer mode */ 5811220Ssam char bytename[32]; /* local byte size in ascii */ 5911220Ssam int bytesize; /* local byte size in binary */ 6010298Ssam 6110298Ssam char *hostname; /* name of host connected to */ 6238033Skarels int unix_server; /* server is unix, can use binary for ascii */ 6338033Skarels int unix_proxy; /* proxy is unix, can use binary for ascii */ 6410298Ssam 6510298Ssam struct servent *sp; /* service spec for tcp/ftp */ 6610298Ssam 6710298Ssam jmp_buf toplevel; /* non-local goto stuff for cmd scanner */ 6810298Ssam 6910298Ssam char line[200]; /* input line buffer */ 7010298Ssam char *stringbase; /* current scan point in line buffer */ 7110298Ssam char argbuf[200]; /* argument storage buffer */ 7210298Ssam char *argbase; /* current storage point in arg buffer */ 7310298Ssam int margc; /* count of arguments on input line */ 7410298Ssam char *margv[20]; /* args parsed from input line */ 7526049Sminshall int cpend; /* flag: if != 0, then pending server reply */ 7626049Sminshall int mflag; /* flag: if != 0, then active multi command */ 7710298Ssam 7810298Ssam int options; /* used during socket creation */ 7910298Ssam 8010298Ssam /* 8110298Ssam * Format of command table. 8210298Ssam */ 8310298Ssam struct cmd { 8410298Ssam char *c_name; /* name of command */ 8510298Ssam char *c_help; /* help string */ 8610298Ssam char c_bell; /* give bell when command completes */ 8711652Ssam char c_conn; /* must be connected to use command */ 8826049Sminshall char c_proxy; /* proxy server may execute */ 8966670Spendry void (*c_handler) __P((int, char **)); /* function to call */ 9010298Ssam }; 9110298Ssam 9226049Sminshall struct macel { 9326049Sminshall char mac_name[9]; /* macro name */ 9426049Sminshall char *mac_start; /* start of macro in macbuf */ 9526049Sminshall char *mac_end; /* end of macro in macbuf */ 9626049Sminshall }; 9726049Sminshall 9826049Sminshall int macnum; /* number of defined macros */ 9926497Sminshall struct macel macros[16]; 10026049Sminshall char macbuf[4096]; 101