Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!apple!voder!wlbr!awds26!mh From: mh@awds26.eaton.com (Mike Hoegeman) Newsgroups: comp.unix.questions Subject: Re: RPC programming Message-ID: <47930@wlbr.IMSD.CONTEL.COM> Date: 1 Mar 90 21:44:21 GMT References: <8008@cs.utexas.edu> Sender: news@wlbr.IMSD.CONTEL.COM Reply-To: mh@awds26.UUCP (Mike Hoegeman) Distribution: comp.unix.questions, comp.protocols.nfs Organization: Contel FSD, Westlake Village, CA Lines: 30 In article <8008@cs.utexas.edu> tph@cs.utexas.edu (Pow-Hwee Tan) writes: >Howdy! >I have just started doing some NFS programming using RPC and XDR, and >have the following questions which I hope some of you can enlighten >me. >1. I am using the intermediate RPC layer of function calls as described >in Sun's documenation. The two functions calls I used are callprc and >registerrpc. Both of these functions require a program number as >parameter. As I understand from the documentation, I can use the numbers >in the range 0x20000000 - 0x3fffffff. Am I right? Or do I need to >make some kind of call to find out what number I should use? there is no call to get an OK program number , just use one in the temporary range. also, just from the general tone of your message, i would guess that you need to read up on RPCGEN, which is an RPC client <-->server protocol compiler. this will do a lot of the mechanical rpc coding for you. it will elminate you needing to things like 'registerrpc'. >2. The XDR serializing/deserializing routines do not explicitly free >the memory allocated. How can I free them myself? for free client side xdr memory, check out clnt_freeres in the RPC(3N) man page for sunOS. you should'nt need anything on the server side if you use RPCGEN. also check out clnt_create, clnt_call, and clnt_destory. you should really use these instead of callrpc. in fact, if you use RPCGEN you just call a canned routine that RPCGEN makes for you from your protocol description.