Back to index

glibc  2.9
Classes | Defines | Typedefs | Enumerations | Functions
clnt.h File Reference
#include <features.h>
#include <sys/types.h>
#include <rpc/types.h>
#include <rpc/auth.h>
#include <sys/un.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rpc_err
struct  CLIENT
struct  CLIENT::clnt_ops
struct  rpc_createerr
union  rpc_err.ru
struct  rpc_err.ru.RE_vers
struct  rpc_err.ru.RE_lb

Defines

#define RPC_PMAPFAILURE   RPC_RPCBFAILURE
#define re_errno   ru.RE_errno
#define re_why   ru.RE_why
#define re_vers   ru.RE_vers
#define re_lb   ru.RE_lb
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)   ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)   ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
#define CLNT_ABORT(rh)   ((*(rh)->cl_ops->cl_abort)(rh))
#define clnt_abort(rh)   ((*(rh)->cl_ops->cl_abort)(rh))
#define CLNT_GETERR(rh, errp)   ((*(rh)->cl_ops->cl_geterr)(rh, errp))
#define clnt_geterr(rh, errp)   ((*(rh)->cl_ops->cl_geterr)(rh, errp))
#define CLNT_FREERES(rh, xres, resp)   ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
#define clnt_freeres(rh, xres, resp)   ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
#define CLNT_CONTROL(cl, rq, in)   ((*(cl)->cl_ops->cl_control)(cl,rq,in))
#define clnt_control(cl, rq, in)   ((*(cl)->cl_ops->cl_control)(cl,rq,in))
#define CLSET_TIMEOUT   1 /* set timeout (timeval) */
#define CLGET_TIMEOUT   2 /* get timeout (timeval) */
#define CLGET_SERVER_ADDR   3 /* get server's address (sockaddr) */
#define CLGET_FD   6 /* get connections file descriptor */
#define CLGET_SVC_ADDR   7 /* get server's address (netbuf) XXX */
#define CLSET_FD_CLOSE   8 /* close fd while clnt_destroy */
#define CLSET_FD_NCLOSE   9 /* Do not close fd while clnt_destroy*/
#define CLGET_XID   10 /* Get xid */
#define CLSET_XID   11 /* Set xid */
#define CLGET_VERS   12 /* Get version number */
#define CLSET_VERS   13 /* Set version number */
#define CLGET_PROG   14 /* Get program number */
#define CLSET_PROG   15 /* Set program number */
#define CLSET_SVC_ADDR   16 /* get server's address (netbuf) XXX */
#define CLSET_PUSH_TIMOD   17 /* push timod if not already present XXX */
#define CLSET_POP_TIMOD   18 /* pop timod XXX */
#define CLSET_RETRY_TIMEOUT   4 /* set retry timeout (timeval) */
#define CLGET_RETRY_TIMEOUT   5 /* get retry timeout (timeval) */
#define CLNT_DESTROY(rh)   ((*(rh)->cl_ops->cl_destroy)(rh))
#define clnt_destroy(rh)   ((*(rh)->cl_ops->cl_destroy)(rh))
#define RPCTEST_PROGRAM   ((u_long)1)
#define RPCTEST_VERSION   ((u_long)1)
#define RPCTEST_NULL_PROC   ((u_long)2)
#define RPCTEST_NULL_BATCH_PROC   ((u_long)3)
#define NULLPROC   ((u_long)0)
#define UDPMSGSIZE   8800 /* rpc imposed limit on udp msg size */
#define RPCSMALLMSGSIZE   400 /* a more reasonable packet size */

Typedefs

typedef struct CLIENT

Enumerations

enum  clnt_stat {
  RPC_SUCCESS = 0, RPC_CANTENCODEARGS = 1, RPC_CANTDECODERES = 2, RPC_CANTSEND = 3,
  RPC_CANTRECV = 4, RPC_TIMEDOUT = 5, RPC_VERSMISMATCH = 6, RPC_AUTHERROR = 7,
  RPC_PROGUNAVAIL = 8, RPC_PROGVERSMISMATCH = 9, RPC_PROCUNAVAIL = 10, RPC_CANTDECODEARGS = 11,
  RPC_SYSTEMERROR = 12, RPC_NOBROADCAST = 21, RPC_UNKNOWNHOST = 13, RPC_UNKNOWNPROTO = 17,
  RPC_UNKNOWNADDR = 19, RPC_RPCBFAILURE = 14, RPC_PROGNOTREGISTERED = 15, RPC_N2AXLATEFAILURE = 22,
  RPC_FAILED = 16, RPC_INTR = 18, RPC_TLIERROR = 20, RPC_UDERROR = 23,
  RPC_INPROGRESS = 24, RPC_STALERACHANDLE = 25
}

