1 /* 2 * Copyright (c) 1985 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that this notice is preserved and that due credit is given 7 * to the University of California at Berkeley. The name of the University 8 * may not be used to endorse or promote products derived from this 9 * software without specific prior written permission. This software 10 * is provided ``as is'' without express or implied warranty. 11 * 12 * @(#)ftp_var.h 5.4 (Berkeley) 03/14/88 13 */ 14 15 /* 16 * FTP global variables. 17 */ 18 19 /* 20 * Options and other state info. 21 */ 22 int trace; /* trace packets exchanged */ 23 int hash; /* print # for each buffer transferred */ 24 int sendport; /* use PORT cmd for each data connection */ 25 int verbose; /* print messages coming back from server */ 26 int connected; /* connected to server */ 27 int fromatty; /* input is from a terminal */ 28 int interactive; /* interactively prompt on m* cmds */ 29 int debug; /* debugging level */ 30 int bell; /* ring bell on cmd completion */ 31 int doglob; /* glob local file names */ 32 int autologin; /* establish user account on connection */ 33 int proxy; /* proxy server connection active */ 34 int proxflag; /* proxy connection exists */ 35 int sunique; /* store files on server with unique name */ 36 int runique; /* store local files with unique name */ 37 int mcase; /* map upper to lower case for mget names */ 38 int ntflag; /* use ntin ntout tables for name translation */ 39 int mapflag; /* use mapin mapout templates on file names */ 40 int code; /* return/reply code for ftp command */ 41 int crflag; /* if 1, strip car. rets. on ascii gets */ 42 char pasv[64]; /* passive port for proxy data connection */ 43 char *altarg; /* argv[1] with no shell-like preprocessing */ 44 char ntin[17]; /* input translation table */ 45 char ntout[17]; /* output translation table */ 46 #include <sys/param.h> 47 char mapin[MAXPATHLEN]; /* input map template */ 48 char mapout[MAXPATHLEN]; /* output map template */ 49 char typename[32]; /* name of file transfer type */ 50 int type; /* file transfer type */ 51 char structname[32]; /* name of file transfer structure */ 52 int stru; /* file transfer structure */ 53 char formname[32]; /* name of file transfer format */ 54 int form; /* file transfer format */ 55 char modename[32]; /* name of file transfer mode */ 56 int mode; /* file transfer mode */ 57 char bytename[32]; /* local byte size in ascii */ 58 int bytesize; /* local byte size in binary */ 59 60 char *hostname; /* name of host connected to */ 61 62 struct servent *sp; /* service spec for tcp/ftp */ 63 64 #include <setjmp.h> 65 jmp_buf toplevel; /* non-local goto stuff for cmd scanner */ 66 67 char line[200]; /* input line buffer */ 68 char *stringbase; /* current scan point in line buffer */ 69 char argbuf[200]; /* argument storage buffer */ 70 char *argbase; /* current storage point in arg buffer */ 71 int margc; /* count of arguments on input line */ 72 char *margv[20]; /* args parsed from input line */ 73 int cpend; /* flag: if != 0, then pending server reply */ 74 int mflag; /* flag: if != 0, then active multi command */ 75 76 int options; /* used during socket creation */ 77 78 /* 79 * Format of command table. 80 */ 81 struct cmd { 82 char *c_name; /* name of command */ 83 char *c_help; /* help string */ 84 char c_bell; /* give bell when command completes */ 85 char c_conn; /* must be connected to use command */ 86 char c_proxy; /* proxy server may execute */ 87 int (*c_handler)(); /* function to call */ 88 }; 89 90 struct macel { 91 char mac_name[9]; /* macro name */ 92 char *mac_start; /* start of macro in macbuf */ 93 char *mac_end; /* end of macro in macbuf */ 94 }; 95 96 int macnum; /* number of defined macros */ 97 struct macel macros[16]; 98 char macbuf[4096]; 99 100 extern char *tail(); 101 extern char *index(); 102 extern char *rindex(); 103 extern char *remglob(); 104 extern int errno; 105 extern char *mktemp(); 106 extern char *strncpy(); 107 extern char *strncat(); 108 extern char *strcat(); 109 extern char *strcpy(); 110