/*
 * $Header: /smsa/bsd:include/sys/bootp.h:bsd  1.2  $
 * $Source: /smsa/bsd:include/sys/bootp.h: $
 *
 * Copyright (c) 1989 Acorn Computers Ltd., Cambridge, England
 *
 */

#ifndef	__sys_bootp_h
#define	__sys_bootp_h

/*
 * 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.
 */

#ifndef	__sys_types_h
#include "types.h"
#endif

#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 */

#endif/*__sys_bootp_h*/

/* EOF bootp.h */
