PreviousNext

Generating an Interface UUID

The first step in building an RPC application is to generate a skeletal interface definition file and a UUID for the interface. Every interface in an RPC application must have a UUID. When you define a new interface, you must generate a new UUID for it.

Typically, you run uuidgen with the -i option, which produces a skeletal interface definition file and includes the generated UUID for the interface. For example, the following command creates a file chess.idl:

uuidgen -i > chess.idl

The contents of the file are as follows:

[

uuid(443f4b20-a100-11c9-baed-08001e0218cb),

version(1)

]

interface INTERFACENAME {

}

The first part of the skeletal definition is the header, which specifies a UUID, a version number, and a name for the interface. The last part of the definition is { } (an empty pair of braces); import, constant, type, and operation declarations go between these braces.

By convention, the names of interface definition files end with the suffix .idl. The IDL compiler constructs names for its output files based on the interface definition filename and uses the following default suffixes:

· .h for header files

· _cstub.o for client stub files

· _sstub.o for server stub files

For example, compilation of a chess.idl interface definition file would produce a chess.h header file, a chess_cstub.o client stub file, and a chess_sstub.o server stub file. (The IDL compiler creates C language intermediate files and by default invokes the C compiler to produce object files, but it can also retain the C language files.)

For more information on the UUID generator, see the OSF DCE Command Referenceuuidgen(1rpc) reference page.