3.2.4.33 R_DhcpAuditLogSetParams (Opnum 32)

The R_DhcpAuditLogSetParams method sets/modifies the DHCP server setting related to the audit log.

 DWORD R_DhcpAuditLogSetParams(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD Flags,
   [in, string] LPWSTR AuditLogDir,
   [in] DWORD DiskCheckInterval,
   [in] DWORD MaxLogFilesSize,
   [in] DWORD MinSpaceOnDisk
 );

ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.

Flags: This flag is not used and MUST be set to 0.

AuditLogDir: A pointer to a null-terminated Unicode string that contains the path where the audit logs are placed.

DiskCheckInterval: This is of type DWORD and contains an interval for disk checking that is used to determine how many times the DHCP server writes audit log events to the log file before checking for available disk space on the DHCP server.

MaxLogFilesSize: This is of type DWORD and contains the maximum size restriction (in megabytes) for the total amount of disk space available for all the audit log files created and stored by the DHCP server.

MinSpaceOnDisk: This is of type DWORD and contains the minimum size requirement (in megabytes) for server disk space that is used during disk checking to determine whether sufficient space exists for the server to continue audit logging.

Return Values: 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 [MS-ERREF]. This error code value can correspond to a DHCP-specific failure, which takes a value between 20000 and 20099, or any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

The opnum field value for this method is 32.

When processing this call, the DHCP server MUST do the following:

  • If Flags is not 0, return ERROR_INVALID_PARAMETER.

  • If AuditLogDir is NULL, return ERROR_INVALID_PARAMETER.

  • Validate that this method is authorized for read/write access, as specified in section 3.5.5. If not, return the error ERROR_ACCESS_DENIED.

  • Copy the values provided in the parameters into the respective fields in the server ADM element DHCPv4AuditLogParams. AuditLogDir is copied into DHCPv4AuditLogParams.AuditLogDir, DiskCheckInterval is copied into DHCPv4AuditLogParams.DiskCheckInterval, MaxLogFilesSize is copied into DHCPv4AuditLogParams.MaxLogFilesSize and MinSpaceOnDisk is copied into DHCPv4AuditLogParams.MinSpaceOnDisk.

Once the call is successfully completed, the server MUST be restarted, so that the DHCP parameters are updated with the correct values.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].