Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

IMA_SetDnsServerAddress (3IMA)

Name

IMA_SetDnsServerAddress - Sets the addresses of the primary and alternate DNS servers for the specified PNP

Synopsis

cc [ flag... ] file... -lima [ library... ]
#include <ima.h>

IMA_STATUS IMA_SetDnsServerAddress(
     /* in */     IMA_OID oid,
     /* in */    const IMA_IP_ADDRESS *pPrimaryDnsServerAddress,
     /* in */    const IMA_IP_ADDRESS *pAlternateDnsServerAddress
);

Parameters

oid

The object ID of the physical network port (PNP) whose DNS servers are to be set.

primaryDnsServerAddress

A pointer to the IP address of the primary DNS server. This parameter is NULL if the primary DNS server address is being cleared. In this case, the alternateDnsServerAddress argument is also NULL

alternateDnsServerAddress

A pointer to the IP address of the alternate DNS server. This parameter is NULL if the alternate DNS server address is being cleared.

Description

The IMA_SetDnsServerAddress() API sets the addresses of the primary and alternate DNS servers for the specified PNP.

Return Values

IMA_STATUS_REBOOT_NECESSARY

Returned if a reboot is necessary before the setting of the DNS servers takes effect.

IMA_ERROR_NOT_SUPPORTED
  • Returned if setting the primary DNS server address is not supported by the specified PNP.

  • Returned if setting the alternate DNS server address is not supported by the specified PNP and the alternateDnsServerAddress argument is not NULL.

IMA_ERROR_INVALID_OBJECT_TYPE

Returned if the oid argument does not specify a valid object type.

IMA_ERROR_INCORRECT_OBJECT_TYPE

Returned if the oid argument does not specify an PNP.

IMA_ERROR_OBJECT_NOT_FOUND

Returned if the oid argument does not specify an PNP known to the system.

IMA_ERROR_INVALID_PARAMETER
  • Returned if the primaryDnsServerAddress or alternateDnsServerAddress argument is not NULL, and specifies a memory area from which data cannot be read

  • Returned if the primaryDnsServerAddress argument is NULL, and the alternateDnsServerAddress argument is not NULL. It is not valid to have an alternate DNS server without having a primary DNS server.

  • Returned if neither the primaryDnsServerAddress nor the alternateDnsServerAddress argument is NULL, and both specify the same IP address.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library/storage/snia-ima
Interface Stability
Volatile
MT-Level
Safe

See Also

libima(3LIB), attributes(7), IMA_GetIpProperties(3IMA)