155682Smarkm#include "ftp_locl.h"
2233294SstasRCSID("$Id$");
355682Smarkm
455682Smarkm/*
555682Smarkm * Options and other state info.
655682Smarkm */
755682Smarkmint	trace;			/* trace packets exchanged */
855682Smarkmint	hash;			/* print # for each buffer transferred */
955682Smarkmint	sendport;		/* use PORT cmd for each data connection */
1055682Smarkmint	verbose;		/* print messages coming back from server */
1155682Smarkmint	connected;		/* connected to server */
1255682Smarkmint	fromatty;		/* input is from a terminal */
1355682Smarkmint	interactive;		/* interactively prompt on m* cmds */
1472445Sassarint	lineedit;		/* use line-editing */
1555682Smarkmint	debug;			/* debugging level */
1655682Smarkmint	bell;			/* ring bell on cmd completion */
1755682Smarkmint	doglob;			/* glob local file names */
18178825Sdfrint	doencrypt;		/* try to use encryption */
1955682Smarkmint	autologin;		/* establish user account on connection */
2055682Smarkmint	proxy;			/* proxy server connection active */
2155682Smarkmint	proxflag;		/* proxy connection exists */
2255682Smarkmint	sunique;		/* store files on server with unique name */
2355682Smarkmint	runique;		/* store local files with unique name */
2455682Smarkmint	mcase;			/* map upper to lower case for mget names */
2555682Smarkmint	ntflag;			/* use ntin ntout tables for name translation */
2655682Smarkmint	mapflag;		/* use mapin mapout templates on file names */
2755682Smarkmint	code;			/* return/reply code for ftp command */
2855682Smarkmint	crflag;			/* if 1, strip car. rets. on ascii gets */
2955682Smarkmchar	pasv[64];		/* passive port for proxy data connection */
3055682Smarkmint	passivemode;		/* passive mode enabled */
3155682Smarkmchar	*altarg;		/* argv[1] with no shell-like preprocessing  */
3255682Smarkmchar	ntin[17];		/* input translation table */
3355682Smarkmchar	ntout[17];		/* output translation table */
3455682Smarkmchar	mapin[MaxPathLen];	/* input map template */
3555682Smarkmchar	mapout[MaxPathLen];	/* output map template */
3655682Smarkmchar	typename[32];		/* name of file transfer type */
3755682Smarkmint	type;			/* requested file transfer type */
3855682Smarkmint	curtype;		/* current file transfer type */
3955682Smarkmchar	structname[32];		/* name of file transfer structure */
4055682Smarkmint	stru;			/* file transfer structure */
4155682Smarkmchar	formname[32];		/* name of file transfer format */
4255682Smarkmint	form;			/* file transfer format */
4355682Smarkmchar	modename[32];		/* name of file transfer mode */
4455682Smarkmint	mode;			/* file transfer mode */
4555682Smarkmchar	bytename[32];		/* local byte size in ascii */
4655682Smarkmint	bytesize;		/* local byte size in binary */
4755682Smarkm
4855682Smarkmchar	*hostname;		/* name of host connected to */
4955682Smarkmint	unix_server;		/* server is unix, can use binary for ascii */
5055682Smarkmint	unix_proxy;		/* proxy is unix, can use binary for ascii */
5155682Smarkm
5255682Smarkmjmp_buf	toplevel;		/* non-local goto stuff for cmd scanner */
5355682Smarkm
5455682Smarkmchar	line[200];		/* input line buffer */
5555682Smarkmchar	*stringbase;		/* current scan point in line buffer */
5655682Smarkmchar	argbuf[200];		/* argument storage buffer */
5755682Smarkmchar	*argbase;		/* current storage point in arg buffer */
5855682Smarkmint	margc;			/* count of arguments on input line */
5955682Smarkmchar	**margv;		/* args parsed from input line */
6055682Smarkmint	margvlen;		/* how large margv is currently */
6155682Smarkmint     cpend;                  /* flag: if != 0, then pending server reply */
6255682Smarkmint	mflag;			/* flag: if != 0, then active multi command */
6355682Smarkm
6455682Smarkmint	options;		/* used during socket creation */
6572445Sassarint     use_kerberos;           /* use Kerberos authentication */
6655682Smarkm
6755682Smarkm/*
6855682Smarkm * Format of command table.
6955682Smarkm */
7055682Smarkm
7155682Smarkmint macnum;			/* number of defined macros */
7255682Smarkmstruct macel macros[16];
7355682Smarkmchar macbuf[4096];
7455682Smarkm
7555682Smarkmchar username[32];
7655682Smarkm
77233294Sstas/* these are set in ruserpassword */
7855682Smarkmchar myhostname[MaxHostNameLen];
7955682Smarkmchar *mydomain;
80