6 * Dynamic Host Configuration Protocol for IPv6, as per RFC3315
10 FILE_LICENCE ( GPL2_OR_LATER
);
14 /** DHCPv6 server port */
15 #define DHCP6S_PORT 547
17 /** DHCPv6 client port */
18 #define DHCP6C_PORT 546
20 /** DHCPv6 Status Codes */
21 #define DHCP6_SUCCESS 0
22 #define DHCP6_UNSPEC 1
23 #define DHCP6_NOADDRS 2
24 #define DHCP6_NOBIND 3
25 #define DHCP6_NOTLINK 4
28 /** DHCPv6 message types */
29 #define DHCP6_SOLICIT 1
30 #define DHCP6_ADVERTISE 2
31 #define DHCP6_REQUEST 3
32 #define DHCP6_CONFIRM 4
34 #define DHCP6_REBIND 6
36 #define DHCP6_RELEASE 8
37 #define DHCP6_DECLINE 9
38 #define DHCP6_RECONF 10
39 #define DHCP6_INFOREQ 11
41 /** DHCPv6 message type. DHCPv6 options follow this header. */
46 /** DHCP option header type. */
47 struct dhcp6_opt_hdr
{
50 /** variable-length option data. */
53 /** DHCPv6 option types */
54 #define DHCP6_OPT_CLIENTID 1
55 #define DHCP6_OPT_SERVERID 2
56 #define DHCP6_OPT_IA_NA 3
57 #define DHCP6_OPT_IA_TA 4
58 #define DHCP6_OPT_IAADDR 5
59 #define DHCP6_OPT_ORO 6
60 #define DHCP6_OPT_PREFERENCE 7
61 #define DHCP6_OPT_ELAPSED 8
62 #define DHCP6_OPT_UNICAST 12
63 #define DHCP6_OPT_STATUS 13
64 #define DHCP6_OPT_RCOMMIT 14
65 #define DHCP6_OPT_USER_CLASS 15
66 #define DHCP6_OPT_VENDOR_CLASS 16
67 #define DHCP6_OPT_VENDOR_INFO 17
68 #define DHCP6_OPT_IFACE_ID 18
69 #define DHCP6_OPT_RECONF_MSG 19
70 #define DHCP6_OPT_RECONF_ACCEPT 20
72 #define DHCP6_OPT_DNS_SERVERS 23
73 #define DHCP6_OPT_DNS_DOMAINS 24
75 /** Identity association for non-temporary address option */
76 struct dhcp6_opt_ia_na
{
82 /** IA-NA options follow. */
85 /** Identity association for temporary addresses option */
86 struct dhcp6_opt_ia_ta
{
90 /** IA-TA options follow. */
93 /** Identity association, Address option. */
94 struct dhcp6_opt_iaaddr
{
98 uint32_t pref_lifetime
;
99 uint32_t valid_lifetime
;
100 /** IAddr options follow. */
103 /** Option request option. */
104 struct dhcp6_opt_oro
{
110 /** Preference option. */
111 struct dhcp6_opt_pref
{
117 /** Elapsed Time option. */
118 struct dhcp6_opt_elapsed
{
124 /** Server Unicast option. */
125 struct dhcp6_opt_unicast
{
128 struct in6_addr addr
;
131 /** Status Code option. */
132 struct dhcp6_opt_status_code
{
136 uint8_t utf8_message
[]; /** UTF-8, for display to the user. */
139 /** User Class option. */
140 struct dhcp6_opt_user_class
{
143 char user_class_data
[];
146 /** Vendor Class option. */
147 struct dhcp6_opt_vendor_class
{
150 uint32_t enterprise_number
;
151 char vendor_class_data
[];
154 /** Vendor-Specific Information option. */
155 struct dhcp6_opt_vendor_specific_info
{
158 uint32_t enterprise_number
;
159 char option_data
[]; /** Interpreted by vendor-specific code. */
162 /** Interface-ID option. */
163 struct dhcp6_opt_interface_id
{
169 /** Reconfigure Message option. */
170 struct dhcp6_opt_reconfigure
{
176 /** DHCPv6 DUID types */
177 #define DHCP6_DUID_LLT 1
178 #define DHCP6_DUID_EN 2
179 #define DHCP6_DUID_LL 3
181 /** Common header for the DHCPv6 DUID. */
186 /** DUID based on link layer address plus time (DUID-LLT) */
187 struct dhcp6_duid_llt
{
188 uint16_t code
; /** 1 for LLT */
191 /** variable length link-layer address follows */
194 /** DUID assigned by vendor based on enterprise number (DUID-EN) */
195 struct dhcp6_duid_en
{
196 uint16_t code
; /** 2 for EN */
198 /** variable length for identifier, defined by the vendor */
201 /** DUID based on link layer address */
202 struct dhcp6_duid_ll
{
203 uint16_t code
; /** 3 for LL */
205 /** variable length for link layer address */
208 /** Start a DHCP6 transaction. */
209 int start_dhcp6 ( struct job_interface
*job
, struct net_device
*netdev
,
210 int onlyinfo
, struct rsolicit_info
*router
);