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:

  1. Initialize Result_options with a collection of DhcpOption.

  2. 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.

  3. For each of the rows, perform the following steps:

    1. 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:

    2. Assign OptionReferenceType to DhcpOption.OptionOwnerType.

    3. Assign RecordId to DhcpOption.RecordId.

  4. Call the procedure GetUserClassFromServer in ADM_DHCPServersTable passing the following parameters: 

    1. Param_addressfamily

    2. Param_serverRecordId is set to ServerRecordId

    3. Param_userClassRecordId is set to UserClassRecordId

  5. Assign the Result_userClass to DhcpOption.UserClass.

  6. Call the procedure GetOptionDefinitionFromServer in ADM_DHCPServersTable passing the following parameters: 

    1. Param_addressfamily

    2. Param_serverRecordId is set to ServerRecordId

    3. Param_optionDefinitionId is set to OptionDefinitionRecordId

  7. Assign the Result_optionDefinition to DhcpOption.OptionDefinition.  

  8. 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.

  9. Return Result_options as the output of the procedure.