/* Copyright 1997 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * 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 */

/* 19980821: sbrodie: The comment used to say "network byte order" but
 * this is wrong.  The value stated here is in HOST byte order.
 * This "confused" the Internet 5.0x modules' vendor block validation code.
 * See TCP/IP Illus. for docs.  Fake IP address is 99.130.83.99
 */
#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
#define VENDOR_END		255

/* EOF bootp.h */
