OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
dced_binding_create("srvrconf@hosts/somehost",
dced_c_binding_syntax_default,
&dced_bh,
&status);
dced_inq_id(dced_bh, server_name, &srvrconf_id, &status);
if(status == error_status_ok) {
puts("Configuration already exists for this server.");
dced_binding_free(dced_bh, &status);
return;
}
/* ___________setup a server_t structure ________________*/
uuid_create(&(conf.id), &status);
conf.name = server_name;
conf.entryname = (dced_string_t)"/.:/greeter";
conf.services.count = 1;
/* ___service_t structures represent each interface supported ___*/
conf.services.list =
(service_t *)malloc(conf.services.count * sizeof(service_t));
for(i=0; i<conf.services.count; i++) {
rpc_if_inq_id(greetif_v1_0_c_ifspec,
&(conf.services.list[i].ifspec),
&status);
conf.services.list[i] = nil_service;
conf.services.list[i].ifname = (dced_string_t)"greet";
conf.services.list[i].annotation = (dced_string_t)"The greet application";
conf.services.list[i].flags = 0;
}
/* ______________server_fixedattr_t structure _______________*/
conf.fixed.startupflags =
server_c_startup_explicit | server_c_startup_on_failure;
conf.fixed.flags = 0;
conf.fixed.program = (dced_string_t)"/server/path/and/program/name";
dced_server_create(dced_bh, &conf, &status);
dced_binding_free(dced_bh, &status);
dced_binding_create()
To configure a server, the application must first create a dced
binding to the srvrconf portion of the server management
service on a specified host. The binding handle created is
used in all subsequent calls to appropriate dced API routines.
dced_inq_id()
This routine returns the UUID that dced associates with the
name input. Each configured server has an associated UUID
used by dced to identify it. In this example, we won’t try to
create a configuration for a server that already exists.
Set Up a server_t Structure for the Server
The server_t structure contains all the information DCE uses
to specify a server.
2− 20 Tandem Computers Incorporated 124245