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