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 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.
16: *
17: * @(#)ftp_var.h 5.5.1 (2.11BSD GTE) 1/1/94
18: */
19:
20: /*
21: * FTP global variables.
22: */
23:
24: /*
25: * Options and other state info.
26: */
27: int trace; /* trace packets exchanged */
28: int hash; /* print # for each buffer transferred */
29: int sendport; /* use PORT cmd for each data connection */
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 */
36: int doglob; /* glob local file names */
37: int autologin; /* establish user account on connection */
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 */
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 */
54: char typename[32]; /* name of file transfer type */
55: int type; /* file transfer type */
56: char structname[32]; /* name of file transfer structure */
57: int stru; /* file transfer structure */
58: char formname[32]; /* name of file transfer format */
59: int form; /* file transfer format */
60: char modename[32]; /* name of file transfer mode */
61: int mode; /* file transfer mode */
62: char bytename[32]; /* local byte size in ascii */
63: int bytesize; /* local byte size in binary */
64:
65: char *hostname; /* name of host connected to */
66:
67: struct servent *sp; /* service spec for tcp/ftp */
68:
69: #include <setjmp.h>
70: jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
71:
72: char line[200]; /* input line buffer */
73: char *stringbase; /* current scan point in line buffer */
74: char argbuf[200]; /* argument storage buffer */
75: char *argbase; /* current storage point in arg buffer */
76: int margc; /* count of arguments on input line */
77: char *margv[20]; /* args parsed from input line */
78: int cpend; /* flag: if != 0, then pending server reply */
79: int mflag; /* flag: if != 0, then active multi command */
80:
81: int options; /* used during socket creation */
82:
83: /*
84: * Format of command table.
85: */
86: struct cmd {
87: char *c_name; /* name of command */
88: char *c_help; /* help string */
89: char c_bell; /* give bell when command completes */
90: char c_conn; /* must be connected to use command */
91: char c_proxy; /* proxy server may execute */
92: int (*c_handler)(); /* function to call */
93: };
94:
95: struct macel {
96: char mac_name[9]; /* macro name */
97: char *mac_start; /* start of macro in macbuf */
98: char *mac_end; /* end of macro in macbuf */
99: };
100:
101: int macnum; /* number of defined macros */
102: struct macel macros[16];
103: char macbuf[4096];
104:
105: extern char *tail();
106: extern char *index();
107: extern char *rindex();
108: extern char *remglob();
109: extern int errno;
110: extern char *mktemp();
111: extern char *strncpy();
112: extern char *strncat();
113: extern char *strcat();
114: extern char *strcpy();
Defined variables
bell
defined in line
35; used 7 times
code
defined in line
45; used 128 times
- in /usr/src/ucb/ftp/cmds.c line
72,
85,
94,
183-188(2),
196,
264,
276,
288,
318,
334,
376,
524,
540,
666,
839,
851,
863,
875,
890,
902,
915,
928,
945,
956,
977-980(2),
1000-1013(4),
1033,
1059,
1105,
1137-1147(3),
1182,
1189,
1252,
1262-1265(2),
1290,
1331,
1355-1358(2),
1382-1385(2),
1411,
1446,
1465,
1478,
1672,
1679,
1685,
1691-1695(2),
1705,
1723,
1730,
1740-1744(2),
1792,
1805-1809(2),
1996,
2003,
2009,
2046,
2059,
2076,
2082-2087(2),
2099,
2122,
2146
- in /usr/src/ucb/ftp/domacro.c line
52,
62,
114-122(3)
- in /usr/src/ucb/ftp/ftp.c line
112,
124,
145,
151,
157,
168,
178,
207,
301,
338,
364,
372,
383-384(3),
398,
410-412(2),
419,
492,
505,
514,
523,
531,
668,
678,
738,
749,
760,
767,
773,
779,
785,
1038,
1062,
1069,
1077,
1351,
1489,
1498,
1520,
1564,
1572,
1595,
1610,
1636,
1650
connected
defined in line
31; used 20 times
- in /usr/src/ucb/ftp/cmds.c line
69,
103,
797,
803,
1524-1527(2),
1541,
1548,
1642,
1700,
1709
- in /usr/src/ucb/ftp/domacro.c line
120
- in /usr/src/ucb/ftp/ftp.c line
1266-1267(2),
1348
- in /usr/src/ucb/ftp/main.c line
158,
169-172(2),
178,
238
cpend
defined in line
78; used 16 times
- in /usr/src/ucb/ftp/ftp.c line
314,
417,
481,
667,
729,
1037,
1286-1287(2),
1452,
1471,
1502,
1527,
1546,
1577,
1602
- in /usr/src/ucb/ftp/main.c line
113
debug
defined in line
34; used 18 times
- in /usr/src/ucb/ftp/cmds.c line
113,
582,
949-956(6),
1241,
2150
- in /usr/src/ucb/ftp/ftp.c line
186,
287,
794,
807,
828,
997,
1022
- in /usr/src/ucb/ftp/main.c line
72
doglob
defined in line
36; used 11 times
form
defined in line
59; used 1 times
hash
defined in line
28; used 17 times
- in /usr/src/ucb/ftp/cmds.c line
754(2),
763,
832,
873-876(5)
- in /usr/src/ucb/ftp/ftp.c line
591,
599,
619,
636,
897,
905,
948,
971
interactive
defined in line
33; used 35 times
- in /usr/src/ucb/ftp/cmds.c line
417-424(4),
440-447(4),
466-473(4),
634-640(4),
704-711(4),
814,
913-915(4),
1074-1079(3),
1201-1206(3),
1560,
2062
- in /usr/src/ucb/ftp/main.c line
63,
84
line
defined in line
72; used 90 times
- in /usr/src/ucb/ftp/cmds.c line
76-78(3),
308-310(3),
322-324(3),
367-369(3),
514-516(3),
528-530(3),
657-659(3),
968-970(3),
1024-1026(3),
1050-1052(3),
1095-1097(3),
1109-1111(3),
1165-1167(3),
1173-1175(3),
1281-1283(3),
1346-1348(3),
1373-1375(3),
1402-1404(3),
1437-1439(3),
1469-1471(3),
1558,
1564-1565(3),
1663-1665(3),
1796-1798(3),
2050-2052(3),
2113-2115(3),
2137-2139(3)
- in /usr/src/ucb/ftp/domacro.c line
43-45(3),
65,
72,
126,
132
- in /usr/src/ucb/ftp/ftp.c line
251
- in /usr/src/ucb/ftp/main.c line
218-223(2),
295
mapin
defined in line
52; used 5 times
margc
defined in line
76; used 33 times
- in /usr/src/ucb/ftp/cmds.c line
80,
312,
326,
371,
518,
532,
661,
972,
1028,
1054,
1099,
1113,
1169,
1177,
1285,
1350,
1377,
1406,
1441,
1473,
1667,
1800,
2054,
2117,
2141
- in /usr/src/ucb/ftp/domacro.c line
47,
128,
134
- in /usr/src/ucb/ftp/ftp.c line
253
- in /usr/src/ucb/ftp/main.c line
226,
242,
293,
299
margv
defined in line
77; used 33 times
- in /usr/src/ucb/ftp/cmds.c line
81,
313,
327,
372,
519,
533,
662,
973,
1029,
1055,
1100,
1114,
1170,
1178,
1286,
1351,
1378,
1407,
1442,
1474,
1668,
1801,
2055,
2118,
2142
- in /usr/src/ucb/ftp/domacro.c line
48,
111,
128,
135
- in /usr/src/ucb/ftp/ftp.c line
253
- in /usr/src/ucb/ftp/main.c line
229,
242,
294
mcase
defined in line
42; used 10 times
mflag
defined in line
79; used 36 times
- in /usr/src/ucb/ftp/cmds.c line
380,
388-391(2),
418-422(2),
429,
436-445(3),
462-471(3),
483,
633,
642,
670-678(3),
705-709(2),
716,
731,
1063-1077(5),
1084,
1194-1204(4),
1210
- in /usr/src/ucb/ftp/ftp.c line
443,
690,
1325
mode
defined in line
61; used 21 times
- in /usr/src/ucb/ftp/cmds.c line
501-503(2),
620,
729,
758-759(3),
1160,
1198-1199(2)
- in /usr/src/ucb/ftp/ftp.c line
464,
479,
556,
576,
697-698(2),
860,
1162-1163(2),
1176
- in /usr/src/ucb/ftp/main.c line
108
ntflag
defined in line
43; used 13 times
ntin
defined in line
49; used 7 times
ntout
defined in line
50; used 8 times
pasv
defined in line
47; used 2 times
proxy
defined in line
38; used 25 times
- in /usr/src/ucb/ftp/cmds.c line
383,
673,
756-761(2),
801,
1550,
1637-1639(2),
1811
- in /usr/src/ucb/ftp/ftp.c line
247,
472,
720,
1227,
1253-1264(4),
1448-1450(2),
1526,
1601,
1616
- in /usr/src/ucb/ftp/main.c line
114,
458
- in /usr/src/ucb/ftp/ruserpass.c line
159
sp
defined in line
67; used 3 times
stru
defined in line
57; used 1 times
trace
defined in line
27; used 5 times
type
defined in line
55; used 14 times
verbose
defined in line
30; used 58 times
- in /usr/src/ucb/ftp/cmds.c line
112-114(2),
144,
581-587(3),
613,
753(2),
763,
814,
888-890(4),
981,
1325-1335(3),
1359,
1386,
1487-1491(3),
1497-1501(3),
1510-1514(3),
2010,
2149-2151(2),
2161
- in /usr/src/ucb/ftp/domacro.c line
125
- in /usr/src/ucb/ftp/ftp.c line
171,
368,
375-378(3),
406(2),
466,
714,
793-797(3),
808,
820,
829,
841,
998,
1010,
1023,
1035,
1187
- in /usr/src/ucb/ftp/main.c line
76,
112
Defined struct's
cmd
defined in line
86; used 38 times
macel
defined in line
95; used 2 times
Usage of this include