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