Generating SRPC Stubs

The first step in using SHRIMP Remote Procedure Call (SRPC) is generating stubs. This requires two steps: writing an interface definition, and then running the stub-generator on the interface definition.

Writing the Interface Definition

The first step is to write the interface definition. By convention, the interface definition for the foo-server is stored in a file called foo.x.

The interface description is written in a language called SIDL.

Running the Stub-Generator

The SHRIMP stub-generator program is /u/shrimp/bin/stubgen. You pass it a single argument, which is the name of the service you are implementing. For example, if you are creating the foo service, you execute this line: /u/shrimp/bin/stubgen foo This will read the file foo.x, which should contain an SIDL description of foo's interface. If all goes well, it will generate three files, foo_rpc.h, foo_clnt.c and foo_serv.c.

foo_rpc.h will contain C function prototypes for all the functions in foo's interface. There are two versions of each prototype: one for the local version of the function, and one for the remote version. (You can tell them apart because the remote version has "remote_" prepended to it name.)

foo_clnt.c will contain a set of C functions that should be compiled and linked with the client program. It implements the "remote" version of all of foo's functions --- the version that can be invoked across the network.

foo_serv.c will contain an implementation for the foo-server. It should be compiled and linked with the server program.

Warning

Unfortunately, the stub-generator may give cryptic error messages. We would appreciate any input on how to improve its error reporting.


Ed Felten