The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 |
| 12 | #define TFTP_OACK 6 |
| 13 | |
| 14 | #define TFTP_FILENAME_MAX 512 |
| 15 | |
| 16 | struct tftp_t { |
| 17 | struct ip ip; |
| 18 | struct udphdr udp; |
| 19 | u_int16_t tp_op; |
| 20 | union { |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 21 | struct { |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 22 | u_int16_t tp_block_nr; |
| 23 | u_int8_t tp_buf[512]; |
| 24 | } tp_data; |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 25 | struct { |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 26 | u_int16_t tp_error_code; |
| 27 | u_int8_t tp_msg[512]; |
| 28 | } tp_error; |
| 29 | u_int8_t tp_buf[512 + 2]; |
| 30 | } x; |
| 31 | }; |
| 32 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 33 | void tftp_input(struct mbuf *m); |