tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pr_netaddrtostring.rst (1071B)


      1 PR_NetAddrToString
      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_NetAddrToString(
     15     const PRNetAddr *addr,
     16     char *string,
     17     PRUint32 size);
     18 
     19 
     20 Parameters
     21 ~~~~~~~~~~
     22 
     23 The function has the following parameters:
     24 
     25 ``addr``
     26   A pointer to the network address to be converted.
     27 ``string``
     28   A buffer that will hold the converted string on output.
     29 ``size``
     30   The size of the result buffer (``string``).
     31 
     32 
     33 Returns
     34 ~~~~~~~
     35 
     36 The function returns one of the following values:
     37 
     38 -  If successful, ``PR_SUCCESS``.
     39 -  If unsuccessful, ``PR_FAILURE``. You can retrieve the reason for the
     40   failure by calling :ref:`PR_GetError`.
     41 
     42 
     43 Description
     44 -----------
     45 
     46 The network address to be converted (``addr``) may be either an IPv4 or
     47 IPv6 address structure, assuming that the NSPR library and the host
     48 system are both configured to utilize IPv6 addressing. If ``addr`` is an
     49 IPv4 address, ``size`` needs to be at least 16. If ``addr`` is an IPv6
     50 address, ``size`` needs to be at least 46.