network_addresses.rst (2402B)
1 This chapter describes the NSPR types and functions used to manipulate 2 network addresses. 3 4 - `Network Address Types and 5 Constants <#Network_Address_Types_and_Constants>`__ 6 - `Network Address Functions <#Network_Address_Functions>`__ 7 8 The API described in this chapter recognizes the emergence of Internet 9 Protocol Version 6 (IPv6). To facilitate the transition to IPv6, it is 10 recommended that clients treat all structures containing network 11 addresses as transparent objects and use the functions documented here 12 to manipulate the information. 13 14 If used consistently, this API also eliminates the need to deal with the 15 byte ordering of network addresses. Typically, the only numeric 16 declarations required are the well-known port numbers that are part of 17 the :ref:`PRNetAddr` structure. 18 19 .. _Network_Address_Types_and_Constants: 20 21 Network Address Types and Constants 22 ----------------------------------- 23 24 - :ref:`PRHostEnt` 25 - :ref:`PRProtoEnt` 26 - :ref:`PR_NETDB_BUF_SIZE` 27 28 .. _Network_Address_Functions: 29 30 Network address functions 31 ------------------------- 32 33 .. _Initializing_a_Network_Address: 34 35 Initializing a network address 36 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 37 38 :ref:`PR_InitializeNetAddr` facilitates the use of :ref:`PRNetAddr`, the basic 39 network address structure, in a polymorphic manner. By using these 40 functions with other network address functions, clients can support 41 either version 4 or version 6 of the Internet Protocol transparently. 42 43 All NSPR functions that require `PRNetAddr <PRNetAddr>`__ as an argument 44 accept either an IPv4 or IPv6 version of the address. 45 46 - :ref:`PR_InitializeNetAddr` 47 48 .. _Converting_Between_a_String_and_a_Network_Address: 49 50 Converting between a string and a network address 51 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 53 - :ref:`PR_StringToNetAddr` 54 - :ref:`PR_NetAddrToString` 55 56 .. _Converting_address_formats: 57 58 Converting address formats 59 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 61 - :ref:`PR_ConvertIPv4AddrToIPv6` 62 63 .. _Getting_Host_Names_and_Addresses: 64 65 Getting host names and addresses 66 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 67 68 - :ref:`PR_GetHostByName` 69 - :ref:`PR_GetHostByAddr` 70 - :ref:`PR_EnumerateHostEnt` 71 - :ref:`PR_GetAddrInfoByName` 72 - :ref:`PR_EnumerateAddrInfo` 73 - :ref:`PR_GetCanonNameFromAddrInfo` 74 - :ref:`PR_FreeAddrInfo` 75 76 .. _Getting_Protocol_Entries: 77 78 Getting protocol entries 79 ~~~~~~~~~~~~~~~~~~~~~~~~ 80 81 - :ref:`PR_GetProtoByName` 82 - :ref:`PR_GetProtoByNumber`