Functions

CLIENTclntraw_create (__const u_long __prog, __const u_long __vers) __THROW
CLIENTclnt_create (__const char *__host, __const u_long __prog, __const u_long __vers, __const char *__prot) __THROW
CLIENTclnttcp_create (struct sockaddr_in *__raddr, u_long __prog, u_long __version, int *__sockp, u_int __sendsz, u_int __recvsz) __THROW
CLIENTclntudp_create (struct sockaddr_in *__raddr, u_long __program, u_long __version, struct timeval __wait_resend, int *__sockp) __THROW
CLIENTclntudp_bufcreate (struct sockaddr_in *__raddr, u_long __program, u_long __version, struct timeval __wait_resend, int *__sockp, u_int __sendsz, u_int __recvsz) __THROW
CLIENTclntunix_create (struct sockaddr_un *__raddr, u_long __program, u_long __version, int *__sockp, u_int __sendsz, u_int __recvsz) __THROW
int callrpc (__const char *__host, __const u_long __prognum, __const u_long __versnum, __const u_long __procnum, __const xdrproc_t __inproc, __const char *__in, __const xdrproc_t __outproc, char *__out) __THROW
int _rpc_dtablesize (void) __THROW
void clnt_pcreateerror (__const char *__msg)
char * clnt_spcreateerror (__const char *__msg) __THROW
void clnt_perrno (enum clnt_stat __num)
void clnt_perror (CLIENT *__clnt, __const char *__msg)
char * clnt_sperror (CLIENT *__clnt, __const char *__msg) __THROW
char * clnt_sperrno (enum clnt_stat __num) __THROW
int getrpcport (__const char *__host, u_long __prognum, u_long __versnum, u_int proto) __THROW
void get_myaddress (struct sockaddr_in *) __THROW

Class Documentation

struct rpc_err

Definition at line 106 of file clnt.h.

Class Members
enum clnt_stat union rpc_err ru
struct CLIENT

Definition at line 133 of file clnt.h.

Collaboration diagram for CLIENT:
Class Members
AUTH * cl_auth
struct clnt_ops * cl_ops
caddr_t cl_private
struct rpc_createerr

Definition at line 390 of file clnt.h.

Class Members
enum clnt_stat struct rpc_err
union rpc_err.ru

Definition at line 108 of file clnt.h.

Class Members
int RE_errno
ru RE_lb
ru RE_vers
struct rpc_err.ru.RE_vers

Definition at line 111 of file clnt.h.

Class Members
u_long high
u_long low
struct rpc_err.ru.RE_lb

Definition at line 115 of file clnt.h.

Class Members
long s1
long s2

Define Documentation

#define CLGET_FD   6 /* get connections file descriptor */

Definition at line 222 of file clnt.h.

#define CLGET_PROG   14 /* Get program number */

Definition at line 230 of file clnt.h.

#define CLGET_RETRY_TIMEOUT   5 /* get retry timeout (timeval) */

Definition at line 239 of file clnt.h.

#define CLGET_SERVER_ADDR   3 /* get server's address (sockaddr) */

Definition at line 221 of file clnt.h.

#define CLGET_SVC_ADDR   7 /* get server's address (netbuf) XXX */

Definition at line 223 of file clnt.h.

#define CLGET_TIMEOUT   2 /* get timeout (timeval) */

Definition at line 220 of file clnt.h.

#define CLGET_VERS   12 /* Get version number */

Definition at line 228 of file clnt.h.

#define CLGET_XID   10 /* Get xid */

Definition at line 226 of file clnt.h.

#define CLNT_ABORT (   rh)    ((*(rh)->cl_ops->cl_abort)(rh))

Definition at line 180 of file clnt.h.

#define clnt_abort (   rh)    ((*(rh)->cl_ops->cl_abort)(rh))

Definition at line 181 of file clnt.h.

#define CLNT_CALL (   rh,
  proc,
  xargs,
  argsp,
  xres,
  resp,
  secs 
)    ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))

