Table of Contents

Title and Copyright Pages

About This Manual
New and Changed Information
Related Documents
Reader's Comments

1    Introduction to Remote Procedure Calls
1.1    The RPC Model
1.2    RPC Procedure Versions
1.3    Using portmap to Determine the Destination Port Number of RPC Packets
1.4    RPC Independence from Transport Protocol
1.5    External Data Representation (XDR)
1.6    Using rpcinfo to Get RPC Registration Information
1.7    Assigning Program Numbers

2    Writing RPC Applications with the rpcgen Protocol Compiler
2.1    Simple Example: Using rpcgen to Generate Client and Server RPC Code
2.1.1    RPC Protocol Specification File Describing Remote Procedure
2.1.2    Implementing the Procedure Declared in the Protocol Specification
2.1.3    The Client Program That Calls the Remote Procedure
2.1.4    Running rpcgen
2.1.5    Compiling the Client and Server Programs
2.1.6    Copying the Server to a Remote Machine and Running It
2.2    Advanced Example: Using rpcgen to Generate XDR Routines
2.2.1    The RPC Protocol Specification
2.2.2    Implementing the Procedure Declared in the Protocol Specification
2.2.3    The Client Program that Calls the Remote Procedure
2.2.4    Running rpcgen
2.2.5    Compiling the File of XDR Routines
2.2.6    Compiling the Client Side Program with rpcgen Output
2.2.7    Compiling the Server Side Program with rpcgen Output
2.2.8    Running the Remote Directory Program
2.3    Debugging Applications
2.4    The C-Preprocessor
2.5    rpcgen Programming
2.5.1    Network Types
2.5.2    User-Provided Define Statements
2.5.3    inetd Support
2.5.4    Dispatch Tables
2.6    Client Programming
2.6.1    Timeout Changes
2.6.2    Client Authentication
2.7    Server Programming
2.7.1    Handling Broadcasts
2.7.2    Passing Data to Server Procedures
2.8    RPC and XDR Languages
2.8.1    Definitions
2.8.2    Enumerations
2.8.3    Typedefs
2.8.4    Constants
2.8.5    Declarations
2.8.6    Structures
2.8.7    Unions
2.8.8    Programs
2.8.9    Special Cases

3    RPC Programming Interface
3.1    RPC Layers
3.1.1    Middle Layer of RPC    Using callrpc    Using registerrpc    Passing Arbitrary Data Types    User-Defined Routines    XDR Serializing Defaults
3.1.2    Lowest Layer of RPC    The Server Side and the Lowest RPC Layer    The Client Side and the Lowest RPC Layer    Memory Allocation with XDR
3.2    Raw RPC
3.3    Miscellaneous RPC Features
3.3.1    Using Select on the Server Side
3.3.2    Broadcast RPC
3.3.3    Batching
3.3.4    Authentication of RPC Calls
3.3.5    Authentication Through the Operating System    The Client Side    The Server Side
3.3.6    Using the Internet Service Daemon (inetd)
3.4    Additional Examples
3.4.1    Program Versions on the Server Side
3.4.2    Program Versions on the Client Side
3.4.3    Using the TCP Transport
3.4.4    Callback Procedures

A    External Data Representation: Technical Notes
A.1    Usefulness of XDR
A.1.1    A Canonical Standard
A.1.2    The XDR Library
A.1.3    XDR Library Primitives
A.1.3.1    Number Filters
A.1.3.2    Floating Point Filters
A.1.3.3    Enumeration Filters
A.1.3.4    Possibility of No Data
A.1.3.5    Constructed Data Type Filters
A.    Strings
A.    Byte Arrays
A.    Arrays
A.    Opaque Data
A.    Arrays of Fixed Size
A.    Discriminated Unions
A.    Pointers
A.1.4    Non-filter Primitives
A.1.5    XDR Operation Directions
A.1.6    XDR Stream Access
A.1.6.1    Standard I/O Streams
A.1.6.2    Memory Streams
A.1.6.3    Record (TCP/IP) Streams
A.1.7    XDR Stream Implementation
A.2    Advanced Topics


2-1    Printing a Remote Message Without ONC RPC
2-2    RPC Protocol Specification File, Simple Example
2-3    Remote Procedure Definition
2-4    Client Program that Calls the Remote Procedure
2-5    RPC Protocol Specification File, Advanced Example
2-6    Remote Procedure Implementation
2-7    Client Program that Calls the Server
2-8    Using the Percent Sign to Bypass Interpretation of a Line
2-9    Locating a Procedure in a Dispatch Table
2-10    Using the clnt_control Routine
2-11    XDR enum Before Compilation
2-12    C enum Resulting from Compiling XDR enum
2-13    RPC Program Illustrating Time Protocol
3-1    Using callrpc
3-2    Remote Server Procedure
3-3    Using registerrpc in the Main Body of a Server Program
3-4    Server Program Using Lowest Layer of RPC
3-5    Using Lowest RPC Layer to Control Data Transport and Delivery
3-6    Debugging and Testing Noncommunication Parts of an Application
3-7    Batching RPC Messages
3-8    Client Batching
3-9    Modifying the Remote Users Service
3-10    C Procedure that Returns Two Different Data Types
3-11    Determining Server-Supported Versions and Creating Associated Client Handles
3-12    RPC Call That Uses TCP Protocol
3-13    Client-Server Usage of gettransient Routine
A-1    Revised Version of writer.c
A-2    Revised Version of reader.c


1-1    Basic Network Communication with Remote Procedure Call