includes/dhcp6.h

Go to the documentation of this file.
00001 /* dhcp6.h
00002 
00003    DHCPv6 Protocol structures... */
00004 
00005 /*
00006  * Copyright (c) 2013 by Internet Systems Consortium, Inc. ("ISC")
00007  * Copyright (c) 2006-2009 by Internet Systems Consortium, Inc. ("ISC")
00008  *
00009  * Permission to use, copy, modify, and distribute this software for any
00010  * purpose with or without fee is hereby granted, provided that the above
00011  * copyright notice and this permission notice appear in all copies.
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
00014  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00015  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
00016  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00017  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00018  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
00019  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00020  *
00021  *   Internet Systems Consortium, Inc.
00022  *   950 Charter Street
00023  *   Redwood City, CA 94063
00024  *   <info@isc.org>
00025  *   https://www.isc.org/
00026  */
00027 
00028 
00029 /* DHCPv6 Option codes: */
00030 
00031 #define D6O_CLIENTID                            1 /* RFC3315 */
00032 #define D6O_SERVERID                            2
00033 #define D6O_IA_NA                               3
00034 #define D6O_IA_TA                               4
00035 #define D6O_IAADDR                              5
00036 #define D6O_ORO                                 6
00037 #define D6O_PREFERENCE                          7
00038 #define D6O_ELAPSED_TIME                        8
00039 #define D6O_RELAY_MSG                           9
00040 /* Option code 10 unassigned. */
00041 #define D6O_AUTH                                11
00042 #define D6O_UNICAST                             12
00043 #define D6O_STATUS_CODE                         13
00044 #define D6O_RAPID_COMMIT                        14
00045 #define D6O_USER_CLASS                          15
00046 #define D6O_VENDOR_CLASS                        16
00047 #define D6O_VENDOR_OPTS                         17
00048 #define D6O_INTERFACE_ID                        18
00049 #define D6O_RECONF_MSG                          19
00050 #define D6O_RECONF_ACCEPT                       20
00051 #define D6O_SIP_SERVERS_DNS                     21 /* RFC3319 */
00052 #define D6O_SIP_SERVERS_ADDR                    22 /* RFC3319 */
00053 #define D6O_NAME_SERVERS                        23 /* RFC3646 */
00054 #define D6O_DOMAIN_SEARCH                       24 /* RFC3646 */
00055 #define D6O_IA_PD                               25 /* RFC3633 */
00056 #define D6O_IAPREFIX                            26 /* RFC3633 */
00057 #define D6O_NIS_SERVERS                         27 /* RFC3898 */
00058 #define D6O_NISP_SERVERS                        28 /* RFC3898 */
00059 #define D6O_NIS_DOMAIN_NAME                     29 /* RFC3898 */
00060 #define D6O_NISP_DOMAIN_NAME                    30 /* RFC3898 */
00061 #define D6O_SNTP_SERVERS                        31 /* RFC4075 */
00062 #define D6O_INFORMATION_REFRESH_TIME            32 /* RFC4242 */
00063 #define D6O_BCMCS_SERVER_D                      33 /* RFC4280 */
00064 #define D6O_BCMCS_SERVER_A                      34 /* RFC4280 */
00065 /* 35 is unassigned */
00066 #define D6O_GEOCONF_CIVIC                       36 /* RFC4776 */
00067 #define D6O_REMOTE_ID                           37 /* RFC4649 */
00068 #define D6O_SUBSCRIBER_ID                       38 /* RFC4580 */
00069 #define D6O_CLIENT_FQDN                         39 /* RFC4704 */
00070 #define D6O_PANA_AGENT                          40 /* paa-option */
00071 #define D6O_NEW_POSIX_TIMEZONE                  41 /* RFC4833 */
00072 #define D6O_NEW_TZDB_TIMEZONE                   42 /* RFC4833 */
00073 #define D6O_ERO                                 43 /* RFC4994 */
00074 #define D6O_LQ_QUERY                            44 /* RFC5007 */
00075 #define D6O_CLIENT_DATA                         45 /* RFC5007 */
00076 #define D6O_CLT_TIME                            46 /* RFC5007 */
00077 #define D6O_LQ_RELAY_DATA                       47 /* RFC5007 */
00078 #define D6O_LQ_CLIENT_LINK                      48 /* RFC5007 */
00079 
00080 /* 
00081  * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007.
00082  */
00083 #define STATUS_Success           0
00084 #define STATUS_UnspecFail        1
00085 #define STATUS_NoAddrsAvail      2
00086 #define STATUS_NoBinding         3
00087 #define STATUS_NotOnLink         4 
00088 #define STATUS_UseMulticast      5 
00089 #define STATUS_NoPrefixAvail     6
00090 #define STATUS_UnknownQueryType  7
00091 #define STATUS_MalformedQuery    8
00092 #define STATUS_NotConfigured     9
00093 #define STATUS_NotAllowed       10
00094 
00095 /* 
00096  * DHCPv6 message types, defined in section 5.3 of RFC 3315 
00097  */
00098 #define DHCPV6_SOLICIT              1
00099 #define DHCPV6_ADVERTISE            2
00100 #define DHCPV6_REQUEST              3
00101 #define DHCPV6_CONFIRM              4
00102 #define DHCPV6_RENEW                5
00103 #define DHCPV6_REBIND               6
00104 #define DHCPV6_REPLY                7
00105 #define DHCPV6_RELEASE              8
00106 #define DHCPV6_DECLINE              9
00107 #define DHCPV6_RECONFIGURE         10
00108 #define DHCPV6_INFORMATION_REQUEST 11
00109 #define DHCPV6_RELAY_FORW          12
00110 #define DHCPV6_RELAY_REPL          13
00111 #define DHCPV6_LEASEQUERY          14
00112 #define DHCPV6_LEASEQUERY_REPLY    15
00113 
00114 extern const char *dhcpv6_type_names[];
00115 extern const int dhcpv6_type_name_max;
00116 
00117 /* DUID type definitions (RFC3315 section 9).
00118  */
00119 #define DUID_LLT        1
00120 #define DUID_EN         2
00121 #define DUID_LL         3
00122 
00123 /* Offsets into IA_*'s where Option spaces commence.  */
00124 #define IA_NA_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
00125 #define IA_TA_OFFSET  4 /* IAID only, 4 octets */
00126 #define IA_PD_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
00127 
00128 /* Offset into IAADDR's where Option spaces commence. */
00129 #define IAADDR_OFFSET 24
00130 
00131 /* Offset into IAPREFIX's where Option spaces commence. */
00132 #define IAPREFIX_OFFSET 25
00133 
00134 /* Offset into LQ_QUERY's where Option spaces commence. */
00135 #define LQ_QUERY_OFFSET 17
00136 
00137 /* 
00138  * DHCPv6 well-known multicast addressess, from section 5.1 of RFC 3315 
00139  */
00140 #define All_DHCP_Relay_Agents_and_Servers "FF02::1:2"
00141 #define All_DHCP_Servers "FF05::1:3"
00142 
00143 /*
00144  * DHCPv6 Retransmission Constants (RFC3315 section 5.5, RFC 5007)
00145  */
00146 
00147 #define SOL_MAX_DELAY     1
00148 #define SOL_TIMEOUT       1
00149 #define SOL_MAX_RT      120
00150 #define REQ_TIMEOUT       1
00151 #define REQ_MAX_RT       30
00152 #define REQ_MAX_RC       10
00153 #define CNF_MAX_DELAY     1
00154 #define CNF_TIMEOUT       1
00155 #define CNF_MAX_RT        4
00156 #define CNF_MAX_RD       10
00157 #define REN_TIMEOUT      10
00158 #define REN_MAX_RT      600
00159 #define REB_TIMEOUT      10
00160 #define REB_MAX_RT      600
00161 #define INF_MAX_DELAY     1
00162 #define INF_TIMEOUT       1
00163 #define INF_MAX_RT      120
00164 #define REL_TIMEOUT       1
00165 #define REL_MAX_RC        5
00166 #define DEC_TIMEOUT       1
00167 #define DEC_MAX_RC        5
00168 #define REC_TIMEOUT       2
00169 #define REC_MAX_RC        8
00170 #define HOP_COUNT_LIMIT  32
00171 #define LQ6_TIMEOUT       1
00172 #define LQ6_MAX_RT       10
00173 #define LQ6_MAX_RC        5
00174 
00175 /* 
00176  * Normal packet format, defined in section 6 of RFC 3315 
00177  */
00178 struct dhcpv6_packet {
00179         unsigned char msg_type;
00180         unsigned char transaction_id[3];
00181         unsigned char options[FLEXIBLE_ARRAY_MEMBER];
00182 };
00183 
00184 /* Offset into DHCPV6 Reply packets where Options spaces commence. */
00185 #define REPLY_OPTIONS_INDEX 4
00186 
00187 /* 
00188  * Relay packet format, defined in section 7 of RFC 3315 
00189  */
00190 struct dhcpv6_relay_packet {
00191         unsigned char msg_type;
00192         unsigned char hop_count;
00193         unsigned char link_address[16];
00194         unsigned char peer_address[16];
00195         unsigned char options[FLEXIBLE_ARRAY_MEMBER];
00196 };
00197 #define MAX_V6RELAY_HOPS 32
00198 
00199 /* Leasequery query-types (RFC 5007) */
00200 
00201 #define LQ6QT_BY_ADDRESS        1
00202 #define LQ6QT_BY_CLIENTID       2
00203 
00204 /*
00205  * DUID time starts 2000-01-01.
00206  * This constant is the number of seconds since 1970-01-01,
00207  * when the Unix epoch began.
00208  */
00209 #define DUID_TIME_EPOCH 946684800
00210 
00211 /* Information-Request Time option (RFC 4242) */
00212 
00213 #define IRT_DEFAULT     86400
00214 #define IRT_MINIMUM     600
00215 

Generated on 5 Apr 2014 for ISC DHCP by  doxygen 1.6.1