xref: /titanic_52/usr/src/head/arpa/ftp.h (revision e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * Portions of this source code were derived from Berkeley 4.3 BSD
32  * under license from the Regents of the University of California.
33  */
34 
35 #ifndef _ARPA_FTP_H
36 #define	_ARPA_FTP_H
37 
38 #pragma ident	"%Z%%M%	%I%	%E% SMI"
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 /*
45  * Definitions for FTP
46  * See RFC-765
47  */
48 
49 /*
50  * Reply codes.
51  */
52 #define	PRELIM		1	/* positive preliminary */
53 #define	COMPLETE	2	/* positive completion */
54 #define	CONTINUE	3	/* positive intermediate */
55 #define	TRANSIENT	4	/* transient negative completion */
56 #define	ERROR		5	/* permanent negative completion */
57 
58 /*
59  * Type codes
60  */
61 #define	TYPE_A		1	/* ASCII */
62 #define	TYPE_E		2	/* EBCDIC */
63 #define	TYPE_I		3	/* image */
64 #define	TYPE_L		4	/* local byte size */
65 #ifdef FTP_NAMES
66 char *typenames[] =
67 {"0", "ASCII", "EBCDIC", "Image", "Local"};
68 #endif
69 
70 /*
71  * Form codes
72  */
73 #define	FORM_N		1	/* non-print */
74 #define	FORM_T		2	/* telnet format effectors */
75 #define	FORM_C		3	/* carriage control (ASA) */
76 #ifdef FTP_NAMES
77 char *formnames[] =
78 {"0", "Nonprint", "Telnet", "Carriage-control"};
79 #endif
80 
81 /*
82  * Structure codes
83  */
84 #define	STRU_F		1	/* file (no record structure) */
85 #define	STRU_R		2	/* record structure */
86 #define	STRU_P		3	/* page structure */
87 #ifdef FTP_NAMES
88 char *strunames[] =
89 {"0", "File", "Record", "Page"};
90 #endif
91 
92 /*
93  * Mode types
94  */
95 #define	MODE_S		1	/* stream */
96 #define	MODE_B		2	/* block */
97 #define	MODE_C		3	/* compressed */
98 #ifdef FTP_NAMES
99 char *modenames[] =
100 {"0", "Stream", "Block", "Compressed"};
101 #endif
102 
103 /*
104  * Authentication types
105  */
106 #define	AUTHTYPE_NONE   0
107 #define	AUTHTYPE_GSSAPI 1
108 #ifdef  FTP_NAMES
109 char *authtypenames[] = {
110 	"NONE", "GSSAPI", 0
111 };
112 #define	GSS_AUTHTYPE_NAME(x)	authtypenames[x]
113 #endif
114 
115 /*
116  * Protection levels
117  */
118 #define	PROT_C		1	/* no integrity; no encryption */
119 #define	PROT_S		2	/*    integrity; no encryption */
120 #define	PROT_P		3	/*    integrity;    encryption */
121 #define	PROT_E		4	/* no integrity;    encryption */
122 #ifdef	FTP_NAMES
123 char *protnames[] =
124 	{"0", "Clear", "Safe", "Private", "Confidential"};
125 #endif
126 
127 /*
128  * Record Tokens
129  */
130 #define	REC_ESC		'\377'	/* Record-mode Escape */
131 #define	REC_EOR		'\001'	/* Record-mode End-of-Record */
132 #define	REC_EOF		'\002'	/* Record-mode End-of-File */
133 
134 /*
135  * Block Header
136  */
137 #define	BLK_EOR		0x80	/* Block is End-of-Record */
138 #define	BLK_EOF		0x40	/* Block is End-of-File */
139 #define	BLK_ERRORS	0x20	/* Block is suspected of containing errors */
140 #define	BLK_RESTART	0x10	/* Block is Restart Marker */
141 
142 #define	BLK_BYTECOUNT	2	/* Bytes in this block */
143 
144 #ifdef	__cplusplus
145 }
146 #endif
147 
148 #endif /* _ARPA_FTP_H */
149