Home | History | Annotate | Line # | Download | only in ftpd
extern.h revision 1.28.2.2
      1  1.28.2.2     lukem /*	$NetBSD: extern.h,v 1.28.2.2 2001/03/29 14:14:17 lukem Exp $	*/
      2      1.19    itojun 
      3      1.21     lukem /*-
      4      1.21     lukem  * Copyright (c) 1992, 1993
      5      1.21     lukem  *	The Regents of the University of California.  All rights reserved.
      6      1.21     lukem  *
      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.21     lukem  * 3. All advertising materials mentioning features or use of this software
     16      1.21     lukem  *    must display the following acknowledgement:
     17      1.21     lukem  *	This product includes software developed by the University of
     18      1.21     lukem  *	California, Berkeley and its contributors.
     19      1.21     lukem  * 4. Neither the name of the University nor the names of its contributors
     20      1.19    itojun  *    may be used to endorse or promote products derived from this software
     21      1.19    itojun  *    without specific prior written permission.
     22      1.21     lukem  *
     23      1.21     lukem  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24      1.19    itojun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25      1.19    itojun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26      1.21     lukem  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27      1.19    itojun  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28      1.19    itojun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29      1.19    itojun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30      1.19    itojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31      1.19    itojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32      1.19    itojun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33      1.19    itojun  * SUCH DAMAGE.
     34      1.21     lukem  *
     35      1.21     lukem  *	@(#)extern.h	8.2 (Berkeley) 4/4/94
     36      1.19    itojun  */
     37       1.2       cgd 
     38       1.1   deraadt /*-
     39      1.22     lukem  * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
     40      1.21     lukem  * All rights reserved.
     41      1.21     lukem  *
     42      1.21     lukem  * This code is derived from software contributed to The NetBSD Foundation
     43      1.21     lukem  * by Luke Mewburn.
     44       1.1   deraadt  *
     45       1.1   deraadt  * Redistribution and use in source and binary forms, with or without
     46       1.1   deraadt  * modification, are permitted provided that the following conditions
     47       1.1   deraadt  * are met:
     48       1.1   deraadt  * 1. Redistributions of source code must retain the above copyright
     49       1.1   deraadt  *    notice, this list of conditions and the following disclaimer.
     50       1.1   deraadt  * 2. Redistributions in binary form must reproduce the above copyright
     51       1.1   deraadt  *    notice, this list of conditions and the following disclaimer in the
     52       1.1   deraadt  *    documentation and/or other materials provided with the distribution.
     53       1.1   deraadt  * 3. All advertising materials mentioning features or use of this software
     54       1.1   deraadt  *    must display the following acknowledgement:
     55      1.21     lukem  *        This product includes software developed by the NetBSD
     56      1.21     lukem  *        Foundation, Inc. and its contributors.
     57      1.21     lukem  * 4. Neither the name of The NetBSD Foundation nor the names of its
     58      1.21     lukem  *    contributors may be used to endorse or promote products derived
     59      1.21     lukem  *    from this software without specific prior written permission.
     60      1.21     lukem  *
     61      1.21     lukem  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     62      1.21     lukem  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     63      1.21     lukem  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     64      1.21     lukem  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     65      1.21     lukem  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     66      1.21     lukem  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     67      1.21     lukem  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     68      1.21     lukem  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     69      1.21     lukem  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     70      1.21     lukem  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     71      1.21     lukem  * POSSIBILITY OF SUCH DAMAGE.
     72      1.21     lukem  */
     73      1.21     lukem 
     74      1.21     lukem /*
     75      1.21     lukem  * Copyright (C) 1997 and 1998 WIDE Project.
     76      1.21     lukem  * All rights reserved.
     77      1.21     lukem  *
     78      1.21     lukem  * Redistribution and use in source and binary forms, with or without
     79      1.21     lukem  * modification, are permitted provided that the following conditions
     80      1.21     lukem  * are met:
     81      1.21     lukem  * 1. Redistributions of source code must retain the above copyright
     82      1.21     lukem  *    notice, this list of conditions and the following disclaimer.
     83      1.21     lukem  * 2. Redistributions in binary form must reproduce the above copyright
     84      1.21     lukem  *    notice, this list of conditions and the following disclaimer in the
     85      1.21     lukem  *    documentation and/or other materials provided with the distribution.
     86      1.21     lukem  * 3. Neither the name of the project nor the names of its contributors
     87       1.1   deraadt  *    may be used to endorse or promote products derived from this software
     88       1.1   deraadt  *    without specific prior written permission.
     89      1.21     lukem  *
     90      1.21     lukem  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     91       1.1   deraadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     92       1.1   deraadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     93      1.21     lukem  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     94       1.1   deraadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     95       1.1   deraadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     96       1.1   deraadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     97       1.1   deraadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     98       1.1   deraadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     99       1.1   deraadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    100       1.1   deraadt  * SUCH DAMAGE.
    101       1.1   deraadt  */
    102       1.1   deraadt 
    103  1.28.2.2     lukem #ifdef NO_LONG_LONG
    104  1.28.2.2     lukem # define LLF		"%ld"
    105  1.28.2.2     lukem # define LLFP(x)	"%" x "ld"
    106  1.28.2.2     lukem # define LLT		long
    107  1.28.2.2     lukem # define ULLF		"%lu"
    108  1.28.2.2     lukem # define ULLFP(x)	"%" x "lu"
    109  1.28.2.2     lukem # define ULLT		unsigned long
    110  1.28.2.2     lukem # define STRTOLL(x,y,z)	strtol(x,y,z)
    111  1.28.2.2     lukem #else
    112  1.28.2.2     lukem # define LLF		"%lld"
    113  1.28.2.2     lukem # define LLFP(x)	"%" x "lld"
    114  1.28.2.2     lukem # define LLT		long long
    115  1.28.2.2     lukem # define ULLF		"%llu"
    116  1.28.2.2     lukem # define ULLFP(x)	"%" x "llu"
    117  1.28.2.2     lukem # define ULLT		unsigned long long
    118  1.28.2.2     lukem # define STRTOLL(x,y,z)	strtoll(x,y,z)
    119  1.28.2.2     lukem #endif
    120  1.28.2.2     lukem 
    121      1.26     lukem void	blkfree(char **);
    122      1.28     lukem void	closedataconn(FILE *);
    123      1.26     lukem char   *conffilename(const char *);
    124      1.26     lukem char  **copyblk(char **);
    125      1.26     lukem void	count_users(void);
    126  1.28.2.1     lukem void	cprintf(FILE *, const char *, ...)
    127  1.28.2.1     lukem 	    __attribute__((__format__(__printf__, 2, 3)));
    128      1.26     lukem void	cwd(const char *);
    129      1.27     lukem FILE   *dataconn(const char *, off_t, const char *);
    130      1.26     lukem void	delete(const char *);
    131  1.28.2.1     lukem int	display_file(const char *, int);
    132      1.26     lukem char  **do_conversion(const char *);
    133      1.26     lukem void	dologout(int);
    134      1.26     lukem void	fatal(const char *);
    135      1.27     lukem void	feat(void);
    136  1.28.2.1     lukem void	format_path(char *, const char *);
    137      1.26     lukem int	ftpd_pclose(FILE *);
    138      1.26     lukem FILE   *ftpd_popen(char *[], const char *, int);
    139      1.26     lukem char   *getline(char *, int, FILE *);
    140      1.26     lukem void	init_curclass(void);
    141  1.28.2.2     lukem void	logxfer(const char *, off_t, const char *, const char *,
    142      1.26     lukem 	    const struct timeval *, const char *);
    143  1.28.2.2     lukem #if 0
    144      1.26     lukem void	logwtmp(const char *, const char *, const char *);
    145  1.28.2.2     lukem #endif
    146      1.27     lukem struct tab *lookup(struct tab *, const char *);
    147      1.26     lukem void	makedir(const char *);
    148      1.27     lukem void	mlsd(const char *);
    149      1.27     lukem void	mlst(const char *);
    150      1.27     lukem void	opts(const char *);
    151      1.26     lukem void	parse_conf(const char *);
    152      1.26     lukem void	pass(const char *);
    153      1.26     lukem void	passive(void);
    154  1.28.2.2     lukem int	lpsvproto2af(int);
    155  1.28.2.2     lukem int	af2lpsvproto(int);
    156  1.28.2.2     lukem int	epsvproto2af(int);
    157  1.28.2.2     lukem int	af2epsvproto(int);
    158      1.26     lukem void	long_passive(char *, int);
    159  1.28.2.2     lukem int	extended_port(const char *);
    160  1.28.2.2     lukem void	epsv_protounsupp(const char *);
    161      1.26     lukem void	perror_reply(int, const char *);
    162      1.26     lukem void	pwd(void);
    163      1.26     lukem void	removedir(const char *);
    164      1.26     lukem void	renamecmd(const char *, const char *);
    165      1.26     lukem char   *renamefrom(const char *);
    166  1.28.2.1     lukem void	reply(int, const char *, ...)
    167  1.28.2.1     lukem 	    __attribute__((__format__(__printf__, 2, 3)));
    168      1.26     lukem void	retrieve(char *[], const char *);
    169      1.26     lukem void	send_file_list(const char *);
    170      1.26     lukem void	show_chdir_messages(int);
    171      1.27     lukem void	sizecmd(const char *);
    172      1.26     lukem void	statcmd(void);
    173      1.26     lukem void	statfilecmd(const char *);
    174      1.26     lukem void	store(const char *, const char *, int);
    175  1.28.2.2     lukem LLT	strsuftoll(const char *);
    176      1.26     lukem void	user(const char *);
    177      1.26     lukem char   *xstrdup(const char *);
    178      1.26     lukem void	yyerror(char *);
    179      1.18      ross 
    180  1.28.2.2     lukem #include <netinet/in.h>
    181       1.3     lukem 
    182  1.28.2.2     lukem #ifdef BSD4_4
    183  1.28.2.2     lukem # define HAVE_SETPROCTITLE	1
    184  1.28.2.2     lukem # define HAVE_SOCKADDR_SA_LEN	1
    185  1.28.2.2     lukem #endif
    186  1.28.2.2     lukem 
    187  1.28.2.2     lukem struct sockinet {
    188  1.28.2.2     lukem 	union sockunion {
    189  1.28.2.2     lukem 		struct sockaddr_in  su_sin;
    190  1.28.2.2     lukem #ifdef INET6
    191  1.28.2.2     lukem 		struct sockaddr_in6 su_sin6;
    192  1.28.2.2     lukem #endif
    193  1.28.2.2     lukem 	} si_su;
    194  1.28.2.2     lukem #if !HAVE_SOCKADDR_SA_LEN
    195  1.28.2.2     lukem 	int	si_len;
    196  1.28.2.2     lukem #endif
    197  1.28.2.2     lukem };
    198  1.28.2.2     lukem 
    199  1.28.2.2     lukem #if !HAVE_SOCKADDR_SA_LEN
    200  1.28.2.2     lukem # define su_len		si_len
    201  1.28.2.2     lukem #else
    202  1.28.2.2     lukem # define su_len		si_su.su_sin.sin_len
    203  1.28.2.2     lukem #endif
    204  1.28.2.2     lukem #define su_addr		si_su.su_sin.sin_addr
    205  1.28.2.2     lukem #define su_family	si_su.su_sin.sin_family
    206  1.28.2.2     lukem #define su_port		si_su.su_sin.sin_port
    207  1.28.2.2     lukem #ifdef INET6
    208  1.28.2.2     lukem # define su_6addr	si_su.su_sin6.sin6_addr
    209  1.28.2.2     lukem # define su_scope_id	si_su.su_sin6.sin6_scope_id
    210  1.28.2.2     lukem #endif
    211      1.27     lukem 
    212      1.27     lukem struct tab {
    213      1.27     lukem 	char	*name;
    214      1.27     lukem 	short	 token;
    215      1.27     lukem 	short	 state;
    216      1.27     lukem 	short	 flags;	/* 1 if command implemented, 2 if has options */
    217      1.27     lukem 	char	*help;
    218      1.27     lukem 	char	*options;
    219      1.27     lukem };
    220       1.3     lukem 
    221       1.3     lukem struct ftpconv {
    222       1.3     lukem 	struct ftpconv	*next;
    223       1.4  christos 	char		*suffix;	/* Suffix of requested name */
    224       1.4  christos 	char		*types;		/* Valid file types */
    225       1.4  christos 	char		*disable;	/* File to disable conversions */
    226       1.4  christos 	char		*command;	/* Command to do the conversion */
    227       1.3     lukem };
    228       1.3     lukem 
    229  1.28.2.2     lukem typedef enum {
    230  1.28.2.2     lukem 	CLASS_GUEST,
    231  1.28.2.2     lukem 	CLASS_CHROOT,
    232  1.28.2.2     lukem 	CLASS_REAL
    233  1.28.2.2     lukem } class_ft;
    234  1.28.2.2     lukem 
    235  1.28.2.2     lukem typedef enum {
    236  1.28.2.2     lukem 	FLAG_checkportcmd =	1<<0,	/* Check port commands */
    237  1.28.2.2     lukem 	FLAG_modify =		1<<1,	/* Allow CHMOD, DELE, MKD, RMD, RNFR,
    238  1.28.2.2     lukem 					   UMASK */
    239  1.28.2.2     lukem 	FLAG_passive =		1<<2,	/* Allow PASV mode */
    240  1.28.2.2     lukem 	FLAG_sanenames =	1<<3,	/* Restrict names of uploaded files */
    241  1.28.2.2     lukem 	FLAG_upload =		1<<4	/* As per modify, but also allow
    242  1.28.2.2     lukem 					   APPE, STOR, STOU */
    243  1.28.2.2     lukem } classflag_t;
    244  1.28.2.2     lukem 
    245  1.28.2.2     lukem #define CURCLASS_FLAGS_SET(x)	(curclass.flags |=  (FLAG_ ## x))
    246  1.28.2.2     lukem #define CURCLASS_FLAGS_CLR(x)	(curclass.flags &= ~(FLAG_ ## x))
    247  1.28.2.2     lukem #define CURCLASS_FLAGS_ISSET(x)	(curclass.flags &   (FLAG_ ## x))
    248  1.28.2.2     lukem 
    249       1.3     lukem struct ftpclass {
    250  1.28.2.2     lukem 	struct sockinet	 advertise;	/* PASV address to advertise as */
    251  1.28.2.1     lukem 	char		*chroot;	/* Directory to chroot(2) to at login */
    252       1.4  christos 	char		*classname;	/* Current class */
    253      1.20     lukem 	struct ftpconv	*conversions;	/* List of conversions */
    254  1.28.2.2     lukem 	char		*display;	/* File to display upon chdir */
    255  1.28.2.1     lukem 	char		*homedir;	/* Directory to chdir(2) to at login */
    256  1.28.2.2     lukem 	classflag_t	 flags;		/* Flags; see classflag_t above */
    257      1.22     lukem 	int	 	 limit;		/* Max connections (-1 = unlimited) */
    258      1.22     lukem 	char		*limitfile;	/* File to display if limit reached */
    259  1.28.2.2     lukem 	LLT		 maxfilesize;	/* Maximum file size of uploads */
    260  1.28.2.2     lukem 	LLT		 maxrateget;	/* Maximum get transfer rate throttle */
    261  1.28.2.2     lukem 	LLT		 maxrateput;	/* Maximum put transfer rate throttle */
    262       1.3     lukem 	unsigned int	 maxtimeout;	/* Maximum permitted timeout */
    263      1.21     lukem 	char		*motd;		/* MotD file to display after login */
    264       1.4  christos 	char		*notify;	/* Files to notify about upon chdir */
    265      1.23     lukem 	int		 portmin;	/* Minumum port for passive mode */
    266      1.23     lukem 	int		 portmax;	/* Maximum port for passive mode */
    267  1.28.2.2     lukem 	LLT		 rateget;	/* Get (RETR) transfer rate throttle */
    268  1.28.2.2     lukem 	LLT		 rateput;	/* Put (STOR) transfer rate throttle */
    269       1.3     lukem 	unsigned int	 timeout;	/* Default timeout */
    270      1.27     lukem 	class_ft	 type;		/* Class type */
    271       1.3     lukem 	mode_t		 umask;		/* Umask to use */
    272       1.3     lukem };
    273      1.11     lukem 
    274  1.28.2.2     lukem #ifndef YYEMPTY
    275      1.26     lukem extern  int		yyparse(void);
    276  1.28.2.2     lukem #endif
    277      1.11     lukem 
    278      1.23     lukem #ifndef	GLOBAL
    279      1.23     lukem #define	GLOBAL	extern
    280      1.23     lukem #endif
    281      1.23     lukem 
    282      1.25     lukem 
    283  1.28.2.2     lukem GLOBAL	struct sockinet ctrl_addr;
    284  1.28.2.2     lukem GLOBAL	struct sockinet	data_dest;
    285  1.28.2.2     lukem GLOBAL	struct sockinet	data_source;
    286  1.28.2.2     lukem GLOBAL	struct sockinet	his_addr;
    287  1.28.2.2     lukem GLOBAL	struct sockinet	pasv_addr;
    288      1.23     lukem GLOBAL	int		connections;
    289      1.23     lukem GLOBAL	struct ftpclass	curclass;
    290      1.23     lukem GLOBAL	int		debug;
    291      1.23     lukem GLOBAL	jmp_buf		errcatch;
    292  1.28.2.2     lukem GLOBAL	char		*emailaddr;
    293      1.23     lukem GLOBAL	int		form;
    294      1.28     lukem GLOBAL	int		gidcount;	/* number of entries in gidlist[] */
    295      1.28     lukem GLOBAL	gid_t		gidlist[NGROUPS_MAX];
    296      1.23     lukem GLOBAL	int		hasyyerrored;
    297      1.25     lukem GLOBAL	char		hostname[MAXHOSTNAMELEN+1];
    298  1.28.2.1     lukem GLOBAL	char		homedir[MAXPATHLEN];
    299      1.11     lukem #ifdef KERBEROS5
    300      1.23     lukem GLOBAL	krb5_context	kcontext;
    301      1.11     lukem #endif
    302      1.23     lukem GLOBAL	int		logged_in;
    303      1.23     lukem GLOBAL	int		logging;
    304      1.25     lukem GLOBAL	int		pdata;			/* for passive mode */
    305  1.28.2.2     lukem #if HAVE_SETPROCTITLE
    306      1.25     lukem GLOBAL	char		proctitle[BUFSIZ];	/* initial part of title */
    307      1.25     lukem #endif
    308      1.23     lukem GLOBAL	struct passwd  *pw;
    309      1.24     lukem GLOBAL	int		quietmessages;
    310      1.25     lukem GLOBAL	char		remotehost[MAXHOSTNAMELEN+1];
    311      1.23     lukem GLOBAL	off_t		restart_point;
    312      1.25     lukem GLOBAL	char		tmpline[7];
    313      1.23     lukem GLOBAL	sig_atomic_t	transflag;
    314      1.23     lukem GLOBAL	int		type;
    315      1.25     lukem GLOBAL	int		usedefault;		/* for data transfers */
    316  1.28.2.1     lukem GLOBAL	const char     *version;
    317      1.23     lukem 
    318      1.25     lukem 						/* total file data bytes */
    319      1.23     lukem GLOBAL	off_t		total_data_in,  total_data_out,  total_data;
    320      1.25     lukem 						/* total number of data files */
    321      1.23     lukem GLOBAL	off_t		total_files_in, total_files_out, total_files;
    322      1.25     lukem 						/* total bytes */
    323      1.23     lukem GLOBAL	off_t		total_bytes_in, total_bytes_out, total_bytes;
    324      1.25     lukem 						/* total number of xfers */
    325      1.23     lukem GLOBAL	off_t		total_xfers_in, total_xfers_out, total_xfers;
    326      1.16     lukem 
    327      1.27     lukem extern	struct tab	cmdtab[];
    328      1.27     lukem 
    329      1.27     lukem #define	INTERNAL_LS	"/bin/ls"
    330      1.27     lukem 
    331      1.27     lukem 
    332      1.27     lukem #define CMD_IMPLEMENTED(x)	((x)->flags != 0)
    333      1.27     lukem #define CMD_HAS_OPTIONS(x)	((x)->flags == 2)
    334      1.28     lukem 
    335      1.28     lukem #define	CPUTC(c, f)	do { \
    336      1.28     lukem 				putc(c, f); total_bytes++; total_bytes_out++; \
    337      1.28     lukem 			} while (0);
    338      1.27     lukem 
    339      1.27     lukem #define CURCLASSTYPE	curclass.type == CLASS_GUEST  ? "GUEST"  : \
    340      1.27     lukem 		    	curclass.type == CLASS_CHROOT ? "CHROOT" : \
    341      1.27     lukem 		    	curclass.type == CLASS_REAL   ? "REAL"   : \
    342      1.27     lukem 			"<unknown>"
    343      1.27     lukem 
    344      1.27     lukem #define ISDOTDIR(x)	(x[0] == '.' && x[1] == '\0')
    345      1.27     lukem #define ISDOTDOTDIR(x)	(x[0] == '.' && x[1] == '.' && x[2] == '\0')
    346      1.16     lukem 
    347      1.21     lukem #define EMPTYSTR(p)	((p) == NULL || *(p) == '\0')
    348      1.21     lukem #define NEXTWORD(P, W)	do { \
    349      1.21     lukem 				(W) = strsep(&(P), " \t"); \
    350      1.21     lukem 			} while ((W) != NULL && *(W) == '\0')
    351      1.16     lukem #define PLURAL(s)	((s) == 1 ? "" : "s")
    352      1.26     lukem #define REASSIGN(X,Y)	do { if (X) free(X); (X)=(Y); } while (/*CONSTCOND*/0)
    353  1.28.2.2     lukem 
    354  1.28.2.2     lukem #ifndef IPPORT_ANONMAX
    355  1.28.2.2     lukem # define IPPORT_ANONMAX	65535
    356  1.28.2.2     lukem #endif
    357