openthread_sys

Type Alias otSrpServerServiceUpdateHandler

Source
pub type otSrpServerServiceUpdateHandler = Option<unsafe extern "C" fn(aId: otSrpServerServiceUpdateId, aHost: *const otSrpServerHost, aTimeout: u32, aContext: *mut c_void)>;
Expand description

Handles SRP service updates.

Is called by the SRP server to notify that a SRP host and possibly SRP services are being updated. It is important that the SRP updates are not committed until the handler returns the result by calling otSrpServerHandleServiceUpdateResult or times out after @p aTimeout.

A SRP service observer should always call otSrpServerHandleServiceUpdateResult with error code OT_ERROR_NONE immediately after receiving the update events.

A more generic handler may perform validations on the SRP host/services and rejects the SRP updates if any validation fails. For example, an Advertising Proxy should advertise (or remove) the host and services on a multicast-capable link and returns specific error code if any failure occurs.

@param[in] aId The service update transaction ID. This ID must be passed back with otSrpServerHandleServiceUpdateResult. @param[in] aHost A pointer to the otSrpServerHost object which contains the SRP updates. The handler should publish/un-publish the host and each service points to this host with below rules: 1. If the host is not deleted (indicated by otSrpServerHostIsDeleted), then it should be published or updated with mDNS. Otherwise, the host should be un-published (remove AAAA RRs). 2. For each service points to this host, it must be un-published if the host is to be un-published. Otherwise, the handler should publish or update the service when it is not deleted (indicated by otSrpServerServiceIsDeleted) and un-publish it when deleted. @param[in] aTimeout The maximum time in milliseconds for the handler to process the service event. @param[in] aContext A pointer to application-specific context.

@sa otSrpServerSetServiceUpdateHandler @sa otSrpServerHandleServiceUpdateResult

Aliased Type§

enum otSrpServerServiceUpdateHandler {
    None,
    Some(unsafe extern "C" fn(_: u32, _: *const otSrpServerHost, _: u32, _: *mut c_void)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: u32, _: *const otSrpServerHost, _: u32, _: *mut c_void))

Some value of type T.