epoc32/include/libc/arpa/tftp.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/libc/arpa/tftp.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/libc/arpa/tftp.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,97 @@
     1.4 -tftp.h
     1.5 +/* TFTP.H
     1.6 + * 
     1.7 + * Portions copyright (c) 1993-1999 Symbian Ltd.  All rights reserved.
     1.8 + */
     1.9 +
    1.10 +/** @file
    1.11 +@publishedAll
    1.12 +@released
    1.13 +*/
    1.14 +
    1.15 +/*
    1.16 + * Copyright (c) 1983, 1993
    1.17 + *	The Regents of the University of California.  All rights reserved.
    1.18 + *
    1.19 + * Redistribution and use in source and binary forms, with or without
    1.20 + * modification, are permitted provided that the following conditions
    1.21 + * are met:
    1.22 + * 1. Redistributions of source code must retain the above copyright
    1.23 + *    notice, this list of conditions and the following disclaimer.
    1.24 + * 2. Redistributions in binary form must reproduce the above copyright
    1.25 + *    notice, this list of conditions and the following disclaimer in the
    1.26 + *    documentation and/or other materials provided with the distribution.
    1.27 + * 3. All advertising materials mentioning features or use of this software
    1.28 + *    must display the following acknowledgement:
    1.29 + *	This product includes software developed by the University of
    1.30 + *	California, Berkeley and its contributors.
    1.31 + * 4. Neither the name of the University nor the names of its contributors
    1.32 + *    may be used to endorse or promote products derived from this software
    1.33 + *    without specific prior written permission.
    1.34 + *
    1.35 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    1.36 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.37 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.38 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    1.39 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.40 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.41 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.42 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.43 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.44 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.45 + * SUCH DAMAGE.
    1.46 + *
    1.47 + *	@(#)tftp.h	8.1 (Berkeley) 6/2/93
    1.48 + */
    1.49 +
    1.50 +#ifndef _ARPA_TFTP_H_
    1.51 +#define	_ARPA_TFTP_H_
    1.52 +
    1.53 +#ifdef __cplusplus
    1.54 +extern "C" {
    1.55 +#endif
    1.56 +
    1.57 +/**
    1.58 +Trivial File Transfer Protocol (IEN-133)
    1.59 +*/
    1.60 +#define	SEGSIZE		512		/* data segment size */
    1.61 +
    1.62 +/**
    1.63 +Packet types.
    1.64 +*/
    1.65 +#define	RRQ	01			/* read request */
    1.66 +#define	WRQ	02			/* write request */
    1.67 +#define	DATA	03			/* data packet */
    1.68 +#define	ACK	04			/* acknowledgement */
    1.69 +#define	ERROR	05			/* error code */
    1.70 +
    1.71 +struct	tftphdr {
    1.72 +	short	th_opcode;		/* packet type */
    1.73 +	union {
    1.74 +		short	tu_block;	/* block # */
    1.75 +		short	tu_code;	/* error code */
    1.76 +		char	tu_stuff[1];	/* request packet stuff */
    1.77 +	} th_u;
    1.78 +	char	th_data[1];		/* data or error string */
    1.79 +};
    1.80 +
    1.81 +#define	th_block	th_u.tu_block
    1.82 +#define	th_code		th_u.tu_code
    1.83 +#define	th_stuff	th_u.tu_stuff
    1.84 +#define	th_msg		th_data
    1.85 +
    1.86 +/**
    1.87 +Error codes.
    1.88 +*/
    1.89 +#define	EUNDEF		0		/* not defined */
    1.90 +#define	ENOTFOUND	1		/* file not found */
    1.91 +#define	EACCESS		2		/* access violation */
    1.92 +#define	ENOSPACE	3		/* disk full or allocation exceeded */
    1.93 +#define	EBADOP		4		/* illegal TFTP operation */
    1.94 +#define	EBADID		5		/* unknown transfer ID */
    1.95 +#define	EEXISTS		6		/* file already exists */
    1.96 +#define	ENOUSER		7		/* no such user */
    1.97 +
    1.98 +#ifdef __cplusplus
    1.99 +}
   1.100 +#endif
   1.101 +#endif /* !_TFTP_H_ */