]>
Commit | Line | Data |
---|---|---|
c7f74643 | 1 | /* tftp defines */ |
cb9c377f PB |
2 | #ifndef SLIRP_TFTP_H |
3 | #define SLIRP_TFTP_H 1 | |
c7f74643 FB |
4 | |
5 | #define TFTP_SESSIONS_MAX 3 | |
6 | ||
7 | #define TFTP_SERVER 69 | |
8 | ||
9 | #define TFTP_RRQ 1 | |
10 | #define TFTP_WRQ 2 | |
11 | #define TFTP_DATA 3 | |
12 | #define TFTP_ACK 4 | |
13 | #define TFTP_ERROR 5 | |
1f697db9 | 14 | #define TFTP_OACK 6 |
c7f74643 FB |
15 | |
16 | #define TFTP_FILENAME_MAX 512 | |
17 | ||
18 | struct tftp_t { | |
19 | struct ip ip; | |
20 | struct udphdr udp; | |
b6dce92e | 21 | uint16_t tp_op; |
c7f74643 | 22 | union { |
5fafdf24 | 23 | struct { |
b6dce92e SW |
24 | uint16_t tp_block_nr; |
25 | uint8_t tp_buf[512]; | |
c7f74643 | 26 | } tp_data; |
5fafdf24 | 27 | struct { |
b6dce92e SW |
28 | uint16_t tp_error_code; |
29 | uint8_t tp_msg[512]; | |
c7f74643 | 30 | } tp_error; |
89d2d3af | 31 | char tp_buf[512 + 2]; |
c7f74643 FB |
32 | } x; |
33 | }; | |
34 | ||
460fec67 JK |
35 | struct tftp_session { |
36 | Slirp *slirp; | |
37 | char *filename; | |
78be0566 | 38 | int fd; |
460fec67 JK |
39 | |
40 | struct in_addr client_ip; | |
b6dce92e | 41 | uint16_t client_port; |
4aa401f3 | 42 | uint32_t block_nr; |
460fec67 JK |
43 | |
44 | int timestamp; | |
45 | }; | |
46 | ||
c7f74643 | 47 | void tftp_input(struct mbuf *m); |
cb9c377f PB |
48 | |
49 | #endif |