/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <libscf.h>
#include <libscf_priv.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include "ksslcfg.h"
void
{
if (do_print)
"ksslcfg delete [-v] [<server_address>] <server_port>\n");
}
void
{
char *state;
SCF_PROPERTY_TIMEOUT)) != NULL) &&
/* incremental wait */
usecs *= 2;
/* Check state after the wait */
return;
}
}
fmri);
}
static int
{
(*num_inst)++;
return (0);
}
/*ARGSUSED*/
static void
{
}
int
{
char *buf;
KSSL_DEBUG("scf_handle_create failed: %s\n",
scf_strerror(scf_error()));
goto out1;
}
KSSL_DEBUG("scf_handle_create succeeded\n");
KSSL_DEBUG("scf_handle_bind failed: %s\n",
scf_strerror(scf_error()));
goto out1;
}
KSSL_DEBUG("scf_handle_bind succeeded\n");
KSSL_DEBUG("scf_scope_create failed: %s\n",
scf_strerror(scf_error()));
goto out2;
}
KSSL_DEBUG("scf_scope_create succeeded\n");
KSSL_DEBUG("scf_service_create failed: %s\n",
scf_strerror(scf_error()));
goto out3;
}
KSSL_DEBUG("scf_service_create succeeded\n");
KSSL_DEBUG("scf_handle_get_scope failed: %s\n",
scf_strerror(scf_error()));
goto out4;
}
KSSL_DEBUG("scf_handle_get_scope succeeded\n");
if (scf_errnum != SCF_ERROR_NOT_FOUND) {
"ERROR scf_scope_get_service failed: %s\n",
}
goto out4;
} else {
KSSL_DEBUG("scf_scope_get_service succeeded\n");
}
KSSL_DEBUG("scf_instance_create failed: %s\n",
scf_strerror(scf_error()));
goto out4;
}
if (scf_errnum == SCF_ERROR_NOT_FOUND) {
} else {
"ERROR scf_scope_get_service failed: %s\n",
}
goto out4;
}
goto out4;
char *state;
if (state)
if (smf_disable_instance(buf, 0) != 0) {
"smf_disable_instance failed: %s\n",
scf_strerror(scf_error()));
} else {
/*
* Wait for some time till timeout to avoid
* a race with scf_instance_delete() below.
*/
}
}
}
if (scf_instance_delete(instance) != 0) {
"ERROR scf_instance_delete failed: %s\n",
scf_strerror(scf_error()));
goto out4;
} else {
}
ign_err) == 0) {
/*
* Disable the kssl socket filter if this is the last
* kssl instance.
*/
if (num_inst == 0) {
if (smf_disable_instance(KSSL_FILTER_SVC_NAME, 0) != 0)
gettext("Unable to disable service \"%s\". "
"Error: %s"), KSSL_FILTER_SVC_NAME,
scf_strerror(scf_error()));
}
}
out4:
out3:
out2:
(void) scf_handle_unbind(handle);
out1:
if (errflag)
"Unexpected fatal libscf error: %s. Exiting.\n"),
scf_strerror(scf_error()));
return (status);
}
int
{
char c;
char *instance_name;
if (argc < 3) {
goto err;
}
argc -= 1;
argv += 1;
switch (c) {
case 'v':
break;
default:
goto err;
}
}
if (pcnt == 1) {
} else {
"argument too long -- %s\n"),
return (FAILURE);
}
} else if (pcnt == 2) {
} else {
"arguments too long -- %s %s\n"),
return (FAILURE);
}
} else {
goto err;
}
if (instance_name == NULL) {
return (FAILURE);
}
return (status);
err:
return (ERROR_USAGE);
}