rpcgen Protocol Compiler

The rpcgen protocol compiler accepts a remote program interface definition written in the Remote Procedure Call language (RPCL), which is similar to the C language.

The rpcgen compiler helps programmers write RPC applications in a simple and direct manner. The rpcgen compiler debugs the network interface code, thereby allowing programmers to spend their time debugging the main features of their applications.

The rpcgen compiler produces a C language output that includes the following:

  • Stub versions of the client and server routines
  • Server skeleton
  • eXternal Data Representation (XDR) filter routines for parameters and results
  • A header file that contains common definitions of constants and macros

Client stubs interface with the RPC library to effectively hide the network from its callers. Server stubs similarly hide the network from server procedures invoked by remote clients. The rpcgen output files can be compiled and linked in the usual way. Using any language, programmers write server procedures and link them with the server skeleton to get an executable server program.

When application programs use the rpcgen compiler, there are many details to consider. Of particular importance is the writing of XDR routines needed to convert procedure arguments and results into the network format, and vice versa.