1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that the above copyright notice and this paragraph are
7: * duplicated in all such forms and that any documentation,
8: * advertising materials, and other materials related to such
9: * distribution and use acknowledge that the software was developed
10: * by the University of California, Berkeley. The name of the
11: * University may not be used to endorse or promote products derived
12: * from this software without specific prior written permission.
13: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16: *
17: * @(#)tftp.h 5.2 (Berkeley) 6/27/88
18: */
19:
20: /*
21: * Trivial File Transfer Protocol (IEN-133)
22: */
23: #define SEGSIZE 512 /* data segment size */
24:
25: /*
26: * Packet types.
27: */
28: #define RRQ 01 /* read request */
29: #define WRQ 02 /* write request */
30: #define DATA 03 /* data packet */
31: #define ACK 04 /* acknowledgement */
32: #define ERROR 05 /* error code */
33:
34: struct tftphdr {
35: short th_opcode; /* packet type */
36: union {
37: short tu_block; /* block # */
38: short tu_code; /* error code */
39: char tu_stuff[1]; /* request packet stuff */
40: } th_u;
41: char th_data[1]; /* data or error string */
42: };
43:
44: #define th_block th_u.tu_block
45: #define th_code th_u.tu_code
46: #define th_stuff th_u.tu_stuff
47: #define th_msg th_data
48:
49: /*
50: * Error codes.
51: */
52: #define EUNDEF 0 /* not defined */
53: #define ENOTFOUND 1 /* file not found */
54: #define EACCESS 2 /* access violation */
55: #define ENOSPACE 3 /* disk full or allocation exceeded */
56: #define EBADOP 4 /* illegal TFTP operation */
57: #define EBADID 5 /* unknown transfer ID */
58: #define EEXISTS 6 /* file already exists */
59: #define ENOUSER 7 /* no such user */
Defined struct's
tftphdr
defined in line
34; used 68 times
- in /usr/src/libexec/tftpd/tftpd.c line
73(2),
159(2),
188(2),
306-312(6),
374-380(6),
467-471(4)
- in /usr/src/ucb/tftp/tftp.c line
76-77(4),
87(2),
177-178(4),
188(2),
278(2),
318-322(4),
342(2)
- in /usr/src/ucb/tftp/tftpsubs.c line
61-66(8),
76(2),
85(2),
97(2),
113(2),
120(2),
155(2),
163(2),
183(2),
191(2)
Defined macros
ACK
defined in line
31; used 6 times
DATA
defined in line
30; used 5 times
ERROR
defined in line
32; used 7 times
RRQ
defined in line
28; used 6 times
WRQ
defined in line
29; used 3 times
th_block
defined in line
44; used 25 times
- in /usr/src/libexec/tftpd/tftpd.c line
320,
339(2),
345-350(2),
384,
402-411(4),
427,
436
- in /usr/src/ucb/tftp/tftp.c line
103,
133(2),
142,
153,
199,
232(2),
241,
251,
266,
366-370(2)
Usage of this include