]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/bootp.h
4de5d87cd60a46d1701e7e8b8edfefc0001a6af1
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 #define iaddr_t struct in_addr
39 u_char bp_op
; /* packet opcode type */
42 u_char bp_htype
; /* hardware addr type */
43 u_char bp_hlen
; /* hardware addr length */
44 u_char bp_hops
; /* gateway hops */
45 u_long bp_xid
; /* transaction ID */
46 u_short bp_secs
; /* seconds since boot began */
48 iaddr_t bp_ciaddr
; /* client IP address */
49 iaddr_t bp_yiaddr
; /* 'your' IP address */
50 iaddr_t bp_siaddr
; /* server IP address */
51 iaddr_t bp_giaddr
; /* gateway IP address */
52 u_char bp_chaddr
[16]; /* client hardware address */
53 u_char bp_sname
[64]; /* server host name */
54 u_char bp_file
[128]; /* boot file name */
55 u_char bp_vend
[64]; /* vendor-specific area */
59 * UDP port numbers, server and client.
61 #define IPPORT_BOOTPS 67
62 #define IPPORT_BOOTPC 68
65 * "vendor" data permitted for Stanford boot clients.
68 u_char v_magic
[4]; /* magic number */
69 u_long v_flags
; /* flags/opcodes, etc. */
70 u_char v_unused
[56]; /* currently unused */
72 #define VM_STANFORD "STAN" /* v_magic for Stanford */
75 #define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
76 #define VF_HELP 2 /* help me, I'm not registered */
78 #define NVMAXTEXT 55 /* don't change this, it just fits RFC951 */
80 u_char nv_magic
[4]; /* Magic number for vendor specificity */
81 u_char nv_version
; /* NeXT protocol version */
84 * of the union to a 16
86 * struct/union alignment
93 u_char NV1_opcode
; /* opcode - Version 1 */
94 u_char NV1_xid
; /* transcation id */
95 u_char NV1_text
[NVMAXTEXT
]; /* text */
96 u_char NV1_null
; /* null terminator */
100 #define nv_unused nv_U.NV0
101 #define nv_opcode nv_U.NV1.NV1_opcode
102 #define nv_xid nv_U.NV1.NV1_xid
103 #define nv_text nv_U.NV1.NV1_text
104 #define nv_null nv_U.NV1.NV1_null
107 #define VM_NEXT "NeXT" /* v_magic for NeXT, Inc. */
112 #define BPOP_QUERY_NE 2
115 struct bootp_packet
{
117 struct udphdr bp_udp
;
118 struct bootp bp_bootp
;
121 #define BOOTP_PKTSIZE (sizeof (struct bootp_packet))
123 /* backoffs must be masks */
124 #define BOOTP_MIN_BACKOFF 0x7ff /* 2.048 sec */
125 #define BOOTP_MAX_BACKOFF 0xffff /* 65.535 sec */
126 #define BOOTP_RETRY 6 /* # retries */