/*
 * Copyright (c) 1989 Acorn Computers Ltd., Cambridge, England
 *
 * :RCS Log discontinued:
 * Revision 1.1  95/01/11  10:18:56  kwelton
 * Initial revision
 *
 * Revision 1.1  89/10/03  17:21:33  keith
 * Added BOOTP diskless identity, and improved net mask request
 *
 */

/*
 * This describes an implementation of the BOOTP (RFC951) protocol
 * for internet bootstrapping.
 *
 * There is only one UDP packet format, used by both client and server.
 * The client should zero all unused entries.
 */

#define CHADDR_MAX      16
#define SNAME_MAX       64
#define FILE_MAX        128
#define VEND_MAX        64

typedef struct { /* C = Must be set by client,  c = may be set by client */
                 /* S = Must be set by server,  s = may be set by server */
                 /* G = Must be set by gateway, g = may be set by gateway*/
  u_char  op,                 /* C S - BOOTREQUEST or BOOTREPLY */
          htype,              /* C   - Hardware type */
          hlen,               /* C   - Length of hardware address */
          hops;               /*  g  - Hop count (used by gateways) */
  u_long  xid;                /* C   - Transaction id */
  u_short secs,               /* C   - Seconds elapsed since start of boot */
          unused;
  u_long  ciaddr,             /* c   - Client  IP address (if known by client) */
          yiaddr,             /*   S - Client  IP address */
          siaddr,             /*   S - Server  IP address */
          giaddr;             /*  gs - Gateway IP address */
  u_char  chaddr[CHADDR_MAX]; /* C   - Client hardware address */
  u_char  sname[SNAME_MAX];   /* c S - Server hostname name */
  u_char  file[FILE_MAX];     /* c S - File name to boot */
  u_char  vend[VEND_MAX];     /* c s - vendor specific */
} BOOTP;

#define BOOTREQUEST     1
#define BOOTREPLY       2

#define ETHERNET_TYPE   1       /* ethernet hardware type */
#define ETHERNET_LEN    6       /* ethernet hardware byte length */

#define VENDOR_COOKIE	0x63825363 /* host byte order */

#define VENDOR_PAD		0	/* Length=0 */
#define VENDOR_NETMASK  	1	/* Length=4 */
#define VENDOR_TIMEOFFSET	2	/* Length=4 */
#define VENDOR_GATEWAY		3
#define VENDOR_TIMESERVER	4
#define VENDOR_IEN116SERVER	5
#define VENDOR_NAMESERVER	6
#define VENDOR_LOGSERVER	7
#define VENDOR_QUOTESERVER	8
#define VENDOR_LPRSERVER	9
#define VENDOR_IMPRESSSERVER	10
#define VENDOR_RLPSERVER	11
#define VENDOR_HOSTNAME		12
#define VENDOR_BOOTFILESIZE	13

/* Taken from dhcp.h */
#define VENDOR_DOMAINNAME       15      /* Domain Name */
#define VENDOR_IPFORWARDING     19      /* IP Forwarding Enable/Disable Option */

#define VENDOR_END		255

/* EOF bootp.h */
