<div class="content" name="R_DhcpServerSetConfigV6" uuid="29668795-cd0d-4762-8a4d-520e8eb3b313"><p>The <b>R_DhcpServerSetConfigV6</b> method sets the DHCPv6
server configuration data at the scope level or at the server level.</p><dl>
<dd>
<div><pre> DWORD R_DhcpServerSetConfigV6(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in, ref] LPDHCP_OPTION_SCOPE_INFO6 ScopeInfo,
   [in] DWORD FieldsToSet,
   [in, ref] LPDHCP_SERVER_CONFIG_INFO_V6 ConfigInfo
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address/host name of
the DHCP server. This parameter is unused.</p><p><b>ScopeInfo: </b>This is a pointer to a <a href="35c698cc-7141-4985-9940-87361653c79d" data-linktype="relative-path">LPDHCP_OPTION_SCOPE_INFO6 (section 2.2.1.2.30)</a>
that contains the configuration information at the scope or server level.</p><p><b>FieldsToSet: </b>Specifies the fields to be set
(see section <a href="b155fb2e-d3fd-44fb-963f-a149c9d6c34f" data-linktype="relative-path">2.2.1.2.62</a>
for details of the fields).<a id="Appendix_A_Target_68"></a><a aria-label="Product behavior note 68" href="afab0546-79ae-4764-8dab-27a85cca5145#Appendix_A_68" data-linktype="relative-path">&lt;68&gt;</a> Valid
values are in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>Set_UnicastFlag 0x00000001</td>
  <td>Set unicast option.</td>
 </tr><tr>
  <td>Set_RapidCommitFlag 0x00000002</td>
  <td>Set rapid commit option.</td>
 </tr><tr>
  <td>Set_PreferredLifetime 0x00000004</td>
  <td>Set preferred lifetime value for nontemporary IPv6 address.</td>
 </tr><tr>
  <td>Set_ValidLifetime 0x00000008</td>
  <td>Set valid lifetime value for nontemporary IPv6 address.</td>
 </tr><tr>
  <td>Set_T1 0x00000010</td>
  <td>Set T1 time value.</td>
 </tr><tr>
  <td>Set_T2 0x00000020</td>
  <td>Set T2 time value.</td>
 </tr><tr>
  <td>Set_PreferredLifetimeIATA 0x00000040</td>
  <td>Set preferred lifetime value for temporary IPv6 address.</td>
 </tr><tr>
  <td>Set_ValidLifetimeIATA 0x00000080</td>
  <td>Set valid lifetime value for temporary IPv6 address.</td>
 </tr><tr>
  <td>Set_AuditLogState 0x00000800</td>
  <td>Set audit log state in the registry.</td>
 </tr></tbody></table>
</dd></dl><p><b>ConfigInfo: </b>This is a pointer of type
LPDHCP_SERVER_CONFIG_INFO_V6 (section 2.2.1.2.62) that contains
values for the field specified by the <i>FieldsToSet</i>.</p><p><b>Return Values: </b>A 32-bit unsigned integer value
that indicates return status. A return value ERROR_SUCCESS (0x00000000)
indicates that the operation was completed successfully, else it contains a
Win32 error code, as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.
This error code value can correspond to a DHCP-specific failure, which takes a
value between 20000 and 20099, or any generic failure.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 ERROR_SUCCESS</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x00004E2D ERROR_DHCP_JET_ERROR</td>
  <td>An error occurred while accessing the DHCP server database.</td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 65.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>Validate if this method is authorized for read/write access per
section <a href="38840bd0-0a5a-47ed-bc69-0dd870d33aec" data-linktype="relative-path">3.5.5</a>. If not,
return the error ERROR_ACCESS_DENIED.</p>
</li><li><p><span><span> 
</span></span>If the <b>ScopeType</b> field of <i>ScopeInfo</i> is set to
DhcpScopeOptions6, search for <b>DHCPv6Scope</b> object in <b>DHCPv6ScopeList</b>
corresponding to the IPv6 address specified in the <b>SubnetScopeInfo</b> field
of <i>ScopeInfo</i>. If it is not found, then return ERROR_FILE_NOT_FOUND.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_AuditLogState, then the <b>DHCPv6ServerAuditLogState</b>
object is set with the value in <b>fAuditLog</b> field of <i>ConfigInfo</i>.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_UnicastFlag, an option is created
with ID as 0x20000 (following the same procedure as stated in – <a href="8e37cf22-b656-44e5-8751-a495f72a8123" data-linktype="relative-path">R_DhcpSetOptionValueV6 (section 3.2.4.53)</a>
– for default user and vendor class) and the value specified in the input <i>ConfigInfo</i>
<b>UnicastFlag</b>. If the option is already present, the value is updated.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_RapidCommitFlag, an option is
created with ID as 0x20001 and the value specified in the input <i>ConfigInfo</i>
<b>RapidCommitFlag</b>. If the option is already present, the value is updated.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_ValidLifetime and the <b>ValidLifetime</b>
in <i>ConfigInfo</i> is greater than the existing value of the preferred lifetime
(existing value of option ID 0x20002) or the value specified in the <i>ConfigInfo</i>
<b>PreferredLifetime</b>, create/update the option with ID 0x20003 with the
value from <i>ConfigInfo</i> <b>ValidLifetime</b>. Otherwise, return
ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_PreferredLifetime and the preferred
lifetime value in <i>ConfigInfo</i> is less than the existing value of the
valid lifetime (existing value of option ID 0x20003), create/update the option
with ID 0x20002 with the value from <i>ConfigInfo</i> <b>PreferredLifetime</b>,
set the <b>T1</b> value (value of option ID 0x20004) to 0.5 and the <b>T2</b>
value (value of option ID 0x20005) to 0.8 of the new preferred lifetime value.
Otherwise, return ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_T2, and the <b>T2</b> time value in <i>ConfigInfo</i>
is less than the existing preferred lifetime value (existing value of option ID
0x20002) and greater than the existing <b>T1</b> value (value of option ID
0x20004), create/update the option with ID 0x20005 with the value from <i>ConfigInfo</i>
<b>T2</b>. Otherwise, return ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_T1, and the <b>T1</b> time value in <i>ConfigInfo</i>
is less than the existing <b>T2</b> time value (value of option ID 0x20005),
create/update the option with ID 0x20004 with the value from <i>ConfigInfo</i> <b>T1</b>.
Otherwise, return ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If <i>FieldsToSet</i> is Set_ValidLifetimeIATA or
Set_PreferredLifetimeIATA, the method returns ERROR_SUCCESS without any
processing.</p>
</li><li><p><span><span> 
</span></span>Return ERROR_SUCCESS.</p>
</li></ul><p><b>Exceptions Thrown:</b> No exceptions are thrown beyond
those thrown by the underlying RPC protocol <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p></div>