From 86b0285d7e65601645db4090d62ee6cb63abad6c Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Mon, 18 Jun 2001 22:07:02 +0000 Subject: [PATCH] missing end tags; other cleanup --- lib/lwres/man/lwres_getaddrinfo.docbook | 6 +- lib/lwres/man/lwres_gethostent.docbook | 235 ++++++++---------------- lib/lwres/man/lwres_getipnode.docbook | 38 ++-- lib/lwres/man/lwres_getnameinfo.docbook | 73 +++----- lib/lwres/man/lwres_hstrerror.docbook | 43 ++--- lib/lwres/man/lwres_inetntop.docbook | 60 +++--- lib/lwres/man/lwres_noop.docbook | 85 ++++----- lib/lwres/man/lwres_packet.docbook | 94 ++++------ lib/lwres/man/lwres_resutil.docbook | 156 ++++++---------- 9 files changed, 300 insertions(+), 490 deletions(-) diff --git a/lib/lwres/man/lwres_getaddrinfo.docbook b/lib/lwres/man/lwres_getaddrinfo.docbook index 19fed11b5a..cbb0b7260a 100644 --- a/lib/lwres/man/lwres_getaddrinfo.docbook +++ b/lib/lwres/man/lwres_getaddrinfo.docbook @@ -16,7 +16,7 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + @@ -101,13 +101,12 @@ IPv4 address or an IPv6 address. servname is either a decimal port number or a service name as listed in /etc/services. - + hints is an optional pointer to a 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 @@ -230,6 +229,7 @@ and no name resolution should be attempted. + All other elements of the struct addrinfo passed diff --git a/lib/lwres/man/lwres_gethostent.docbook b/lib/lwres/man/lwres_gethostent.docbook index 9aeb0bf1a4..9c62f40a15 100644 --- a/lib/lwres/man/lwres_gethostent.docbook +++ b/lib/lwres/man/lwres_gethostent.docbook @@ -16,19 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + - - Jun 30, 2000 + lwres_gethostent 3 BIND9 + lwres_gethostbyname lwres_gethostbyname2 @@ -166,13 +167,13 @@ The members of this structure are: The official (canonical) name of the host. - + h_aliases A NULL-terminated array of alternate names (nicknames) for the host. - + h_addrtype @@ -181,13 +182,13 @@ The type of address being returned — or PF_INET6. - + h_length The length of the address in bytes. - + h_addr_list @@ -195,7 +196,7 @@ A NULL terminated array of network addresses for the host. Host addresses are returned in network byte order. - + @@ -219,130 +220,68 @@ or NIS. The lightweight resolver does not currently implement these functions; it only provides them as stub functions that always return failure. + -lwres_gethostbyname() -and -lwres_gethostbyname2() -look up the hostname +lwres_gethostbyname() and +lwres_gethostbyname2() look up the hostname name. - -lwres_gethostbyname() -always looks for an IPv4 address while -lwres_gethostbyname2() -looks for an address of protocol family -af: - -either -PF_INET -or -PF_INET6 -— IPv4 or IPV6 addresses respectively. -Successful calls of the functions return a -struct hostentfor - -the name that was looked up. -NULL -is returned if the lookups by -lwres_gethostbyname() -or -lwres_gethostbyname2() -fail. +lwres_gethostbyname() always looks for an IPv4 +address while lwres_gethostbyname2() looks for an +address of protocol family af: either +PF_INET or PF_INET6 — IPv4 or IPV6 +addresses respectively. Successful calls of the functions return a +struct hostentfor the name that was looked up. +NULL is returned if the lookups by +lwres_gethostbyname() or +lwres_gethostbyname2() fail. + Reverse lookups of addresses are performed by lwres_gethostbyaddr(). -addr -is an address of length -len -bytes and protocol family -type — -PF_INET -or +addr is an address of length +len bytes and protocol family +typePF_INET or PF_INET6. - -lwres_gethostbyname_r() -is a thread-safe function for forward lookups. -If an error occurs, an error code is returned in +lwres_gethostbyname_r() 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 -struct hostent -which is initialised by a successful call to +resbuf is a pointer to a struct +hostent which is initialised by a successful call to lwres_gethostbyname_r() . -buf -is a buffer of length -len -bytes which is used to store the -h_name, - -h_aliases, - -and -h_addr_list -elements of the -struct hostent -returned in -resbuf. - -Successful calls to -lwres_gethostbyname_r() -return -resbuf, - -which is a pointer to the -struct hostent -it created. +buf is a buffer of length +len bytes which is used to store the +h_name, h_aliases, and +h_addr_list elements of the struct +hostent returned in resbuf. +Successful calls to lwres_gethostbyname_r() +return resbuf, +which is a pointer to the struct hostent it created. + -lwres_gethostbyaddr_r() -is a thread-safe function that performs a reverse lookup of address -addr -which is -len -bytes long -and is of protocol family -type — - -PF_INET -or -PF_INET6. - -If an error occurs, the error code is returned in -*error. - -The other function parameters are identical to those in -lwres_gethostbyname_r(). -resbuf -is a pointer to a -struct hostent -which is initialised by a successful call to +lwres_gethostbyaddr_r() is a thread-safe function +that performs a reverse lookup of address addr +which is len bytes long and is of protocol +family typePF_INET or +PF_INET6. If an error occurs, the error code is returned +in *error. The other function parameters are +identical to those in lwres_gethostbyname_r(). +resbuf is a pointer to a struct +hostent which is initialised by a successful call to lwres_gethostbyaddr_r(). -buf -is a buffer of length -len -bytes which is used to store the -h_name, - -h_aliases, - -and -h_addr_list -elements of the -struct hostent -returned in -resbuf. - -Successful calls to -lwres_gethostbyaddr_r() -return -resbuf, - -which is a pointer to the -struct hostent() -it created. +buf is a buffer of length +len bytes which is used to store the +h_name, h_aliases, and +h_addr_list elements of the struct +hostent returned in resbuf. Successful +calls to lwres_gethostbyaddr_r() return +resbuf, which is a pointer to the +struct hostent() it created. + + RETURN VALUES @@ -363,20 +302,20 @@ will contain one of the following error codes defined in The host or address was not found. - + TRY_AGAIN A recoverable error occurred, e.g., a timeout. Retrying the lookup may succeed. - + NO_RECOVERY A non-recoverable error occurred. - + NO_DATA @@ -386,9 +325,10 @@ of a reverse lookup). The code NO_ADDRESS is accepted as a synonym for NO_DATA for backwards compatibility. - + + lwres_hstrerror3 @@ -396,53 +336,30 @@ compatibility. translates these error codes to suitable error messages. + lwres_gethostent() and lwres_gethostent_r() always return NULL. - + -Successful calls to -lwres_gethostbyname_r() -and -lwres_gethostbyaddr_r() -return -resbuf, - -a pointer to the -struct hostent -that was initialised by these functions. -They return -NULL -if the lookups fail -or if -buf +Successful calls to lwres_gethostbyname_r() and +lwres_gethostbyaddr_r() return +resbuf, a pointer to the struct +hostent that was initialised by these functions. They return +NULL 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 -h_addr_list -elements of the -struct hostent. - -If -buf -was too small, both -lwres_gethostbyname_r() -and -lwres_gethostbyaddr_r() -set the global variable -errno -to -ERANGE. - +the h_name, h_aliases, and +h_addr_list elements of the struct +hostent. If buf was too small, both +lwres_gethostbyname_r() and +lwres_gethostbyaddr_r() set the global variable +errno to ERANGE. + SEE ALSO diff --git a/lib/lwres/man/lwres_getipnode.docbook b/lib/lwres/man/lwres_getipnode.docbook index 9083896d30..f7e6e82dcf 100644 --- a/lib/lwres/man/lwres_getipnode.docbook +++ b/lib/lwres/man/lwres_getipnode.docbook @@ -16,19 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + - - Jun 30, 2000 + lwres_getipnode 3 BIND9 + lwres_getipnodebyname lwres_getipnodebyaddr @@ -64,19 +65,21 @@ void + DESCRIPTION + These functions perform thread safe, protocol independent nodename-to-address and address-to-nodename translation as defined in RFC2553. + They use a struct hostent which is defined in namedb.h: - struct hostent { char *h_name; /* official name of host */ @@ -88,6 +91,7 @@ struct hostent { #define h_addr h_addr_list[0] /* address, for backward compatibility */ + The members of this structure are: @@ -96,13 +100,13 @@ The members of this structure are: The official (canonical) name of the host. - + h_aliases A NULL-terminated array of alternate names (nicknames) for the host. - + h_addrtype @@ -112,13 +116,13 @@ or PF_INET6. - + h_length The length of the address in bytes. - + h_addr_list @@ -127,7 +131,7 @@ A terminated array of network addresses for the host. Host addresses are returned in network byte order. - + @@ -153,7 +157,7 @@ This is used with an of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped IPv6 addresses. - + AI_ALL @@ -163,7 +167,7 @@ of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned. If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped IPv6 addresses. - + AI_ADDRCONFIG @@ -171,7 +175,7 @@ Only return an IPv6 or IPv4 address if here is an active network interface of that type. This is not currently implemented in the BIND 9 lightweight resolver, and the flag is ignored. - + AI_DEFAULT @@ -181,7 +185,7 @@ and AI_ADDRCONFIG flag bits. - + @@ -238,7 +242,7 @@ The error codes and their meanings are defined in No such host is known. - + NO_ADDRESS @@ -246,7 +250,7 @@ The server recognised the request and the name but no address is available. Another type of request to the name server for the domain might return an answer. - + TRY_AGAIN @@ -254,14 +258,14 @@ A temporary and possibly transient error occurred, such as a failure of a server to respond. The request may succeed if retried. - + NO_RECOVERY An unexpected failure occurred, and retrying the request is pointless. - + diff --git a/lib/lwres/man/lwres_getnameinfo.docbook b/lib/lwres/man/lwres_getnameinfo.docbook index 108dc00151..52094ddcd1 100644 --- a/lib/lwres/man/lwres_getnameinfo.docbook +++ b/lib/lwres/man/lwres_getnameinfo.docbook @@ -16,17 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + Jun 30, 2000 + lwres_getnameinfo 3 BIND9 + lwres_getnameinfo lightweight resolver socket address structure to hostname and service name @@ -48,59 +51,41 @@ int + DESCRIPTION - -This function is equivalent to the - -getnameinfo3 - - -function defined in RFC2133. -lwres_getnameinfo() -returns the hostname for the -struct sockaddr -sa -which is -salen -bytes long. -The hostname is of length -hostlen -and is returned via -*host. -The maximum length of the hostname is -1025 bytes: -NI_MAXHOST. + This function is equivalent to the +getnameinfo3 + function defined in RFC2133. +lwres_getnameinfo() returns the hostname for the +struct sockaddr sa which is +salen bytes long. The hostname is of length +hostlen and is returned via +*host. The maximum length of the hostname is +1025 bytes: NI_MAXHOST. + + The name of the service associated with the port number in +sa is returned in *serv. +It is servlen bytes long. The maximum length +of the service name is NI_MAXSERV - 32 bytes. - -The name of the service associated with the port number in -sa -is returned in -*serv. -It is -servlen -bytes long. -The maximum length of the service name is -NI_MAXSERV - 32 bytes. - - -The -flags -argument sets the following bits: + + The flags argument sets the following +bits: NI_NOFQDN A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead. - + NI_NUMERICHOST Return the address in numeric form, as if calling inet_ntop(), instead of a host name. - + NI_NAMEREQD @@ -108,12 +93,12 @@ A name is required. If the hostname cannot be found in the DNS and this flag is set, a non-zero error code is returned. If the hostname is not found and the flag is not set, the address is returned in numeric form. - + NI_NUMERICSERV The service name is returned as a digit string representing the port number. - + NI_DGRAM @@ -122,13 +107,11 @@ 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. - - + - - + RETURN VALUES diff --git a/lib/lwres/man/lwres_hstrerror.docbook b/lib/lwres/man/lwres_hstrerror.docbook index 2d696fb606..bff308ddcc 100644 --- a/lib/lwres/man/lwres_hstrerror.docbook +++ b/lib/lwres/man/lwres_hstrerror.docbook @@ -16,19 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + - - Jun 30, 2000 + lwres_hstrerror 3 BIND9 + lwres_herror lwres_hstrerror @@ -54,54 +55,50 @@ const char * DESCRIPTION - -lwres_herror() -prints the string -s -on -stderr -followed by the string generated by -lwres_hstrerror() -for the error code stored in the global variable -lwres_h_errno. + +lwres_herror() prints the string +s on stderr followed by the string +generated by lwres_hstrerror() for the error code +stored in the global variable lwres_h_errno. - -lwres_hstrerror() -returns an appropriate string for the error code gievn by -err. -The values of the error codes and messages are as follows: + +lwres_hstrerror() returns an appropriate string +for the error code gievn by err. The values of +the error codes and messages are as follows: + NETDB_SUCCESS Resolver Error 0 (no error) - + HOST_NOT_FOUND Unknown host - + TRY_AGAIN Host name lookup failure - + NO_RECOVERY Unknown server error - + NO_DATA No address associated with name - + + RETURN VALUES diff --git a/lib/lwres/man/lwres_inetntop.docbook b/lib/lwres/man/lwres_inetntop.docbook index 6a9d1db021..53dce24eb3 100644 --- a/lib/lwres/man/lwres_inetntop.docbook +++ b/lib/lwres/man/lwres_inetntop.docbook @@ -16,19 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + - - Jun 30, 2000 + lwres_inetntop 3 BIND9 + lwres_net_ntop lightweight resolver IP address presentation @@ -47,48 +48,39 @@ const char * + DESCRIPTION + -lwres_net_ntop() -converts an IP address of protocol family -af -— IPv4 or IPv6 — -at location -src -from network format to its conventional representation as a string. -For IPv4 addresses, that string would be a dotted-decimal. -An IPv6 address would be represented in colon notation as described in -RFC1884. +lwres_net_ntop() converts an IP address of +protocol family af — IPv4 or IPv6 — +at location src from network format to its +conventional representation as a string. For IPv4 addresses, that +string would be a dotted-decimal. An IPv6 address would be +represented in colon notation as described in RFC1884. + -The generated string is copied to -dst -provided -size -indicates it is long enough to store the ASCII representation -of the address. +The generated string is copied to dst provided +size indicates it is long enough to store the +ASCII representation of the address. + RETURN VALUES - -If successful, the function returns -dst: -a pointer to a string containing -the presentation format of the address. -lwres_net_ntop() -returns -NULL -and sets the global variable -errno -to -EAFNOSUPPORT -if the protocol family given in -af -is not supported. + +If successful, the function returns dst: +a pointer to a string containing the presentation format of the +address. lwres_net_ntop() returns +NULL and sets the global variable +errno to EAFNOSUPPORT if +the protocol family given in af is not +supported. + SEE ALSO diff --git a/lib/lwres/man/lwres_noop.docbook b/lib/lwres/man/lwres_noop.docbook index c951ed1077..6f19a883e0 100644 --- a/lib/lwres/man/lwres_noop.docbook +++ b/lib/lwres/man/lwres_noop.docbook @@ -16,19 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + - - Jun 30, 2000 + lwres_noop 3 BIND9 + lwres_nooprequest_render lwres_noopresponse_render @@ -141,65 +142,41 @@ Although the structures have different types, they are identical. This is because the no-op opcode simply echos whatever data was sent: the response is therefore identical to the request. - -lwres_nooprequest_render() -uses resolver context -ctx -to convert no-op request structure -req -to canonical format. -The packet header structure -pkt -is initialised and transferred to -buffer -b. -The contents of -*req -are then appended to the buffer in canonical format. -lwres_noopresponse_render() + +lwres_nooprequest_render() uses resolver +context ctx to convert no-op request structure +req to canonical format. The packet header +structure pkt is initialised and transferred to +buffer b. The contents of +*req are then appended to the buffer in +canonical format. lwres_noopresponse_render() performs the same task, except it converts a no-op response structure -lwres_noopresponse_t -to the lightweight resolver's canonical format. +lwres_noopresponse_t to the lightweight resolver's +canonical format. + -lwres_nooprequest_parse() -uses context -ctx -to convert the contents of packet -pkt -to a -lwres_nooprequest_t -structure. -Buffer -b -provides space to be used for storing this structure. -When the function succeeds, the resulting -lwres_nooprequest_t -is made available through +lwres_nooprequest_parse() uses context +ctx to convert the contents of packet +pkt to a lwres_nooprequest_t +structure. Buffer b provides space to be used +for storing this structure. When the function succeeds, the resulting +lwres_nooprequest_t is made available through *structp. - -lwres_noopresponse_parse() -offers the same semantics as -lwres_nooprequest_parse() -except it yields a -lwres_noopresponse_t -structure. +lwres_noopresponse_parse() offers the same +semantics as lwres_nooprequest_parse() except it +yields a lwres_noopresponse_t structure. + -lwres_noopresponse_free() -and -lwres_nooprequest_free() -release the memory in resolver context -ctx -that was allocated to the -lwres_noopresponse_t -or -lwres_nooprequest_t -structures referenced via -structp. - +lwres_noopresponse_free() and +lwres_nooprequest_free() release the memory in +resolver context ctx that was allocated to the +lwres_noopresponse_t or lwres_nooprequest_t +structures referenced via structp. + RETURN VALUES diff --git a/lib/lwres/man/lwres_packet.docbook b/lib/lwres/man/lwres_packet.docbook index 61a6abe987..86e1896f5a 100644 --- a/lib/lwres/man/lwres_packet.docbook +++ b/lib/lwres/man/lwres_packet.docbook @@ -16,17 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + + Jun 30, 2000 + lwres_packet 3 BIND9 + lwres_lwpacket_renderheader lwres_lwpacket_parseheader @@ -75,8 +78,7 @@ struct lwres_lwpacket { }; - - + The elements of this structure are: @@ -86,7 +88,7 @@ The elements of this structure are: the overall packet length, including the entire packet header. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls. - + version @@ -95,7 +97,7 @@ the header format. There is currently only one format, This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls. - + pktflags @@ -105,7 +107,7 @@ the caller. This field is filled in by the application wit the exception of the LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the lwres_gabn_*() and lwres_gnba_*() calls. - + serial @@ -114,7 +116,7 @@ packets from the same source have the same serial number and are from the same source, they are assumed to be duplicates and the latter ones may be dropped. This field must be set by the application. - + opcode @@ -124,7 +126,7 @@ reserved for use by the lightweight resolver library. Opcodes between 0x04000000 and 0xffffffff are application defined. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls. - + result @@ -133,7 +135,7 @@ Results between 0x04000000 and 0xffffffff are application defined. Results between 0x00000000 and 0x03ffffff are reserved for library use. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls. - + recvlength @@ -141,7 +143,7 @@ is the maximum buffer size that the receiver can handle on requests and the size of the buffer needed to satisfy a request when the buffer is too large for replies. This field is supplied by the application. - + authtype @@ -149,14 +151,13 @@ defines the packet level authentication that is used. Authorisation types between 0x1000 and 0xffff are application defined and types between 0x0000 and 0x0fff are reserved for library use. Currently these are not used and must be zero. - + authlen gives the length of the authentication data. Since packet authentication is currently not used, this must be zero. - - + @@ -167,72 +168,57 @@ The following opcodes are currently defined: Success is always returned and the packet contents are echoed. The lwres_noop_*() functions should be used for this type. - + GETADDRSBYNAME returns all known addresses for a given name. The lwres_gabn_*() functions should be used for this type. - + GETNAMEBYADDR return the hostname for the given address. The lwres_gnba_*() functions should be used for this type. - - + + -lwres_lwpacket_renderheader() -transfers the contents of lightweight resolver packet structure -lwres_lwpacket_t -*pkt -in network byte order to the lightweight resolver buffer, +lwres_lwpacket_renderheader() transfers the +contents of lightweight resolver packet structure +lwres_lwpacket_t *pkt 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 -*b -to resolver packet -*pkt. - -The contents of the buffer -b -should correspond to a +lwres_lwpacket_parseheader() performs the +converse operation. It transfers data in network byte order from +buffer *b to resolver packet +*pkt. The contents of the buffer +b should correspond to a lwres_lwpacket_t. - + Both functions have assertion checks to ensure that -b -and -pkt -are not +b and pkt are not NULL. - + + RETURN VALUES - -Successful calls to -lwres_lwpacket_renderheader() -and -lwres_lwpacket_parseheader() -return -LWRES_R_SUCCESS. - -If there is insufficient space to copy data between the buffer -*b -and lightweight resolver packet -*pkt -both functions return -LWRES_R_UNEXPECTEDEND. - + Successful calls to +lwres_lwpacket_renderheader() and +lwres_lwpacket_parseheader() return +LWRES_R_SUCCESS. If there is insufficient +space to copy data between the buffer *b and +lightweight resolver packet *pkt both functions +return LWRES_R_UNEXPECTEDEND. + diff --git a/lib/lwres/man/lwres_resutil.docbook b/lib/lwres/man/lwres_resutil.docbook index c9fb19b68b..f892e37e98 100644 --- a/lib/lwres/man/lwres_resutil.docbook +++ b/lib/lwres/man/lwres_resutil.docbook @@ -16,19 +16,20 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + - - + Jun 30, 2000 + lwres_resutil 3 BIND9 + lwres_string_parse lwres_addr_parse @@ -75,55 +76,38 @@ lwres_result_t + DESCRIPTION + -lwres_string_parse() -retrieves a DNS-encoded string starting the current pointer of -lightweight resolver buffer -b: - -i.e. -b->current. - +lwres_string_parse() retrieves a DNS-encoded +string starting the current pointer of lightweight resolver buffer +b: i.e. b->current. When the function returns, the address of the first byte of the -encoded string is returned via -*c -and the length of that string is given by -*len. - -The buffer's current pointer is advanced to point at the character +encoded string is returned via *c and the +length of that string is given by *len. The +buffer's current pointer is advanced to point at the character following the string length, the encoded string, and the trailing -NULL -character. -lwres_string_parse() -has an assertion check that -b -is not -NULL. - +NULL character. +lwres_string_parse() has an assertion check that +b is not NULL. - -lwres_addr_parse() -extracts an address from the buffer -b. -It checks that -addr -is not null. -The buffer's current pointer -b->current -is presumed to point at an encoded address: the address preceded by a -32-bit protocol family identifier and a 16-bit length field. -The encoded address is copied to -addr->address -and -addr->length -indicates the size in bytes of the address that was copied. -b->current -is advanced to point at the next byte of available data in the buffer + +lwres_addr_parse() extracts an address from the +buffer b. It checks that +addr is not null. The buffer's current pointer +b->current is presumed to point at an encoded +address: the address preceded by a 32-bit protocol family identifier +and a 16-bit length field. The encoded address is copied to +addr->address and +addr->length indicates the size in bytes of +the address that was copied. b->current is +advanced to point at the next byte of available data in the buffer following the encoded address. + lwres_getaddrsbyname() and @@ -153,68 +137,37 @@ they are controlled through the functions. + The lightweight resolver uses -lwres_getaddrsbyname() -to perform foward lookups. -Hostname -name -is looked up using the resolver context -ctx -for memory allocation. -addrtypes -is a bitmask indicating which type of addresses are to be looked up. -Current values for this bitmask are -LWRES_ADDRTYPE_V4 -for IPv4 addresses and -LWRES_ADDRTYPE_V6 -for IPv6 addresses. -Results of the lookup are returned in -*structp. - -lwres_getaddrsbyname() -checks that its pointer arguments are not -NULL -and that -addrtypes -is non-zero. - - -lwres_getnamebyaddr() -performs reverse lookups. -Resolver context -ctx -is used for memory allocation. -The address type is indicated by -addrtype: - -LWRES_ADDRTYPE_V4 -or -LWRES_ADDRTYPE_V6. - -The address to be looked up is given by -addr -and its length is -addrlen -bytes. -The result of the function call is made available through -*structp. - -Like +lwres_getaddrsbyname() to perform foward lookups. +Hostname name is looked up using the resolver +context ctx for memory allocation. +addrtypes is a bitmask indicating which type of +addresses are to be looked up. Current values for this bitmask are +LWRES_ADDRTYPE_V4 for IPv4 addresses and +LWRES_ADDRTYPE_V6 for IPv6 addresses. Results of the +lookup are returned in *structp. +lwres_getaddrsbyname() checks that its pointer +arguments are not NULL and that +addrtypes is non-zero. +lwres_getnamebyaddr() performs reverse lookups. +Resolver context ctx is used for memory +allocation. The address type is indicated by +addrtype: LWRES_ADDRTYPE_V4 or +LWRES_ADDRTYPE_V6. The address to be looked up is given +by addr and its length is +addrlen bytes. The result of the function call +is made available through *structp. Like lwres_getaddrsbyname(), - -lwres_getnamebyaddr() -uses assertion checking to ensure its pointer arguments are not -NULL -and -addrtype -is not zero. -lwres_getaddrsbyname() -also checks that -addrlen -is non-zero. +lwres_getnamebyaddr() uses assertion checking to +ensure its pointer arguments are not NULL and +addrtype is not zero. +lwres_getaddrsbyname() also checks that +addrlen is non-zero. + RETURN VALUES @@ -245,8 +198,8 @@ could not be found. LWRES_R_SUCCESS is returned by a successful call to lwres_getnamebyaddr(). - + Both lwres_getaddrsbyname() @@ -259,6 +212,7 @@ when memory allocation requests fail and if the buffers used for sending queries and receiving replies are too small. + SEE ALSO