Skip to main content

otDnsSetNameCompressionEnabled

Function otDnsSetNameCompressionEnabled 

Source
pub unsafe extern "C" fn otDnsSetNameCompressionEnabled(
    aInstance: *mut otInstance,
    aEnabled: bool,
) -> otError
Expand description

Enables/disables the “DNS name compression” mode.

By default, DNS name compression is enabled. When disabled, DNS names are appended in full and are never compressed. This applies to OpenThread’s DNS and SRP client/server modules.

DNS name compression cannot be disabled if the OpenThread mDNS module is enabled. Enabling the mDNS module will automatically enable name compression if it was previously disabled. Attempting to disable compression while the mDNS module is active will return OT_ERROR_NOT_CAPABLE.

This is intended for testing only and available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE config is enabled.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aEnabled TRUE to enable the “DNS name compression” mode, FALSE to disable.

@retval OT_ERROR_NONE The “DNS name compression” mode is updated. @retval OT_ERROR_NOT_CAPABLE The “DNS name compression” mode cannot be disabled since OpenThread mDNS module is enabled.