diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 08:53:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 08:53:40 +0000 |
commit | d6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch) | |
tree | ece253b876159b39c620e62b6c9b1174642e070e /sys/arch/i386/netboot/tftp.h |
initial import of NetBSD tree
Diffstat (limited to 'sys/arch/i386/netboot/tftp.h')
-rw-r--r-- | sys/arch/i386/netboot/tftp.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/arch/i386/netboot/tftp.h b/sys/arch/i386/netboot/tftp.h new file mode 100644 index 00000000000..6abba940325 --- /dev/null +++ b/sys/arch/i386/netboot/tftp.h @@ -0,0 +1,43 @@ +/* $NetBSD: tftp.h,v 1.3 1994/10/27 04:21:27 cgd Exp $ */ + +/* + * source in this file came from + * the Mach ethernet boot written by Leendert van Doorn. + * + * Trivial File Transfer Protocol (see RFC 783) + */ + +#define SEGSIZE 512 /* data segment size */ + +/* + * Packet types + */ +#define TFTP_RRQ 01 /* read request */ +#define TFTP_WRQ 02 /* write request */ +#define TFTP_DATA 03 /* data packet */ +#define TFTP_ACK 04 /* acknowledgement */ +#define TFTP_ERROR 05 /* error code */ + +/* + * TFTP header structure + */ +typedef struct { + u_short th_op; /* packet type */ + union { + u_short tu_block; /* block # */ + u_short tu_code; /* error code */ + char tu_stuff[1]; /* request packet stuff */ + } th_u; +} tftphdr_t; + +/* for ease of reference */ +#define th_block th_u.tu_block +#define th_code th_u.tu_code +#define th_stuff th_u.tu_stuff +#define th_data th_stuff[2] +#define th_msg th_data + +void SetTftpParms(ipaddr_t server, ipaddr_t gateway, char *file_name); +u_long Read(void *result, u_long nbytes); +u_long PhysRead(u_long addr, u_long nbytes); +void IpSend(packet_t *pkt, ipaddr_t dst, ipaddr_t gateway); |