Digital TCP/IP Services for OpenVMS
ONC RPC Programming
Begin
Contents (summary)
Chapter 1
Introduction to Remote Procedure Calls
Chapter 2
Writing RPC Applications with the RPCGEN Protocol Compiler
Chapter 3
RPC Application Programming Interface
Chapter 4
External Data Representation
Chapter 5
ONC RPC Client Routines
Chapter 6
ONC RPC Portmapper Routines
Chapter 7
ONC RPC Server Routines
Chapter 8
XDR Routine Reference
Appendix A
Acronyms
Index
Figures
Examples
Tables
Contents
Chapter 1
Introduction to Remote Procedure Calls
1.1
Overview
1.2
The RPC Model
1.3
RPC Procedure Versions
1.4
Using Portmapper to Determine the Destination Port Number of RPC Packets
1.4.1
Portmapper Notes for UCX
1.4.2
Displaying Registered RPC Servers
1.5
RPC Independence from Transport Protocol
1.6
External Data Representation (XDR)
1.7
Assigning Program Numbers
Chapter 2
Writing RPC Applications with the RPCGEN Protocol Compiler
2.1
The RPCGEN Protocol Compiler
2.2
Simple Example: Using RPCGEN to Generate Client and Server RPC Code
2.2.1
RPC Protocol Specification File Describing Remote Procedure
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 Client and Server Programs
2.2.6
Copying the Server to a Remote System and Running It
2.3
Advanced Example: Using RPCGEN to Generate XDR Routines
2.3.1
The RPC Protocol Specification
2.3.2
Implementing the Procedure Declared in the Protocol Specification
2.3.3
The Client Program that Calls the Remote Procedure
2.3.4
Running RPCGEN
2.3.5
Compiling the File of XDR Routines
2.3.6
Compiling the Client and Server Programs
2.3.7
Copying the Server to a Remote System and Running It
2.4
Debugging Applications
2.5
The C Preprocessor
2.6
RPCGEN Programming
2.6.1
Network Types
2.6.2
User-Provided Define Statements
2.6.3
INETd Support
2.6.4
Dispatch Tables
2.7
Client Programming
2.7.1
Timeout Changes
2.7.2
Client Authentication
2.8
Server Programming
2.8.1
Handling Broadcasts
2.8.2
Passing Data to Server Procedures
2.9
RPC and XDR Languages
2.9.1
Definitions
2.9.2
Enumerations
2.9.3
Typedefs
2.9.4
Constants
2.9.5
Declarations
2.9.6
Structures
2.9.7
Unions
2.9.8
Programs
2.9.9
Special Cases
Command 1
RPCGEN
Chapter 3
RPC Application Programming Interface
3.1
RPC Layers
3.2
Middle Layer of RPC
3.2.1
Using callrpc
3.2.2
Using registerrpc and svc_run
3.2.3
Using XDR Routines to Pass Arbitrary Data Types
3.2.4
User-Defined XDR Routines
3.2.5
XDR Serializing Defaults
3.3
Lowest Layer of RPC
3.3.1
The Server Side and the Lowest RPC Layer
3.3.2
The Client Side and the Lowest RPC Layer
3.3.3
Memory Allocation with XDR
3.4
Raw RPC
3.5
Miscellaneous RPC Features
3.5.1
Using Select on the Server Side
3.5.2
Broadcast RPC
3.5.3
Batching
3.6
Authentication of RPC Calls
3.6.1
The Client Side
3.6.2
The Server Side
3.7
Using the Internet Service Daemon (INETd)
3.8
Additional Examples
3.8.1
Program Versions on the Server Side
3.8.2
Program Versions on the Client Side
3.8.3
Using the TCP Transport
3.8.4
Callback Procedures
Chapter 4
External Data Representation
4.1
Usefulness of XDR
4.1.1
A Canonical Standard
4.1.2
The XDR Library
4.2
XDR Library Primitives
4.2.1
Number and Single-Character Filters
4.2.2
Floating-Point Filters
4.2.3
Enumeration Filters
4.2.4
Possibility of No Data
4.2.5
Constructed Data Type Filters
4.2.5.1
Strings
4.2.5.2
Variable-Length Byte Arrays
4.2.5.3
Variable-Length Arrays of Arbitrary Data Elements
4.2.5.4
Fixed-Length Arrays of Arbitrary Data Elements
4.2.5.5
Opaque Data
4.2.5.6
Discriminated Unions
4.2.5.7
Pointers
4.2.6
Non-filter Primitives
4.3
XDR Operation Directions
4.4
XDR Stream Access
4.4.1
Standard I/O Streams
4.4.2
Memory Streams
4.4.3
Record (TCP/IP) Streams
4.4.4
XDR Stream Implementation
4.5
Advanced Topics
Chapter 5
ONC RPC Client Routines
Command 2
auth_destroy
Command 3
authnone_create
Command 4
authunix_create
Command 5
authunix_create_default
Command 6
callrpc
Command 7
clnt_broadcast
Command 8
clnt_call
Command 9
clnt_control
Command 10
clnt_create
Command 11
clnt_create_vers
Command 12
clnt_destroy
Command 13
clnt_freeres
Command 14
clnt_geterr
Command 15
clnt_pcreateerror
Command 16
clnt_perrno
Command 17
clnt_perror
Command 18
clnt_spcreateerror
Command 19
clnt_sperrno
Command 20
clnt_sperror
Command 21
clntraw_create
Command 22
clnttcp_create
Command 23
clntudp_bufcreate
Command 24
clntudp_create
Command 25
get_myaddress
Command 26
get_myaddr_dest
Chapter 6
ONC RPC Portmapper Routines
Command 27
pmap_getmaps
Command 28
pmap_getmaps_vms
Command 29
pmap_getport
Command 30
pmap_rmtcall
Command 31
pmap_set
Command 32
pmap_unset
Chapter 7
ONC RPC Server Routines
Command 33
registerrpc
Command 34
seterr_reply
Command 35
svc_destroy
Command 36
svc_freeargs
Command 37
svc_getargs
Command 38
svc_getcaller
Command 39
svc_getreqset
Command 40
svc_register
Command 41
svc_run
Command 42
svc_sendreply
Command 43
svc_unregister
Command 44
svcerr_auth
Command 45
svcerr_decode
Command 46
svcerr_noproc
Command 47
svcerr_noprog
Command 48
svcerr_progvers
Command 49
svcerr_systemerr
Command 50
svcerr_weakauth
Command 51
svcraw_create
Command 52
svcfd_create
Command 53
svctcp_create
Command 54
svcudp_bufcreate
Command 55
svcudp_create
Command 56
xprt_register
Command 57
xprt_unregister
Command 58
_authenticate
Chapter 8
XDR Routine Reference
Command 59
xdr_accepted_reply
Command 60
xdr_array
Command 61
xdr_authunix_parms
Command 62
xdr_bool
Command 63
xdr_bytes
Command 64
xdr_callhdr
Command 65
xdr_callmsg
Command 66
xdr_char
Command 67
xdr_double
Command 68
xdr_enum
Command 69
xdr_float
Command 70
xdr_free
Command 71
xdr_hyper
Command 72
xdr_int
Command 73
xdr_long
Command 74
xdr_opaque
Command 75
xdr_opaque_auth
Command 76
xdr_pmap
Command 77
xdr_pmap_vms
Command 78
xdr_pmaplist
Command 79
xdr_pmaplist_vms
Command 80
xdr_pointer
Command 81
xdr_reference
Command 82
xdr_rejected_reply
Command 83
xdr_replymsg
Command 84
xdr_short
Command 85
xdr_string
Command 86
xdr_u_char
Command 87
xdr_u_hyper
Command 88
xdr_u_int
Command 89
xdr_u_long
Command 90
xdr_u_short
Command 91
xdr_union
Command 92
xdr_vector
Command 93
xdr_void
Command 94
xdr_wrapstring
Command 95
xdrmem_create
Command 96
xdrrec_create
Command 97
xdrrec_endofrecord
Command 98
xdrrec_eof
Command 99
xdrrec_skiprecord
Command 100
xdrstdio_create
Appendix A
Acronyms
Index
Examples
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
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 the Noncommunication Parts of an Application
3-7
Server Batching
3-8
Client Batching
3-9
Authentication on Server Side
3-10
C Procedure That Returns Two Different Data Types
3-11
Determining Server-Supported Versions and Creating Associated Client Handles
3-12
RPC Example that Uses TCP Protocol---XDR Routine
3-13
RPC Example that Uses TCP Protocol--- Client
3-14
RPC Example that Uses TCP Protocol--- Server
3-15
Client Usage of the gettransient Routine
3-16
Server Usage of the gettransient Routine
4-1
Structure and Associated XDR Routine
4-2
Declaration and Associated XDR Routines
4-3
Declarations and XDR Routines
4-4
Constructs and XDR Procedure
Figures
1-1
Basic Network Communication with Remote Procedure Call
Tables
3-1
XDR Routines
5-1
ONC RPC Client Routines
6-1
ONC RPC Portmapper Routines
7-1
ONC RPC SERVER Routines
8-1
XDR Data Conversion Routines
8-2
XDR Stream Handling Routines
A-1
Acronyms
Next