Information Technology Reference
In-Depth Information
IDL Input
getdate.x
rpcgen
Generated
Code
getdate_clnt.c
getdate.h
getdate_svc.c
User
supplied
User
supplied
compiler
client.c
server.c
RPC runtime
library
client
server
Figure 2.3.
Sun ONC RPC generator.
The unique program number for our implementation is 22855. The rpcgen pro-
gram is then run against the IDL file, which generates a header file getdate.h ,and
two skeleton files, getdate_clnt.c and getdate_svc.c for the client and server
implementations respectively as illustrated in Figure 2.3.
The generated files contain the marshalling and unmarshalling, binding, data
representation (XDR), and framework integration code required to implement the
ONC protocol.
2.3.6.2
ONC Example Implementation
The files generated by the rpcgen application are required to be linked with user-
supplied files for the client and server implementation.
For our example, the
relevant portion of our client implementation is as follows:
if ((cl = clnt_create(server, GETDATE_PROG,
GETDATE_VERS, "udp" )) == NULL) {
clnt_pcreateerror(server);
exit(1);
}
 
Search WWH ::




Custom Search