summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/prhostent.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /docs/nspr/reference/prhostent.rst
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/nspr/reference/prhostent.rst')
-rw-r--r--docs/nspr/reference/prhostent.rst69
1 files changed, 69 insertions, 0 deletions
diff --git a/docs/nspr/reference/prhostent.rst b/docs/nspr/reference/prhostent.rst
new file mode 100644
index 0000000000..daf2d89d40
--- /dev/null
+++ b/docs/nspr/reference/prhostent.rst
@@ -0,0 +1,69 @@
+PRHostEnt
+=========
+
+A structure that defines a list of network addresses. This structure is
+output from :ref:`PR_GetHostByName` and :ref:`PR_GetHostByAddr` and passed to
+:ref:`PR_EnumerateHostEnt`. Clients should avoid directly accessing any of
+the structure's fields.
+
+
+Syntax
+------
+
+.. code::
+
+ #include <prnetdb.h>
+
+ typedef struct PRHostEnt {
+ char *h_name;
+ char **h_aliases;
+ #if defined(_WIN32)
+ PRInt16 h_addrtype;
+ PRInt16 h_length;
+ #else
+ PRInt32 h_addrtype;
+ PRInt32 h_length;
+ #endif
+ char **h_addr_list;
+ } PRHostEnt;
+
+
+Fields
+~~~~~~
+
+The structure has the following fields:
+
+``h_name``
+ Pointer to the official name of host.
+``h_aliases``
+ Pointer to a pointer to list of aliases. The list is terminated with
+ a ``NULL`` entry.
+``h_addrtype``
+ Host address type. For valid NSPR usage, this field must have a value
+ indicating either an IPv4 or an IPv6 address.
+``h_length``
+ Length of internal representation of the address in bytes. All of the
+ addresses in the list are of the same type and therefore of the same
+ length.
+``h_addr_list``
+ Pointer to a pointer to a list of addresses from name server (in
+ network byte order). The list is terminated with a ``NULL`` entry.
+
+
+Description
+-----------
+
+This structure is used by many of the network address functions. All
+addresses are passed in host order and returned in network order
+(suitable for use in system calls).
+
+Use the network address functions to manipulate the :ref:`PRHostEnt`
+structure. To make the transition to IP version 6 easier, it's best to
+treat :ref:`PRHostEnt` as an opaque structure.
+
+Note
+----
+
+``WINSOCK.H`` defines ``h_addrtype`` and ``h_length`` as a 16-bit field,
+whereas other platforms treat it as a 32-bit field. The ``#ifdef`` in
+the structure allows direct assignment of the :ref:`PRHostEnt` structure.