From owner-freebsd-net@FreeBSD.ORG Thu Feb 7 07:14:46 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1F6E16A419 for ; Thu, 7 Feb 2008 07:14:46 +0000 (UTC) (envelope-from granica_raydom@rambler.ru) Received: from mcgi48.rambler.ru (mcgi48.rambler.ru [81.19.67.32]) by mx1.freebsd.org (Postfix) with ESMTP id C63BD13C46A for ; Thu, 7 Feb 2008 07:14:45 +0000 (UTC) (envelope-from granica_raydom@rambler.ru) Received: from [91.76.68.56] by mcgi48.rambler.ru with HTTP (mailimap); Thu, 07 Feb 2008 10:14:43 +0300 From: To: Adrian Chadd Date: Thu, 07 Feb 2008 10:14:43 +0300 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="windows-1251"; format="flowed" MIME-Version: 1.0 References: <916331822.1202324171.150714460.5300@127.0.0.1> In-Reply-To: Message-Id: <173020478.1202368483.165355804.67144@mcgi48.rambler.ru> X-Mailer: Ramail 3, (aten) Cc: freebsd-net@freebsd.org Subject: Re: crpc-0.7.4 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 07:14:46 -0000 * Adrian Chadd [Thu, 7 Feb 2008 14:21:01 +0900]: > On 07/02/2008, granica_raydom@rambler.ru > wrote: > > Hi all, > > > > The CRPC (C-based remote procedure call) version 0.7.4 is now > available. > > To download the package use the link on the project site - > > http://crpc.sourceforge.net/ > > > > Write me back, if you have any questions. > > How's this different from Sun's RPC stuff? > > > > Adrian > > -- > Adrian Chadd - adrian@freebsd.org > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" I worked generally on the programer's interface. For example, in SunRPC we have such definition and client code: //////////////////////////////////////////////////////// const MAXSORTSIZE = 64; const MAXSTRINGLEN = 64; typedef string str; /* the string itself */ struct sortstrings { str ss; }; program SORTPROG { version SORTVERS { sortstrings SORT(sortstrings) = 1; } = 1; } = 22855; //////////////////////////////////////////////////////////////////////// #include #include #include "sort.h" int main(int argc, char **argv) { char *machinename; struct sortstrings args, res; int i; machinename = argv[1]; args.ss.ss_len = argc - 2; /* substract off progname, machinename */ args.ss.ss_val = &argv[2]; res.ss.ss_val = (char **)NULL; if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT, xdr_sortstrings, &args, xdr_sortstrings, &res))) { fprintf(stderr, "%s: call to sort service failed. ", argv[0]); clnt_perrno(i); fprintf(stderr, "\n"); exit(1); } exit(0); } But using CRPC we can have rather simular client code like this: #include __remote int sort(char **ssp, int size) __attribute__((__format_ptr(0[1]))); int main(int argc, char **argv) { int res; res = sort(argv+1,argc-1); exit(0); } In CRPC, all the stub information is extracted from the prototype declaration, function call is the same, as in ordinary program. Also the system could work with any data type, defined in the C code. And this file is to compiled with the rcc only, cause it is a gcc wrapper.