res_findzonecut()--Find the Enclosing Zone and Servers
Syntax
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int res_findzonecut(state* res,
const char *domain_name,
ns_class class,
int options,
char *zone_name,
size_t zone_size,
struct in_addr *addresses,
int num_addresses)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: Yes
The res_findzonecut() queries name servers until it finds the
enclosing zone and its master name servers for the specified domain name.
Parameters
- res
- (Input) The pointer to the state structure.
- domain_name
- (Input) The pointer to the domain name whose enclosing zone is desired.
- class
- (Input) The class of domain_name.
- options
- (Input) Processing options, may be RES_EXHAUSTIVE.
- zone_name
- (Output) The pointer to the enclosing zone name found.
- zonesize
- (Input) The size of the zone_name buffer.
- addresses
- (Output) The name server addresses found for the enclosing zone.
- num_addresses
- (Input) The maximum number of addresses to be returned.
Authorities
No authorization is required.
Return Value
res_findzonecut() returns an integer. Possible values are:
- < 0 - (unsuccessful).
- = 0 - zone_name is now valid, but addresses wasn't
changed.
- > 0 - zone_name is now valid, and the return value is number of
addresses found.
Error Conditions
When the res_findzonecut() function fails,
res_findzonecut() can set errno to one of the following:
- [ECONVERT]
Either the input packet could not be translated
to ASCII or the answer received could not be translated to the coded character
set identifier (CCSID) currently in effect for the job.
- [EDESTADDRREQ]
No zone could be found for the domain.
- [EFAULT]
The system detected a pointer that was invalid
while attempting to access an input pointer.
- [EINVAL]
One of the following reasons:
- An invalid length or NULL pointer was passed to res_findzonecut()
- The res appears to be initialized but the reserved field
is not set to zeros.
Note: No attempt is made to initialize the
res structure if it was initialized previous to the
res_findzonecut() being issued.
- [EMSGSIZE]
An invalid message length was returned on an
answer.
- [EPROTOTYPE]
The answer to a query had the wrong domain
name.
Note: There are numerous other values that errno
can be set to by the resolver and sockets functions that
res_findzonecut() calls. Refer to other functions for the other
values.
Usage Notes
- res_findzonecut() calls res_mkquery() and
res_send() to query the specified server for the zone information.
- res_findzonecut() calls res_ninit() if the
res structure has not been initialized.
- res_findzonecut() assumes that the data passed to it is EBCDIC and
is in the default coded character set identifier (CCSID) currently in effect
for the job. It translates the data from the default CCSID currently in effect
for the job to ASCII (CCSID 819) before the data is sent out to a name server.
The response that it receives from the name server is returned in the default
CCSID currently in effect for the job.
Related Information
API introduced: V5R1