res_nisourserver()--Check Server Address
Syntax
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> int res_nisourserver(state* res, const struct sockaddr_in* server)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: Yes
The res_nisourserver() looks up the specified server address in the ns_addr_list[] of the specified res structure.
Parameters
- res
- (Input) The pointer to the state structure.
- server
- (Input) The pointer to the server address to check. Although it is declared as a const struct sockaddr_in*, it may be either a const struct sockaddr_in* or a const struct sockaddr_in6*.
Authorities:
No authorization is required.
Return Value
(0) Server not found in ns_addr_list[].
(>0) Server found in ns_addr_list[].
(<0) Error.
Error Conditions
When the res_nisourserver() function returns an error, errno will be set to one of the following:
- [EFAULT]
The system detected a pointer that was invalid while attempting to access an input pointer.
- [EINVAL]
One of the following reasons:
- A NULL pointer was passed to res_nisourserver()
- The res appears to be initialized but the reserved field is not set to zeros.
- A NULL pointer was passed to res_nisourserver()
Related Information
- res_findzonecut()--Find the Enclosing Zone and
Servers
- res_init()--Initialize res Structure
- res_nclose()--Close Socket and Reset res
Structure
- res_nmkquery()--Place Domain Query in
Buffer
- res_nquery()--Send Domain Query
- res_nsearch()--Search for Domain Name
- res_nsend()--Send Buffered Domain Query
- res_xlate()--Translate DNS Packets
API introduced: V5R1