pub type otDnsAddressCallback = Option<unsafe extern "C" fn(aError: otError, aResponse: *const otDnsAddressResponse, aContext: *mut c_void)>;
Expand description

Pointer is called when a DNS response is received for an address resolution query.

Within this callback the user can use otDnsAddressResponseGet{Item}() functions along with the @p aResponse pointer to get more info about the response.

The @p aResponse pointer can only be used within this callback and after returning from this function it will not stay valid, so the user MUST NOT retain the @p aResponse pointer for later use.

@param[in] aError The result of the DNS transaction. @param[in] aResponse A pointer to the response (it is always non-NULL). @param[in] aContext A pointer to application-specific context.

The @p aError can have the following:

  • OT_ERROR_NONE A response was received successfully.
  • OT_ERROR_ABORT A DNS transaction was aborted by stack.
  • OT_ERROR_RESPONSE_TIMEOUT No DNS response has been received within timeout.

If the server rejects the address resolution request the error code from server is mapped as follow:

  • (0) NOERROR Success (no error condition) -> OT_ERROR_NONE
  • (1) FORMERR Server unable to interpret due to format error -> OT_ERROR_PARSE
  • (2) SERVFAIL Server encountered an internal failure -> OT_ERROR_FAILED
  • (3) NXDOMAIN Name that ought to exist, does not exist -> OT_ERROR_NOT_FOUND
  • (4) NOTIMP Server does not support the query type (OpCode) -> OT_ERROR_NOT_IMPLEMENTED
  • (5) REFUSED Server refused for policy/security reasons -> OT_ERROR_SECURITY
  • (6) YXDOMAIN Some name that ought not to exist, does exist -> OT_ERROR_DUPLICATED
  • (7) YXRRSET Some RRset that ought not to exist, does exist -> OT_ERROR_DUPLICATED
  • (8) NXRRSET Some RRset that ought to exist, does not exist -> OT_ERROR_NOT_FOUND
  • (9) NOTAUTH Service is not authoritative for zone -> OT_ERROR_SECURITY
  • (10) NOTZONE A name is not in the zone -> OT_ERROR_PARSE
  • (20) BADNAME Bad name -> OT_ERROR_PARSE
  • (21) BADALG Bad algorithm -> OT_ERROR_SECURITY
  • (22) BADTRUN Bad truncation -> OT_ERROR_PARSE
  • Other response codes -> OT_ERROR_FAILED

Aliased Type§

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

Variants§

§1.0.0

None

No value.

§1.0.0

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

Some value of type T.