3.1.1.1.18.2.2 GetPolicyOptions
The GetPolicyOptions procedure is specific to usage with IPv4 and is used to retrieve the DHCP options defined at either the server level or at the scope level for a specific DHCP policy. The following are the input parameters for this procedure:
Param_addressfamily: This is of type AddressFamily and it can be either InterNetwork or InterNetworkV6. The value InterNetwork is used to specify the processing to be done on the IPv4-specific simple tables for any compound table involved during the processing. The value InterNetworkV6 is used to specify the processing to be done on IPv6-specific simple tables for any compound table involved during the processing.
Param_serverRecordId: This specifies the record identifier of the server for which the options are being requested.
Param_ScopeRecordId: This specifies the record identifier of the scope for which the options are being requested. If this is specified, the scope-level options for the scope defined on the server specified by Param_ServerRecordId are returned. Otherwise the server-level options are returned.
Param_PolicyRecordId: This specifies the record identifier of the DhcpPolicy for which the options are being requested.
The following is the output of this procedure.
Result_options: This is a collection of DhcpOption. Based on the Param_addressfamily, this will be composed of a collection of either DhcpOptionV4 or DhcpOptionV6.
The following are the processing steps involved:
Initialize Result_options with a collection of DhcpOption.
Enumerate the rows in ADM_DhcpOptionsTable that meet the following criteria:
ServerRecordId is equal to Param_ServerRecordId.
If Param_ScopeRecordId is specified, ScopeRecordId is equal to Param_ScopeRecordId.
If Param_PolicyRecordId is specified, PolicyRecordId is equal to Param_PolicyRecordId.
For each of the rows, perform the following steps:
If the Param_addressfamily is InterNetwork, create an instance of DhcpOptionV4. Otherwise if the Param_addressfamily is InterNetworkV6, create an instance of DhcpOptionV6. Add it to Result_options. Fill the values as follows:
Assign OptionReferenceType to DhcpOption.OptionOwnerType.
Assign RecordId to DhcpOption.RecordId.
Call the procedure GetUserClassFromServer in ADM_DHCPServersTable passing the following parameters:
Param_addressfamily.
Param_serverRecordId is set to ServerRecordId.
Param_userClassRecordId is set to UserClassRecordId.
Assign the Result_userClass to DhcpOption.UserClass.
Call the procedure GetOptionDefinitionFromServer in ADM_DHCPServersTable passing the following parameters:
Param_addressfamily.
Param_serverRecordId is set to ServerRecordId.
Param_optionDefinitionId is set to OptionDefinitionRecordId.
Assign the Result_optionDefinition to DhcpOption.OptionDefinition.
Based on DhcpOption.OptionDefinition.OptionType and DhcpOption.OptionDefinition.OptionCollectionType, assign Values to DhcpOption.Values by converting the binary data into the type specified by OptionType.
Return Result_options as the output of the procedure.