PreviousNext

rpc_object_set_type(3rpc)

Registers the type of an object with the RPC runtime

Used by server applications.

Synopsis

#include <dce/rpc.h>

void rpc_object_set_type(

uuid_t *obj_uuid,

uuid_t *type_uuid,

unsigned32 *status);

Parameters

Input

obj_uuid
Specifies an object UUID to associate with the type UUID in the type_uuid parameter. Do not specify NULL or a nil UUID.

type_uuid
Specifies the type UUID of the obj_uuid parameter.

Specify an argument value of NULL or a nil UUID to reset the object type to the default association of object UUID/nil type UUID.

Output

status
Returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not.

Description
The rpc_object_set_type( ) routine assigns a type UUID to an object UUID.

By default, the RPC runtime assumes that the type of all objects is nil. A server program that contains one implementation of an interface (one manager entry point vector) does not need to call this routine, provided that the server registered the interface with the nil type UUID (see rpc_server_register_if(3rpc)).

A server program that contains multiple implementations of an interface (multiple manager entry point vectors; that is, multiple type UUIDs) calls this routine once for each object UUID the server offers. Associating each object with a type UUID tells the RPC runtime which manager entry point vector (interface implementation) to use when the server receives a remote procedure call for a non-nil object UUID.

The RPC runtime allows an application to set the type for an unlimited number of objects.

To remove the association between an object UUID and its type UUID (established by calling this routine), a server calls this routine again and specifies the value NULL or a nil UUID for the type_uuid parameter. This resets the association between an object UUID and type UUID to the default.

A server cannot register a nil object UUID. The RPC runtime automatically registers the nil object UUID with a nil type UUID. Attempting to set the type of a nil object UUID will result in the routine's returning the status code rpc_s_invalid_object.

Servers that want to maintain their own object UUID to type UUID mapping can use rpc_object_set_inq_fn( ) in place of, or in addition to, rpc_object_set_type( ).

Return Values
No value is returned.

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

rpc_s_ok
Success.

rpc_s_already_registered
Object already registered.

rpc_s_invalid_object
Invalid object.

uuid_s_bad_version
Bad UUID version.

Related Information
Functions: rpc_object_set_inq_fn(3rpc)

rpc_server_register_if(3rpc)