Using the Intermediate Layer of RPC
The intermediate layer RPC routines are used for most applications. The intermediate layer is sometimes overlooked in programming due to its simplicity and lack of flexibility. At this level, RPC does not allow time-out specifications, choice of transport, or process control in case of errors.
Nor does the intermediate layer of RPC support multiple types of call authentication. The programmer often needs these kinds of control.
Remote procedure calls are made with the registerrpc, callrpc, and svc_run system routines, which belong to the intermediate layer of RPC. The registerrpc and callrpc routines are the most fundamental. The registerrpc routine obtains a unique system-wide procedure identification number. The callrpc routine executes the remote procedure call.
Each RPC procedure is uniquely defined by a program number, version number, and procedure number. The program number specifies a group of related remote procedures, each of which has a different procedure number. Each program also has a version number. Therefore, when a minor change, such as adding a new procedure, is made to a remote service, a new program number need not be assigned.
The RPC interface also handles arbitrary data structures (Passing Arbitrary Data Types), regardless of the different byte orders or structure layout conventions at various workstations. For more information, see the Using the Intermediate Layer of RPC Example.