Print this page
7388 Support DHCP Client FQDN. Allow IAID/DUID for all v4.
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/netinet/dhcp.h
+++ new/usr/src/uts/common/netinet/dhcp.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
|
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 1996-2003 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 + * Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
25 26 */
26 27
27 28 /*
28 29 * dhcp.h - Generic DHCP definitions, as per RFC's 2131 and 2132.
29 30 */
30 31
31 32 #ifndef _DHCP_H
32 33 #define _DHCP_H
33 34
34 35 #pragma ident "%Z%%M% %I% %E% SMI"
35 36
36 37 #ifdef __cplusplus
37 38 extern "C" {
38 39 #endif
39 40
40 41 #ifdef _REENTRANT
41 42 #include <thread.h>
42 43 #endif /* _REENTRANT */
43 44
44 45 /*
45 46 * DHCP option codes.
46 47 */
47 48
48 49 #define CD_PAD 0
49 50 #define CD_END 255
50 51 #define CD_SUBNETMASK 1
51 52 #define CD_TIMEOFFSET 2
52 53 #define CD_ROUTER 3
53 54 #define CD_TIMESERV 4
54 55 #define CD_IEN116_NAME_SERV 5
55 56 #define CD_DNSSERV 6
56 57 #define CD_LOG_SERV 7
57 58 #define CD_COOKIE_SERV 8
58 59 #define CD_LPR_SERV 9
59 60 #define CD_IMPRESS_SERV 10
60 61 #define CD_RESOURCE_SERV 11
61 62 #define CD_HOSTNAME 12
62 63 #define CD_BOOT_SIZE 13
63 64 #define CD_DUMP_FILE 14
64 65 #define CD_DNSDOMAIN 15
65 66 #define CD_SWAP_SERV 16
66 67 #define CD_ROOT_PATH 17
67 68 #define CD_EXTEND_PATH 18
68 69
69 70 /* IP layer parameters */
70 71 #define CD_IP_FORWARDING_ON 19
71 72 #define CD_NON_LCL_ROUTE_ON 20
72 73 #define CD_POLICY_FILTER 21
73 74 #define CD_MAXIPSIZE 22
74 75 #define CD_IPTTL 23
75 76 #define CD_PATH_MTU_TIMEOUT 24
76 77 #define CD_PATH_MTU_TABLE_SZ 25
77 78
78 79 /* IP layer parameters per interface */
79 80 #define CD_MTU 26
80 81 #define CD_ALL_SUBNETS_LCL_ON 27
81 82 #define CD_BROADCASTADDR 28
82 83 #define CD_MASK_DISCVRY_ON 29
83 84 #define CD_MASK_SUPPLIER_ON 30
84 85 #define CD_ROUTER_DISCVRY_ON 31
85 86 #define CD_ROUTER_SOLICIT_SERV 32
86 87 #define CD_STATIC_ROUTE 33
87 88
88 89 /* Link Layer Parameters per Interface */
89 90 #define CD_TRAILER_ENCAPS_ON 34
90 91 #define CD_ARP_TIMEOUT 35
91 92 #define CD_ETHERNET_ENCAPS_ON 36
92 93
93 94 /* TCP Parameters */
94 95 #define CD_TCP_TTL 37
95 96 #define CD_TCP_KALIVE_INTVL 38
96 97 #define CD_TCP_KALIVE_GRBG_ON 39
97 98
98 99 /* Application layer parameters */
99 100 #define CD_NIS_DOMAIN 40
100 101 #define CD_NIS_SERV 41
101 102 #define CD_NTP_SERV 42
102 103 #define CD_VENDOR_SPEC 43
103 104
104 105 /* NetBIOS parameters */
105 106 #define CD_NETBIOS_NAME_SERV 44
106 107 #define CD_NETBIOS_DIST_SERV 45
107 108 #define CD_NETBIOS_NODE_TYPE 46
108 109 #define CD_NETBIOS_SCOPE 47
109 110
110 111 /* X Window parameters */
111 112 #define CD_XWIN_FONT_SERV 48
112 113 #define CD_XWIN_DISP_SERV 49
113 114
114 115 /* DHCP protocol extension options */
115 116 #define CD_REQUESTED_IP_ADDR 50
116 117 #define CD_LEASE_TIME 51
117 118 #define CD_OPTION_OVERLOAD 52
118 119 #define CD_DHCP_TYPE 53
119 120 #define CD_SERVER_ID 54
120 121 #define CD_REQUEST_LIST 55
121 122 #define CD_MESSAGE 56
122 123 #define CD_MAX_DHCP_SIZE 57
123 124 #define CD_T1_TIME 58
124 125 #define CD_T2_TIME 59
125 126 #define CD_CLASS_ID 60
126 127 #define CD_CLIENT_ID 61
127 128
128 129 /* Netware options */
129 130 #define CD_NW_IP_DOMAIN 62
130 131 #define CD_NW_IP_OPTIONS 63
131 132
132 133 /* Nisplus options */
133 134 #define CD_NISPLUS_DMAIN 64
134 135 #define CD_NISPLUS_SERVS 65
135 136
136 137 /* Optional sname/bootfile options */
137 138 #define CD_TFTP_SERV_NAME 66
138 139 #define CD_OPT_BOOTFILE_NAME 67
139 140
140 141 /* Additional server options */
141 142 #define CD_MOBILE_IP_AGENT 68
142 143 #define CD_SMTP_SERVS 69
143 144 #define CD_POP3_SERVS 70
144 145 #define CD_NNTP_SERVS 71
145 146 #define CD_WWW_SERVS 72
146 147 #define CD_FINGER_SERVS 73
147 148 #define CD_IRC_SERVS 74
148 149
149 150 /* Streettalk options */
|
↓ open down ↓ |
115 lines elided |
↑ open up ↑ |
150 151 #define CD_STREETTALK_SERVS 75
151 152 #define CD_STREETTALK_DA_SERVS 76
152 153
153 154 /* User class identifier */
154 155 #define CD_USER_CLASS_ID 77
155 156
156 157 /* Newer options */
157 158
158 159 #define CD_SLPDA 78
159 160 #define CD_SLPSS 79
161 +#define CD_CLIENTFQDN 81
160 162 #define CD_AGENTOPT 82
163 +
164 +/*
165 + * Per RFC 3679, option 89 was "Never published as standard and [is] not in
166 + * general use". See active CD_CLIENTFQDN and RFC 4702.
167 + */
161 168 #define CD_FQDN 89
169 +
162 170 #define CD_PXEARCHi 93
163 171 #define CD_PXENIIi 94
164 172 #define CD_PXECID 95
165 173 #define CD_MULTICST 107
166 174
167 175 #define DHCP_FIRST_OPT CD_SUBNETMASK
168 176 #define DHCP_LAST_STD CD_MULTICST
169 177 #define DHCP_SITE_OPT 128 /* inclusive */
170 178 #define DHCP_END_SITE 254
171 179 #define DHCP_LAST_OPT DHCP_END_SITE /* last op code */
172 180
173 181 #define DHCP_MAX_OPT_SIZE 255 /* maximum option size in octets */
174 182
175 183 /*
176 184 * DHCP Packet. What will fit in a ethernet frame. We may use a smaller
177 185 * size, based on what our transport can handle.
178 186 */
179 187 #define DHCP_DEF_MAX_SIZE 576 /* as spec'ed in RFC 2131 */
180 188 #define PKT_BUFFER 1486 /* max possible size of pkt buffer */
181 189 #define BASE_PKT_SIZE 240 /* everything but the options */
182 190 typedef struct dhcp {
183 191 uint8_t op; /* message opcode */
184 192 uint8_t htype; /* Hardware address type */
185 193 uint8_t hlen; /* Hardware address length */
186 194 uint8_t hops; /* Used by relay agents */
187 195 uint32_t xid; /* transaction id */
188 196 uint16_t secs; /* Secs elapsed since client boot */
189 197 uint16_t flags; /* DHCP Flags field */
190 198 struct in_addr ciaddr; /* client IP addr */
191 199 struct in_addr yiaddr; /* 'Your' IP addr. (from server) */
192 200 struct in_addr siaddr; /* Boot server IP addr */
193 201 struct in_addr giaddr; /* Relay agent IP addr */
194 202 uint8_t chaddr[16]; /* Client hardware addr */
195 203 uint8_t sname[64]; /* Optl. boot server hostname */
196 204 uint8_t file[128]; /* boot file name (ascii path) */
197 205 uint8_t cookie[4]; /* Magic cookie */
198 206 uint8_t options[60]; /* Options */
199 207 } PKT;
200 208
201 209 typedef uint32_t lease_t; /* DHCP lease time (32 bit quantity) */
202 210
203 211 /*
204 212 * DHCP packet types. As per protocol.
205 213 */
206 214 #define DISCOVER ((uint8_t)1)
207 215 #define OFFER ((uint8_t)2)
208 216 #define REQUEST ((uint8_t)3)
209 217 #define DECLINE ((uint8_t)4)
210 218 #define ACK ((uint8_t)5)
211 219 #define NAK ((uint8_t)6)
212 220 #define RELEASE ((uint8_t)7)
213 221 #define INFORM ((uint8_t)8)
214 222
215 223 /*
216 224 * Generic DHCP protocol defines
217 225 */
218 226 #define DHCP_PERM ((lease_t)0xffffffff) /* "permanent" lease time */
219 227 #define BOOTREQUEST (1) /* BOOTP REQUEST opcode */
220 228 #define BOOTREPLY (2) /* BOOTP REPLY opcode */
221 229 #define BOOTMAGIC { 99, 130, 83, 99 } /* rfc1048 magic cookie */
222 230 #define BCAST_MASK 0x8000 /* BROADCAST flag */
223 231
224 232 #ifdef __cplusplus
225 233 }
226 234 #endif
227 235
228 236 #endif /* _DHCP_H */
|
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX