ISC DHCP  4.3.3
A reference DHCPv4 and DHCPv6 implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dhcp6.h
Go to the documentation of this file.
1 /* dhcp6.h
2 
3  DHCPv6 Protocol structures... */
4 
5 /*
6  * Copyright (c) 2013 by Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 2006-2009 by Internet Systems Consortium, Inc. ("ISC")
8  *
9  * Permission to use, copy, modify, and distribute this software for any
10  * purpose with or without fee is hereby granted, provided that the above
11  * copyright notice and this permission notice appear in all copies.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  *
21  * Internet Systems Consortium, Inc.
22  * 950 Charter Street
23  * Redwood City, CA 94063
24  * <info@isc.org>
25  * https://www.isc.org/
26  */
27 
28 
29 /* DHCPv6 Option codes: */
30 
31 #define D6O_CLIENTID 1 /* RFC3315 */
32 #define D6O_SERVERID 2
33 #define D6O_IA_NA 3
34 #define D6O_IA_TA 4
35 #define D6O_IAADDR 5
36 #define D6O_ORO 6
37 #define D6O_PREFERENCE 7
38 #define D6O_ELAPSED_TIME 8
39 #define D6O_RELAY_MSG 9
40 /* Option code 10 unassigned. */
41 #define D6O_AUTH 11
42 #define D6O_UNICAST 12
43 #define D6O_STATUS_CODE 13
44 #define D6O_RAPID_COMMIT 14
45 #define D6O_USER_CLASS 15
46 #define D6O_VENDOR_CLASS 16
47 #define D6O_VENDOR_OPTS 17
48 #define D6O_INTERFACE_ID 18
49 #define D6O_RECONF_MSG 19
50 #define D6O_RECONF_ACCEPT 20
51 #define D6O_SIP_SERVERS_DNS 21 /* RFC3319 */
52 #define D6O_SIP_SERVERS_ADDR 22 /* RFC3319 */
53 #define D6O_NAME_SERVERS 23 /* RFC3646 */
54 #define D6O_DOMAIN_SEARCH 24 /* RFC3646 */
55 #define D6O_IA_PD 25 /* RFC3633 */
56 #define D6O_IAPREFIX 26 /* RFC3633 */
57 #define D6O_NIS_SERVERS 27 /* RFC3898 */
58 #define D6O_NISP_SERVERS 28 /* RFC3898 */
59 #define D6O_NIS_DOMAIN_NAME 29 /* RFC3898 */
60 #define D6O_NISP_DOMAIN_NAME 30 /* RFC3898 */
61 #define D6O_SNTP_SERVERS 31 /* RFC4075 */
62 #define D6O_INFORMATION_REFRESH_TIME 32 /* RFC4242 */
63 #define D6O_BCMCS_SERVER_D 33 /* RFC4280 */
64 #define D6O_BCMCS_SERVER_A 34 /* RFC4280 */
65 /* 35 is unassigned */
66 #define D6O_GEOCONF_CIVIC 36 /* RFC4776 */
67 #define D6O_REMOTE_ID 37 /* RFC4649 */
68 #define D6O_SUBSCRIBER_ID 38 /* RFC4580 */
69 #define D6O_CLIENT_FQDN 39 /* RFC4704 */
70 #define D6O_PANA_AGENT 40 /* paa-option */
71 #define D6O_NEW_POSIX_TIMEZONE 41 /* RFC4833 */
72 #define D6O_NEW_TZDB_TIMEZONE 42 /* RFC4833 */
73 #define D6O_ERO 43 /* RFC4994 */
74 #define D6O_LQ_QUERY 44 /* RFC5007 */
75 #define D6O_CLIENT_DATA 45 /* RFC5007 */
76 #define D6O_CLT_TIME 46 /* RFC5007 */
77 #define D6O_LQ_RELAY_DATA 47 /* RFC5007 */
78 #define D6O_LQ_CLIENT_LINK 48 /* RFC5007 */
79 
80 /*
81  * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007.
82  */
83 #define STATUS_Success 0
84 #define STATUS_UnspecFail 1
85 #define STATUS_NoAddrsAvail 2
86 #define STATUS_NoBinding 3
87 #define STATUS_NotOnLink 4
88 #define STATUS_UseMulticast 5
89 #define STATUS_NoPrefixAvail 6
90 #define STATUS_UnknownQueryType 7
91 #define STATUS_MalformedQuery 8
92 #define STATUS_NotConfigured 9
93 #define STATUS_NotAllowed 10
94 
95 /*
96  * DHCPv6 message types, defined in section 5.3 of RFC 3315
97  */
98 #define DHCPV6_SOLICIT 1
99 #define DHCPV6_ADVERTISE 2
100 #define DHCPV6_REQUEST 3
101 #define DHCPV6_CONFIRM 4
102 #define DHCPV6_RENEW 5
103 #define DHCPV6_REBIND 6
104 #define DHCPV6_REPLY 7
105 #define DHCPV6_RELEASE 8
106 #define DHCPV6_DECLINE 9
107 #define DHCPV6_RECONFIGURE 10
108 #define DHCPV6_INFORMATION_REQUEST 11
109 #define DHCPV6_RELAY_FORW 12
110 #define DHCPV6_RELAY_REPL 13
111 #define DHCPV6_LEASEQUERY 14
112 #define DHCPV6_LEASEQUERY_REPLY 15
113 
114 extern const char *dhcpv6_type_names[];
115 extern const int dhcpv6_type_name_max;
116 
117 /* DUID type definitions (RFC3315 section 9).
118  */
119 #define DUID_LLT 1
120 #define DUID_EN 2
121 #define DUID_LL 3
122 
123 /* Offsets into IA_*'s where Option spaces commence. */
124 #define IA_NA_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
125 #define IA_TA_OFFSET 4 /* IAID only, 4 octets */
126 #define IA_PD_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
127 
128 /* Offset into IAADDR's where Option spaces commence. */
129 #define IAADDR_OFFSET 24
130 
131 /* Offset into IAPREFIX's where Option spaces commence. */
132 #define IAPREFIX_OFFSET 25
133 
134 /* Offset into LQ_QUERY's where Option spaces commence. */
135 #define LQ_QUERY_OFFSET 17
136 
137 /*
138  * DHCPv6 well-known multicast addressess, from section 5.1 of RFC 3315
139  */
140 #define All_DHCP_Relay_Agents_and_Servers "FF02::1:2"
141 #define All_DHCP_Servers "FF05::1:3"
142 
143 /*
144  * DHCPv6 Retransmission Constants (RFC3315 section 5.5, RFC 5007)
145  */
146 
147 #define SOL_MAX_DELAY 1
148 #define SOL_TIMEOUT 1
149 #define SOL_MAX_RT 120
150 #define REQ_TIMEOUT 1
151 #define REQ_MAX_RT 30
152 #define REQ_MAX_RC 10
153 #define CNF_MAX_DELAY 1
154 #define CNF_TIMEOUT 1
155 #define CNF_MAX_RT 4
156 #define CNF_MAX_RD 10
157 #define REN_TIMEOUT 10
158 #define REN_MAX_RT 600
159 #define REB_TIMEOUT 10
160 #define REB_MAX_RT 600
161 #define INF_MAX_DELAY 1
162 #define INF_TIMEOUT 1
163 #define INF_MAX_RT 120
164 #define REL_TIMEOUT 1
165 #define REL_MAX_RC 5
166 #define DEC_TIMEOUT 1
167 #define DEC_MAX_RC 5
168 #define REC_TIMEOUT 2
169 #define REC_MAX_RC 8
170 #define HOP_COUNT_LIMIT 32
171 #define LQ6_TIMEOUT 1
172 #define LQ6_MAX_RT 10
173 #define LQ6_MAX_RC 5
174 
175 /*
176  * Normal packet format, defined in section 6 of RFC 3315
177  */
179  unsigned char msg_type;
180  unsigned char transaction_id[3];
182 };
183 
184 /* Offset into DHCPV6 Reply packets where Options spaces commence. */
185 #define REPLY_OPTIONS_INDEX 4
186 
187 /*
188  * Relay packet format, defined in section 7 of RFC 3315
189  */
191  unsigned char msg_type;
192  unsigned char hop_count;
193  unsigned char link_address[16];
194  unsigned char peer_address[16];
196 };
197 #define MAX_V6RELAY_HOPS 32
198 
199 /* Leasequery query-types (RFC 5007) */
200 
201 #define LQ6QT_BY_ADDRESS 1
202 #define LQ6QT_BY_CLIENTID 2
203 
204 /*
205  * DUID time starts 2000-01-01.
206  * This constant is the number of seconds since 1970-01-01,
207  * when the Unix epoch began.
208  */
209 #define DUID_TIME_EPOCH 946684800
210 
211 /* Information-Request Time option (RFC 4242) */
212 
213 #define IRT_DEFAULT 86400
214 #define IRT_MINIMUM 600
215 
unsigned char peer_address[16]
Definition: dhcp6.h:194
unsigned char options[FLEXIBLE_ARRAY_MEMBER]
Definition: dhcp6.h:195
unsigned char msg_type
Definition: dhcp6.h:179
const int dhcpv6_type_name_max
Definition: tables.c:637
unsigned char msg_type
Definition: dhcp6.h:191
const char * dhcpv6_type_names[]
Definition: tables.c:619
unsigned char link_address[16]
Definition: dhcp6.h:193
#define FLEXIBLE_ARRAY_MEMBER
Definition: config.h:39
unsigned char hop_count
Definition: dhcp6.h:192
unsigned char transaction_id[3]
Definition: dhcp6.h:180
unsigned char options[FLEXIBLE_ARRAY_MEMBER]
Definition: dhcp6.h:181