usb-ohci: add exit function
[qemu/ar7.git] / slirp / tftp.h
blobe1cc24b9bf8a004ddd966a152cd9b6e312501f59
1 /* tftp defines */
2 #ifndef SLIRP_TFTP_H
3 #define SLIRP_TFTP_H 1
5 #define TFTP_SESSIONS_MAX 20
7 #define TFTP_SERVER 69
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
14 #define TFTP_OACK 6
16 #define TFTP_FILENAME_MAX 512
18 struct tftp_t {
19 struct ip ip;
20 struct udphdr udp;
21 uint16_t tp_op;
22 union {
23 struct {
24 uint16_t tp_block_nr;
25 uint8_t tp_buf[512];
26 } tp_data;
27 struct {
28 uint16_t tp_error_code;
29 uint8_t tp_msg[512];
30 } tp_error;
31 char tp_buf[512 + 2];
32 } x;
35 struct tftp_session {
36 Slirp *slirp;
37 char *filename;
38 int fd;
40 struct in_addr client_ip;
41 uint16_t client_port;
42 uint32_t block_nr;
44 int timestamp;
47 void tftp_input(struct mbuf *m);
49 #endif