8ddade050a0084315d3771b0c71af89cab737d6b
[oftp] / libs / watt32 / arpa / ftp.h
1 /*!\file arpa/ftp.h
2  * FTP definitions.
3  */
4
5 /*
6  * Copyright (c) 1983, 1989 Regents of the University of California.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *      This product includes software developed by the University of
20  *      California, Berkeley and its contributors.
21  * 4. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  *
37  *      @(#)ftp.h       8.1 (Berkeley) 6/2/93
38  */
39
40 #ifndef __ARPA_FTP_H
41 #define __ARPA_FTP_H
42
43 /* Definitions for FTP; see RFC-765. */
44
45 /*
46  * Reply codes.
47  */
48 #define PRELIM          1       /* positive preliminary */
49 #define COMPLETE        2       /* positive completion */
50 #define CONTINUE        3       /* positive intermediate */
51 #define TRANSIENT       4       /* transient negative completion */
52 #undef  ERROR                   /* <wingdi.h> */
53 #define ERROR           5       /* permanent negative completion */
54
55 /*
56  * Type codes
57  */
58 #define TYPE_A          1       /* ASCII */
59 #define TYPE_E          2       /* EBCDIC */
60 #define TYPE_I          3       /* image */
61 #define TYPE_L          4       /* local byte size */
62
63 #ifdef FTP_NAMES
64 const char *typenames[] =  {"0", "ASCII", "EBCDIC", "Image", "Local" };
65 #endif
66
67 /*
68  * Form codes
69  */
70 #define FORM_N          1       /* non-print */
71 #define FORM_T          2       /* telnet format effectors */
72 #define FORM_C          3       /* carriage control (ASA) */
73 #ifdef FTP_NAMES
74 const char *formnames[] =  {"0", "Nonprint", "Telnet", "Carriage-control" };
75 #endif
76
77 /*
78  * Structure codes
79  */
80 #define STRU_F          1       /* file (no record structure) */
81 #define STRU_R          2       /* record structure */
82 #define STRU_P          3       /* page structure */
83 #ifdef FTP_NAMES
84 const char *strunames[] =  {"0", "File", "Record", "Page" };
85 #endif
86
87 /*
88  * Mode types
89  */
90 #define MODE_S          1       /* stream */
91 #define MODE_B          2       /* block */
92 #define MODE_C          3       /* compressed */
93 #ifdef FTP_NAMES
94 const char *modenames[] =  {"0", "Stream", "Block", "Compressed" };
95 #endif
96
97 /*
98  * Protection levels
99  */
100 #define PROT_C          1       /* clear */
101 #define PROT_S          2       /* safe */
102 #define PROT_P          3       /* private */
103 #define PROT_E          4       /* confidential */
104
105 #ifdef FTP_NAMES
106 const char *levelnames[] =  {"0", "Clear", "Safe", "Private", "Confidential" };
107 #endif
108
109 #if defined(KERBEROS) && defined(NOENCRYPTION)
110  /* Define away krb_rd_priv and krb_mk_priv.  Don't need them anyway.
111   * This might not be the best place for this ...
112   */
113   #define krb_rd_priv(o,l,ses,s,h,c,m) krb_rd_safe(o,l,s,h,c,m)
114   #define krb_mk_priv(i,o,l,ses,s,h,c) krb_mk_safe(i,o,l,s,h,c)
115 #endif
116
117 /*
118  * Record Tokens
119  */
120 #define REC_ESC         '\377'  /* Record-mode Escape */
121 #define REC_EOR         '\001'  /* Record-mode End-of-Record */
122 #define REC_EOF         '\002'  /* Record-mode End-of-File */
123
124 /*
125  * Block Header
126  */
127 #define BLK_EOR         0x80    /* Block is End-of-Record */
128 #define BLK_EOF         0x40    /* Block is End-of-File */
129 #define BLK_ERRORS      0x20    /* Block is suspected of containing errors */
130 #define BLK_RESTART     0x10    /* Block is Restart Marker */
131
132 #define BLK_BYTECOUNT   2       /* Bytes in this block */
133
134 #endif