Home | History | Annotate | Line # | Download | only in ftpd
extern.h revision 1.19
      1  1.19    itojun /*	$NetBSD: extern.h,v 1.19 1999/07/02 05:52:14 itojun Exp $	*/
      2  1.19    itojun 
      3  1.19    itojun /*
      4  1.19    itojun  * Copyright (C) 1997 and 1998 WIDE Project.
      5  1.19    itojun  * All rights reserved.
      6  1.19    itojun  *
      7  1.19    itojun  * Redistribution and use in source and binary forms, with or without
      8  1.19    itojun  * modification, are permitted provided that the following conditions
      9  1.19    itojun  * are met:
     10  1.19    itojun  * 1. Redistributions of source code must retain the above copyright
     11  1.19    itojun  *    notice, this list of conditions and the following disclaimer.
     12  1.19    itojun  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.19    itojun  *    notice, this list of conditions and the following disclaimer in the
     14  1.19    itojun  *    documentation and/or other materials provided with the distribution.
     15  1.19    itojun  * 3. Neither the name of the project nor the names of its contributors
     16  1.19    itojun  *    may be used to endorse or promote products derived from this software
     17  1.19    itojun  *    without specific prior written permission.
     18  1.19    itojun  *
     19  1.19    itojun  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     20  1.19    itojun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21  1.19    itojun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22  1.19    itojun  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     23  1.19    itojun  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24  1.19    itojun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25  1.19    itojun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  1.19    itojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  1.19    itojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  1.19    itojun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  1.19    itojun  * SUCH DAMAGE.
     30  1.19    itojun  */
     31   1.2       cgd 
     32   1.1   deraadt /*-
     33   1.1   deraadt  * Copyright (c) 1992, 1993
     34   1.1   deraadt  *	The Regents of the University of California.  All rights reserved.
     35   1.1   deraadt  *
     36   1.1   deraadt  * Redistribution and use in source and binary forms, with or without
     37   1.1   deraadt  * modification, are permitted provided that the following conditions
     38   1.1   deraadt  * are met:
     39   1.1   deraadt  * 1. Redistributions of source code must retain the above copyright
     40   1.1   deraadt  *    notice, this list of conditions and the following disclaimer.
     41   1.1   deraadt  * 2. Redistributions in binary form must reproduce the above copyright
     42   1.1   deraadt  *    notice, this list of conditions and the following disclaimer in the
     43   1.1   deraadt  *    documentation and/or other materials provided with the distribution.
     44   1.1   deraadt  * 3. All advertising materials mentioning features or use of this software
     45   1.1   deraadt  *    must display the following acknowledgement:
     46   1.1   deraadt  *	This product includes software developed by the University of
     47   1.1   deraadt  *	California, Berkeley and its contributors.
     48   1.1   deraadt  * 4. Neither the name of the University nor the names of its contributors
     49   1.1   deraadt  *    may be used to endorse or promote products derived from this software
     50   1.1   deraadt  *    without specific prior written permission.
     51   1.1   deraadt  *
     52   1.1   deraadt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     53   1.1   deraadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     54   1.1   deraadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     55   1.1   deraadt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     56   1.1   deraadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     57   1.1   deraadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     58   1.1   deraadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     59   1.1   deraadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     60   1.1   deraadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     61   1.1   deraadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     62   1.1   deraadt  * SUCH DAMAGE.
     63   1.1   deraadt  *
     64   1.2       cgd  *	@(#)extern.h	8.2 (Berkeley) 4/4/94
     65   1.1   deraadt  */
     66   1.1   deraadt 
     67   1.1   deraadt void	blkfree __P((char **));
     68   1.5     lukem char   *conffilename __P((const char *));
     69   1.1   deraadt char  **copyblk __P((char **));
     70  1.10   mycroft void	cwd __P((const char *));
     71  1.16     lukem void	delete __P((const char *));
     72   1.3     lukem char   *do_conversion __P((const char *));
     73   1.1   deraadt void	dologout __P((int));
     74  1.16     lukem void	fatal __P((const char *));
     75   1.1   deraadt int	ftpd_pclose __P((FILE *));
     76   1.3     lukem FILE   *ftpd_popen __P((char *, char *, int));
     77   1.1   deraadt char   *getline __P((char *, int, FILE *));
     78  1.16     lukem void	logcmd __P((const char *, off_t, const char *, const char *,
     79  1.16     lukem 	    const struct timeval *, const char *));
     80   1.9   mycroft void	logwtmp __P((const char *, const char *, const char *));
     81   1.1   deraadt void	lreply __P((int, const char *, ...));
     82  1.16     lukem void	makedir __P((const char *));
     83   1.4  christos void	parse_conf __P((char *));
     84  1.16     lukem void	pass __P((const char *));
     85   1.1   deraadt void	passive __P((void));
     86  1.19    itojun void	long_passive __P((char *, int));
     87  1.10   mycroft void	perror_reply __P((int, const char *));
     88   1.1   deraadt void	pwd __P((void));
     89  1.16     lukem void	removedir __P((const char *));
     90  1.16     lukem void	renamecmd __P((const char *, const char *));
     91   1.1   deraadt char   *renamefrom __P((char *));
     92   1.1   deraadt void	reply __P((int, const char *, ...));
     93  1.16     lukem void	retrieve __P((const char *, const char *));
     94  1.16     lukem void	send_file_list __P((const char *));
     95   1.3     lukem void	show_chdir_messages __P((int));
     96   1.1   deraadt void	statcmd __P((void));
     97  1.16     lukem void	statfilecmd __P((const char *));
     98  1.16     lukem void	store __P((const char *, const char *, int));
     99  1.16     lukem void	user __P((const char *));
    100  1.12     lukem char   *xstrdup __P((const char *));
    101   1.1   deraadt void	yyerror __P((char *));
    102  1.18      ross 
    103  1.18      ross typedef long long qdfmt_t;
    104  1.18      ross typedef unsigned long long qufmt_t;
    105   1.3     lukem 
    106   1.3     lukem #define CLASS_CHROOT	"chroot"
    107   1.3     lukem #define CLASS_GUEST	"guest"
    108   1.3     lukem #define CLASS_REAL	"real"
    109   1.3     lukem 
    110   1.3     lukem struct ftpconv {
    111   1.3     lukem 	struct ftpconv	*next;
    112   1.4  christos 	char		*suffix;	/* Suffix of requested name */
    113   1.4  christos 	char		*types;		/* Valid file types */
    114   1.4  christos 	char		*disable;	/* File to disable conversions */
    115   1.4  christos 	char		*command;	/* Command to do the conversion */
    116   1.3     lukem };
    117   1.3     lukem 
    118   1.3     lukem struct ftpclass {
    119   1.7     lukem 	int		 checkportcmd;	/* Check PORT commands are valid */
    120   1.4  christos 	char		*classname;	/* Current class */
    121   1.3     lukem 	struct ftpconv 	*conversions;	/* List of conversions */
    122   1.4  christos 	char		*display;	/* Files to display upon chdir */
    123   1.3     lukem 	unsigned int	 maxtimeout;	/* Maximum permitted timeout */
    124   1.3     lukem 	int		 modify;	/* Allow dele, mkd, rmd, umask, chmod */
    125   1.4  christos 	char		*notify;	/* Files to notify about upon chdir */
    126   1.8        tv 	int		 passive;	/* Allow pasv */
    127   1.3     lukem 	unsigned int	 timeout;	/* Default timeout */
    128   1.3     lukem 	mode_t		 umask;		/* Umask to use */
    129   1.3     lukem };
    130  1.11     lukem 
    131  1.19    itojun #include <netinet/in.h>
    132  1.19    itojun 
    133  1.19    itojun union sockunion {
    134  1.19    itojun 	struct sockinet {
    135  1.19    itojun 		u_char si_len;
    136  1.19    itojun 		u_char si_family;
    137  1.19    itojun 		u_short si_port;
    138  1.19    itojun 	} su_si;
    139  1.19    itojun 	struct sockaddr_in  su_sin;
    140  1.19    itojun 	struct sockaddr_in6 su_sin6;
    141  1.19    itojun };
    142  1.19    itojun #define su_len		su_si.si_len
    143  1.19    itojun #define su_family	su_si.si_family
    144  1.19    itojun #define su_port		su_si.si_port
    145  1.19    itojun 
    146  1.11     lukem extern  int yyparse __P((void));
    147  1.11     lukem 
    148  1.11     lukem extern	char		cbuf[];
    149  1.11     lukem extern	struct ftpclass	curclass;
    150  1.19    itojun extern	union sockunion data_dest;
    151  1.11     lukem extern	int		debug;
    152  1.11     lukem extern	int		form;
    153  1.11     lukem extern	int		guest;
    154  1.11     lukem extern	int		hasyyerrored;
    155  1.19    itojun extern	union sockunion his_addr;
    156  1.11     lukem extern	char		hostname[];
    157  1.11     lukem #ifdef KERBEROS5
    158  1.11     lukem extern	krb5_context	kcontext;
    159  1.11     lukem #endif
    160  1.11     lukem extern	int		logged_in;
    161  1.11     lukem extern	int		logging;
    162  1.11     lukem extern	int		pdata;
    163  1.11     lukem extern	char		proctitle[];
    164  1.11     lukem extern	struct passwd  *pw;
    165  1.11     lukem extern	char		remotehost[];
    166  1.11     lukem extern	off_t		restart_point;
    167  1.11     lukem extern	char		tmpline[];
    168  1.14    kleink extern	sig_atomic_t	transflag;
    169  1.11     lukem extern	int		type;
    170  1.11     lukem extern	int		usedefault;
    171  1.11     lukem extern	const char	version[];
    172  1.16     lukem 
    173  1.16     lukem extern	off_t		total_data_in, total_data_out, total_data;
    174  1.16     lukem extern	off_t		total_files_in, total_files_out, total_files;
    175  1.16     lukem extern	off_t		total_bytes_in, total_bytes_out, total_bytes;
    176  1.16     lukem extern	off_t		total_xfers_in, total_xfers_out, total_xfers;
    177  1.16     lukem 
    178  1.16     lukem 
    179  1.16     lukem #define PLURAL(s)	((s) == 1 ? "" : "s")
    180  1.17     lukem #define	INTERNAL_LS	"/bin/ls"
    181