Lecture Notes for Client-Server Interfaces

28 February 2002 - The Horrible Truth About RPC


The Three Faces of RPC


High-Level Access to RPC


RPC Library Routines


And Then. . .


cl make cc-high-rstat
g++ -c cc-high-rstat.cc -o cc-high-rstat.o
g++ -o cc-high-rstat cc-high-rstat.o -lrpcsvc

cl uname -a
SunOS clayton 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10

cl cc-high-rstat cslab05
cslab05 has a disk.

cl cc-high-rstat clayton 
clayton has a disk.

cl cc-high-rstat starbase.se.monmouth.edu
starbase.se.monmouth.edu has a disk.

cl cc-high-rstat cslab00                 
havedisk(cslab00) failed.

cl rsh cslab00 ps -Af | grep -i rpc
  root  156    1  0   Jan 29 ?   1:32 /usr/sbin/rpcbind
  root  186    1  0   Jan 29 ?   0:00 /usr/lib/netsvc/yp/rpc.ypupdated
  root  171  169  0   Jan 29 ?   5:57 rpc.nisd_resolv -F -C 8 
  root  667    1  0   Jan 29 ?   0:00 /usr/sbin/rpc.bootparamd
  root  785  213  0   Jan 29 ?   0:00 /usr/dt/bin/rpc.ttdbserverd

cl rsh cslab05 ps -Af | grep -i rpc
  root  105    1  0   Feb 12 ?   0:00 /usr/sbin/rpcbind
  root  338  142  0   Feb 12 ?   0:00 rpc.ttdbserverd
daemon  537  142  0   Feb 13 ?   0:00 rpc.cmsd
  root 2835  142  0 16:14:20 ?   0:00 rpc.rstatd


The High-Level API


The Client High-Level API


Using the Client

cl gcc -o rusers rusers.c -lrpcsvc -lnsl

cl ./rusers cslab18
0 users on cslab18.

cl ./rusers cslab00
38 users on cslab00.

cl ./rusers enterprise.se.monmouth.edu
RPC: Program/version mismatch

cl ./rusers rockhopper.monmouth.edu   
RPC: Program not registered

cl ./rusers moncol.monmouth.edu    
RPC: Program not registered

cl ./rusers bluehawk.monmouth.edu
RPC: Program/version mismatch

cl 


The Server High-Level Interface


An Encrypt-Service Client