Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!nntpd.lkg.dec.com!riscy.enet.dec.com!croton.nyo.dec.com!frank From: frank@croton.nyo.dec.com (Frank Wortner) Newsgroups: comp.unix.ultrix Subject: Re: ONC RPC, XDR and Data conversion on DEC RISC Ultrix Message-ID: <2232@riscy.enet.dec.com> Date: 14 May 91 14:36:54 GMT References: <1991May8.154008.2112@milton.u.washington.edu> <64164@bbn.BBN.COM> Sender: newsdaemon@riscy.enet.dec.com Reply-To: frank@croton.nyo.dec.com Organization: NY ULTRIX Resource Center, Digital Equipment Corporation Lines: 61 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);