DCE Application Programming Guide
Sample Application Listings
HP NonStop DCE Application Programming Guide—429551-003
A-10
The Installation File
if (argc = 2)
{
dce_cf_get_host_name(&hostname_p, &status); /* (1) */
ERR_CHK(status,"Could not get host name");
cp = strstr (hostname_p, "hosts/");
if (cp==NULL)
{
printf ("Can't interpret local host name format");
exit (1);
}
cp = strchr (cp, '/')+1;
}
else
{
cp = argv[2];
}
sprintf ((char *)name, "/.:/applications/info_server_%s", cp);
if (strcmp(argv[1], "-i") == 0)
{
rpc_server_use_protseq((idl_char *) "ncadg_ip_udp", /* (2) */
rpc_c_protseq_max_reqs_default,
&status);
ERR_CHK(status,"Could not use UDP protocol");
rpc_server_inq_bindings( &bindings, /* (3) */
&status);
ERR_CHK(status,"Could not get binding vector");
rpc_ns_binding_export( rpc_c_ns_syntax_default, /* (4) */
name,
infpls_v1_0_s_ifspec,
bindings,
NULL,
&status);
ERR_CHK(status,"Could not export server bindings");
rpc_ns_group_mbr_add( rpc_c_ns_syntax_default, /* (5) */
group_name,
rpc_c_ns_syntax_default,
name,
&status);
ERR_CHK(status,"Could not add server entry to group");
/* Add code here for additional de-installation tasks */
}
else if (strcmp(argv[1], "-r") == 0)
{
rpc_ns_binding_unexport( rpc_c_ns_syntax_default, /* (6) */
name,
infpls_v1_0_s_ifspec,
NULL,
&status);
ERR_CHK(status,"Could not remove server bindings");
Figure A-6. The Installation File in a Straight Port (page 2 of 3)