Lines Matching defs:handle

328 scf_free(asi_scfhandle_t *handle)
330 if (handle == NULL) {
334 scf_property_destroy(handle->prop);
335 scf_pg_destroy(handle->pgrp);
336 scf_instance_destroy(handle->inst);
338 if (handle->hndl != NULL) {
339 if (scf_handle_unbind(handle->hndl) == -1) {
343 scf_handle_destroy(handle->hndl);
351 scf_init(asi_scfhandle_t *handle)
353 bzero(handle, sizeof (asi_scfhandle_t));
355 if ((handle->hndl = scf_handle_create(SCF_VERSION)) == NULL ||
356 scf_handle_bind(handle->hndl) != 0 ||
357 (handle->inst = scf_instance_create(handle->hndl)) == NULL ||
358 (handle->pgrp = scf_pg_create(handle->hndl)) == NULL ||
359 (handle->prop = scf_property_create(handle->hndl)) == NULL) {
361 scf_free(handle);
388 asi_scfhandle_t *handle)
392 if ((handle_iter->pgrp = scf_iter_create(handle->hndl)) == NULL ||
393 (handle_iter->prop = scf_iter_create(handle->hndl)) == NULL ||
394 (handle_iter->prop_val = scf_value_create(handle->hndl)) == NULL) {
422 asi_scfhandle_t *handle)
426 if ((handle_iter_prop->prop = scf_iter_create(handle->hndl)) == NULL ||
427 (handle_iter_prop->prop_val = scf_value_create(handle->hndl))
532 asi_scfhandle_t *handle)
536 if (!scf_init_iter_prop(&handle_iter_prop, handle)) {
542 if (scf_iter_property_values(handle_iter_prop.prop, handle->prop)
552 handle->prop, handle_iter_prop.prop_val)) {
566 get_props_kva_all(asi_scfhandle_t *handle, asi_scfhandle_iter_t *handle_iter,
590 while (scf_iter_next_property(handle_iter->prop, handle->prop) == 1) {
591 if (scf_property_get_name(handle->prop, key_buf,
597 if (scf_property_get_value(handle->prop,
601 key_buf, handle->prop, handle_iter->prop_val)) {
611 key_buf, handle)) {
643 get_pgrp_kva(asi_scfhandle_t *handle, asi_scfhandle_iter_t *handle_iter,
663 if (scf_iter_instance_pgs_typed(handle_iter->pgrp, handle->inst,
669 while ((rc = scf_iter_next_pg(handle_iter->pgrp, handle->pgrp)) == 1) {
677 if (scf_pg_get_name(handle->pgrp, pgrp_name_buf,
708 handle->pgrp) != 0) {
714 if (!get_props_kva_all(handle, handle_iter,
1276 asi_scfhandle_t handle;
1290 if (!scf_init(&handle)) {
1296 if (scf_handle_decode_fmri(handle.hndl, asi_fmri, NULL, NULL,
1297 handle.inst, handle.pgrp, NULL, SCF_DECODE_FMRI_EXACT) == -1) {
1301 if (scf_pg_delete(handle.pgrp) == -1) {
1305 scf_free(&handle);
1311 scf_free(&handle);
1322 asi_scfhandle_t handle;
1329 if (!scf_init(&handle)) {
1334 if (scf_handle_decode_fmri(handle.hndl, AUDITD_FMRI, NULL, NULL,
1335 handle.inst, NULL, NULL, SCF_DECODE_FMRI_EXACT) == -1) {
1339 if (scf_instance_add_pg(handle.inst, pgrp_name, pgrp_type, 0,
1340 handle.pgrp) == -1) {
1345 scf_free(&handle);
1356 scf_free(&handle);
1414 asi_scfhandle_t handle;
1434 if (!scf_init(&handle)) {
1440 if (scf_handle_decode_fmri(handle.hndl, asi_fmri, NULL, NULL,
1441 handle.inst, handle.pgrp, NULL, SCF_DECODE_FMRI_EXACT) == -1) {
1450 scf_free(&handle);
1464 asi_scfhandle_t handle;
1473 if (!scf_init(&handle)) {
1478 if (scf_handle_decode_fmri(handle.hndl, AUDITD_FMRI, NULL, NULL,
1479 handle.inst, NULL, NULL, SCF_DECODE_FMRI_EXACT) == -1) {
1481 scf_free(&handle);
1485 if (!scf_init_iter(&handle_iter, &handle)) {
1487 scf_free(&handle);
1491 if (scf_iter_instance_pgs_typed(handle_iter.pgrp, handle.inst,
1495 scf_free(&handle);
1499 while ((rc = scf_iter_next_pg(handle_iter.pgrp, handle.pgrp)) == 1) {
1508 scf_free(&handle);
1522 asi_scfhandle_t handle;
1542 if (!scf_init(&handle)) {
1548 if (scf_handle_decode_fmri(handle.hndl, asi_fmri, NULL, NULL,
1549 handle.inst, pgrp_all ? NULL : handle.pgrp, NULL,
1552 scf_free(&handle);
1557 if (!scf_init_iter(&handle_iter, &handle)) {
1559 scf_free(&handle);
1564 rv = get_pgrp_kva(&handle, &handle_iter, pgrp_kva_ll,
1567 scf_free(&handle);