17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0b6880ccSsp149894 * Common Development and Distribution License (the "License"). 6*0b6880ccSsp149894 * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*0b6880ccSsp149894 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 277c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate /* 307c478bd9Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 317c478bd9Sstevel@tonic-gate * The Regents of the University of California 327c478bd9Sstevel@tonic-gate * All Rights Reserved 337c478bd9Sstevel@tonic-gate * 347c478bd9Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 357c478bd9Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 367c478bd9Sstevel@tonic-gate * contributors. 377c478bd9Sstevel@tonic-gate */ 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate #ifndef _FTP_VAR_H 407c478bd9Sstevel@tonic-gate #define _FTP_VAR_H 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #ifdef __cplusplus 457c478bd9Sstevel@tonic-gate extern "C" { 467c478bd9Sstevel@tonic-gate #endif 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate #include <sys/param.h> 497c478bd9Sstevel@tonic-gate #include <sys/types.h> 507c478bd9Sstevel@tonic-gate #include <sys/socket.h> 517c478bd9Sstevel@tonic-gate #include <sys/ioctl.h> 527c478bd9Sstevel@tonic-gate #include <sys/stat.h> 537c478bd9Sstevel@tonic-gate #include <sys/wait.h> 547c478bd9Sstevel@tonic-gate #include <sys/resource.h> 557c478bd9Sstevel@tonic-gate #include <sys/ttold.h> 567c478bd9Sstevel@tonic-gate #include <sys/stropts.h> 577c478bd9Sstevel@tonic-gate #include <sys/time.h> 587c478bd9Sstevel@tonic-gate #include <netinet/in.h> 597c478bd9Sstevel@tonic-gate #include <netinet/tcp.h> 607c478bd9Sstevel@tonic-gate #include <arpa/ftp.h> 617c478bd9Sstevel@tonic-gate #include <arpa/telnet.h> 627c478bd9Sstevel@tonic-gate #include <arpa/inet.h> 637c478bd9Sstevel@tonic-gate #include <setjmp.h> 647c478bd9Sstevel@tonic-gate #include <libintl.h> 657c478bd9Sstevel@tonic-gate #include <string.h> 667c478bd9Sstevel@tonic-gate #include <fcntl.h> 677c478bd9Sstevel@tonic-gate #include <stdlib.h> 687c478bd9Sstevel@tonic-gate #include <stdio.h> 697c478bd9Sstevel@tonic-gate #include <widec.h> 707c478bd9Sstevel@tonic-gate #include <signal.h> 717c478bd9Sstevel@tonic-gate #include <netdb.h> 727c478bd9Sstevel@tonic-gate #include <pwd.h> 737c478bd9Sstevel@tonic-gate #include <locale.h> 747c478bd9Sstevel@tonic-gate #include <limits.h> 757c478bd9Sstevel@tonic-gate #include <fnmatch.h> 767c478bd9Sstevel@tonic-gate #include <dirent.h> 777c478bd9Sstevel@tonic-gate #include <termios.h> 787c478bd9Sstevel@tonic-gate #include <stdarg.h> 797c478bd9Sstevel@tonic-gate #include <unistd.h> 807c478bd9Sstevel@tonic-gate #include <malloc.h> 817c478bd9Sstevel@tonic-gate #include <strings.h> 827c478bd9Sstevel@tonic-gate #include <errno.h> 837c478bd9Sstevel@tonic-gate #include <ctype.h> 847c478bd9Sstevel@tonic-gate #include <gssapi/gssapi.h> 857c478bd9Sstevel@tonic-gate #include <gssapi/gssapi_ext.h> 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate #define signal(s, f) sigset(s, f) 887c478bd9Sstevel@tonic-gate #define setjmp(e) sigsetjmp(e, 1) 897c478bd9Sstevel@tonic-gate #define longjmp(e, v) siglongjmp(e, v) 907c478bd9Sstevel@tonic-gate #define jmp_buf sigjmp_buf 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate /* 937c478bd9Sstevel@tonic-gate * FTP global variables. 947c478bd9Sstevel@tonic-gate */ 957c478bd9Sstevel@tonic-gate #ifndef EXTERN 967c478bd9Sstevel@tonic-gate #define EXTERN extern 977c478bd9Sstevel@tonic-gate #endif 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gate #define DEFAULTFTPFILE "/etc/default/ftp" 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate /* 1027c478bd9Sstevel@tonic-gate * Options and other state info. 1037c478bd9Sstevel@tonic-gate */ 1047c478bd9Sstevel@tonic-gate EXTERN int trace; /* trace packets exchanged */ 1057c478bd9Sstevel@tonic-gate EXTERN int hash; /* print # for each buffer transferred */ 1067c478bd9Sstevel@tonic-gate EXTERN int sendport; /* use PORT cmd for each data connection */ 1077c478bd9Sstevel@tonic-gate EXTERN int verbose; /* print messages coming back from server */ 1087c478bd9Sstevel@tonic-gate EXTERN int connected; /* connected to server */ 1097c478bd9Sstevel@tonic-gate EXTERN int fromatty; /* input is from a terminal */ 1107c478bd9Sstevel@tonic-gate EXTERN int interactive; /* interactively prompt on m* cmds */ 1117c478bd9Sstevel@tonic-gate EXTERN int debug; /* debugging level */ 1127c478bd9Sstevel@tonic-gate EXTERN int bell; /* ring bell on cmd completion */ 1137c478bd9Sstevel@tonic-gate EXTERN int doglob; /* glob local file names */ 1147c478bd9Sstevel@tonic-gate EXTERN int autologin; /* establish user account on connection */ 1157c478bd9Sstevel@tonic-gate EXTERN int proxy; /* proxy server connection active */ 1167c478bd9Sstevel@tonic-gate EXTERN int proxflag; /* proxy connection exists */ 1177c478bd9Sstevel@tonic-gate EXTERN int sunique; /* store files on server with unique name */ 1187c478bd9Sstevel@tonic-gate EXTERN int runique; /* store local files with unique name */ 1197c478bd9Sstevel@tonic-gate EXTERN int mcase; /* map upper to lower case for mget names */ 1207c478bd9Sstevel@tonic-gate EXTERN int ntflag; /* use ntin ntout tables for name translation */ 1217c478bd9Sstevel@tonic-gate EXTERN int mapflag; /* use mapin mapout templates on file names */ 1227c478bd9Sstevel@tonic-gate EXTERN int code; /* return/reply code for ftp command */ 1237c478bd9Sstevel@tonic-gate EXTERN int crflag; /* if 1, strip car. rets. on ascii gets */ 1247c478bd9Sstevel@tonic-gate EXTERN char pasv[64]; /* passive port for proxy data connection */ 1257c478bd9Sstevel@tonic-gate EXTERN char *altarg; /* argv[1] with no shell-like preprocessing */ 1267c478bd9Sstevel@tonic-gate EXTERN char ntin[17]; /* input translation table */ 1277c478bd9Sstevel@tonic-gate EXTERN char ntout[17]; /* output translation table */ 1287c478bd9Sstevel@tonic-gate EXTERN char mapin[MAXPATHLEN]; /* input map template */ 1297c478bd9Sstevel@tonic-gate EXTERN char mapout[MAXPATHLEN]; /* output map template */ 1307c478bd9Sstevel@tonic-gate EXTERN char typename[32]; /* name of file transfer type */ 1317c478bd9Sstevel@tonic-gate EXTERN int type; /* file transfer type */ 1327c478bd9Sstevel@tonic-gate EXTERN char structname[32]; /* name of file transfer structure */ 1337c478bd9Sstevel@tonic-gate EXTERN int stru; /* file transfer structure */ 1347c478bd9Sstevel@tonic-gate EXTERN char formname[32]; /* name of file transfer format */ 1357c478bd9Sstevel@tonic-gate EXTERN int form; /* file transfer format */ 1367c478bd9Sstevel@tonic-gate EXTERN char modename[32]; /* name of file transfer mode */ 1377c478bd9Sstevel@tonic-gate EXTERN int mode; /* file transfer mode */ 1387c478bd9Sstevel@tonic-gate EXTERN char bytename[32]; /* local byte size in ascii */ 1397c478bd9Sstevel@tonic-gate EXTERN int bytesize; /* local byte size in binary */ 1407c478bd9Sstevel@tonic-gate EXTERN int passivemode; /* passive transfer mode toggle */ 1417c478bd9Sstevel@tonic-gate EXTERN off_t restart_point; /* transfer restart offset */ 1427c478bd9Sstevel@tonic-gate EXTERN int tcpwindowsize; /* TCP window size for the data connection */ 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gate EXTERN boolean_t ls_invokes_NLST; /* behaviour of 'ls' */ 1457c478bd9Sstevel@tonic-gate EXTERN char *hostname; /* name of host connected to */ 1467c478bd9Sstevel@tonic-gate EXTERN char *home; 1477c478bd9Sstevel@tonic-gate EXTERN char *globerr; 1487c478bd9Sstevel@tonic-gate 1497c478bd9Sstevel@tonic-gate EXTERN struct sockaddr_in6 myctladdr; /* for channel bindings */ 1507c478bd9Sstevel@tonic-gate EXTERN struct sockaddr_in6 remctladdr; /* for channel bindings */ 1517c478bd9Sstevel@tonic-gate 1527c478bd9Sstevel@tonic-gate EXTERN int clevel; /* command channel protection level */ 1537c478bd9Sstevel@tonic-gate EXTERN int dlevel; /* data channel protection level */ 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate EXTERN int autoauth; /* do authentication on connect */ 1567c478bd9Sstevel@tonic-gate EXTERN int auth_type; /* authentication type */ 1577c478bd9Sstevel@tonic-gate EXTERN int auth_error; /* one error code for all auth types */ 1587c478bd9Sstevel@tonic-gate EXTERN int autoencrypt; /* do encryption on connect */ 1597c478bd9Sstevel@tonic-gate EXTERN int fflag; /* forward credentials */ 1607c478bd9Sstevel@tonic-gate EXTERN boolean_t goteof; 1617c478bd9Sstevel@tonic-gate 162*0b6880ccSsp149894 EXTERN int skipsyst; /* enable automatic sending of SYST command */ 163*0b6880ccSsp149894 1647c478bd9Sstevel@tonic-gate EXTERN uchar_t *ucbuf; /* clear text buffer */ 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate #define MECH_SZ 40 1677c478bd9Sstevel@tonic-gate #define FTP_DEF_MECH "kerberos_v5" 1687c478bd9Sstevel@tonic-gate EXTERN char mechstr[MECH_SZ]; /* mechanism type */ 1697c478bd9Sstevel@tonic-gate 1707c478bd9Sstevel@tonic-gate EXTERN gss_OID mechoid; /* corresponding mechanism oid type */ 1717c478bd9Sstevel@tonic-gate EXTERN gss_ctx_id_t gcontext; /* gss security context */ 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gate #define FTPBUFSIZ BUFSIZ*16 1747c478bd9Sstevel@tonic-gate #define HASHSIZ BUFSIZ*8 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate EXTERN char *buf; /* buffer for binary sends and gets */ 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate EXTERN jmp_buf toplevel; /* non-local goto stuff for cmd scanner */ 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate /* 1817c478bd9Sstevel@tonic-gate * BUFSIZE includes 1827c478bd9Sstevel@tonic-gate * - (MAXPATHLEN)*2 to accomodate 2 paths (remote and local file names). 1837c478bd9Sstevel@tonic-gate * - MAXCMDLEN to accomodate the longest command listed in cmdtab[] 1847c478bd9Sstevel@tonic-gate * (defined in cmdtab.c) as this is stuffed into the buffer along 1857c478bd9Sstevel@tonic-gate * with the remote and local file names. 1867c478bd9Sstevel@tonic-gate * - The 4 bytes are for the 2 blank separators, a carriage-return 1877c478bd9Sstevel@tonic-gate * and a NULL terminator. 1887c478bd9Sstevel@tonic-gate * 1897c478bd9Sstevel@tonic-gate * NOTE : The arguments may not be always pathnames (they can be commands 1907c478bd9Sstevel@tonic-gate * too). But, here we have considered the worst case of two pathnames. 1917c478bd9Sstevel@tonic-gate */ 1927c478bd9Sstevel@tonic-gate #define MAXCMDLEN 10 /* The length of longest command in cmdtab[] */ 1937c478bd9Sstevel@tonic-gate #define BUFSIZE ((MAXPATHLEN)*2+MAXCMDLEN+4) 1947c478bd9Sstevel@tonic-gate 1957c478bd9Sstevel@tonic-gate EXTERN char line[BUFSIZE]; /* input line buffer */ 1967c478bd9Sstevel@tonic-gate EXTERN char *stringbase; /* current scan point in line buffer */ 1977c478bd9Sstevel@tonic-gate EXTERN char argbuf[BUFSIZE]; /* argument storage buffer */ 1987c478bd9Sstevel@tonic-gate EXTERN char *argbase; /* current storage point in arg buffer */ 1997c478bd9Sstevel@tonic-gate EXTERN int margc; /* count of arguments on input line */ 2007c478bd9Sstevel@tonic-gate EXTERN char **margv; /* args parsed from input line */ 2017c478bd9Sstevel@tonic-gate EXTERN int cpend; /* flag: if != 0, then pending server reply */ 2027c478bd9Sstevel@tonic-gate EXTERN int mflag; /* flag: if != 0, then active multi command */ 2037c478bd9Sstevel@tonic-gate EXTERN FILE *tmp_nlst; /* tmp file; holds NLST results for mget, etc */ 2047c478bd9Sstevel@tonic-gate 2057c478bd9Sstevel@tonic-gate EXTERN char *reply_parse; /* for parsing replies to the ADAT command */ 2067c478bd9Sstevel@tonic-gate EXTERN char reply_buf[FTPBUFSIZ]; 2077c478bd9Sstevel@tonic-gate EXTERN char *reply_ptr; 2087c478bd9Sstevel@tonic-gate 2097c478bd9Sstevel@tonic-gate EXTERN int options; /* used during socket creation */ 2107c478bd9Sstevel@tonic-gate 2117c478bd9Sstevel@tonic-gate EXTERN int timeout; /* connection timeout */ 2127c478bd9Sstevel@tonic-gate EXTERN int timeoutms; /* connection timeout in msec */ 2137c478bd9Sstevel@tonic-gate EXTERN jmp_buf timeralarm; /* to recover from global timeout */ 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate /* 2177c478bd9Sstevel@tonic-gate * Format of command table. 2187c478bd9Sstevel@tonic-gate */ 2197c478bd9Sstevel@tonic-gate struct cmd { 2207c478bd9Sstevel@tonic-gate char *c_name; /* name of command */ 2217c478bd9Sstevel@tonic-gate char *c_help; /* help string */ 2227c478bd9Sstevel@tonic-gate char c_bell; /* give bell when command completes */ 2237c478bd9Sstevel@tonic-gate char c_conn; /* must be connected to use command */ 2247c478bd9Sstevel@tonic-gate char c_proxy; /* proxy server may execute */ 2257c478bd9Sstevel@tonic-gate void (*c_handler)(int argc, char *argv[]); /* function to call */ 2267c478bd9Sstevel@tonic-gate }; 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate struct macel { 2297c478bd9Sstevel@tonic-gate char mac_name[9]; /* macro name */ 2307c478bd9Sstevel@tonic-gate char *mac_start; /* start of macro in macbuf */ 2317c478bd9Sstevel@tonic-gate char *mac_end; /* end of macro in macbuf */ 2327c478bd9Sstevel@tonic-gate }; 2337c478bd9Sstevel@tonic-gate 2347c478bd9Sstevel@tonic-gate EXTERN int macnum; /* number of defined macros */ 2357c478bd9Sstevel@tonic-gate EXTERN struct macel macros[16]; 2367c478bd9Sstevel@tonic-gate EXTERN char macbuf[4096]; 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate extern void macdef(int argc, char *argv[]); 2397c478bd9Sstevel@tonic-gate extern void doproxy(int argc, char *argv[]); 2407c478bd9Sstevel@tonic-gate extern void setpeer(int argc, char *argv[]); 2417c478bd9Sstevel@tonic-gate extern void rmthelp(int argc, char *argv[]); 2427c478bd9Sstevel@tonic-gate extern void settype(int argc, char *argv[]); 2437c478bd9Sstevel@tonic-gate extern void setbinary(int argc, char *argv[]); 2447c478bd9Sstevel@tonic-gate extern void setascii(int argc, char *argv[]); 2457c478bd9Sstevel@tonic-gate extern void settenex(int argc, char *argv[]); 2467c478bd9Sstevel@tonic-gate extern void setebcdic(int argc, char *argv[]); 2477c478bd9Sstevel@tonic-gate extern void setmode(int argc, char *argv[]); 2487c478bd9Sstevel@tonic-gate extern void setform(int argc, char *argv[]); 2497c478bd9Sstevel@tonic-gate extern void setstruct(int argc, char *argv[]); 2507c478bd9Sstevel@tonic-gate extern void put(int argc, char *argv[]); 2517c478bd9Sstevel@tonic-gate extern void mput(int argc, char *argv[]); 2527c478bd9Sstevel@tonic-gate extern void get(int argc, char *argv[]); 2537c478bd9Sstevel@tonic-gate extern void mget(int argc, char *argv[]); 2547c478bd9Sstevel@tonic-gate extern void status(int argc, char *argv[]); 2557c478bd9Sstevel@tonic-gate extern void setbell(int argc, char *argv[]); 2567c478bd9Sstevel@tonic-gate extern void settrace(int argc, char *argv[]); 2577c478bd9Sstevel@tonic-gate extern void sethash(int argc, char *argv[]); 2587c478bd9Sstevel@tonic-gate extern void setverbose(int argc, char *argv[]); 2597c478bd9Sstevel@tonic-gate extern void setport(int argc, char *argv[]); 2607c478bd9Sstevel@tonic-gate extern void setprompt(int argc, char *argv[]); 2617c478bd9Sstevel@tonic-gate extern void setglob(int argc, char *argv[]); 2627c478bd9Sstevel@tonic-gate extern void setdebug(int argc, char *argv[]); 2637c478bd9Sstevel@tonic-gate extern void cd(int argc, char *argv[]); 2647c478bd9Sstevel@tonic-gate extern void lcd(int argc, char *argv[]); 2657c478bd9Sstevel@tonic-gate extern void delete(int argc, char *argv[]); 2667c478bd9Sstevel@tonic-gate extern void mdelete(int argc, char *argv[]); 2677c478bd9Sstevel@tonic-gate extern void renamefile(int argc, char *argv[]); 2687c478bd9Sstevel@tonic-gate extern void ls(int argc, char *argv[]); 2697c478bd9Sstevel@tonic-gate extern void mls(int argc, char *argv[]); 2707c478bd9Sstevel@tonic-gate extern void shell(int argc, char *argv[]); 2717c478bd9Sstevel@tonic-gate extern void user(int argc, char *argv[]); 2727c478bd9Sstevel@tonic-gate extern void pwd(int argc, char *argv[]); 2737c478bd9Sstevel@tonic-gate extern void makedir(int argc, char *argv[]); 2747c478bd9Sstevel@tonic-gate extern void removedir(int argc, char *argv[]); 2757c478bd9Sstevel@tonic-gate extern void quote(int argc, char *argv[]); 2767c478bd9Sstevel@tonic-gate extern void rmthelp(int argc, char *argv[]); 2777c478bd9Sstevel@tonic-gate extern void quit(int argc, char *argv[]); 2787c478bd9Sstevel@tonic-gate extern void disconnect(int argc, char *argv[]); 2797c478bd9Sstevel@tonic-gate extern void account(int argc, char *argv[]); 2807c478bd9Sstevel@tonic-gate extern void setcase(int argc, char *argv[]); 2817c478bd9Sstevel@tonic-gate extern void setcr(int argc, char *argv[]); 2827c478bd9Sstevel@tonic-gate extern void setntrans(int argc, char *argv[]); 2837c478bd9Sstevel@tonic-gate extern void setnmap(int argc, char *argv[]); 2847c478bd9Sstevel@tonic-gate extern void setsunique(int argc, char *argv[]); 2857c478bd9Sstevel@tonic-gate extern void setrunique(int argc, char *argv[]); 2867c478bd9Sstevel@tonic-gate extern void cdup(int argc, char *argv[]); 2877c478bd9Sstevel@tonic-gate extern void domacro(int argc, char *argv[]); 2887c478bd9Sstevel@tonic-gate extern void help(int argc, char *argv[]); 2897c478bd9Sstevel@tonic-gate extern void reset(int argc, char *argv[]); 2907c478bd9Sstevel@tonic-gate extern void reget(int argc, char *argv[]); 2917c478bd9Sstevel@tonic-gate extern void restart(int argc, char *argv[]); 2927c478bd9Sstevel@tonic-gate extern void setpassive(int argc, char *argv[]); 2937c478bd9Sstevel@tonic-gate extern void settcpwindow(int argc, char *argv[]); 2947c478bd9Sstevel@tonic-gate extern void site(int argc, char *argv[]); 2957c478bd9Sstevel@tonic-gate 2967c478bd9Sstevel@tonic-gate extern void ccc(int argc, char *argv[]); 2977c478bd9Sstevel@tonic-gate extern void setclear(int argc, char *argv[]); 2987c478bd9Sstevel@tonic-gate extern void setclevel(int argc, char *argv[]); 2997c478bd9Sstevel@tonic-gate extern void setdlevel(int argc, char *argv[]); 3007c478bd9Sstevel@tonic-gate extern void setsafe(int argc, char *argv[]); 3017c478bd9Sstevel@tonic-gate extern void setmech(int argc, char *argv[]); 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate extern int do_auth(void); 3047c478bd9Sstevel@tonic-gate extern void setpbsz(uint_t size); 3057c478bd9Sstevel@tonic-gate extern char *radix_error(int); 3067c478bd9Sstevel@tonic-gate extern int radix_encode(uchar_t *, uchar_t *, size_t, int *, int); 3077c478bd9Sstevel@tonic-gate extern void user_gss_error(OM_uint32 maj_stat, OM_uint32 min_stat, 3087c478bd9Sstevel@tonic-gate char *errstr); 3097c478bd9Sstevel@tonic-gate extern void setprivate(int argc, char *argv[]); 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate extern int secure_flush(int); 3127c478bd9Sstevel@tonic-gate extern int secure_getc(FILE *); 3137c478bd9Sstevel@tonic-gate extern int secure_putc(int, FILE *); 3147c478bd9Sstevel@tonic-gate extern ssize_t secure_read(int, void *, size_t); 3157c478bd9Sstevel@tonic-gate extern ssize_t secure_write(int, const void *, size_t); 3167c478bd9Sstevel@tonic-gate 3177c478bd9Sstevel@tonic-gate extern void fatal(char *msg); 3187c478bd9Sstevel@tonic-gate extern int getreply(int expecteof); 3197c478bd9Sstevel@tonic-gate extern void call(void (*routine)(int argc, char *argv[]), ...); 3207c478bd9Sstevel@tonic-gate extern void sendrequest(char *cmd, char *local, char *remote, int allowpipe); 3217c478bd9Sstevel@tonic-gate extern void recvrequest(char *cmd, char *local, char *remote, char *mode, 3227c478bd9Sstevel@tonic-gate int allowpipe); 3237c478bd9Sstevel@tonic-gate extern void makeargv(void); 3247c478bd9Sstevel@tonic-gate extern int login(char *host); 3257c478bd9Sstevel@tonic-gate extern int command(char *fmt, ...); 3267c478bd9Sstevel@tonic-gate extern char **glob(char *v); 3277c478bd9Sstevel@tonic-gate extern void blkfree(char **); 3287c478bd9Sstevel@tonic-gate extern void pswitch(int flag); 3297c478bd9Sstevel@tonic-gate 3307c478bd9Sstevel@tonic-gate extern char *hookup(char *host, char *); 3317c478bd9Sstevel@tonic-gate extern char *mygetpass(char *prompt); 3327c478bd9Sstevel@tonic-gate extern void lostpeer(int sig); 3337c478bd9Sstevel@tonic-gate extern int ruserpass(char *host, char **aname, char **apass, char **aacct); 3347c478bd9Sstevel@tonic-gate extern FILE *mypopen(char *cmd, char *mode); 3357c478bd9Sstevel@tonic-gate extern int mypclose(FILE *ptr); 3367c478bd9Sstevel@tonic-gate extern struct cmd *getcmd(char *name); 3377c478bd9Sstevel@tonic-gate 3387c478bd9Sstevel@tonic-gate extern void stop_timer(void); 3397c478bd9Sstevel@tonic-gate extern void reset_timer(void); 3407c478bd9Sstevel@tonic-gate extern int getpagesize(void); 3417c478bd9Sstevel@tonic-gate 3427c478bd9Sstevel@tonic-gate #define ENCODELEN(l) (((4 * (l)) / 3) + 4) 3437c478bd9Sstevel@tonic-gate #define DECODELEN(l) (((3 * (l)) / 4) + 4) 3447c478bd9Sstevel@tonic-gate 3457c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3467c478bd9Sstevel@tonic-gate } 3477c478bd9Sstevel@tonic-gate #endif 3487c478bd9Sstevel@tonic-gate 3497c478bd9Sstevel@tonic-gate #endif /* _FTP_VAR_H */ 350