pr_stringtonetaddr.rst (1037B)
1 PR_StringToNetAddr 2 ================== 3 4 Converts a character string to a network address. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prnetdb.h> 13 14 PRStatus PR_StringToNetAddr( 15 const char *string, 16 PRNetAddr *addr); 17 18 19 Parameters 20 ~~~~~~~~~~ 21 22 The function has the following parameters: 23 24 ``string`` 25 The string to be converted. 26 ``addr`` 27 On output, the equivalent network address. 28 29 30 Returns 31 ~~~~~~~ 32 33 The function returns one of the following values: 34 35 - If successful, ``PR_SUCCESS``. 36 - If unsuccessful, ``PR_FAILURE``. You can retrieve the reason for the 37 failure by calling :ref:`PR_GetError`. 38 39 40 Description 41 ----------- 42 43 For IPv4 addresses, the input string represents numbers in the Internet 44 standard "." notation. IPv6 addresses are indicated as strings using ":" 45 characters separating octets, with numerous caveats for shortcutting 46 (see RFC #1884). If the NSPR library and the host are configured to 47 support IPv6, both formats are supported. Otherwise, use of anything 48 other than IPv4 dotted notation results in an error.