123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #if 0
- static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
- #endif
- #include "rpc_private.h"
- #include <rpc/pmap_prot.h>
- #include <rpc/pmap_clnt.h>
- #include <netdb.h>
- #include <stdbool.h>
- #include <stdio.h>
- #include <errno.h>
- #include <unistd.h>
- struct pmaplist *
- pmap_getmaps (struct sockaddr_in *address)
- {
- struct pmaplist *head = (struct pmaplist *) NULL;
- int _socket = -1;
- struct timeval minutetimeout;
- CLIENT *client;
- minutetimeout.tv_sec = 60;
- minutetimeout.tv_usec = 0;
- address->sin_port = htons (PMAPPORT);
-
- client = clnttcp_create (address, PMAPPROG,
- PMAPVERS, &_socket, 50, 500);
- if (client != (CLIENT *) NULL)
- {
- if (CLNT_CALL (client, PMAPPROC_DUMP, (xdrproc_t)xdr_void, NULL,
- (xdrproc_t)xdr_pmaplist, (caddr_t)&head,
- minutetimeout) != RPC_SUCCESS)
- {
- clnt_perror (client, _("pmap_getmaps rpc problem"));
- }
- CLNT_DESTROY (client);
- }
-
- address->sin_port = 0;
- return head;
- }
|