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:


Related Information



API introduced: V5R1

[ Back to top | UNIX-Type APIs | APIs by category ]