Definition at line 170 of file clnt.h.

#define clnt_call (   rh,
  proc,
  xargs,
  argsp,
  xres,
  resp,
  secs 
)    ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))

Definition at line 172 of file clnt.h.

#define CLNT_CONTROL (   cl,
  rq,
  in 
)    ((*(cl)->cl_ops->cl_control)(cl,rq,in))

Definition at line 209 of file clnt.h.

#define clnt_control (   cl,
  rq,
  in 
)    ((*(cl)->cl_ops->cl_control)(cl,rq,in))

Definition at line 210 of file clnt.h.

#define CLNT_DESTROY (   rh)    ((*(rh)->cl_ops->cl_destroy)(rh))

Definition at line 246 of file clnt.h.

#define clnt_destroy (   rh)    ((*(rh)->cl_ops->cl_destroy)(rh))

Definition at line 247 of file clnt.h.

#define CLNT_FREERES (   rh,
  xres,
  resp 
)    ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))

Definition at line 199 of file clnt.h.

#define clnt_freeres (   rh,
  xres,
  resp 
)    ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))

Definition at line 200 of file clnt.h.

#define CLNT_GETERR (   rh,
  errp 
)    ((*(rh)->cl_ops->cl_geterr)(rh, errp))

Definition at line 188 of file clnt.h.

#define clnt_geterr (   rh,
  errp 
)    ((*(rh)->cl_ops->cl_geterr)(rh, errp))

Definition at line 189 of file clnt.h.

#define CLSET_FD_CLOSE   8 /* close fd while clnt_destroy */

Definition at line 224 of file clnt.h.

#define CLSET_FD_NCLOSE   9 /* Do not close fd while clnt_destroy*/

Definition at line 225 of file clnt.h.

#define CLSET_POP_TIMOD   18 /* pop timod XXX */

Definition at line 234 of file clnt.h.

#define CLSET_PROG   15 /* Set program number */

Definition at line 231 of file clnt.h.

#define CLSET_PUSH_TIMOD   17 /* push timod if not already present XXX */

Definition at line 233 of file clnt.h.

#define CLSET_RETRY_TIMEOUT   4 /* set retry timeout (timeval) */

Definition at line 238 of file clnt.h.

#define CLSET_SVC_ADDR   16 /* get server's address (netbuf) XXX */

Definition at line 232 of file clnt.h.

#define CLSET_TIMEOUT   1 /* set timeout (timeval) */

Definition at line 219 of file clnt.h.

#define CLSET_VERS   13 /* Set version number */

Definition at line 229 of file clnt.h.

#define CLSET_XID   11 /* Set xid */

Definition at line 227 of file clnt.h.

#define NULLPROC   ((u_long)0)

Definition at line 265 of file clnt.h.

#define re_errno   ru.RE_errno

Definition at line 120 of file clnt.h.

#define re_lb   ru.RE_lb

Definition at line 123 of file clnt.h.

#define re_vers   ru.RE_vers

Definition at line 122 of file clnt.h.

#define re_why   ru.RE_why

Definition at line 121 of file clnt.h.

Definition at line 85 of file clnt.h.

#define RPCSMALLMSGSIZE   400 /* a more reasonable packet size */

Definition at line 417 of file clnt.h.

#define RPCTEST_NULL_BATCH_PROC   ((u_long)3)

Definition at line 259 of file clnt.h.

#define RPCTEST_NULL_PROC   ((u_long)2)

Definition at line 258 of file clnt.h.

#define RPCTEST_PROGRAM   ((u_long)1)

Definition at line 256 of file clnt.h.

#define RPCTEST_VERSION   ((u_long)1)

Definition at line 257 of file clnt.h.

#define UDPMSGSIZE   8800 /* rpc imposed limit on udp msg size */

Definition at line 416 of file clnt.h.


Typedef Documentation

typedef struct CLIENT

Definition at line 132 of file clnt.h.


Enumeration Type Documentation

