179968Sobrien/*	$NetBSD: ftp.h,v 1.5 1998/02/10 00:32:50 perry Exp $	*/
279968Sobrien
379968Sobrien/*
479968Sobrien * Copyright (c) 1983, 1989, 1993
579968Sobrien *	The Regents of the University of California.  All rights reserved.
679968Sobrien *
779968Sobrien * Redistribution and use in source and binary forms, with or without
879968Sobrien * modification, are permitted provided that the following conditions
979968Sobrien * are met:
1079968Sobrien * 1. Redistributions of source code must retain the above copyright
1179968Sobrien *    notice, this list of conditions and the following disclaimer.
1279968Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1379968Sobrien *    notice, this list of conditions and the following disclaimer in the
1479968Sobrien *    documentation and/or other materials provided with the distribution.
1579968Sobrien * 3. All advertising materials mentioning features or use of this software
1679968Sobrien *    must display the following acknowledgement:
1779968Sobrien *	This product includes software developed by the University of
1879968Sobrien *	California, Berkeley and its contributors.
1979968Sobrien * 4. Neither the name of the University nor the names of its contributors
2079968Sobrien *    may be used to endorse or promote products derived from this software
2179968Sobrien *    without specific prior written permission.
2279968Sobrien *
2379968Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2479968Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2579968Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2679968Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2779968Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2879968Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2979968Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3079968Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3179968Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3279968Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3379968Sobrien * SUCH DAMAGE.
3479968Sobrien *
3579968Sobrien *	@(#)ftp.h	8.1 (Berkeley) 6/2/93
3679968Sobrien */
3779968Sobrien
3879968Sobrien#ifndef _ARPA_FTP_H_
3979968Sobrien#define	_ARPA_FTP_H_
4079968Sobrien
4179968Sobrien/* Definitions for FTP; see RFC-765. */
4279968Sobrien
4379968Sobrien/*
4479968Sobrien * Reply codes.
4579968Sobrien */
4679968Sobrien#define PRELIM		1	/* positive preliminary */
4779968Sobrien#define COMPLETE	2	/* positive completion */
4879968Sobrien#define CONTINUE	3	/* positive intermediate */
4979968Sobrien#define TRANSIENT	4	/* transient negative completion */
5079968Sobrien#define ERROR		5	/* permanent negative completion */
5179968Sobrien
5279968Sobrien/*
5379968Sobrien * Type codes
5479968Sobrien */
5579968Sobrien#define	TYPE_A		1	/* ASCII */
5679968Sobrien#define	TYPE_E		2	/* EBCDIC */
5779968Sobrien#define	TYPE_I		3	/* image */
5879968Sobrien#define	TYPE_L		4	/* local byte size */
5979968Sobrien
6079968Sobrien#ifdef FTP_NAMES
6179968Sobrienchar *typenames[] =  {"0", "ASCII", "EBCDIC", "Image", "Local" };
6279968Sobrien#endif
6379968Sobrien
6479968Sobrien/*
6579968Sobrien * Form codes
6679968Sobrien */
6779968Sobrien#define	FORM_N		1	/* non-print */
6879968Sobrien#define	FORM_T		2	/* telnet format effectors */
6979968Sobrien#define	FORM_C		3	/* carriage control (ASA) */
7079968Sobrien#ifdef FTP_NAMES
7179968Sobrienchar *formnames[] =  {"0", "Nonprint", "Telnet", "Carriage-control" };
7279968Sobrien#endif
7379968Sobrien
7479968Sobrien/*
7579968Sobrien * Structure codes
7679968Sobrien */
7779968Sobrien#define	STRU_F		1	/* file (no record structure) */
7879968Sobrien#define	STRU_R		2	/* record structure */
7979968Sobrien#define	STRU_P		3	/* page structure */
8079968Sobrien#ifdef FTP_NAMES
8179968Sobrienchar *strunames[] =  {"0", "File", "Record", "Page" };
8279968Sobrien#endif
8379968Sobrien
8479968Sobrien/*
8579968Sobrien * Mode types
8679968Sobrien */
8779968Sobrien#define	MODE_S		1	/* stream */
8879968Sobrien#define	MODE_B		2	/* block */
8979968Sobrien#define	MODE_C		3	/* compressed */
9079968Sobrien#ifdef FTP_NAMES
9179968Sobrienchar *modenames[] =  {"0", "Stream", "Block", "Compressed" };
9279968Sobrien#endif
9379968Sobrien
9479968Sobrien/*
9579968Sobrien * Record Tokens
9679968Sobrien */
9779968Sobrien#define	REC_ESC		'\377'	/* Record-mode Escape */
9879968Sobrien#define	REC_EOR		'\001'	/* Record-mode End-of-Record */
9979968Sobrien#define REC_EOF		'\002'	/* Record-mode End-of-File */
10079968Sobrien
10179968Sobrien/*
10279968Sobrien * Block Header
10379968Sobrien */
10479968Sobrien#define	BLK_EOR		0x80	/* Block is End-of-Record */
10579968Sobrien#define	BLK_EOF		0x40	/* Block is End-of-File */
10679968Sobrien#define BLK_ERRORS	0x20	/* Block is suspected of containing errors */
10779968Sobrien#define	BLK_RESTART	0x10	/* Block is Restart Marker */
10879968Sobrien
10979968Sobrien#define	BLK_BYTECOUNT	2	/* Bytes in this block */
11079968Sobrien
11179968Sobrien#endif /* _ARPA_FTP_H_ */
112