[comp.unix.ultrix] ONC RPC, XDR and Data conversion on DEC RISC Ultrix

fkittred@bbn.com (Fletcher Kittredge) (05/14/91)

In article <1991May8.154008.2112@milton.u.washington.edu> dittrich@milton.u.washington.edu (Dave Dittrich) writes:
>I am trying to compile CAP60 (which I picked up from munnari.oz.au) on
>a DECstation 3100 running Ultrix 4.1.  I am compiling CAP to use Ethertalk
>rather than IPTalk.  Looking into my problems a little bit I notice some
>things.
>
>First, it looks as is my system does not have all of the RPC distribution.
>Specifically, there is no /lib/librpc.lib and no rpcgen!
>
>I would like to hear from people who have installed CAP60 on DECstation
>3100's under Ultrix 4.0 or 4.1, especially those who use Ethertalk rather
>than IPTalk.
>
>I also would like to hear from people who have a working distribution of RPC
>properly installed on the above platform so I can find out what I need to do
>to get past this hurdle. (E.g., can I just install RPCSRC 4.0 from any
>Internet archive site that has it?  Are there any conflicts with other
>software or DEC modifications that I need to be aware of?)

You can't install RPC SRC without a fair amount of twiddling.  The default
version only has IEEE little endian and VAX definitions for XDR.  You can
fix this by adding your own definitions.  Look at /usr/include/ieeefp.h for
templates on how IEEE EL is handled.  Remember that the MIPS chip is setable
as to the byte order of the architecture.  There are definitions for both
MIPSEL and big endian (regular) MIPS.

Beware of the fact that DEC has included the RPC and XDR functions in /libc.a

good luck!   DEC really missed the boat by not including support for RPC and
XDR...  Especially XDR, whose general data conversion functionality is missing
in NCS and DCE.  HP included both XDR and and RPC even though they support
NCS and DCE.

regards,
fletcher



Fletcher Kittredge
Senior Engineer, BBN Software Products
150 CambridgePark Dr,  Cambridge, MA. 02140
617-873-3465  /  fkittred@bbn.com  /  fkittred@das.harvard.edu

frank@croton.nyo.dec.com (Frank Wortner) (05/14/91)

In article <64164@bbn.BBN.COM>, fkittred@bbn.com (Fletcher Kittredge) writes:

|>You can't install RPC SRC without a fair amount of twiddling.

Depends on what you define as "a fair amount."  :-)  The only file that needs to
be patched is xdr_float.c.

|>  The default version only has IEEE little endian and VAX definitions for XDR.

You probably meant IEEE big endian.  If it had little-endian support, then there
would be nothing to fix.

|> You can fix this by adding your own definitions.  Look at /usr/include/ieeefp.h for
|>templates on how IEEE EL is handled.  Remember that the MIPS chip is setable
|>as to the byte order of the architecture.  There are definitions for both
|>MIPSEL and big endian (regular) MIPS.

Yes, but this is making a mountain out of a molehill!  It is very easy to reverse
the bytes in the appropriate places and be done with it.  I no longer have the original
source, so I can't supply a context diff, but at the end of this message, I've tacked on
the *only* portion of xdr_float.c that I changed when I compiled an older version
of RPC SRC.  This section of code is from the function xdr_double().

|>Beware of the fact that DEC has included the RPC and XDR functions in /libc.a

Given this, you can compile and link most Sun RPC-based programs.  The only
major piece that isn't there is rpcgen.  This is also not much of a handicap to
porting:  run rpcgen on the source on your Sun, copy the resulting C code to your
Digital platform, then compile and link.

If you want to develop new RPC code, try NCS.  It's really quite nice.

Have fun!

						Frank
===============================================================================
	shipit:
		id.sign = vd.sign;
		lp = (long *)&id;
#endif /* ndef vax */

#ifdef MIPSEL
		return (XDR_PUTLONG(xdrs, lp+1) && XDR_PUTLONG(xdrs, lp));
#else
		return (XDR_PUTLONG(xdrs, lp++) && XDR_PUTLONG(xdrs, lp));
#endif /* MIPSEL */

	case XDR_DECODE:
#ifndef vax
		lp = (long *)dp;
#ifdef MIPSEL
		return (XDR_GETLONG(xdrs, lp+1) && XDR_GETLONG(xdrs, lp));
#else /* MIPSEL */
		return (XDR_GETLONG(xdrs, lp++) && XDR_GETLONG(xdrs, lp));
#endif /* MIPSEL */
#endif /* ndef vax */

#ifdef vax
		lp = (long *)&id;
		if (!XDR_GETLONG(xdrs, lp++) || !XDR_GETLONG(xdrs, lp))
			return (FALSE);