enum clnt_stat
Enumerator:
RPC_SUCCESS 
RPC_CANTENCODEARGS 
RPC_CANTDECODERES 
RPC_CANTSEND 
RPC_CANTRECV 
RPC_TIMEDOUT 
RPC_VERSMISMATCH 
RPC_AUTHERROR 
RPC_PROGUNAVAIL 
RPC_PROGVERSMISMATCH 
RPC_PROCUNAVAIL 
RPC_CANTDECODEARGS 
RPC_SYSTEMERROR 
RPC_NOBROADCAST 
RPC_UNKNOWNHOST 
RPC_UNKNOWNPROTO 
RPC_UNKNOWNADDR 
RPC_RPCBFAILURE 
RPC_PROGNOTREGISTERED 
RPC_N2AXLATEFAILURE 
RPC_FAILED 
RPC_INTR 
RPC_TLIERROR 
RPC_UDERROR 
RPC_INPROGRESS 
RPC_STALERACHANDLE 

Definition at line 53 of file clnt.h.

               {
       RPC_SUCCESS=0,                     /* call succeeded */
       /*
        * local errors
        */
       RPC_CANTENCODEARGS=1,              /* can't encode arguments */
       RPC_CANTDECODERES=2,        /* can't decode results */
       RPC_CANTSEND=3,                    /* failure in sending call */
       RPC_CANTRECV=4,                    /* failure in receiving result */
       RPC_TIMEDOUT=5,                    /* call timed out */
       /*
        * remote errors
        */
       RPC_VERSMISMATCH=6,         /* rpc versions not compatible */
       RPC_AUTHERROR=7,            /* authentication error */
       RPC_PROGUNAVAIL=8,          /* program not available */
       RPC_PROGVERSMISMATCH=9,            /* program version mismatched */
       RPC_PROCUNAVAIL=10,         /* procedure unavailable */
       RPC_CANTDECODEARGS=11,             /* decode arguments error */
       RPC_SYSTEMERROR=12,         /* generic "other problem" */
       RPC_NOBROADCAST = 21,              /* Broadcasting not supported */
       /*
        * callrpc & clnt_create errors
        */
       RPC_UNKNOWNHOST=13,         /* unknown host name */
       RPC_UNKNOWNPROTO=17,        /* unknown protocol */
       RPC_UNKNOWNADDR = 19,              /* Remote address unknown */

       /*
        * rpcbind errors
        */
       RPC_RPCBFAILURE=14,         /* portmapper failed in its call */
#define RPC_PMAPFAILURE RPC_RPCBFAILURE
       RPC_PROGNOTREGISTERED=15,   /* remote program is not registered */
       RPC_N2AXLATEFAILURE = 22,   /* Name to addr translation failed */
       /*
        * unspecified error
        */
       RPC_FAILED=16,
       RPC_INTR=18,
       RPC_TLIERROR=20,
       RPC_UDERROR=23,
        /*
         * asynchronous errors
         */
        RPC_INPROGRESS = 24,
        RPC_STALERACHANDLE = 25
};

Function Documentation

int _rpc_dtablesize ( void  )

Definition at line 42 of file rpc_dtable.c.

