pub unsafe extern "C" fn otSrpClientRemoveHostAndServices(
    aInstance: *mut otInstance,
    aRemoveKeyLease: bool,
    aSendUnregToServer: bool
) -> otError
Expand description

Starts the remove process of the host info and all services.

After returning from this function, otSrpClientCallback will be called to report the status of remove request with SRP server.

If the host info is to be permanently removed from server, @p aRemoveKeyLease should be set to true which removes the key lease associated with host on server. Otherwise, the key lease record is kept as before, which ensures that the server holds the host name in reserve for when the client is once again able to provide and register its service(s).

The @p aSendUnregToServer determines the behavior when the host info is not yet registered with the server. If @p aSendUnregToServer is set to false (which is the default/expected value) then the SRP client will immediately remove the host info and services without sending an update message to server (no need to update the server if nothing is yet registered with it). If @p aSendUnregToServer is set to true then the SRP client will send an update message to the server. Note that if the host info is registered then the value of @p aSendUnregToServer does not matter and the SRP client will always send an update message to server requesting removal of all info.

One situation where @p aSendUnregToServer can be useful is on a device reset/reboot, caller may want to remove any previously registered services with the server. In this case, caller can otSrpClientSetHostName() and then request otSrpClientRemoveHostAndServices() with aSendUnregToServer as true.

@param[in] aInstance A pointer to the OpenThread instance. @param[in] aRemoveKeyLease A boolean indicating whether or not the host key lease should also be removed. @param[in] aSendUnregToServer A boolean indicating whether to send update to server when host info is not registered.

@retval OT_ERROR_NONE The removal of host info and services started successfully. The otSrpClientCallback will be called to report the status. @retval OT_ERROR_ALREADY The host info is already removed.