From ac299c4f5ca236370b9df2a91b18b149b1d344a7 Mon Sep 17 00:00:00 2001
From: Andreas Gustafsson
struct addrinfo. - This structure can be used to provide hints concerning the type of socket that the caller supports or wishes to use. The caller can supply the following structure elements in @@ -420,7 +419,7 @@ and no name resolution should be attempted.
All other elements of the lwres_gethostbyname() -and +> and lwres_gethostbyname2() -look up the hostname +> look up the hostname name. - lwres_gethostbyname() -always looks for an IPv4 address while - always looks for an IPv4 +address while lwres_gethostbyname2() -looks for an address of protocol family - looks for an +address of protocol family af: - -either +>: either PF_INET -or - or PF_INET6 -— IPv4 or IPV6 addresses respectively. -Successful calls of the functions return a +> — IPv4 or IPV6 +addresses respectively. Successful calls of the functions return a struct hostentfor - -the name that was looked up. +>for the name that was looked up. NULL -is returned if the lookups by +> is returned if the lookups by lwres_gethostbyname() -or +> or lwres_gethostbyname2() -fail.
fail.Reverse lookups of addresses are performed by addr -is an address of length +> is an address of length len -bytes and protocol family +> bytes and protocol family type — - — PF_INET -or +> or PF_INET6. - lwres_gethostbyname_r() -is a thread-safe function for forward lookups. -If an error occurs, an error code is returned in +> is a thread-safe function +for forward lookups. If an error occurs, an error code is returned in *error. - resbuf -is a pointer to a - is a pointer to a struct hostent -which is initialised by a successful call to +>struct +hostent which is initialised by a successful call to lwres_gethostbyname_r()buf -is a buffer of length +> is a buffer of length len -bytes which is used to store the +> bytes which is used to store the h_name, - -, h_aliases, - -and +>, and h_addr_list -elements of the - elements of the struct hostent -returned in -struct +hostent returned in resbuf. - -Successful calls to -lwres_gethostbyname_r() -return -resbuf, - -which is a pointer to the -struct hostent -it created.
it created.lwres_gethostbyaddr_r() -is a thread-safe function that performs a reverse lookup of address - is a thread-safe function +that performs a reverse lookup of address addr -which is -len -bytes long -and is of protocol family - bytes long and is of protocol +family type — - - — PF_INET -or +> or PF_INET6. - -If an error occurs, the error code is returned in -. If an error occurs, the error code is returned +in *error. - -The other function parameters are identical to those in -. The other function parameters are +identical to those in lwres_gethostbyname_r(). @@ -557,13 +507,11 @@ CLASS="PARAMETER" >resbuf -is a pointer to a - is a pointer to a struct hostent -which is initialised by a successful call to +>struct +hostent which is initialised by a successful call to lwres_gethostbyaddr_r()buf -is a buffer of length +> is a buffer of length len -bytes which is used to store the +> bytes which is used to store the h_name, - -, h_aliases, - -and +>, and h_addr_list -elements of the - elements of the struct hostent -returned in -struct +hostent returned in resbuf. - -Successful calls to -. Successful +calls to lwres_gethostbyaddr_r() -return +> return resbuf, - -which is a pointer to the +>, which is a pointer to the struct hostent() -it created.
it created.Successful calls to -Successful calls to lwres_gethostbyname_r() -and +> and lwres_gethostbyaddr_r() -return +> return resbuf, - -a pointer to the -, a pointer to the struct hostent -that was initialised by these functions. -They return +>struct +hostent that was initialised by these functions. They return NULL -if the lookups fail -or if - if the lookups fail or if buf was too small to hold the list of addresses and names referenced by -the -h_name, - -, h_aliases, - -and +>, and h_addr_list -elements of the - elements of the struct hostent. - -If -struct +hostent. If buf -was too small, both +> was too small, both lwres_gethostbyname_r() -and +> and lwres_gethostbyaddr_r() -set the global variable +> set the global variable errno -to - to ERANGE.
.struct hostent {
diff --git a/lib/lwres/man/lwres_getnameinfo.3 b/lib/lwres/man/lwres_getnameinfo.3
index f0446c9950..61f3ba426c 100644
--- a/lib/lwres/man/lwres_getnameinfo.3
+++ b/lib/lwres/man/lwres_getnameinfo.3
@@ -26,37 +26,21 @@ lwres_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t ho
.ad
\fR.SH "DESCRIPTION"
.PP
-This function is equivalent to the
-\fBgetnameinfo\fR(3)
-function defined in RFC2133.
-\fBlwres_getnameinfo()\fR
-returns the hostname for the
-\fBstruct sockaddr\fR
-\fIsa\fR
-which is
-\fIsalen\fR
-bytes long.
-The hostname is of length
-\fIhostlen\fR
-and is returned via
-\fI*host.\fR
-The maximum length of the hostname is
-1025 bytes:
-NI_MAXHOST.
+This function is equivalent to the \fBgetnameinfo\fR(3) function defined in RFC2133.
+\fBlwres_getnameinfo()\fR returns the hostname for the
+\fBstruct sockaddr\fR \fIsa\fR which is
+\fIsalen\fR bytes long. The hostname is of length
+\fIhostlen\fR and is returned via
+\fI*host.\fR The maximum length of the hostname is
+1025 bytes: NI_MAXHOST.
.PP
The name of the service associated with the port number in
-\fIsa\fR
-is returned in
-\fI*serv.\fR
-It is
-\fIservlen\fR
-bytes long.
-The maximum length of the service name is
-NI_MAXSERV - 32 bytes.
+\fIsa\fR is returned in \fI*serv.\fR
+It is \fIservlen\fR bytes long. The maximum length
+of the service name is NI_MAXSERV - 32 bytes.
.PP
-The
-\fIflags\fR
-argument sets the following bits:
+The \fIflags\fR argument sets the following
+bits:
.TP
\fBNI_NOFQDN\fR
A fully qualified domain name is not required for local hosts.
@@ -81,7 +65,6 @@ service, and causes getservbyport() to be called with a second
argument of "udp" instead of its default of "tcp". This is required
for the few ports (512-514) that have different services for UDP and
TCP.
-.PP
.SH "RETURN VALUES"
.PP
\fBlwres_getnameinfo()\fR
diff --git a/lib/lwres/man/lwres_getnameinfo.html b/lib/lwres/man/lwres_getnameinfo.html
index 05e40b668b..b98a928483 100644
--- a/lib/lwres/man/lwres_getnameinfo.html
+++ b/lib/lwres/man/lwres_getnameinfo.html
@@ -79,95 +79,79 @@ NAME="AEN24"
>DESCRIPTION
This function is equivalent to the
- This function is equivalent to the getnameinfo(3)
-function defined in RFC2133.
+> function defined in RFC2133.
lwres_getnameinfo()
-returns the hostname for the
+> returns the hostname for the
struct sockaddr
- sa
-which is
+> which is
salen
-bytes long.
-The hostname is of length
+> bytes long. The hostname is of length
hostlen
-and is returned via
+> and is returned via
*host.
-The maximum length of the hostname is
-1025 bytes:
- The maximum length of the hostname is
+1025 bytes: NI_MAXHOST.
.The name of the service associated with the port number in
+> The name of the service associated with the port number in
sa
-is returned in
- is returned in *serv.
-It is
-servlen
-bytes long.
-The maximum length of the service name is
- bytes long. The maximum length
+of the service name is NI_MAXSERV - 32 bytes.
The
- The flags
-argument sets the following bits:
+> argument sets the following
+bits:
lwres_hstrerror() -returns an appropriate string for the error code gievn by - returns an appropriate string +for the error code gievn by err. +>. The values of +the error codes and messages are as follows: -The values of the error codes and messages are as follows:
The generated string is copied to -The generated string is copied to dst -provided +> provided size -indicates it is long enough to store the ASCII representation -of the address.
indicates it is long enough to store the +ASCII representation of the address.If successful, the function returns -If successful, the function returns dst: - -a pointer to a string containing -the presentation format of the address. -lwres_net_ntop() -returns +> returns NULL -and sets the global variable +> and sets the global variable errno -to - to EAFNOSUPPORT -if the protocol family given in - if +the protocol family given in af -is not supported.
is not +supported.lwres_nooprequest_parse() -uses context +> uses context ctx -to convert the contents of packet +> to convert the contents of packet pkt -to a - to a lwres_nooprequest_t -structure. -Buffer -b -provides space to be used for storing this structure. -When the function succeeds, the resulting +> provides space to be used +for storing this structure. When the function succeeds, the resulting lwres_nooprequest_t -is made available through +> is made available through *structp. - lwres_noopresponse_parse() -offers the same semantics as - offers the same +semantics as lwres_nooprequest_parse() -except it yields a - except it +yields a lwres_noopresponse_t -structure.
structure.lwres_noopresponse_free() -and +> and lwres_nooprequest_free() -release the memory in resolver context - release the memory in +resolver context ctx -that was allocated to the +> that was allocated to the lwres_noopresponse_t -or - or lwres_nooprequest_t -structures referenced via -structp.
.The elements of this structure are:
lwres_lwpacket_renderheader() -transfers the contents of lightweight resolver packet structure +> transfers the +contents of lightweight resolver packet structure lwres_lwpacket_t - *pkt -in network byte order to the lightweight resolver buffer, +> in network +byte order to the lightweight resolver buffer, *b. .lwres_lwpacket_parseheader() -performs the converse operation. -It transfers data in network byte order from buffer - performs the +converse operation. It transfers data in network byte order from +buffer *b -to resolver packet +> to resolver packet *pkt. - -The contents of the buffer +>. The contents of the buffer b -should correspond to a +> should correspond to a lwres_lwpacket_t.
.Both functions have assertion checks to ensure that b -and - and pkt -are not +> are not NULL.
.Successful calls to +> Successful calls to lwres_lwpacket_renderheader() -and +> and lwres_lwpacket_parseheader() -return +> return LWRES_R_SUCCESS. - -If there is insufficient space to copy data between the buffer -. If there is insufficient +space to copy data between the buffer *b -and lightweight resolver packet - and +lightweight resolver packet *pkt -both functions return - both functions +return LWRES_R_UNEXPECTEDEND.
.