PreviousNext

dced_entry_add(3dce)

Adds a keytab or hostdata entry to a host's dced for an existing file on that host

Synopsis

#include <dce/dced.h>

void dced_entry_add(

dced_binding_handle_t dced_bh,

dced_entry_t *entry,

error_status_t *status);

Parameters

Input

dced_bh
Specifies the dced binding handle for a dced service on a specific host.

Input/Output

entry
Specifies the data entry to add to the service.

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 dced_entry_add( ) routine adds a data entry to a dced service. The data it refers to must already exist in a file on the dced's host. You can only add hostdata or keytab entries.

A service's data entries do not contain the actual data. Instead, they contain a UUID, a name for the entry, a brief description of the item, and a storage tag that describes the location of the actual data. In the cases of the hostdata and keytab services, the data for each entry is stored in a file. The dced uses this two-level scheme so that it can manipulate different kinds of data in the same way and so names are independent of local file system requirements.

The hostdata and keytab services each have their respective routines to create new data and at the same time, add a new entry to the appropriate service. These routines are dced_hostdata_create( ) and dced_keytab_create( ).

Prior to calling the dced_entry_add( ) routine, the application must have established a valid dced binding handle for the hostdata or keytab service by calling either the dced_binding_create( ) or dced_binding_from_rpc_binding( ) routine.

Examples
The following example shows how to add a printer configuration file to the hostdata service. The example creates a dced binding to the local hostdata service, an entry data structure is filled in with the storage tag containing the full path of the existing configuration file, and finally the dced_entry_add( ) routine is called.

dced_binding_handle_t dced_bh;
error_status_t status;
dced_entry_t entry;

dced_binding_create(dced_c_service_hostdata,
dced_c_binding_syntax_default,
&dced_bh,
&status);
uuid_create(&(entry.id), &status);
entry.name = (dced_string_t)("NEWERprinter");
entry.description = (dced_string_t)("Configuration for a new printer.");
entry.storage_tag = (dced_string_t)("/etc/NEWprinter");

dced_entry_add(dced_bh, &entry, &status);
.
.
.

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.

error_status_ok

db_s_readonly

db_s_store_failed

dced_s_already_exists

dced_s_bad_binding

dced_s_import_cant_access

dced_s_no_support

rpc_s_binding_has_no_auth

sec_acl_invalid_permission

uuid_s_no_address

Related Information
Routines: dced_entry_remove(3dce)

dced_hostdata_create(3dce)

dced_keytab_create(3dce)

dced_binding_create(3dce)

dced_binding_from_rpc_binding(3dce)

Book: OSF DCE Application Development Guide - Core Components