xref: /onnv-gate/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp_var.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  *	Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  *	Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28*0Sstevel@tonic-gate /*	All Rights Reserved  	*/
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate /*
31*0Sstevel@tonic-gate  *	University Copyright- Copyright (c) 1982, 1986, 1988
32*0Sstevel@tonic-gate  *	The Regents of the University of California
33*0Sstevel@tonic-gate  *	All Rights Reserved
34*0Sstevel@tonic-gate  *
35*0Sstevel@tonic-gate  *	University Acknowledgment- Portions of this document are derived from
36*0Sstevel@tonic-gate  *	software developed by the University of California, Berkeley, and its
37*0Sstevel@tonic-gate  *	contributors.
38*0Sstevel@tonic-gate  */
39*0Sstevel@tonic-gate 
40*0Sstevel@tonic-gate #ifndef	_FTP_VAR_H
41*0Sstevel@tonic-gate #define	_FTP_VAR_H
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
44*0Sstevel@tonic-gate 
45*0Sstevel@tonic-gate #ifdef	__cplusplus
46*0Sstevel@tonic-gate extern "C" {
47*0Sstevel@tonic-gate #endif
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate #include <sys/param.h>
50*0Sstevel@tonic-gate #include <sys/types.h>
51*0Sstevel@tonic-gate #include <sys/socket.h>
52*0Sstevel@tonic-gate #include <sys/ioctl.h>
53*0Sstevel@tonic-gate #include <sys/stat.h>
54*0Sstevel@tonic-gate #include <sys/wait.h>
55*0Sstevel@tonic-gate #include <sys/resource.h>
56*0Sstevel@tonic-gate #include <sys/ttold.h>
57*0Sstevel@tonic-gate #include <sys/stropts.h>
58*0Sstevel@tonic-gate #include <sys/time.h>
59*0Sstevel@tonic-gate #include <netinet/in.h>
60*0Sstevel@tonic-gate #include <netinet/tcp.h>
61*0Sstevel@tonic-gate #include <arpa/ftp.h>
62*0Sstevel@tonic-gate #include <arpa/telnet.h>
63*0Sstevel@tonic-gate #include <arpa/inet.h>
64*0Sstevel@tonic-gate #include <setjmp.h>
65*0Sstevel@tonic-gate #include <libintl.h>
66*0Sstevel@tonic-gate #include <string.h>
67*0Sstevel@tonic-gate #include <fcntl.h>
68*0Sstevel@tonic-gate #include <stdlib.h>
69*0Sstevel@tonic-gate #include <stdio.h>
70*0Sstevel@tonic-gate #include <widec.h>
71*0Sstevel@tonic-gate #include <signal.h>
72*0Sstevel@tonic-gate #include <netdb.h>
73*0Sstevel@tonic-gate #include <pwd.h>
74*0Sstevel@tonic-gate #include <locale.h>
75*0Sstevel@tonic-gate #include <limits.h>
76*0Sstevel@tonic-gate #include <fnmatch.h>
77*0Sstevel@tonic-gate #include <dirent.h>
78*0Sstevel@tonic-gate #include <termios.h>
79*0Sstevel@tonic-gate #include <stdarg.h>
80*0Sstevel@tonic-gate #include <unistd.h>
81*0Sstevel@tonic-gate #include <malloc.h>
82*0Sstevel@tonic-gate #include <strings.h>
83*0Sstevel@tonic-gate #include <errno.h>
84*0Sstevel@tonic-gate #include <ctype.h>
85*0Sstevel@tonic-gate #include <gssapi/gssapi.h>
86*0Sstevel@tonic-gate #include <gssapi/gssapi_ext.h>
87*0Sstevel@tonic-gate 
88*0Sstevel@tonic-gate #define	signal(s, f)	sigset(s, f)
89*0Sstevel@tonic-gate #define	setjmp(e)	sigsetjmp(e, 1)
90*0Sstevel@tonic-gate #define	longjmp(e, v)	siglongjmp(e, v)
91*0Sstevel@tonic-gate #define	jmp_buf		sigjmp_buf
92*0Sstevel@tonic-gate 
93*0Sstevel@tonic-gate /*
94*0Sstevel@tonic-gate  * FTP global variables.
95*0Sstevel@tonic-gate  */
96*0Sstevel@tonic-gate #ifndef	EXTERN
97*0Sstevel@tonic-gate #define	EXTERN	extern
98*0Sstevel@tonic-gate #endif
99*0Sstevel@tonic-gate 
100*0Sstevel@tonic-gate #define	DEFAULTFTPFILE	"/etc/default/ftp"
101*0Sstevel@tonic-gate 
102*0Sstevel@tonic-gate /*
103*0Sstevel@tonic-gate  * Options and other state info.
104*0Sstevel@tonic-gate  */
105*0Sstevel@tonic-gate EXTERN int	trace;		/* trace packets exchanged */
106*0Sstevel@tonic-gate EXTERN int	hash;		/* print # for each buffer transferred */
107*0Sstevel@tonic-gate EXTERN int	sendport;	/* use PORT cmd for each data connection */
108*0Sstevel@tonic-gate EXTERN int	verbose;	/* print messages coming back from server */
109*0Sstevel@tonic-gate EXTERN int	connected;	/* connected to server */
110*0Sstevel@tonic-gate EXTERN int	fromatty;	/* input is from a terminal */
111*0Sstevel@tonic-gate EXTERN int	interactive;	/* interactively prompt on m* cmds */
112*0Sstevel@tonic-gate EXTERN int	debug;		/* debugging level */
113*0Sstevel@tonic-gate EXTERN int	bell;		/* ring bell on cmd completion */
114*0Sstevel@tonic-gate EXTERN int	doglob;		/* glob local file names */
115*0Sstevel@tonic-gate EXTERN int	autologin;	/* establish user account on connection */
116*0Sstevel@tonic-gate EXTERN int	proxy;		/* proxy server connection active */
117*0Sstevel@tonic-gate EXTERN int	proxflag;	/* proxy connection exists */
118*0Sstevel@tonic-gate EXTERN int	sunique;	/* store files on server with unique name */
119*0Sstevel@tonic-gate EXTERN int	runique;	/* store local files with unique name */
120*0Sstevel@tonic-gate EXTERN int	mcase;		/* map upper to lower case for mget names */
121*0Sstevel@tonic-gate EXTERN int	ntflag;		/* use ntin ntout tables for name translation */
122*0Sstevel@tonic-gate EXTERN int	mapflag;	/* use mapin mapout templates on file names */
123*0Sstevel@tonic-gate EXTERN int	code;		/* return/reply code for ftp command */
124*0Sstevel@tonic-gate EXTERN int	crflag;		/* if 1, strip car. rets. on ascii gets */
125*0Sstevel@tonic-gate EXTERN char	pasv[64];	/* passive port for proxy data connection */
126*0Sstevel@tonic-gate EXTERN char	*altarg;	/* argv[1] with no shell-like preprocessing  */
127*0Sstevel@tonic-gate EXTERN char	ntin[17];	/* input translation table */
128*0Sstevel@tonic-gate EXTERN char	ntout[17];	/* output translation table */
129*0Sstevel@tonic-gate EXTERN char	mapin[MAXPATHLEN]; /* input map template */
130*0Sstevel@tonic-gate EXTERN char	mapout[MAXPATHLEN]; /* output map template */
131*0Sstevel@tonic-gate EXTERN char	typename[32];	/* name of file transfer type */
132*0Sstevel@tonic-gate EXTERN int	type;		/* file transfer type */
133*0Sstevel@tonic-gate EXTERN char	structname[32];	/* name of file transfer structure */
134*0Sstevel@tonic-gate EXTERN int	stru;		/* file transfer structure */
135*0Sstevel@tonic-gate EXTERN char	formname[32];	/* name of file transfer format */
136*0Sstevel@tonic-gate EXTERN int	form;		/* file transfer format */
137*0Sstevel@tonic-gate EXTERN char	modename[32];	/* name of file transfer mode */
138*0Sstevel@tonic-gate EXTERN int	mode;		/* file transfer mode */
139*0Sstevel@tonic-gate EXTERN char	bytename[32];	/* local byte size in ascii */
140*0Sstevel@tonic-gate EXTERN int	bytesize;	/* local byte size in binary */
141*0Sstevel@tonic-gate EXTERN int	passivemode;	/* passive transfer mode toggle */
142*0Sstevel@tonic-gate EXTERN off_t	restart_point;	/* transfer restart offset */
143*0Sstevel@tonic-gate EXTERN int	tcpwindowsize;	/* TCP window size for the data connection */
144*0Sstevel@tonic-gate 
145*0Sstevel@tonic-gate EXTERN boolean_t	ls_invokes_NLST;	/* behaviour of 'ls' */
146*0Sstevel@tonic-gate EXTERN char		*hostname;		/* name of host connected to */
147*0Sstevel@tonic-gate EXTERN char		*home;
148*0Sstevel@tonic-gate EXTERN char		*globerr;
149*0Sstevel@tonic-gate 
150*0Sstevel@tonic-gate EXTERN struct	sockaddr_in6 myctladdr;		/* for channel bindings */
151*0Sstevel@tonic-gate EXTERN struct	sockaddr_in6 remctladdr;	/* for channel bindings */
152*0Sstevel@tonic-gate 
153*0Sstevel@tonic-gate EXTERN int	clevel;		/* command channel protection level */
154*0Sstevel@tonic-gate EXTERN int	dlevel;		/* data channel protection level */
155*0Sstevel@tonic-gate 
156*0Sstevel@tonic-gate EXTERN int	autoauth;	/* do authentication on connect */
157*0Sstevel@tonic-gate EXTERN int	auth_type;	/* authentication type */
158*0Sstevel@tonic-gate EXTERN int	auth_error;	/* one error code for all auth types */
159*0Sstevel@tonic-gate EXTERN int	autoencrypt;	/* do encryption on connect */
160*0Sstevel@tonic-gate EXTERN int	fflag;		/* forward credentials */
161*0Sstevel@tonic-gate EXTERN boolean_t goteof;
162*0Sstevel@tonic-gate 
163*0Sstevel@tonic-gate EXTERN uchar_t	*ucbuf;		/* clear text buffer */
164*0Sstevel@tonic-gate 
165*0Sstevel@tonic-gate #define	MECH_SZ		40
166*0Sstevel@tonic-gate #define	FTP_DEF_MECH	"kerberos_v5"
167*0Sstevel@tonic-gate EXTERN char	mechstr[MECH_SZ];	/* mechanism type */
168*0Sstevel@tonic-gate 
169*0Sstevel@tonic-gate EXTERN gss_OID	mechoid;	/* corresponding mechanism oid type */
170*0Sstevel@tonic-gate EXTERN gss_ctx_id_t gcontext;	/* gss security context */
171*0Sstevel@tonic-gate 
172*0Sstevel@tonic-gate #define	FTPBUFSIZ	BUFSIZ*16
173*0Sstevel@tonic-gate #define	HASHSIZ		BUFSIZ*8
174*0Sstevel@tonic-gate 
175*0Sstevel@tonic-gate EXTERN char *buf;		/* buffer for binary sends and gets */
176*0Sstevel@tonic-gate 
177*0Sstevel@tonic-gate EXTERN jmp_buf toplevel;	/* non-local goto stuff for cmd scanner */
178*0Sstevel@tonic-gate 
179*0Sstevel@tonic-gate /*
180*0Sstevel@tonic-gate  * BUFSIZE includes
181*0Sstevel@tonic-gate  *	- (MAXPATHLEN)*2 to  accomodate 2 paths (remote and local file names).
182*0Sstevel@tonic-gate  *	- MAXCMDLEN to accomodate the longest command listed in cmdtab[]
183*0Sstevel@tonic-gate  *	  (defined in cmdtab.c) as this is stuffed into the buffer along
184*0Sstevel@tonic-gate  *	  with the remote and local file names.
185*0Sstevel@tonic-gate  *	- The 4 bytes are for the 2 blank separators, a carriage-return
186*0Sstevel@tonic-gate  *	  and a NULL terminator.
187*0Sstevel@tonic-gate  *
188*0Sstevel@tonic-gate  * NOTE : The arguments may not be always pathnames (they can be commands
189*0Sstevel@tonic-gate  *	  too). But, here we have considered the worst case of two pathnames.
190*0Sstevel@tonic-gate  */
191*0Sstevel@tonic-gate #define	MAXCMDLEN	10	/* The length of longest command in cmdtab[] */
192*0Sstevel@tonic-gate #define	BUFSIZE	((MAXPATHLEN)*2+MAXCMDLEN+4)
193*0Sstevel@tonic-gate 
194*0Sstevel@tonic-gate EXTERN char	line[BUFSIZE];	/* input line buffer */
195*0Sstevel@tonic-gate EXTERN char	*stringbase;	/* current scan point in line buffer */
196*0Sstevel@tonic-gate EXTERN char	argbuf[BUFSIZE]; /* argument storage buffer */
197*0Sstevel@tonic-gate EXTERN char	*argbase;	/* current storage point in arg buffer */
198*0Sstevel@tonic-gate EXTERN int	margc;		/* count of arguments on input line */
199*0Sstevel@tonic-gate EXTERN char	**margv;	/* args parsed from input line */
200*0Sstevel@tonic-gate EXTERN int	cpend;		/* flag: if != 0, then pending server reply */
201*0Sstevel@tonic-gate EXTERN int	mflag;		/* flag: if != 0, then active multi command */
202*0Sstevel@tonic-gate EXTERN FILE	*tmp_nlst;	/* tmp file; holds NLST results for mget, etc */
203*0Sstevel@tonic-gate 
204*0Sstevel@tonic-gate EXTERN char	*reply_parse;	/* for parsing replies to the ADAT command */
205*0Sstevel@tonic-gate EXTERN char	reply_buf[FTPBUFSIZ];
206*0Sstevel@tonic-gate EXTERN char	*reply_ptr;
207*0Sstevel@tonic-gate 
208*0Sstevel@tonic-gate EXTERN int	options;	/* used during socket creation */
209*0Sstevel@tonic-gate 
210*0Sstevel@tonic-gate EXTERN int	timeout;	/* connection timeout */
211*0Sstevel@tonic-gate EXTERN int	timeoutms;	/* connection timeout in msec */
212*0Sstevel@tonic-gate EXTERN jmp_buf	timeralarm;	/* to recover from global timeout */
213*0Sstevel@tonic-gate 
214*0Sstevel@tonic-gate 
215*0Sstevel@tonic-gate /*
216*0Sstevel@tonic-gate  * Format of command table.
217*0Sstevel@tonic-gate  */
218*0Sstevel@tonic-gate struct cmd {
219*0Sstevel@tonic-gate 	char	*c_name;	/* name of command */
220*0Sstevel@tonic-gate 	char	*c_help;	/* help string */
221*0Sstevel@tonic-gate 	char	c_bell;		/* give bell when command completes */
222*0Sstevel@tonic-gate 	char	c_conn;		/* must be connected to use command */
223*0Sstevel@tonic-gate 	char	c_proxy;	/* proxy server may execute */
224*0Sstevel@tonic-gate 	void	(*c_handler)(int argc, char *argv[]); /* function to call */
225*0Sstevel@tonic-gate };
226*0Sstevel@tonic-gate 
227*0Sstevel@tonic-gate struct macel {
228*0Sstevel@tonic-gate 	char mac_name[9];	/* macro name */
229*0Sstevel@tonic-gate 	char *mac_start;	/* start of macro in macbuf */
230*0Sstevel@tonic-gate 	char *mac_end;		/* end of macro in macbuf */
231*0Sstevel@tonic-gate };
232*0Sstevel@tonic-gate 
233*0Sstevel@tonic-gate EXTERN int macnum;			/* number of defined macros */
234*0Sstevel@tonic-gate EXTERN struct macel macros[16];
235*0Sstevel@tonic-gate EXTERN char macbuf[4096];
236*0Sstevel@tonic-gate 
237*0Sstevel@tonic-gate extern void macdef(int argc, char *argv[]);
238*0Sstevel@tonic-gate extern void doproxy(int argc, char *argv[]);
239*0Sstevel@tonic-gate extern void setpeer(int argc, char *argv[]);
240*0Sstevel@tonic-gate extern void rmthelp(int argc, char *argv[]);
241*0Sstevel@tonic-gate extern void settype(int argc, char *argv[]);
242*0Sstevel@tonic-gate extern void setbinary(int argc, char *argv[]);
243*0Sstevel@tonic-gate extern void setascii(int argc, char *argv[]);
244*0Sstevel@tonic-gate extern void settenex(int argc, char *argv[]);
245*0Sstevel@tonic-gate extern void setebcdic(int argc, char *argv[]);
246*0Sstevel@tonic-gate extern void setmode(int argc, char *argv[]);
247*0Sstevel@tonic-gate extern void setform(int argc, char *argv[]);
248*0Sstevel@tonic-gate extern void setstruct(int argc, char *argv[]);
249*0Sstevel@tonic-gate extern void put(int argc, char *argv[]);
250*0Sstevel@tonic-gate extern void mput(int argc, char *argv[]);
251*0Sstevel@tonic-gate extern void get(int argc, char *argv[]);
252*0Sstevel@tonic-gate extern void mget(int argc, char *argv[]);
253*0Sstevel@tonic-gate extern void status(int argc, char *argv[]);
254*0Sstevel@tonic-gate extern void setbell(int argc, char *argv[]);
255*0Sstevel@tonic-gate extern void settrace(int argc, char *argv[]);
256*0Sstevel@tonic-gate extern void sethash(int argc, char *argv[]);
257*0Sstevel@tonic-gate extern void setverbose(int argc, char *argv[]);
258*0Sstevel@tonic-gate extern void setport(int argc, char *argv[]);
259*0Sstevel@tonic-gate extern void setprompt(int argc, char *argv[]);
260*0Sstevel@tonic-gate extern void setglob(int argc, char *argv[]);
261*0Sstevel@tonic-gate extern void setdebug(int argc, char *argv[]);
262*0Sstevel@tonic-gate extern void cd(int argc, char *argv[]);
263*0Sstevel@tonic-gate extern void lcd(int argc, char *argv[]);
264*0Sstevel@tonic-gate extern void delete(int argc, char *argv[]);
265*0Sstevel@tonic-gate extern void mdelete(int argc, char *argv[]);
266*0Sstevel@tonic-gate extern void renamefile(int argc, char *argv[]);
267*0Sstevel@tonic-gate extern void ls(int argc, char *argv[]);
268*0Sstevel@tonic-gate extern void mls(int argc, char *argv[]);
269*0Sstevel@tonic-gate extern void shell(int argc, char *argv[]);
270*0Sstevel@tonic-gate extern void user(int argc, char *argv[]);
271*0Sstevel@tonic-gate extern void pwd(int argc, char *argv[]);
272*0Sstevel@tonic-gate extern void makedir(int argc, char *argv[]);
273*0Sstevel@tonic-gate extern void removedir(int argc, char *argv[]);
274*0Sstevel@tonic-gate extern void quote(int argc, char *argv[]);
275*0Sstevel@tonic-gate extern void rmthelp(int argc, char *argv[]);
276*0Sstevel@tonic-gate extern void quit(int argc, char *argv[]);
277*0Sstevel@tonic-gate extern void disconnect(int argc, char *argv[]);
278*0Sstevel@tonic-gate extern void account(int argc, char *argv[]);
279*0Sstevel@tonic-gate extern void setcase(int argc, char *argv[]);
280*0Sstevel@tonic-gate extern void setcr(int argc, char *argv[]);
281*0Sstevel@tonic-gate extern void setntrans(int argc, char *argv[]);
282*0Sstevel@tonic-gate extern void setnmap(int argc, char *argv[]);
283*0Sstevel@tonic-gate extern void setsunique(int argc, char *argv[]);
284*0Sstevel@tonic-gate extern void setrunique(int argc, char *argv[]);
285*0Sstevel@tonic-gate extern void cdup(int argc, char *argv[]);
286*0Sstevel@tonic-gate extern void domacro(int argc, char *argv[]);
287*0Sstevel@tonic-gate extern void help(int argc, char *argv[]);
288*0Sstevel@tonic-gate extern void reset(int argc, char *argv[]);
289*0Sstevel@tonic-gate extern void reget(int argc, char *argv[]);
290*0Sstevel@tonic-gate extern void restart(int argc, char *argv[]);
291*0Sstevel@tonic-gate extern void setpassive(int argc, char *argv[]);
292*0Sstevel@tonic-gate extern void settcpwindow(int argc, char *argv[]);
293*0Sstevel@tonic-gate extern void site(int argc, char *argv[]);
294*0Sstevel@tonic-gate 
295*0Sstevel@tonic-gate extern void ccc(int argc, char *argv[]);
296*0Sstevel@tonic-gate extern void setclear(int argc, char *argv[]);
297*0Sstevel@tonic-gate extern void setclevel(int argc, char *argv[]);
298*0Sstevel@tonic-gate extern void setdlevel(int argc, char *argv[]);
299*0Sstevel@tonic-gate extern void setsafe(int argc, char *argv[]);
300*0Sstevel@tonic-gate extern void setmech(int argc, char *argv[]);
301*0Sstevel@tonic-gate 
302*0Sstevel@tonic-gate extern int do_auth(void);
303*0Sstevel@tonic-gate extern void setpbsz(uint_t size);
304*0Sstevel@tonic-gate extern char *radix_error(int);
305*0Sstevel@tonic-gate extern int radix_encode(uchar_t *, uchar_t *, size_t, int *, int);
306*0Sstevel@tonic-gate extern void user_gss_error(OM_uint32 maj_stat, OM_uint32 min_stat,
307*0Sstevel@tonic-gate 	char *errstr);
308*0Sstevel@tonic-gate extern void setprivate(int argc, char *argv[]);
309*0Sstevel@tonic-gate 
310*0Sstevel@tonic-gate extern int secure_flush(int);
311*0Sstevel@tonic-gate extern int secure_getc(FILE *);
312*0Sstevel@tonic-gate extern int secure_putc(int, FILE *);
313*0Sstevel@tonic-gate extern ssize_t secure_read(int, void *, size_t);
314*0Sstevel@tonic-gate extern ssize_t secure_write(int, const void *, size_t);
315*0Sstevel@tonic-gate 
316*0Sstevel@tonic-gate extern void fatal(char *msg);
317*0Sstevel@tonic-gate extern int getreply(int expecteof);
318*0Sstevel@tonic-gate extern void call(void (*routine)(int argc, char *argv[]), ...);
319*0Sstevel@tonic-gate extern void sendrequest(char *cmd, char *local, char *remote, int allowpipe);
320*0Sstevel@tonic-gate extern void recvrequest(char *cmd, char *local, char *remote, char *mode,
321*0Sstevel@tonic-gate     int allowpipe);
322*0Sstevel@tonic-gate extern void makeargv(void);
323*0Sstevel@tonic-gate extern int login(char *host);
324*0Sstevel@tonic-gate extern int command(char *fmt, ...);
325*0Sstevel@tonic-gate extern char **glob(char *v);
326*0Sstevel@tonic-gate extern void blkfree(char **);
327*0Sstevel@tonic-gate extern void pswitch(int flag);
328*0Sstevel@tonic-gate 
329*0Sstevel@tonic-gate extern char *hookup(char *host, char *);
330*0Sstevel@tonic-gate extern char *mygetpass(char *prompt);
331*0Sstevel@tonic-gate extern void lostpeer(int sig);
332*0Sstevel@tonic-gate extern int ruserpass(char *host, char **aname, char **apass, char **aacct);
333*0Sstevel@tonic-gate extern FILE *mypopen(char *cmd, char *mode);
334*0Sstevel@tonic-gate extern int mypclose(FILE *ptr);
335*0Sstevel@tonic-gate extern struct cmd *getcmd(char *name);
336*0Sstevel@tonic-gate 
337*0Sstevel@tonic-gate extern void stop_timer(void);
338*0Sstevel@tonic-gate extern void reset_timer(void);
339*0Sstevel@tonic-gate extern int getpagesize(void);
340*0Sstevel@tonic-gate 
341*0Sstevel@tonic-gate #define	ENCODELEN(l)	(((4 * (l)) / 3) + 4)
342*0Sstevel@tonic-gate #define	DECODELEN(l)	(((3 * (l)) / 4) + 4)
343*0Sstevel@tonic-gate 
344*0Sstevel@tonic-gate #ifdef	__cplusplus
345*0Sstevel@tonic-gate }
346*0Sstevel@tonic-gate #endif
347*0Sstevel@tonic-gate 
348*0Sstevel@tonic-gate #endif	/* _FTP_VAR_H */
349