xref: /freebsd/lib/libc/rpc/README (revision 990647991e51c0f93ad5d9985587a60f322f543a)
199064799SGarrett WollmanRPCSRC 4.0 7/11/89
299064799SGarrett Wollman
399064799SGarrett WollmanThis distribution contains Sun Microsystem's implementation of the
499064799SGarrett WollmanRPC and XDR protocols and is compatible with 4.2BSD and 4.3BSD.  Also
599064799SGarrett Wollmanincluded is complete documentation, utilities, RPC service
699064799SGarrett Wollmanspecification files, and demonstration services in the format used by
799064799SGarrett Wollmanthe RPC protocol compiler (rpcgen).  See WHAT'S NEW below for
899064799SGarrett Wollmandetails.
999064799SGarrett Wollman
1099064799SGarrett WollmanNOTE ABOUT SECURE RPC:
1199064799SGarrett Wollman
1299064799SGarrett WollmanThis release of RPCSRC contains most of the code needed to implement
1399064799SGarrett WollmanSecure RPC (see "DES Authentication" in the RPC Protocol Specification,
1499064799SGarrett Wollmandoc/rpc.rfc.ms).  Due to legal considerations, we are unable to
1599064799SGarrett Wollmandistribute an implementation of DES, the Data Encryption Standard, which
1699064799SGarrett WollmanSecure RPC requires.  For this reason, all of the files, documentation, and
1799064799SGarrett Wollmanprograms associated with Secure RPC have been placed into a separate
1899064799SGarrett Wollmandirectory, secure_rpc.  The RPC library contained in the main body of this
1999064799SGarrett Wollmanrelease *DOES NOT* support Secure RPC.  See secure_rpc/README for more
2099064799SGarrett Wollmandetails.  (A DES library was posted in Volume 18 of comp.sources.unix.)
2199064799SGarrett Wollman
2299064799SGarrett WollmanIf you wish to report bugs found in this release, send mail to:
2399064799SGarrett Wollman
2499064799SGarrett WollmanPortable ONC/NFS
2599064799SGarrett WollmanSun Microsystems, Inc
2699064799SGarrett WollmanMS 12-33
2799064799SGarrett Wollman2550 Garcia Avenue
2899064799SGarrett WollmanMountain View, CA  94043
2999064799SGarrett Wollman
3099064799SGarrett Wollmanor send Email to nfsnet@sun.com (the Internet) or sun!nfsnet (Usenet).
3199064799SGarrett Wollman
3299064799SGarrett WollmanROADMAP
3399064799SGarrett Wollman
3499064799SGarrett WollmanThe directory hierarchy is as follows:
3599064799SGarrett Wollman
3699064799SGarrett Wollman    demo/       Various demonstration services
3799064799SGarrett Wollman    demo/dir        Remote directory lister
3899064799SGarrett Wollman    demo/msg        Remote console message delivery service
3999064799SGarrett Wollman    demo/sort       Remote sort service
4099064799SGarrett Wollman
4199064799SGarrett Wollman    doc/        Documentation for RPC, XDR and NFS in "-ms" format.
4299064799SGarrett Wollman
4399064799SGarrett Wollman    etc/        Utilities (rpcinfo and portmap).  portmap must be
4499064799SGarrett Wollman                started by root before any other RPC network services are
4599064799SGarrett Wollman                used.  SEE BELOW FOR BUGFIX TO 4.3BSD COMPILER.
4699064799SGarrett Wollman
4799064799SGarrett Wollman    man/        Manual pages for RPC library, rpcgen, and utilities.
4899064799SGarrett Wollman
4999064799SGarrett Wollman    rpc/        The RPC and XDR library.  SEE BELOW
5099064799SGarrett Wollman                FOR BUGFIX TO 4.2BSD COMPILER.
5199064799SGarrett Wollman
5299064799SGarrett Wollman    rpcgen/     The RPC Language compiler (for .x files)
5399064799SGarrett Wollman
5499064799SGarrett Wollman    rpcsvc/     Service definition files for various services and the
5599064799SGarrett Wollman                server and client code for the Remote Status service.
5699064799SGarrett Wollman
5799064799SGarrett Wollman    secure_rpc/ The files in this directory are used to build a version of
5899064799SGarrett Wollman                the RPC library with DES Authentication.  See the README
5999064799SGarrett Wollman                file in that directory for more details.
6099064799SGarrett Wollman
6199064799SGarrett WollmanBUILD INSTRUCTIONS
6299064799SGarrett Wollman
6399064799SGarrett WollmanMakefiles can be found in all directories except for man.  The
6499064799SGarrett WollmanMakefile in the top directory will cause these others to be invoked
6599064799SGarrett Wollman(except for in the doc, man and demo directories), in turn building the
6699064799SGarrett Wollmanentire release.
6799064799SGarrett Wollman
6899064799SGarrett WollmanWARNING!  THE DEFAULT INSTALLATION PROCEDURES WILL INSTALL FILES
6999064799SGarrett WollmanIN /usr/include, /usr/lib, /usr/bin and /etc.
7099064799SGarrett Wollman
7199064799SGarrett WollmanThe master RPC include file, rpc/rpc.h, is used by all programs and
7299064799SGarrett Wollmanroutines that use RPC.  It includes other RPC and system include files
7399064799SGarrett Wollmanneeded by the RPC system.  PLEASE NOTE: If your system has NFS, it
7499064799SGarrett Wollmanmay have been based on Sun's NFS Source.  The include files installed
7599064799SGarrett Wollmanby this package may duplicate include files you will find on your NFS
7699064799SGarrett Wollmansystem.  The RPCSRC 4.0 include files are upwardly compatible to all
7799064799SGarrett WollmanNFS Source include files as of the date of this distribution (not
7899064799SGarrett Wollmanincluding any new definitions or declarations added by your system
7999064799SGarrett Wollmanvendor).  HOWEVER: Please read the comments towards the end of
8099064799SGarrett Wollmanrpc/rpc.h regarding rpc/netdb.h.  You may need to uncomment the
8199064799SGarrett Wollmaninclusion of that file if the structures it defines are already
8299064799SGarrett Wollmandefined by your system's include files.
8399064799SGarrett Wollman
8499064799SGarrett WollmanAfter making any compiler fixes that are needed (see below), at
8599064799SGarrett Wollmanthe top directory, type:
8699064799SGarrett Wollman
8799064799SGarrett Wollman    make install
8899064799SGarrett Wollman
8999064799SGarrett WollmanFor all installations, the Makefile macro DESTDIR is prepended to the
9099064799SGarrett Wollmaninstallation path.  It is defined to be null in the Makefiles, so
9199064799SGarrett Wollmaninstallations are relative to root.  (You will probably need root
9299064799SGarrett Wollmanprivileges for installing the files under the default path.)  To
9399064799SGarrett Wollmaninstall the files under some other tree (e.g., /usr/local), use the
9499064799SGarrett Wollmancommand:
9599064799SGarrett Wollman
9699064799SGarrett Wollman    make install DESTDIR=/usr/local
9799064799SGarrett Wollman
9899064799SGarrett WollmanThis will place the include files in /usr/local/usr/include, the RPC
9999064799SGarrett Wollmanlibrary in /usr/local/usr/lib, rpcgen in /usr/local/usr/bin, and the
10099064799SGarrett Wollmanutilities in /usr/local/etc.  You'll have to edit the Makefiles or
10199064799SGarrett Wollmaninstall the files by hand if you want to do anything other than this
10299064799SGarrett Wollmankind of relocation of the installation tree.
10399064799SGarrett Wollman
10499064799SGarrett WollmanThe RPC library will be built and installed first.  By default it is
10599064799SGarrett Wollmaninstalled in /usr/lib as "librpclib.a".  The directory
10699064799SGarrett Wollman/usr/include/rpc will also be created, and several header files will
10799064799SGarrett Wollmanbe installed there.  ALL RPC SERVICES INCLUDE THESE HEADER FILES.
10899064799SGarrett Wollman
10999064799SGarrett WollmanThe programs in etc/ link in routines from librpclib.a.  If you change
11099064799SGarrett Wollmanwhere it is installed, be sure to edit etc/'s Makefile to reflect this.
11199064799SGarrett WollmanThese programs are installed in /etc.  PORTMAP MUST BE RUNNING ON
11299064799SGarrett WollmanYOUR SYSTEM BEFORE YOU START ANY OTHER RPC SERVICE.
11399064799SGarrett Wollman
11499064799SGarrett Wollmanrpcgen is installed in /usr/bin.  This program is required to build
11599064799SGarrett Wollmanthe demonstration services in demo and the rstat client and server in
11699064799SGarrett Wollmanrpcsvc/.
11799064799SGarrett Wollman
11899064799SGarrett WollmanThe rpcsvc/ directory will install its files in the directory
11999064799SGarrett Wollman/usr/include/rpcsvc.  The Remote Status service (rstat_svc) will be
12099064799SGarrett Wollmancompiled and installed in /etc.  If you wish to make this service
12199064799SGarrett Wollmanavailable, you should either start this service when needed or have
12299064799SGarrett Wollmanit started at boot time by invoking it in your /etc/rc.local script.
12399064799SGarrett Wollman(Be sure that portmap is started first!)  Sun has modified its
12499064799SGarrett Wollmanversion of inetd to automatically start RPC services.  (Use "make
12599064799SGarrett WollmanLIB=" when building rstat on a Sun Workstation.)  The Remote Status
12699064799SGarrett Wollmanclient (rstat) will be installed in /usr/bin.  This program queries
12799064799SGarrett Wollmanthe rstat_svc on a remote host and prints a system status summary
12899064799SGarrett Wollmansimilar to the one printed by "uptime".
12999064799SGarrett Wollman
13099064799SGarrett WollmanThe documentation is not built during the "make install" command.
13199064799SGarrett WollmanTyping "make" in the doc directory will cause all of the manuals to
13299064799SGarrett Wollmanbe formatted using nroff into a single file.  We have had a report
13399064799SGarrett Wollmanthat certain "troff" equivalents have trouble processing the full
13499064799SGarrett Wollmanmanual.  If you have trouble, try building the manuals individually
13599064799SGarrett Wollman(see the Makefile).
13699064799SGarrett Wollman
13799064799SGarrett WollmanThe demonstration services in the demo directory are not built by the
13899064799SGarrett Wollmantop-level "make install" command.  To build these, cd to the demo
13999064799SGarrett Wollmandirectory and enter "make".  The three services will be built.
14099064799SGarrett WollmanRPCGEN MUST BE INSTALLED in a path that make can find.  To run the
14199064799SGarrett Wollmanservices, start the portmap program as root and invoke the service
14299064799SGarrett Wollman(you probably will want to put it in the background).  rpcinfo can be
14399064799SGarrett Wollmanused to check that the service succeeded in getting registered with
14499064799SGarrett Wollmanportmap, and to ping the service (see rpcinfo's man page).  You can
14599064799SGarrett Wollmanthen use the corresponding client program to exercise the service.
14699064799SGarrett WollmanTo build these services on a Sun workstation, you must prevent the
14799064799SGarrett WollmanMakefile from trying to link the RPC library (as these routines are
14899064799SGarrett Wollmanalready a part of Sun's libc).  Use: "make LIB=".
14999064799SGarrett Wollman
15099064799SGarrett WollmanBUGFIX FOR 4.3BSD COMPILER
15199064799SGarrett Wollman
15299064799SGarrett WollmanThe use of a 'void *' declaration for one of the arguments in
15399064799SGarrett Wollmanthe reply_proc() procedure in etc/rpcinfo.c will trigger a bug
15499064799SGarrett Wollmanin the 4.3BSD compiler.  The bug is fixed by the following change to
15599064799SGarrett Wollmanthe compiler file mip/manifest.h:
15699064799SGarrett Wollman
15799064799SGarrett Wollman*** manifest.h.r1.1	Thu Apr 30 13:52:25 1987
15899064799SGarrett Wollman--- manifest.h.r1.2	Mon Nov 23 18:58:17 1987
15999064799SGarrett Wollman***************
16099064799SGarrett Wollman*** 21,27 ****
16199064799SGarrett Wollman  /*
16299064799SGarrett Wollman   * Bogus type values
16399064799SGarrett Wollman   */
16499064799SGarrett Wollman! #define TNULL	PTR		/* pointer to UNDEF */
16599064799SGarrett Wollman  #define TVOID	FTN		/* function returning UNDEF (for void) */
16699064799SGarrett Wollman
16799064799SGarrett Wollman  /*
16899064799SGarrett Wollman--- 21,27 ----
16999064799SGarrett Wollman  /*
17099064799SGarrett Wollman   * Bogus type values
17199064799SGarrett Wollman   */
17299064799SGarrett Wollman! #define TNULL	INCREF(MOETY)	/* pointer to MOETY -- impossible type */
17399064799SGarrett Wollman  #define TVOID	FTN		/* function returning UNDEF (for void) */
17499064799SGarrett Wollman
17599064799SGarrett Wollman  /*
17699064799SGarrett Wollman
17799064799SGarrett WollmanIf you cannot fix your compiler, change the declaration in reply_proc()
17899064799SGarrett Wollmanfrom 'void *' to 'char *'.
17999064799SGarrett Wollman
18099064799SGarrett WollmanBUGFIX FOR 4.2BSD COMPILER
18199064799SGarrett Wollman
18299064799SGarrett WollmanUnpatched 4.2BSD compilers complain about valid C.  You can make old
18399064799SGarrett Wollmancompilers happy by changing some voids to ints.  However, the fix to
18499064799SGarrett Wollmanthe 4.2 VAX compiler is as follows (to mip/trees.c):
18599064799SGarrett Wollman
18699064799SGarrett Wollman*** trees.c.r1.1	Mon May 11 13:47:58 1987
18799064799SGarrett Wollman--- trees.c.r1.2	Wed Jul  2 18:28:52 1986
18899064799SGarrett Wollman***************
18999064799SGarrett Wollman*** 1247,1253 ****
19099064799SGarrett Wollman  		if(o==CAST && mt1==0)return(TYPL+TYMATCH);
19199064799SGarrett Wollman  		if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH );
19299064799SGarrett Wollman  		else if( (mt1&MENU)||(mt2&MENU) ) return( LVAL+NCVT+TYPL+PTMATCH+PUN );
19399064799SGarrett Wollman! 		else if( mt12 == 0 ) break;
19499064799SGarrett Wollman  		else if( mt1 & MPTR ) return( LVAL+PTMATCH+PUN );
19599064799SGarrett Wollman  		else if( mt12 & MPTI ) return( TYPL+LVAL+TYMATCH+PUN );
19699064799SGarrett Wollman  		break;
19799064799SGarrett Wollman--- 1261,1269 ----
19899064799SGarrett Wollman  		if(o==CAST && mt1==0)return(TYPL+TYMATCH);
19999064799SGarrett Wollman  		if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH );
20099064799SGarrett Wollman  		else if( (mt1&MENU)||(mt2&MENU) ) return( LVAL+NCVT+TYPL+PTMATCH+PUN );
20199064799SGarrett Wollman! 		/* if right is TVOID and looks like a CALL, is not ok */
20299064799SGarrett Wollman! 		else if (mt2 == 0 && (p->in.right->in.op == CALL || p->in.right->in.op == UNARY CALL))
20399064799SGarrett Wollman! 			break;
20499064799SGarrett Wollman  		else if( mt1 & MPTR ) return( LVAL+PTMATCH+PUN );
20599064799SGarrett Wollman  		else if( mt12 & MPTI ) return( TYPL+LVAL+TYMATCH+PUN );
20699064799SGarrett Wollman  		break;
20799064799SGarrett Wollman
20899064799SGarrett WollmanWHAT'S NEW IN THIS RELEASE: RPCSRC 4.0
20999064799SGarrett Wollman
21099064799SGarrett WollmanThe previous release was RPCSRC 3.9.  As with all previous releases,
21199064799SGarrett Wollmanthis release is based directly on files from Sun Microsystem's
21299064799SGarrett Wollmanimplementation.
21399064799SGarrett Wollman
21499064799SGarrett WollmanUpgrade from RPCSRC 3.9
21599064799SGarrett Wollman
21699064799SGarrett Wollman1)  RPCSRC 4.0 upgrades RPCSRC 3.9.  Improvements from SunOS 4.0 have
21799064799SGarrett Wollman    been integrated into this release.
21899064799SGarrett Wollman
21999064799SGarrett WollmanSecure RPC (in the secure_rpc/ directory)
22099064799SGarrett Wollman
22199064799SGarrett Wollman2)  DES Authentication routines and programs are provided.
22299064799SGarrett Wollman3)  A new manual, "Secure NFS" is provided, which describes Secure RPC
22399064799SGarrett Wollman    and Secure NFS.
22499064799SGarrett Wollman4)  Skeleton routines and manual pages are provided which describe the
22599064799SGarrett Wollman    DES encryption procedures required by Secure RPC.  HOWEVER, NO DES
22699064799SGarrett Wollman    ROUTINE IS PROVIDED.
22799064799SGarrett Wollman
22899064799SGarrett WollmanNew Functionality
22999064799SGarrett Wollman
23099064799SGarrett Wollman5)  rpcinfo can now be used to de-register services from the portmapper
23199064799SGarrett Wollman    which may have terminated abnormally.
23299064799SGarrett Wollman6)  A new client, rstat, is provided which queries the rstat_svc and
23399064799SGarrett Wollman    prints a status line similar to the one displayed by "uptime".
234