xref: /onnv-gate/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/extensions.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
3*0Sstevel@tonic-gate  * Use is subject to license terms.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
7*0Sstevel@tonic-gate 
8*0Sstevel@tonic-gate /****************************************************************************
9*0Sstevel@tonic-gate   Copyright (c) 1999,2000 WU-FTPD Development Group.
10*0Sstevel@tonic-gate   All rights reserved.
11*0Sstevel@tonic-gate 
12*0Sstevel@tonic-gate   Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994
13*0Sstevel@tonic-gate     The Regents of the University of California.
14*0Sstevel@tonic-gate   Portions Copyright (c) 1993, 1994 Washington University in Saint Louis.
15*0Sstevel@tonic-gate   Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc.
16*0Sstevel@tonic-gate   Portions Copyright (c) 1989 Massachusetts Institute of Technology.
17*0Sstevel@tonic-gate   Portions Copyright (c) 1998 Sendmail, Inc.
18*0Sstevel@tonic-gate   Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P.  Allman.
19*0Sstevel@tonic-gate   Portions Copyright (c) 1997 by Stan Barber.
20*0Sstevel@tonic-gate   Portions Copyright (c) 1997 by Kent Landfield.
21*0Sstevel@tonic-gate   Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997
22*0Sstevel@tonic-gate     Free Software Foundation, Inc.
23*0Sstevel@tonic-gate 
24*0Sstevel@tonic-gate   Use and distribution of this software and its source code are governed
25*0Sstevel@tonic-gate   by the terms and conditions of the WU-FTPD Software License ("LICENSE").
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate   If you did not receive a copy of the license, it may be obtained online
28*0Sstevel@tonic-gate   at http://www.wu-ftpd.org/license.html.
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate   $Id: extensions.h,v 1.12 2000/07/01 18:17:39 wuftpd Exp $
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate ****************************************************************************/
33*0Sstevel@tonic-gate #define LOG_IN  0
34*0Sstevel@tonic-gate #define C_WD    1
35*0Sstevel@tonic-gate #define BANNER  2
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate #ifndef ALIGN
38*0Sstevel@tonic-gate #define ALIGN(x)        ((x) + (sizeof(long) - (x) % sizeof(long)))
39*0Sstevel@tonic-gate #endif
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate #define O_COMPRESS              (1 << 0)	/* file was compressed */
42*0Sstevel@tonic-gate #define O_UNCOMPRESS            (1 << 1)	/* file was uncompressed */
43*0Sstevel@tonic-gate #define O_TAR                   (1 << 2)	/* file was tar'ed */
44*0Sstevel@tonic-gate 
45*0Sstevel@tonic-gate #define MAXARGS         50
46*0Sstevel@tonic-gate #define MAXKWLEN        20
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate struct aclmember {
49*0Sstevel@tonic-gate     struct aclmember *next;
50*0Sstevel@tonic-gate     char keyword[MAXKWLEN];
51*0Sstevel@tonic-gate     char *arg[MAXARGS];
52*0Sstevel@tonic-gate };
53*0Sstevel@tonic-gate 
54*0Sstevel@tonic-gate #define ARG0    entry->arg[0]
55*0Sstevel@tonic-gate #define ARG1    entry->arg[1]
56*0Sstevel@tonic-gate #define ARG2    entry->arg[2]
57*0Sstevel@tonic-gate #define ARG3    entry->arg[3]
58*0Sstevel@tonic-gate #define ARG4    entry->arg[4]
59*0Sstevel@tonic-gate #define ARG5    entry->arg[5]
60*0Sstevel@tonic-gate #define ARG6    entry->arg[6]
61*0Sstevel@tonic-gate #define ARG7    entry->arg[7]
62*0Sstevel@tonic-gate #define ARG8    entry->arg[8]
63*0Sstevel@tonic-gate #define ARG9    entry->arg[9]
64*0Sstevel@tonic-gate #define ARG     entry->arg
65*0Sstevel@tonic-gate 
66*0Sstevel@tonic-gate /* Header at start of PID file */
67*0Sstevel@tonic-gate struct pidfile_header {
68*0Sstevel@tonic-gate     int     count;
69*0Sstevel@tonic-gate     time_t  last_checked;
70*0Sstevel@tonic-gate };
71*0Sstevel@tonic-gate 
72*0Sstevel@tonic-gate /* File transfer logging (xferlog) */
73*0Sstevel@tonic-gate #include <sys/param.h>
74*0Sstevel@tonic-gate 
75*0Sstevel@tonic-gate #define MAXXFERSTRLEN	(MAXPATHLEN + 1024)
76*0Sstevel@tonic-gate #define MAXSPACTCHARS	4
77*0Sstevel@tonic-gate 
78*0Sstevel@tonic-gate struct xferstat {
79*0Sstevel@tonic-gate     char    *filename;
80*0Sstevel@tonic-gate     char    access_mode;
81*0Sstevel@tonic-gate     char    completion;
82*0Sstevel@tonic-gate     char    transfer_direction;
83*0Sstevel@tonic-gate     char    transfer_type;
84*0Sstevel@tonic-gate     char    special_action[MAXSPACTCHARS];
85*0Sstevel@tonic-gate     int     auth;
86*0Sstevel@tonic-gate     int     transfer_time;
87*0Sstevel@tonic-gate     off_t   filesize;
88*0Sstevel@tonic-gate     off_t   restart_offset;
89*0Sstevel@tonic-gate     off_t   transfer_bytes;
90*0Sstevel@tonic-gate };
91*0Sstevel@tonic-gate extern int xferdone;
92*0Sstevel@tonic-gate extern char xferlog_format[];
93*0Sstevel@tonic-gate extern struct xferstat xfervalues;
94*0Sstevel@tonic-gate 
95*0Sstevel@tonic-gate /* Type values for the various passive modes supported by the server */
96*0Sstevel@tonic-gate #define TYPE_PASV	0
97*0Sstevel@tonic-gate #ifdef INET6
98*0Sstevel@tonic-gate #define TYPE_EPSV	1
99*0Sstevel@tonic-gate #define TYPE_LPSV	2
100*0Sstevel@tonic-gate #endif
101*0Sstevel@tonic-gate 
102*0Sstevel@tonic-gate #ifdef QUOTA
103*0Sstevel@tonic-gate #ifdef TIME_WITH_SYS_TIME
104*0Sstevel@tonic-gate #include <time.h>
105*0Sstevel@tonic-gate #include <sys/time.h>
106*0Sstevel@tonic-gate #else
107*0Sstevel@tonic-gate #ifdef HAVE_SYS_TIME_H
108*0Sstevel@tonic-gate #include <sys/time.h>
109*0Sstevel@tonic-gate #else
110*0Sstevel@tonic-gate #include <time.h>
111*0Sstevel@tonic-gate #endif
112*0Sstevel@tonic-gate #endif
113*0Sstevel@tonic-gate 
114*0Sstevel@tonic-gate #ifdef IRIX
115*0Sstevel@tonic-gate #define QUOTA_BLOCKS
116*0Sstevel@tonic-gate #define QUOTA_DEVICE
117*0Sstevel@tonic-gate #include <mntent.h>
118*0Sstevel@tonic-gate #include <sys/quota.h>
119*0Sstevel@tonic-gate #endif
120*0Sstevel@tonic-gate 
121*0Sstevel@tonic-gate #ifdef SOLARIS_2
122*0Sstevel@tonic-gate #define QUOTA_BLOCKS
123*0Sstevel@tonic-gate #define QUOTA_DEVICE
124*0Sstevel@tonic-gate #define HAS_OLDSTYLE_GETMNTENT
125*0Sstevel@tonic-gate #define HAS_NO_QUOTACTL
126*0Sstevel@tonic-gate #include <sys/mntent.h>
127*0Sstevel@tonic-gate #include <sys/mnttab.h>
128*0Sstevel@tonic-gate #include <sys/fs/ufs_quota.h>
129*0Sstevel@tonic-gate #include <sys/types.h>
130*0Sstevel@tonic-gate #include <sys/stat.h>
131*0Sstevel@tonic-gate #include <fcntl.h>
132*0Sstevel@tonic-gate #endif
133*0Sstevel@tonic-gate 
134*0Sstevel@tonic-gate #ifdef SUNOS
135*0Sstevel@tonic-gate #define QUOTA_BLOCKS
136*0Sstevel@tonic-gate #define QUOTA_DEVICE
137*0Sstevel@tonic-gate #include <mntent.h>
138*0Sstevel@tonic-gate #include <ufs/quota.h>
139*0Sstevel@tonic-gate #endif
140*0Sstevel@tonic-gate 
141*0Sstevel@tonic-gate #ifdef AIX
142*0Sstevel@tonic-gate #include <jfs/quota.h>
143*0Sstevel@tonic-gate #endif
144*0Sstevel@tonic-gate 
145*0Sstevel@tonic-gate #ifdef DIGITAL
146*0Sstevel@tonic-gate #include <ufs/quota.h>
147*0Sstevel@tonic-gate #endif
148*0Sstevel@tonic-gate 
149*0Sstevel@tonic-gate #ifdef BSDI
150*0Sstevel@tonic-gate #include <ufs/ufs/quota.h>
151*0Sstevel@tonic-gate #endif
152*0Sstevel@tonic-gate 
153*0Sstevel@tonic-gate #ifdef LINUX
154*0Sstevel@tonic-gate #define QUOTA_DEVICE
155*0Sstevel@tonic-gate #include <mntent.h>
156*0Sstevel@tonic-gate #include <asm/types.h>
157*0Sstevel@tonic-gate #ifdef HAVE_SYS_QUOTA_H
158*0Sstevel@tonic-gate #include <sys/quota.h>
159*0Sstevel@tonic-gate #else
160*0Sstevel@tonic-gate #include <linux/quota.h>
161*0Sstevel@tonic-gate #endif
162*0Sstevel@tonic-gate #endif
163*0Sstevel@tonic-gate 
164*0Sstevel@tonic-gate #ifdef HAVE_FCNTL_H
165*0Sstevel@tonic-gate #include <fcntl.h>
166*0Sstevel@tonic-gate #endif
167*0Sstevel@tonic-gate #ifdef HAVE_SYS_QUOTA_H		/* This is defined only in the autoconf'ed build */
168*0Sstevel@tonic-gate #include <sys/quota.h>
169*0Sstevel@tonic-gate #endif
170*0Sstevel@tonic-gate #ifdef HAVE_MNTENT_H
171*0Sstevel@tonic-gate #include <mntent.h>
172*0Sstevel@tonic-gate #endif
173*0Sstevel@tonic-gate 
174*0Sstevel@tonic-gate #endif /* QUOTA */
175