00001
00002
00003 #define TFTP_SESSIONS_MAX 3
00004
00005 #define TFTP_SERVER 69
00006
00007 #define TFTP_RRQ 1
00008 #define TFTP_WRQ 2
00009 #define TFTP_DATA 3
00010 #define TFTP_ACK 4
00011 #define TFTP_ERROR 5
00012 #define TFTP_OACK 6
00013
00014 #define TFTP_FILENAME_MAX 512
00015
00016 struct tftp_t {
00017 struct ip ip;
00018 struct udphdr udp;
00019 u_int16_t tp_op;
00020 union {
00021 struct {
00022 u_int16_t tp_block_nr;
00023 u_int8_t tp_buf[512];
00024 } tp_data;
00025 struct {
00026 u_int16_t tp_error_code;
00027 u_int8_t tp_msg[512];
00028 } tp_error;
00029 u_int8_t tp_buf[512 + 2];
00030 } x;
00031 };
00032
00033 void tftp_input(struct mbuf *m);