7 * Revision 1.17 1994/04/21 23:23:44 hollings
8 * removed paradynd name from make args function.
10 * Revision 1.16 1994/04/06 22:45:24 markc
11 * Cleaned up rpcUtil.h. Moved include files to rpcUtil.C where they belonged.
13 * Revision 1.15 1994/03/31 22:59:04 hollings
14 * added well known port as a paramter to xdrRPC constructor.
16 * Revision 1.14 1994/03/25 16:07:31 markc
17 * Added option to specify timeout on readReady.
19 * Revision 1.13 1994/03/20 01:45:23 markc
20 * Changed xdr_Boolean to char rather than int to reflect Boolean change.
22 * Revision 1.12 1994/03/11 21:01:24 hollings
23 * Changed Boolean from int to char to match X11 convention.
29 #include <sys/types.h>
30 #include <sys/socket.h>
33 #include <rpc/types.h>
37 #define xdr_Boolean xdr_char
39 typedef int (*xdrIOFunc)(int handle, char *buf, unsigned int len);
45 // Functions common to server and client side.
49 XDRrpc(char *m, char *u, char *p, xdrIOFunc, xdrIOFunc,
50 char **arg_list=0, int nblock=0, int wellKnownPortFd = 0);
51 XDRrpc(int fd, xdrIOFunc readRoutine, xdrIOFunc writeRoutine, int nblock=0);
52 XDRrpc(int family, int port, int type, char *machine, xdrIOFunc readFunc,
53 xdrIOFunc writeFunc, int nblock=0);
55 void closeConnect() { if (fd >= 0) close(fd); fd = -1;}
57 int get_fd() { return fd;}
58 int readReady(int timeout=0);
61 int pid; // pid of child;
62 static int __wellKnownPortFd__;
63 // should the fd be closed by a destructor ??
69 void setNonBlock() { ; }
70 void setTid(int id) { tid = id; }
73 // these are only to be used by implmentors of thread RPCs.
74 // the value is only valid during a thread RPC.
75 unsigned int requestingThread;
76 unsigned int getRequestingThread() { return requestingThread; }
81 // client side common routines that are transport independent.
85 void awaitResponce(int tag);
86 void verifyProtocolAndVersion();
91 // server side routines that are transport independent.
95 int __versionVerifyDone__;
98 extern int RPC_readReady (int fd, int timeout=0);
99 extern int RPC_setup_socket (int *sfd, // return file descriptor
100 int family, // AF_INET ...
101 int type); // SOCK_STREAM ...
102 extern int xdr_String(XDR*, String*);
103 extern int RPCprocessCreate(int *pid, char *hostName, char *userName,
104 char *commandLine, char **arg_list = 0,
105 int wellKnownPort = 0);
106 extern char **RPC_make_arg_list (int family, int type, int port, int flag);
108 RPC_undo_arg_list (int argc, char **arg_list, char **machine, int &family,
109 int &type, int &well_known_socket, int &flag);
110 extern int RPC_getConnect (int fd);