www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


getHostByAddr

This function can be used to find the (canonical) domain name associated with a host by one of its IPv4 addresses via the Domain Name Service (DNS).
The operating system manages a DNS cache. Thus it is save to call this function each time you need the respective domain name. The function will not issue another request to the name server before the cached name has expired.

short getHostByAddr( struct in_addr far *address,

char far *domainName );

Parameters

address

Pointer to the host's IP address of type struct in_addr.

domainName

Pointer to a buffer where the function is to store the domain name; A domain name can be up to 254 characters long. Adding one byte for the trailing zero byte of the string, the buffer must have a size of at least 255 bytes.

Return Value

Zero in case of success or negative error code

Comments

DNS queries consume a relative large part of your task's stack.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to the RTOS API function DNS_GET_HOST_BY_ADDR for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV1.05V1.00

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.04

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document