Mercurial > ecos
comparison packages/redboot/current/include/net/tftp_support.h @ 115:6ed91473a1cd ecos-sw-2000-08-21
Merge from eCos master repository on 2000-08-21-22:40:54-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 17:32:38 +0000 |
| parents | |
| children | 518f42066aba |
comparison
equal
deleted
inserted
replaced
| 114:5ad2b71d525e | 115:6ed91473a1cd |
|---|---|
| 1 //========================================================================== | |
| 2 // | |
| 3 // net/tftp_support.h | |
| 4 // | |
| 5 // Stand-alone TFTP support for RedBoot | |
| 6 // | |
| 7 //========================================================================== | |
| 8 //####COPYRIGHTBEGIN#### | |
| 9 // | |
| 10 // ------------------------------------------- | |
| 11 // The contents of this file are subject to the Red Hat eCos Public License | |
| 12 // Version 1.1 (the "License"); you may not use this file except in | |
| 13 // compliance with the License. You may obtain a copy of the License at | |
| 14 // http://www.redhat.com/ | |
| 15 // | |
| 16 // Software distributed under the License is distributed on an "AS IS" | |
| 17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 18 // License for the specific language governing rights and limitations under | |
| 19 // the License. | |
| 20 // | |
| 21 // The Original Code is eCos - Embedded Configurable Operating System, | |
| 22 // released September 30, 1998. | |
| 23 // | |
| 24 // The Initial Developer of the Original Code is Red Hat. | |
| 25 // Portions created by Red Hat are | |
| 26 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. | |
| 27 // All Rights Reserved. | |
| 28 // ------------------------------------------- | |
| 29 // | |
| 30 //####COPYRIGHTEND#### | |
| 31 //========================================================================== | |
| 32 //#####DESCRIPTIONBEGIN#### | |
| 33 // | |
| 34 // Author(s): gthomas | |
| 35 // Contributors: gthomas | |
| 36 // Date: 2000-07-14 | |
| 37 // Purpose: | |
| 38 // Description: | |
| 39 // | |
| 40 // This code is part of RedBoot (tm). | |
| 41 // | |
| 42 //####DESCRIPTIONEND#### | |
| 43 // | |
| 44 //========================================================================== | |
| 45 | |
| 46 #ifndef _TFTP_SUPPORT_H_ | |
| 47 #define _TFTP_SUPPORT_H_ | |
| 48 | |
| 49 #include "net.h" | |
| 50 | |
| 51 /* | |
| 52 * File transfer modes | |
| 53 */ | |
| 54 #define TFTP_NETASCII 0 // Text files | |
| 55 #define TFTP_OCTET 1 // Binary files | |
| 56 | |
| 57 /* | |
| 58 * Errors | |
| 59 */ | |
| 60 #define TFTP_ENOTFOUND 1 /* file not found */ | |
| 61 #define TFTP_EACCESS 2 /* access violation */ | |
| 62 #define TFTP_ENOSPACE 3 /* disk full or allocation exceeded */ | |
| 63 #define TFTP_EBADOP 4 /* illegal TFTP operation */ | |
| 64 #define TFTP_EBADID 5 /* unknown transfer ID */ | |
| 65 #define TFTP_EEXISTS 6 /* file already exists */ | |
| 66 #define TFTP_ENOUSER 7 /* no such user */ | |
| 67 #define TFTP_TIMEOUT 8 /* operation timed out */ | |
| 68 #define TFTP_NETERR 9 /* some sort of network error */ | |
| 69 #define TFTP_INVALID 10 /* invalid parameter */ | |
| 70 #define TFTP_PROTOCOL 11 /* protocol violation */ | |
| 71 #define TFTP_TOOLARGE 12 /* file is larger than buffer */ | |
| 72 | |
| 73 /* | |
| 74 * Client support | |
| 75 */ | |
| 76 | |
| 77 extern int tftp_get(char *, struct sockaddr_in *, char *, int, int, int *); | |
| 78 extern char *tftp_error(int err); | |
| 79 | |
| 80 extern int tftp_stream_open(char *file, struct sockaddr_in *server, int mode, int *err); | |
| 81 extern int tftp_stream_read(char *buf, int len, int *err); | |
| 82 extern int tftp_stream_close(int *err); | |
| 83 | |
| 84 #define TFTP_TIMEOUT_PERIOD 5 | |
| 85 #define TFTP_TIMEOUT_MAX 5 | |
| 86 #define TFTP_RETRIES_MAX 5 | |
| 87 | |
| 88 #define TFTP_PORT 69 | |
| 89 | |
| 90 #endif // _TFTP_SUPPORT_H_ |
