1*86268722Schristos /* $NetBSD: ftp.h,v 1.7 2017/01/12 18:42:53 christos Exp $ */ 24d2cbfceScgd 361f28255Scgd /* 4a141abe4Sperry * Copyright (c) 1983, 1989, 1993 5a141abe4Sperry * The Regents of the University of California. All rights reserved. 661f28255Scgd * 761f28255Scgd * Redistribution and use in source and binary forms, with or without 861f28255Scgd * modification, are permitted provided that the following conditions 961f28255Scgd * are met: 1061f28255Scgd * 1. Redistributions of source code must retain the above copyright 1161f28255Scgd * notice, this list of conditions and the following disclaimer. 1261f28255Scgd * 2. Redistributions in binary form must reproduce the above copyright 1361f28255Scgd * notice, this list of conditions and the following disclaimer in the 1461f28255Scgd * documentation and/or other materials provided with the distribution. 15039cc956Sagc * 3. Neither the name of the University nor the names of its contributors 1661f28255Scgd * may be used to endorse or promote products derived from this software 1761f28255Scgd * without specific prior written permission. 1861f28255Scgd * 1961f28255Scgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2061f28255Scgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2161f28255Scgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2261f28255Scgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2361f28255Scgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2461f28255Scgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2561f28255Scgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2661f28255Scgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2761f28255Scgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2861f28255Scgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2961f28255Scgd * SUCH DAMAGE. 3061f28255Scgd * 31a141abe4Sperry * @(#)ftp.h 8.1 (Berkeley) 6/2/93 3261f28255Scgd */ 3361f28255Scgd 34d39928a2Sperry #ifndef _ARPA_FTP_H_ 35d39928a2Sperry #define _ARPA_FTP_H_ 3661f28255Scgd 3761f28255Scgd /* Definitions for FTP; see RFC-765. */ 3861f28255Scgd 3961f28255Scgd /* 4061f28255Scgd * Reply codes. 4161f28255Scgd */ 4261f28255Scgd #define PRELIM 1 /* positive preliminary */ 4361f28255Scgd #define COMPLETE 2 /* positive completion */ 4461f28255Scgd #define CONTINUE 3 /* positive intermediate */ 4561f28255Scgd #define TRANSIENT 4 /* transient negative completion */ 4661f28255Scgd #define ERROR 5 /* permanent negative completion */ 4761f28255Scgd 4861f28255Scgd /* 4961f28255Scgd * Type codes 5061f28255Scgd */ 5161f28255Scgd #define TYPE_A 1 /* ASCII */ 5261f28255Scgd #define TYPE_E 2 /* EBCDIC */ 5361f28255Scgd #define TYPE_I 3 /* image */ 5461f28255Scgd #define TYPE_L 4 /* local byte size */ 5561f28255Scgd 5661f28255Scgd #ifdef FTP_NAMES 57*86268722Schristos const char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" }; 5861f28255Scgd #endif 5961f28255Scgd 6061f28255Scgd /* 6161f28255Scgd * Form codes 6261f28255Scgd */ 6361f28255Scgd #define FORM_N 1 /* non-print */ 6461f28255Scgd #define FORM_T 2 /* telnet format effectors */ 6561f28255Scgd #define FORM_C 3 /* carriage control (ASA) */ 6661f28255Scgd #ifdef FTP_NAMES 67*86268722Schristos const char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" }; 6861f28255Scgd #endif 6961f28255Scgd 7061f28255Scgd /* 7161f28255Scgd * Structure codes 7261f28255Scgd */ 7361f28255Scgd #define STRU_F 1 /* file (no record structure) */ 7461f28255Scgd #define STRU_R 2 /* record structure */ 7561f28255Scgd #define STRU_P 3 /* page structure */ 7661f28255Scgd #ifdef FTP_NAMES 77*86268722Schristos const char *strunames[] = {"0", "File", "Record", "Page" }; 7861f28255Scgd #endif 7961f28255Scgd 8061f28255Scgd /* 8161f28255Scgd * Mode types 8261f28255Scgd */ 8361f28255Scgd #define MODE_S 1 /* stream */ 8461f28255Scgd #define MODE_B 2 /* block */ 8561f28255Scgd #define MODE_C 3 /* compressed */ 8661f28255Scgd #ifdef FTP_NAMES 87*86268722Schristos const char *modenames[] = {"0", "Stream", "Block", "Compressed" }; 8861f28255Scgd #endif 8961f28255Scgd 9061f28255Scgd /* 9161f28255Scgd * Record Tokens 9261f28255Scgd */ 9361f28255Scgd #define REC_ESC '\377' /* Record-mode Escape */ 9461f28255Scgd #define REC_EOR '\001' /* Record-mode End-of-Record */ 9561f28255Scgd #define REC_EOF '\002' /* Record-mode End-of-File */ 9661f28255Scgd 9761f28255Scgd /* 9861f28255Scgd * Block Header 9961f28255Scgd */ 10061f28255Scgd #define BLK_EOR 0x80 /* Block is End-of-Record */ 10161f28255Scgd #define BLK_EOF 0x40 /* Block is End-of-File */ 10261f28255Scgd #define BLK_ERRORS 0x20 /* Block is suspected of containing errors */ 10361f28255Scgd #define BLK_RESTART 0x10 /* Block is Restart Marker */ 10461f28255Scgd 10561f28255Scgd #define BLK_BYTECOUNT 2 /* Bytes in this block */ 10661f28255Scgd 107d39928a2Sperry #endif /* _ARPA_FTP_H_ */ 108