xref: /illumos-gate/usr/src/head/arpa/ftp.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
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 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * Definitions for FTP
44  * See RFC-765
45  */
46 
47 /*
48  * Reply codes.
49  */
50 #define	PRELIM		1	/* positive preliminary */
51 #define	COMPLETE	2	/* positive completion */
52 #define	CONTINUE	3	/* positive intermediate */
53 #define	TRANSIENT	4	/* transient negative completion */
54 #define	ERROR		5	/* permanent negative completion */
55 
56 /*
57  * Type codes
58  */
59 #define	TYPE_A		1	/* ASCII */
60 #define	TYPE_E		2	/* EBCDIC */
61 #define	TYPE_I		3	/* image */
62 #define	TYPE_L		4	/* local byte size */
63 #ifdef FTP_NAMES
64 char *typenames[] =
65 {"0", "ASCII", "EBCDIC", "Image", "Local"};
66 #endif
67 
68 /*
69  * Form codes
70  */
71 #define	FORM_N		1	/* non-print */
72 #define	FORM_T		2	/* telnet format effectors */
73 #define	FORM_C		3	/* carriage control (ASA) */
74 #ifdef FTP_NAMES
75 char *formnames[] =
76 {"0", "Nonprint", "Telnet", "Carriage-control"};
77 #endif
78 
79 /*
80  * Structure codes
81  */
82 #define	STRU_F		1	/* file (no record structure) */
83 #define	STRU_R		2	/* record structure */
84 #define	STRU_P		3	/* page structure */
85 #ifdef FTP_NAMES
86 char *strunames[] =
87 {"0", "File", "Record", "Page"};
88 #endif
89 
90 /*
91  * Mode types
92  */
93 #define	MODE_S		1	/* stream */
94 #define	MODE_B		2	/* block */
95 #define	MODE_C		3	/* compressed */
96 #ifdef FTP_NAMES
97 char *modenames[] =
98 {"0", "Stream", "Block", "Compressed"};
99 #endif
100 
101 /*
102  * Authentication types
103  */
104 #define	AUTHTYPE_NONE   0
105 #define	AUTHTYPE_GSSAPI 1
106 #ifdef  FTP_NAMES
107 char *authtypenames[] = {
108 	"NONE", "GSSAPI", 0
109 };
110 #define	GSS_AUTHTYPE_NAME(x)	authtypenames[x]
111 #endif
112 
113 /*
114  * Protection levels
115  */
116 #define	PROT_C		1	/* no integrity; no encryption */
117 #define	PROT_S		2	/*    integrity; no encryption */
118 #define	PROT_P		3	/*    integrity;    encryption */
119 #define	PROT_E		4	/* no integrity;    encryption */
120 #ifdef	FTP_NAMES
121 char *protnames[] =
122 	{"0", "Clear", "Safe", "Private", "Confidential"};
123 #endif
124 
125 /*
126  * Record Tokens
127  */
128 #define	REC_ESC		'\377'	/* Record-mode Escape */
129 #define	REC_EOR		'\001'	/* Record-mode End-of-Record */
130 #define	REC_EOF		'\002'	/* Record-mode End-of-File */
131 
132 /*
133  * Block Header
134  */
135 #define	BLK_EOR		0x80	/* Block is End-of-Record */
136 #define	BLK_EOF		0x40	/* Block is End-of-File */
137 #define	BLK_ERRORS	0x20	/* Block is suspected of containing errors */
138 #define	BLK_RESTART	0x10	/* Block is Restart Marker */
139 
140 #define	BLK_BYTECOUNT	2	/* Bytes in this block */
141 
142 #ifdef	__cplusplus
143 }
144 #endif
145 
146 #endif /* _ARPA_FTP_H */
147