8559 Add EFI utility functions to libefi
[unleashed.git] / include / arpa / tftp.h
blob8ee12ff28bc4c40bb17d1e03b695a8ded28128f8
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 * Portions of this source code were derived from Berkeley 4.3 BSD
32 * under license from the Regents of the University of California.
35 #ifndef _ARPA_TFTP_H
36 #define _ARPA_TFTP_H
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 * Trivial File Transfer Protocol (RFC 1350, RFC 2347)
45 #define SEGSIZE 512 /* data segment size */
48 * Packet types.
50 #define RRQ 01 /* read request */
51 #define WRQ 02 /* write request */
52 #define DATA 03 /* data packet */
53 #define ACK 04 /* acknowledgement */
54 #define ERROR 05 /* error code */
55 #define OACK 06 /* option acknowledgement */
57 struct tftphdr {
58 short th_opcode; /* packet type */
59 ushort_t th_block; /* block # */
60 char th_data[1]; /* data or error string */
63 #define th_code th_block /* error code overlay on tu_block */
64 #define th_stuff th_block /* ditto */
66 #define th_msg th_data
69 * Error codes.
71 #define EUNDEF 0 /* not defined */
72 #define ENOTFOUND 1 /* file not found */
73 #define EACCESS 2 /* access violation */
74 #define ENOSPACE 3 /* disk full or allocation exceeded */
75 #define EBADOP 4 /* illegal TFTP operation */
76 #define EBADID 5 /* unknown transfer ID */
77 #define EEXISTS 6 /* file already exists */
78 #define ENOUSER 7 /* no such user */
79 #define EOPTNEG 8 /* option negotiation error */
81 #ifdef __cplusplus
83 #endif
85 #endif /* _ARPA_TFTP_H */