OSF DCE Application Development Guide--Core Components
Time-Provider Interface
• Time Response Message
An output parameter that contains a TP process status value (K_TPI_SUCCESS or
K_TPI_FAILURE), a count of the timestamps that are returned, and the timestamps
obtained from the external time-provider. The timestamp count is an integer in the
range K_MIN_TIMESTAMPS to K_MAX_TIMESTAMPS. Each timestamp
consists of three utc time values:
— The system clock time immediately before the TP process polls the external time
source. (The TP process normally obtains the time from the utc_gettime( ) DTS
API routine.)
— The time value returned to the TP process by the external time source.
— The system clock time immediately after the external time source is read. (The
TP process obtains the time from the utc_gettime() DTS API routine.)
• Communication Status
An output parameter that contains a status code returned by the DCE RPC runtime
library. The status rpc_s_ok is returned if the TP process is successfully contacted.
20.2 Time-Provider Process IDL File
A remote procedure call can only work if an interface definition that clearly defines
operation signatures exists. Operation signatures define the syntax for an operation,
including its name and parameters (input and output) that are passed as part of the
procedure call. The TP process interface exports the two operation signatures that have
been previously explained. The interface is provided in the file
examples/dts/dtsprovider.idl. When building the TP process application, this file must
be compiled using the IDL compiler, which creates three files:
• dtsprovider.h (header file)
• dtsprovider_sstub.c (server stub file)
• dtsprovider_cstub.c (client stub file)
The Time-Provider program (TP program) must be compiled along with the
dtsprovider_sstub.c code and then linked together. The TP program must also include
the stub-generated file dtsprovider.h. The following sample code shows the structure of
this interface.
/*
* Time Service Provider Interface
*
* This interface is defined through the Network Interface
* Definition Language (NIDL).
*/
[uuid (bfca1238-628a-11c9-a073-08002b0dea7a),
version(1)
]
124245 Tandem Computers Incorporated 20−5