ONC RPC, XDR and Data conversion on DEC RISC Ultrix
Frank Wortner
frank at croton.nyo.dec.com
Wed May 15 00:36:54 AEST 1991
In article <64164 at bbn.BBN.COM>, fkittred at 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);
More information about the Comp.unix.ultrix
mailing list