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