tests: Test blockjob IDs
[qemu/ar7.git] / slirp / tftp.h
blob2cd276dec63a030ba71e86e4d72d316df2718a8b
1 /* tftp defines */
3 #ifndef SLIRP_TFTP_H
4 #define SLIRP_TFTP_H
6 #define TFTP_SESSIONS_MAX 20
8 #define TFTP_SERVER 69
10 #define TFTP_RRQ 1
11 #define TFTP_WRQ 2
12 #define TFTP_DATA 3
13 #define TFTP_ACK 4
14 #define TFTP_ERROR 5
15 #define TFTP_OACK 6
17 #define TFTP_FILENAME_MAX 512
19 struct tftp_t {
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;
33 } __attribute__((packed));
35 struct tftp_session {
36 Slirp *slirp;
37 char *filename;
38 int fd;
40 struct sockaddr_storage client_addr;
41 uint16_t client_port;
42 uint32_t block_nr;
44 int timestamp;
47 void tftp_input(struct sockaddr_storage *srcsas, struct mbuf *m);
49 #endif