pmap_getport

Name

pmap_getport -- Returns the port number on which a service is waiting for.

Synopsis

#include <pmap_clnt.h>

extern u_short *pmap_getport(struct sockaddr_in *address, __const u_long program, __const u_long *version, u_int protocol);

Description

pmap_getport returns the port number on which a service is waiting for. pmap_getport is called given the RPC program number program, version, and the transport protocol set to either IPPROTO_UDP or IPPROTO_TCP. The pre-allocated socket address is a returned parameter.

Return Value

pmap_getport returns 0 if the mapping does not exist or if contact to the remote portmap service failed. If the remote portmap service could not be reached, the status is left in the global variable rpc_createerr.