7 * Revision 1.16 1994/04/06 22:45:24 markc
8 * Cleaned up rpcUtil.h. Moved include files to rpcUtil.C where they belonged.
10 * Revision 1.15 1994/03/31 22:59:04 hollings
11 * added well known port as a paramter to xdrRPC constructor.
13 * Revision 1.14 1994/03/25 16:07:31 markc
14 * Added option to specify timeout on readReady.
16 * Revision 1.13 1994/03/20 01:45:23 markc
17 * Changed xdr_Boolean to char rather than int to reflect Boolean change.
19 * Revision 1.12 1994/03/11 21:01:24 hollings
20 * Changed Boolean from int to char to match X11 convention.
26 #include <sys/types.h>
27 #include <sys/socket.h>
30 #include <rpc/types.h>
34 #define xdr_Boolean xdr_char
36 typedef int (*xdrIOFunc)(int handle, char *buf, unsigned int len);
42 // Functions common to server and client side.
46 XDRrpc(char *m, char *u, char *p, xdrIOFunc, xdrIOFunc,
47 char **arg_list=0, int nblock=0, int wellKnownPortFd = 0);
48 XDRrpc(int fd, xdrIOFunc readRoutine, xdrIOFunc writeRoutine, int nblock=0);
49 XDRrpc(int family, int port, int type, char *machine, xdrIOFunc readFunc,
50 xdrIOFunc writeFunc, int nblock=0);
52 void closeConnect() { if (fd >= 0) close(fd); fd = -1;}
54 int get_fd() { return fd;}
55 int readReady(int timeout=0);
58 int pid; // pid of child;
59 static int __wellKnownPortFd__;
60 // should the fd be closed by a destructor ??
66 void setNonBlock() { ; }
67 void setTid(int id) { tid = id; }
70 // these are only to be used by implmentors of thread RPCs.
71 // the value is only valid during a thread RPC.
72 unsigned int requestingThread;
73 unsigned int getRequestingThread() { return requestingThread; }
78 // client side common routines that are transport independent.
82 void awaitResponce(int tag);
83 void verifyProtocolAndVersion();
88 // server side routines that are transport independent.
92 int __versionVerifyDone__;
95 extern int RPC_readReady (int fd, int timeout=0);
96 extern int RPC_setup_socket (int *sfd, // return file descriptor
97 int family, // AF_INET ...
98 int type); // SOCK_STREAM ...
99 extern int xdr_String(XDR*, String*);
100 extern int RPCprocessCreate(int *pid, char *hostName, char *userName,
101 char *commandLine, char **arg_list = 0,
102 int wellKnownPort = 0);
103 extern char **RPC_make_arg_list (char *program, int family, int type, int port, int flag);
105 RPC_undo_arg_list (int argc, char **arg_list, char **machine, int &family,
106 int &type, int &well_known_socket, int &flag);
107 extern int RPC_getConnect (int fd);