OSF DCE Application Development Guide--Core Components
Time-Provider Interface
20.3 Initializing the Time-Provider Process
Initializing the RPC-based TP process prepares it to receive remote procedure calls from
a DTS daemon requesting the timestamps. The following steps are involved:
1. Include the header file (dtsprovider.h) that is created by compiling
/usr/include/dce/dtsprovider.idl, which contains the interface definition.
2. Register the interface with the DCE RPC runtime.
3. Select one or more protocol sequences that are compatible with both the interface
and the runtime library. It is recommended that the TP process application selects
all protocol sequences available on the system. Available protocol sequences are
obtained by calling an RPC API routine, described in the example that follows.
This ensures that transport independence is maintained in RPC applications.
4. Register the TP process with the endpoint mapper service of the DCE daemon
(dced) running on the system. This makes the TP process available to the DTS
daemon.
5. Obtain the name of the machine’s principal and then register an authentication
service to use with authenticated remote procedure calls coming from the DTS
daemon. Note that DTS and the TP program are presumed to be running in an
authenticated environment.
6. Listen for remote procedure calls.
The following shows these steps, including the sequence of calls needed:
/* Register the TP server interface with the RPC runtime.
* The interface specification time_provider_v1_0_ifspec
* is obtained from the generated header file dtsprovider.h
* The entry point vector is normally defined at the top of
* the TP source program similar to this:
*
* globaldef time_provider_v1_0_epv_t time_provider_epv =
*{
* ContactProvider,
* ServerRequestProviderTime
*};
*/
rpc_server_register_if (time_provider_v1_0_s_ifspec,
NULL,
(rpc_mgr_epv_t) &time_provider_epv,
&RPCstatus);
/*
* This call tells the DCE RPC runtime to listen for remote
* procedure calls using all supported protocol sequences.
* To listen for a specific protocol sequence, use the
* rpc_server_use_protreq call.
*/
124245 Tandem Computers Incorporated 20−9