Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

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
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
#include netdb.h>
int lwres_getaddrinfo(
const char * hostname,
const char * servname,
const struct addrinfo * hints,
struct addrinfo **result);
PARAMETERS
hostname Specifies 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 Specifies 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 Specifies one of the following:
Points to an addrinfo struct for a socket; the format of the addrinfo
structure is defined in the header file 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), fill in the needed fields, and
then call this function. This function returns through the result pointer a linked list of addrinfo
structures (defined in the netdb.h header file) that you can use with other socket functions.
527187-017 Hewlett-Packard Company 4155