{
  static int size;

  if (size == 0)
    size = __getdtablesize ();

  return size;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int callrpc ( __const char *  __host,
__const u_long  __prognum,
__const u_long  __versnum,
__const u_long  __procnum,
__const xdrproc_t  __inproc,
__const char *  __in,
__const xdrproc_t  __outproc,
char *  __out 
)
CLIENT* clnt_create ( __const char *  __host,
__const u_long  __prog,
__const u_long  __vers,
__const char *  __prot 
)
void clnt_pcreateerror ( __const char *  __msg)

Here is the caller graph for this function:

void clnt_perrno ( enum clnt_stat  __num)

Here is the caller graph for this function:

void clnt_perror ( CLIENT __clnt,
__const char *  __msg 
)

Here is the caller graph for this function:

char* clnt_spcreateerror ( __const char *  __msg)
char* clnt_sperrno ( enum clnt_stat  __num)

Definition at line 256 of file clnt_perr.c.

{
  size_t i;

  for (i = 0; i < sizeof (rpc_errlist) / sizeof (struct rpc_errtab); i++)
    {
      if (rpc_errlist[i].status == stat)
       {
         return _(rpc_errstr + rpc_errlist[i].message_off);
       }
    }
  return _("RPC: (unknown error code)");
}

Here is the caller graph for this function:

char* clnt_sperror ( CLIENT __clnt,
__const char *  __msg 
)
CLIENT* clntraw_create ( __const u_long  __prog,
__const u_long  __vers 
)
CLIENT* clnttcp_create ( struct sockaddr_in __raddr,
u_long  __prog,
u_long  __version,
int __sockp,
u_int  __sendsz,
u_int  __recvsz 
)

Definition at line 119 of file clnt_tcp.c.

{
  CLIENT *h;
  struct ct_data *ct;
  struct rpc_msg call_msg;

  h = (CLIENT *) mem_alloc (sizeof (*h));
  ct = (struct ct_data *) mem_alloc (sizeof (*ct));
  if (h == NULL || ct == NULL)
    {
      struct rpc_createerr *ce = &get_rpc_createerr ();
      (void) __fxprintf (NULL, "%s: %s", __func__, _("out of memory\n"));
      ce->cf_stat = RPC_SYSTEMERROR;
      ce->cf_error.re_errno = ENOMEM;
      goto fooy;
    }

  /*
   * If no port number given ask the pmap for one
   */
  if (raddr->sin_port == 0)
    {
      u_short port;
      if ((port = pmap_getport (raddr, prog, vers, IPPROTO_TCP)) == 0)
       {
         mem_free ((caddr_t) ct, sizeof (struct ct_data));
         mem_free ((caddr_t) h, sizeof (CLIENT));
         return ((CLIENT *) NULL);
       }
      raddr->sin_port = htons (port);
    }

  /*
   * If no socket given, open one
   */
  if (*sockp < 0)
    {
      *sockp = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
      (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
      if ((*sockp < 0)
         || (__connect (*sockp, (struct sockaddr *) raddr,
                      sizeof (*raddr)) < 0))
       {
         struct rpc_createerr *ce = &get_rpc_createerr ();
         ce->cf_stat = RPC_SYSTEMERROR;
         ce->cf_error.re_errno = errno;
         if (*sockp >= 0)
           (void) __close (*sockp);
         goto fooy;
       }
      ct->ct_closeit = TRUE;
    }
  else
    {
      ct->ct_closeit = FALSE;
    }

  /*
   * Set up private data struct
   */
  ct->ct_sock = *sockp;
  ct->ct_wait.tv_usec = 0;
  ct->ct_waitset = FALSE;
  ct->ct_addr = *raddr;

  /*
   * Initialize call message
   */
  call_msg.rm_xid = _create_xid ();
  call_msg.rm_direction = CALL;
  call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
  call_msg.rm_call.cb_prog = prog;
  call_msg.rm_call.cb_vers = vers;

  /*
   * pre-serialize the static part of the call msg and stash it away
   */
  INTUSE(xdrmem_create) (&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
                      XDR_ENCODE);
  if (!INTUSE(xdr_callhdr) (&(ct->ct_xdrs), &call_msg))
    {
      if (ct->ct_closeit)
       {
         (void) __close (*sockp);
       }
      goto fooy;
    }
  ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs));
  XDR_DESTROY (&(ct->ct_xdrs));

  /*
   * Create a client handle which uses xdrrec for serialization
   * and authnone for authentication.
   */
  INTUSE(xdrrec_create) (&(ct->ct_xdrs), sendsz, recvsz,
                      (caddr_t) ct, readtcp, writetcp);
  h->cl_ops = (struct clnt_ops *) &tcp_ops;
  h->cl_private = (caddr_t) ct;
  h->cl_auth = INTUSE(authnone_create) ();
  return h;

fooy:
  /*
   * Something goofed, free stuff and barf
   */
  mem_free ((caddr_t) ct, sizeof (struct ct_data));
  mem_free ((caddr_t) h, sizeof (CLIENT));
  return ((CLIENT *) NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

CLIENT* clntudp_bufcreate ( struct sockaddr_in __raddr,
u_long  __program,
u_long  __version,
struct timeval  __wait_resend,
int __sockp,
u_int  __sendsz,
u_int  __recvsz 
)

Definition at line 250 of file clnt_udp.c.

{
  return INTUSE(__libc_clntudp_bufcreate) (raddr, program, version, wait,
                                      sockp, sendsz, recvsz, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

CLIENT* clntudp_create ( struct sockaddr_in __raddr,
u_long  __program,
u_long  __version,
struct timeval  __wait_resend,
int __sockp 
)

Definition at line 260 of file clnt_udp.c.

Here is the call graph for this function:

Here is the caller graph for this function:

CLIENT* clntunix_create ( struct sockaddr_un __raddr,
u_long  __program,
u_long  __version,
int __sockp,
u_int  __sendsz,
u_int  __recvsz 
)

Definition at line 116 of file clnt_unix.c.

{
  CLIENT *h;
  struct ct_data *ct = (struct ct_data *) mem_alloc (sizeof (*ct));
  struct rpc_msg call_msg;
  int len;

  h = (CLIENT *) mem_alloc (sizeof (*h));
  if (h == NULL || ct == NULL)
    {
      struct rpc_createerr *ce = &get_rpc_createerr ();
      (void) __fxprintf (NULL, "%s: %s", __func__, _("out of memory\n"));
      ce->cf_stat = RPC_SYSTEMERROR;
      ce->cf_error.re_errno = ENOMEM;
      goto fooy;
    }

  /*
   * If no socket given, open one
   */
  if (*sockp < 0)
    {
      *sockp = __socket (AF_UNIX, SOCK_STREAM, 0);
      len = strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1;
      if (*sockp < 0
         || __connect (*sockp, (struct sockaddr *) raddr, len) < 0)
       {
         struct rpc_createerr *ce = &get_rpc_createerr ();
         ce->cf_stat = RPC_SYSTEMERROR;
         ce->cf_error.re_errno = errno;
         if (*sockp != -1)
           __close (*sockp);
         goto fooy;
       }
      ct->ct_closeit = TRUE;
    }
  else
    {
      ct->ct_closeit = FALSE;
    }

  /*
   * Set up private data struct
   */
  ct->ct_sock = *sockp;
  ct->ct_wait.tv_usec = 0;
  ct->ct_waitset = FALSE;
  ct->ct_addr = *raddr;

  /*
   * Initialize call message
   */
  call_msg.rm_xid = _create_xid ();
  call_msg.rm_direction = CALL;
  call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
  call_msg.rm_call.cb_prog = prog;
  call_msg.rm_call.cb_vers = vers;

  /*
   * pre-serialize the static part of the call msg and stash it away
   */
  INTUSE(xdrmem_create) (&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
                      XDR_ENCODE);
  if (!INTUSE(xdr_callhdr) (&(ct->ct_xdrs), &call_msg))
    {
      if (ct->ct_closeit)
       __close (*sockp);
      goto fooy;
    }
  ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs));
  XDR_DESTROY (&(ct->ct_xdrs));

  /*
   * Create a client handle which uses xdrrec for serialization
   * and authnone for authentication.
   */
  INTUSE(xdrrec_create) (&(ct->ct_xdrs), sendsz, recvsz,
                      (caddr_t) ct, readunix, writeunix);
  h->cl_ops = (struct clnt_ops *) &unix_ops;
  h->cl_private = (caddr_t) ct;
  h->cl_auth = INTUSE(authnone_create) ();
  return h;

fooy:
  /*
   * Something goofed, free stuff and barf
   */
  mem_free ((caddr_t) ct, sizeof (struct ct_data));
  mem_free ((caddr_t) h, sizeof (CLIENT));
  return (CLIENT *) NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void get_myaddress ( struct sockaddr_in )

Definition at line 62 of file get_myaddr.c.

{
  struct ifaddrs *ifa;

  if (getifaddrs (&ifa) != 0)
    {
      perror ("get_myaddress: getifaddrs");
      exit (1);
    }

  int loopback = 0;
  struct ifaddrs *run;

 again:
  run = ifa;
  while (run != NULL)
    {
      if ((run->ifa_flags & IFF_UP)
         && run->ifa_addr != NULL
         && run->ifa_addr->sa_family == AF_INET
         && (!(run->ifa_flags & IFF_LOOPBACK)
             || (loopback == 1 && (run->ifa_flags & IFF_LOOPBACK))))
       {
         *addr = *((struct sockaddr_in *) run->ifa_addr);
         addr->sin_port = htons (PMAPPORT);
         goto out;
       }

      run = run->ifa_next;
    }

  if (loopback == 0)
    {
      loopback = 1;
      goto again;
    }
 out:
  freeifaddrs (ifa);

  /* The function is horribly specified.  It does not return any error
     if no interface is up.  Probably this won't happen (at least
     loopback is there) but still...  */
}

Here is the call graph for this function:

Here is the caller graph for this function:

int getrpcport ( __const char *  __host,
u_long  __prognum,
u_long  __versnum,
u_int  proto 
)