Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

OSS Library Calls (i - m) lwres_getaddrinfo(3)
NAME
lwres_getaddrinfo - Converts host names and service names into socket address structures
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include netdb.h>
int lwres_getaddrinfo (
const char * hostname,
const char * servname,
const struct addrinfo * hints,
struct addrinfo **result
);
PARAMETERS
hostname Species a pointer to a character representing one of the following:
An Internet node host name.
An IPv4 address in dotted-decimal format.
An IPv6 address in hexadecimal format.
NULL if no hostname requires converting; when NULL is used, either
servname or hints must be nonnull.
servname Species a pointer to a character representing one of the following:
A network service name.
A decimal port number.
NULL if no service name requires converting; when NULL is used,
either hostname or hints must be nonnull.
hints Species one of the following:
Points to an addrinfo struct for a socket; the format of the addrinfo
structure is dened in the header le netdb.h.
NULL if no struct is available; when NULL is used, either hostname or
servname must be nonnull.
result Points to a list of addrinfo structs upon successful completion (see NOTES).
DESCRIPTION
This function is a protocol-independent replacement for the lwres_gethostbyname() and
lwres_getipnodebyname( ) function calls. lwres_getaddrinfo() provides extra functionality
beyond what lwres_getipnodebyname() provides because lwres_getaddrinfo() handles both
the host name and the service.
The lwres_getaddrinfo() function converts host names and service names into socket address
structures. You allocate a hints structure, initialize it to 0 (zero), ll in the needed elds, and
then call this function. This function returns through the result pointer a linked list of addrinfo
structures (dened in the netdb.h header le) that you can use with other socket functions.
527187-004 Hewlett-Packard Company 497