NAME

dced_binding_from_rpc_binding - Establishes a dced binding to one of the host services on the host specified in an existing RPC binding handle.

SYNOPSIS

#include <dce/dced.h>
void                               dced_binding_from_rpc_binding(
        dced_service_type_t     service,
        handle_t                        rpc_bh,
        dced_binding_handle_t   *dced_bh,
        error_status_t          *status);

PARAMETERS

Input

service
A variable that specifies one of the host services. A valid variable name includes one of the following:
dced_e_service_type_hostdata         dced_e_service_type_srvrconf
dced_e_service_type_srvrexec           dced_e_service_type_secval
dced_e_service_type_keytab

rpc_bh
An RPC binding handle to some server.

Output

dced_bh
Returns a dced binding handle which is a pointer to an opaque data structure containing information about an RPC binding, the host, the host service, and a local cache.

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

error_status_ok      dced_s_no_memory      dced_s_unknown_service
ept_s_cant_perform_op                      ept_s_database_invalid
ept_s_invalid_context   ept_s_invalid_entry    rpc_s_comm_failure
rpc_s_fault_context_mismatch                    rpc_s_invalid_arg
rpc_s_invalid_binding                      rpc_s_no_more_elements
rpc_s_wrong_kind_of_binding

DESCRIPTION

The dced on each DCE host maintains the host services and provides a remote interface to the services. The dced_binding_from_rpc_binding() routine establishes a dced binding to a dced service, and it (or dced_binding_create()) must be the first dced API routine called before an application can access one of the host services with other dced routines. When an application is finished with the service, it should call the dced_binding_free() routine to free resources.

Prior to using the RPC binding in this routine, make a copy of the binding by using the rpc_binding_copy() routine. This is necessary if the application needs to continue using the RPC binding because otherwise the dced binding takes over the RPC binding.

The RPC binding may be obtained from a call to specific RPC runtime routines such as rpc_binding_from_string_binding(3rpc), rpc_ns_binding_import_next(3rpc), or rpc_ns_binding_lookup_next(3rpc).

EXAMPLES

This example obtains an RPC binding from a string binding, and it later makes a copy of the RPC binding for use in the dced_binding_from_rpc_binding() call.

handle_t                rpc_bh, binding_handle;
dced_binding_handle_t   dced_bh;
dced_service_type_t     service_type;
error_status_t          status;
unsigned_char_t         string_binding[STRINGLEN];
rpc_binding_from_string_binding(string_binding, &binding_handle, &status);
rpc_binding_copy(binding_handle, &rpc_bh, &status);
dced_binding_from_rpc_binding(service_type, rpc_bh, &dced_bh, &status);
 . /* Other routines including dced API routines. */
dced_binding_free(dced_bh, &status);

RELATED INFORMATION

Routines:   dced_binding_free(3dce),                  dced_binding_create(3dce),
            rpc_ns_binding_import_next(3rpc),         rpc_ns_binding_lookup_next(3rpc),
            rpc_binding_from_string_binding(3rpc),    rpc_binding_copy(3rpc).

Books: OSF DCE Application Development Guide.


© 1990-1996, Transarc Corporation