Hi, I don't know if anyone is interested but I was looking at the RPC2 docs today and tried to build the first example program - without success. I had a muck around and fixed the errors in the first example programs. Patches attached.
Mark Phalan
--- rtime_clnt.c 2003-02-11 01:23:30.000000000 +0000 +++ ../rtime_clnt.c 2003-02-11 00:50:38.000000000 +0000 @@ -2,8 +2,8 @@ #include <sys/types.h> #include <netinet/in.h> #include <assert.h> -#include "lwp.h" -#include "rpc2.h" +#include <lwp/lwp.h> +#include <rpc2/rpc2.h> #include "rtime.h" @@ -56,7 +56,7 @@ if (LWP_Init(LWP_VERSION, LWP_NORMAL_PRIORITY, &mylpid) != LWP_SUCCESS) error_report("Can't Initialize LWP"); /* Initialize LWP package */ - rc = RPC2_Init(RPC2_VERSION, NULL, NULL, 0, -1, NULL) ; + rc = RPC2_Init(RPC2_VERSION, NULL, 0, -1, NULL); if (rc != RPC2_SUCCESS) error_report("%s\nCan't Initialize RPC2", RPC2_ErrorMsg(rc)); /* Initialize RPC2 package */ @@ -67,7 +67,7 @@ char *machine_name; { RPC2_HostIdent hid; - RPC2_PortalIdent pid; + RPC2_PortIdent pid; RPC2_SubsysIdent sid; RPC2_Handle cid; char msg[100]; @@ -80,7 +80,7 @@ error_report(msg); } ; strcpy(hid.Value.Name, machine_name); - pid.Tag = RPC2_PORTALBYINETNUMBER; + pid.Tag = RPC2_PORTBYINETNUMBER; pid.Value.InetPortNumber = htons(RTIMEPORTAL); sid.Tag = RPC2_SUBSYSBYID; sid.Value.SubsysId = RTIMESUBSYSID; @@ -90,7 +90,7 @@ bp.SideEffectType = NULL; bp.ClientIdent = NULL; bp.SharedSecret = NULL; - rc = RPC2_NewBinding(&hid, &pid, &sid, &bp, &Gcid); + rc = RPC2_NewBinding(&hid, &pid, &sid, &bp, &cid); if (rc != RPC2_SUCCESS) { sprintf(msg, "%s\nCan't connect to machine %s", RPC2_ErrorMsg(rc), machine_name);
--- rtime_srv.c 2003-02-11 01:23:49.000000000 +0000 +++ ../rtime_srv.c 2003-02-11 01:27:07.000000000 +0000 @@ -3,8 +3,8 @@ #include <netinet/in.h> #include <assert.h> #include <sys/time.h> -#include "lwp.h" -#include "rpc2.h" +#include <lwp/lwp.h> +#include <rpc2/rpc2.h> #include "rtime.h" @@ -23,10 +23,10 @@ /* loop forever, wait for the client to call for service */ for ( ; ; ) { - rc = RPC2_GetRequest(&reqfilter, &cid, &reqbuffer, NULL, NULL, NULL) ; + rc = RPC2_GetRequest(&reqfilter, &cid, &reqbuffer, NULL, NULL, NULL, NULL) ; if (rc != RPC2_SUCCESS) fprintf(stderr, RPC2_ErrorMsg(rc)); - rc = rtime_ExecuteRequest(cid, reqbuffer); + rc = rtime_ExecuteRequest(cid, reqbuffer,NULL); if (rc != RPC2_SUCCESS) fprintf(stderr, RPC2_ErrorMsg(rc)); }; @@ -43,7 +43,7 @@ Init_RPC() { PROCESS mylpid; - RPC2_PortalIdent pid, *pids; + RPC2_PortIdent pid, *pids; RPC2_SubsysIdent sid; int rc; char msg[100]; @@ -54,9 +54,9 @@ /* Initialize RPC2 package */ pids = &pid; - pid.Tag = RPC2_PORTALBYINETNUMBER; + pid.Tag = RPC2_PORTBYINETNUMBER; pid.Value.InetPortNumber = htons(RTIMEPORTAL); - rc = RPC2_Init(RPC2_VERSION, NULL, &pids, 1, -1, NULL); + rc = RPC2_Init(RPC2_VERSION,0,pids,-1, NULL); if (rc != RPC2_SUCCESS) { sprintf(msg, "%s\nCan't Initialize RPC2", RPC2_ErrorMsg(rc)); error_report(msg); @@ -73,8 +73,8 @@ long GetRTime(_cid, tv_sec, tv_usec) RPC2_Handle _cid; -int *tv_sec; -int *tv_usec; +RPC2_Integer *tv_sec; +RPC2_Integer *tv_usec; { struct timeval tp; struct timezone tzp;