]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/bootp.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Bootstrap Protocol (BOOTP). RFC 951.
28 * 14 May 1992 ? at NeXT
29 * Added correct padding to struct nextvend. This is
30 * needed for the i386 due to alignment differences wrt
31 * the m68k. Also adjusted the size of the array fields
32 * because the NeXT vendor area was overflowing the bootp
36 #include <netinet/udp.h>
38 #define iaddr_t struct in_addr
41 u_char bp_op
; /* packet opcode type */
44 u_char bp_htype
; /* hardware addr type */
45 u_char bp_hlen
; /* hardware addr length */
46 u_char bp_hops
; /* gateway hops */
47 u_long bp_xid
; /* transaction ID */
48 u_short bp_secs
; /* seconds since boot began */
50 iaddr_t bp_ciaddr
; /* client IP address */
51 iaddr_t bp_yiaddr
; /* 'your' IP address */
52 iaddr_t bp_siaddr
; /* server IP address */
53 iaddr_t bp_giaddr
; /* gateway IP address */
54 u_char bp_chaddr
[16]; /* client hardware address */
55 u_char bp_sname
[64]; /* server host name */
56 u_char bp_file
[128]; /* boot file name */
57 u_char bp_vend
[64]; /* vendor-specific area */
61 * UDP port numbers, server and client.
63 #define IPPORT_BOOTPS 67
64 #define IPPORT_BOOTPC 68
67 * "vendor" data permitted for Stanford boot clients.
70 u_char v_magic
[4]; /* magic number */
71 u_long v_flags
; /* flags/opcodes, etc. */
72 u_char v_unused
[56]; /* currently unused */
74 #define VM_STANFORD "STAN" /* v_magic for Stanford */
77 #define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
78 #define VF_HELP 2 /* help me, I'm not registered */
80 #define NVMAXTEXT 55 /* don't change this, it just fits RFC951 */
82 u_char nv_magic
[4]; /* Magic number for vendor specificity */
83 u_char nv_version
; /* NeXT protocol version */
86 * of the union to a 16
88 * struct/union alignment
95 u_char NV1_opcode
; /* opcode - Version 1 */
96 u_char NV1_xid
; /* transcation id */
97 u_char NV1_text
[NVMAXTEXT
]; /* text */
98 u_char NV1_null
; /* null terminator */
102 #define nv_unused nv_U.NV0
103 #define nv_opcode nv_U.NV1.NV1_opcode
104 #define nv_xid nv_U.NV1.NV1_xid
105 #define nv_text nv_U.NV1.NV1_text
106 #define nv_null nv_U.NV1.NV1_null
109 #define VM_NEXT "NeXT" /* v_magic for NeXT, Inc. */
114 #define BPOP_QUERY_NE 2
117 struct bootp_packet
{
119 struct udphdr bp_udp
;
120 struct bootp bp_bootp
;
123 #define BOOTP_PKTSIZE (sizeof (struct bootp_packet))
125 /* backoffs must be masks */
126 #define BOOTP_MIN_BACKOFF 0x7ff /* 2.048 sec */
127 #define BOOTP_MAX_BACKOFF 0xffff /* 65.535 sec */
128 #define BOOTP_RETRY 6 /* # retries */