pr_getaddrinfobyname.rst (1202B)
1 PR_GetAddrInfoByName 2 ==================== 3 4 Looks up a host by name. Equivalent to ``getaddrinfo(host, NULL, ...)`` 5 of RFC 3493. 6 7 8 Syntax 9 ------ 10 11 .. code:: 12 13 #include <prnetdb.h> 14 15 PRAddrInfo *PR_GetAddrInfoByName( 16 const char *hostname, 17 PRUint16 af, 18 PRIntn flags); 19 20 21 Parameters 22 ~~~~~~~~~~ 23 24 The function has the following parameters: 25 26 ``hostname`` 27 The character string defining the host name of interest. 28 ``af`` 29 The address family. May be ``PR_AF_UNSPEC`` or ``PR_AF_INET``. 30 ``flags`` 31 May be either ``PR_AI_ADDRCONFIG`` or 32 ``PR_AI_ADDRCONFIG | PR_AI_NOCANONNAME``. Include 33 ``PR_AI_NOCANONNAME`` to suppress the determination of the canonical 34 name corresponding to ``hostname`` 35 36 37 Returns 38 ~~~~~~~ 39 40 The function returns one of the following values: 41 42 - If successful, a pointer to the opaque ``PRAddrInfo`` structure 43 containing the results of the host lookup. Use 44 :ref:`PR_EnumerateAddrInfo` to inspect the :ref:`PRNetAddr` values stored 45 in this structure. When no longer needed, this pointer must be 46 destroyed with a call to :ref:`PR_FreeAddrInfo`. 47 - If unsuccessful, ``NULL``. You can retrieve the reason for the 48 failure by calling :ref:`PR_GetError`.