]>
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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Bootstrap Protocol (BOOTP). RFC 951.
31 * 14 May 1992 ? at NeXT
32 * Added correct padding to struct nextvend. This is
33 * needed for the i386 due to alignment differences wrt
34 * the m68k. Also adjusted the size of the array fields
35 * because the NeXT vendor area was overflowing the bootp
39 #define iaddr_t struct in_addr
42 u_char bp_op
; /* packet opcode type */
45 u_char bp_htype
; /* hardware addr type */
46 u_char bp_hlen
; /* hardware addr length */
47 u_char bp_hops
; /* gateway hops */
48 u_long bp_xid
; /* transaction ID */
49 u_short bp_secs
; /* seconds since boot began */
51 iaddr_t bp_ciaddr
; /* client IP address */
52 iaddr_t bp_yiaddr
; /* 'your' IP address */
53 iaddr_t bp_siaddr
; /* server IP address */
54 iaddr_t bp_giaddr
; /* gateway IP address */
55 u_char bp_chaddr
[16]; /* client hardware address */
56 u_char bp_sname
[64]; /* server host name */
57 u_char bp_file
[128]; /* boot file name */
58 u_char bp_vend
[64]; /* vendor-specific area */
62 * UDP port numbers, server and client.
64 #define IPPORT_BOOTPS 67
65 #define IPPORT_BOOTPC 68
68 * "vendor" data permitted for Stanford boot clients.
71 u_char v_magic
[4]; /* magic number */
72 u_long v_flags
; /* flags/opcodes, etc. */
73 u_char v_unused
[56]; /* currently unused */
75 #define VM_STANFORD "STAN" /* v_magic for Stanford */
78 #define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
79 #define VF_HELP 2 /* help me, I'm not registered */
81 #define NVMAXTEXT 55 /* don't change this, it just fits RFC951 */
83 u_char nv_magic
[4]; /* Magic number for vendor specificity */
84 u_char nv_version
; /* NeXT protocol version */
87 * of the union to a 16
89 * struct/union alignment
96 u_char NV1_opcode
; /* opcode - Version 1 */
97 u_char NV1_xid
; /* transcation id */
98 u_char NV1_text
[NVMAXTEXT
]; /* text */
99 u_char NV1_null
; /* null terminator */
103 #define nv_unused nv_U.NV0
104 #define nv_opcode nv_U.NV1.NV1_opcode
105 #define nv_xid nv_U.NV1.NV1_xid
106 #define nv_text nv_U.NV1.NV1_text
107 #define nv_null nv_U.NV1.NV1_null
110 #define VM_NEXT "NeXT" /* v_magic for NeXT, Inc. */
115 #define BPOP_QUERY_NE 2
118 struct bootp_packet
{
120 struct udphdr bp_udp
;
121 struct bootp bp_bootp
;
124 #define BOOTP_PKTSIZE (sizeof (struct bootp_packet))
126 /* backoffs must be masks */
127 #define BOOTP_MIN_BACKOFF 0x7ff /* 2.048 sec */
128 #define BOOTP_MAX_BACKOFF 0xffff /* 65.535 sec */
129 #define BOOTP_RETRY 6 /* # retries */