Home | History | Annotate | Line # | Download | only in ftp
ftp_var.h revision 1.5.2.2
      1  1.5.2.2  mycroft /*
      2  1.5.2.2  mycroft  * Copyright (c) 1985, 1989, 1993, 1994
      3  1.5.2.2  mycroft  *	The Regents of the University of California.  All rights reserved.
      4  1.5.2.2  mycroft  *
      5  1.5.2.2  mycroft  * Redistribution and use in source and binary forms, with or without
      6  1.5.2.2  mycroft  * modification, are permitted provided that the following conditions
      7  1.5.2.2  mycroft  * are met:
      8  1.5.2.2  mycroft  * 1. Redistributions of source code must retain the above copyright
      9  1.5.2.2  mycroft  *    notice, this list of conditions and the following disclaimer.
     10  1.5.2.2  mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     11  1.5.2.2  mycroft  *    notice, this list of conditions and the following disclaimer in the
     12  1.5.2.2  mycroft  *    documentation and/or other materials provided with the distribution.
     13  1.5.2.2  mycroft  * 3. All advertising materials mentioning features or use of this software
     14  1.5.2.2  mycroft  *    must display the following acknowledgement:
     15  1.5.2.2  mycroft  *	This product includes software developed by the University of
     16  1.5.2.2  mycroft  *	California, Berkeley and its contributors.
     17  1.5.2.2  mycroft  * 4. Neither the name of the University nor the names of its contributors
     18  1.5.2.2  mycroft  *    may be used to endorse or promote products derived from this software
     19  1.5.2.2  mycroft  *    without specific prior written permission.
     20  1.5.2.2  mycroft  *
     21  1.5.2.2  mycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22  1.5.2.2  mycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23  1.5.2.2  mycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24  1.5.2.2  mycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25  1.5.2.2  mycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26  1.5.2.2  mycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27  1.5.2.2  mycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28  1.5.2.2  mycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29  1.5.2.2  mycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30  1.5.2.2  mycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31  1.5.2.2  mycroft  * SUCH DAMAGE.
     32  1.5.2.2  mycroft  *
     33  1.5.2.2  mycroft  *	from: @(#)ftp_var.h	8.3 (Berkeley) 4/2/94
     34  1.5.2.2  mycroft  *	$Id: ftp_var.h,v 1.5.2.2 1994/08/29 03:09:18 mycroft Exp $
     35  1.5.2.2  mycroft  */
     36  1.5.2.2  mycroft 
     37  1.5.2.2  mycroft /*
     38  1.5.2.2  mycroft  * FTP global variables.
     39  1.5.2.2  mycroft  */
     40  1.5.2.2  mycroft 
     41  1.5.2.2  mycroft #include <sys/param.h>
     42  1.5.2.2  mycroft #include <setjmp.h>
     43  1.5.2.2  mycroft 
     44  1.5.2.2  mycroft #include "extern.h"
     45  1.5.2.2  mycroft 
     46  1.5.2.2  mycroft /*
     47  1.5.2.2  mycroft  * Options and other state info.
     48  1.5.2.2  mycroft  */
     49  1.5.2.2  mycroft int	trace;			/* trace packets exchanged */
     50  1.5.2.2  mycroft int	hash;			/* print # for each buffer transferred */
     51  1.5.2.2  mycroft int	sendport;		/* use PORT cmd for each data connection */
     52  1.5.2.2  mycroft int	verbose;		/* print messages coming back from server */
     53  1.5.2.2  mycroft int	connected;		/* connected to server */
     54  1.5.2.2  mycroft int	fromatty;		/* input is from a terminal */
     55  1.5.2.2  mycroft int	interactive;		/* interactively prompt on m* cmds */
     56  1.5.2.2  mycroft int	debug;			/* debugging level */
     57  1.5.2.2  mycroft int	bell;			/* ring bell on cmd completion */
     58  1.5.2.2  mycroft int	doglob;			/* glob local file names */
     59  1.5.2.2  mycroft int	autologin;		/* establish user account on connection */
     60  1.5.2.2  mycroft int	proxy;			/* proxy server connection active */
     61  1.5.2.2  mycroft int	proxflag;		/* proxy connection exists */
     62  1.5.2.2  mycroft int	sunique;		/* store files on server with unique name */
     63  1.5.2.2  mycroft int	runique;		/* store local files with unique name */
     64  1.5.2.2  mycroft int	mcase;			/* map upper to lower case for mget names */
     65  1.5.2.2  mycroft int	ntflag;			/* use ntin ntout tables for name translation */
     66  1.5.2.2  mycroft int	mapflag;		/* use mapin mapout templates on file names */
     67  1.5.2.2  mycroft int	code;			/* return/reply code for ftp command */
     68  1.5.2.2  mycroft int	crflag;			/* if 1, strip car. rets. on ascii gets */
     69  1.5.2.2  mycroft char	pasv[64];		/* passive port for proxy data connection */
     70  1.5.2.2  mycroft int	passivemode;		/* passive mode enabled */
     71  1.5.2.2  mycroft char	*altarg;		/* argv[1] with no shell-like preprocessing  */
     72  1.5.2.2  mycroft char	ntin[17];		/* input translation table */
     73  1.5.2.2  mycroft char	ntout[17];		/* output translation table */
     74  1.5.2.2  mycroft char	mapin[MAXPATHLEN];	/* input map template */
     75  1.5.2.2  mycroft char	mapout[MAXPATHLEN];	/* output map template */
     76  1.5.2.2  mycroft char	typename[32];		/* name of file transfer type */
     77  1.5.2.2  mycroft int	type;			/* requested file transfer type */
     78  1.5.2.2  mycroft int	curtype;		/* current file transfer type */
     79  1.5.2.2  mycroft char	structname[32];		/* name of file transfer structure */
     80  1.5.2.2  mycroft int	stru;			/* file transfer structure */
     81  1.5.2.2  mycroft char	formname[32];		/* name of file transfer format */
     82  1.5.2.2  mycroft int	form;			/* file transfer format */
     83  1.5.2.2  mycroft char	modename[32];		/* name of file transfer mode */
     84  1.5.2.2  mycroft int	mode;			/* file transfer mode */
     85  1.5.2.2  mycroft char	bytename[32];		/* local byte size in ascii */
     86  1.5.2.2  mycroft int	bytesize;		/* local byte size in binary */
     87  1.5.2.2  mycroft 
     88  1.5.2.2  mycroft char	*hostname;		/* name of host connected to */
     89  1.5.2.2  mycroft int	unix_server;		/* server is unix, can use binary for ascii */
     90  1.5.2.2  mycroft int	unix_proxy;		/* proxy is unix, can use binary for ascii */
     91  1.5.2.2  mycroft 
     92  1.5.2.2  mycroft struct	servent *sp;		/* service spec for tcp/ftp */
     93  1.5.2.2  mycroft 
     94  1.5.2.2  mycroft jmp_buf	toplevel;		/* non-local goto stuff for cmd scanner */
     95  1.5.2.2  mycroft 
     96  1.5.2.2  mycroft char	line[200];		/* input line buffer */
     97  1.5.2.2  mycroft char	*stringbase;		/* current scan point in line buffer */
     98  1.5.2.2  mycroft char	argbuf[200];		/* argument storage buffer */
     99  1.5.2.2  mycroft char	*argbase;		/* current storage point in arg buffer */
    100  1.5.2.2  mycroft int	margc;			/* count of arguments on input line */
    101  1.5.2.2  mycroft char	*margv[20];		/* args parsed from input line */
    102  1.5.2.2  mycroft int     cpend;                  /* flag: if != 0, then pending server reply */
    103  1.5.2.2  mycroft int	mflag;			/* flag: if != 0, then active multi command */
    104  1.5.2.2  mycroft 
    105  1.5.2.2  mycroft int	options;		/* used during socket creation */
    106  1.5.2.2  mycroft 
    107  1.5.2.2  mycroft /*
    108  1.5.2.2  mycroft  * Format of command table.
    109  1.5.2.2  mycroft  */
    110  1.5.2.2  mycroft struct cmd {
    111  1.5.2.2  mycroft 	char	*c_name;	/* name of command */
    112  1.5.2.2  mycroft 	char	*c_help;	/* help string */
    113  1.5.2.2  mycroft 	char	c_bell;		/* give bell when command completes */
    114  1.5.2.2  mycroft 	char	c_conn;		/* must be connected to use command */
    115  1.5.2.2  mycroft 	char	c_proxy;	/* proxy server may execute */
    116  1.5.2.2  mycroft 	void	(*c_handler) __P((int, char **)); /* function to call */
    117  1.5.2.2  mycroft };
    118  1.5.2.2  mycroft 
    119  1.5.2.2  mycroft struct macel {
    120  1.5.2.2  mycroft 	char mac_name[9];	/* macro name */
    121  1.5.2.2  mycroft 	char *mac_start;	/* start of macro in macbuf */
    122  1.5.2.2  mycroft 	char *mac_end;		/* end of macro in macbuf */
    123  1.5.2.2  mycroft };
    124  1.5.2.2  mycroft 
    125  1.5.2.2  mycroft int macnum;			/* number of defined macros */
    126  1.5.2.2  mycroft struct macel macros[16];
    127  1.5.2.2  mycroft char macbuf[4096];
    128