10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/in.h>
18 #define xdr_Boolean xdr_bool
20 typedef int (*xdrIOFunc)(int handle, char *buf, unsigned int len);
26 // Functions common to server and client side.
30 XDRrpc(char *m, char *u, char *p, xdrIOFunc, xdrIOFunc,
31 char **arg_list=0, int nblock=0);
32 XDRrpc(int fd, xdrIOFunc readRoutine, xdrIOFunc writeRoutine, int nblock=0);
33 XDRrpc(int family, int port, int type, char *machine, xdrIOFunc readFunc,
34 xdrIOFunc writeFunc, int nblock=0);
36 void closeConnect() { if (fd >= 0) close(fd); fd = -1;}
38 int get_fd() { return fd;}
42 int pid; // pid of child;
43 // should the fd be closed by a destructor ??
49 void setNonBlock() { ; }
50 void setTid(int id) { tid = id; }
53 // these are only to be used by implmentors of thread RPCs.
54 // the value is only valid during a thread RPC.
55 unsigned int requestingThread;
56 unsigned int getRequestingThread() { return requestingThread; }
61 // client side common routines that are transport independent.
65 void awaitResponce(int tag);
66 void verifyProtocolAndVersion();
70 // server side routines that are transport independent.
74 int __versionVerifyDone__;
77 extern int RPC_readReady (int fd);
78 extern int RPC_setup_socket (int *sfd, // return file descriptor
79 int family, // AF_INET ...
80 int type); // SOCK_STREAM ...
81 extern int xdr_String(XDR*, String*);
82 extern int RPCprocessCreate(int *pid, char *hostName, char *userName,
83 char *commandLine, char **arg_list = 0);
84 extern char **RPC_make_arg_list (char *program, int family, int type, int port, int flag);
86 RPC_undo_arg_list (int argc, char **arg_list, char **machine, int *family,
87 int *type, int *well_known_socket, int *flag);
88 extern int RPC_getConnect (int fd);