Lines Matching defs:vsc

591 	vs_scfctx_t vsc;
596 if ((vs_scf_ctx_open(&vsc)) != 0) {
597 vs_scf_ctx_close(&vsc);
601 if (scf_instance_get_pg(vsc.vscf_inst, pgname, vsc.vscf_pgroup) == -1) {
602 vs_scf_ctx_close(&vsc);
623 vsc.vscf_prop[np] = scf_property_create(vsc.vscf_handle);
624 vsc.vscf_val[np] = scf_value_create(vsc.vscf_handle);
626 if (vsc.vscf_prop[np] == NULL || vsc.vscf_val[np] == NULL) {
631 if (scf_pg_get_property(vsc.vscf_pgroup, vpd->vpd_name,
632 vsc.vscf_prop[np]) == -1) {
641 if ((rc = vs_scf_get(vpd, prop_hd, &vsc, np)) != VS_ERR_NONE)
648 vs_scf_ctx_close(&vsc);
662 vs_scfctx_t *vsc, int idx)
670 if ((rc = scf_property_get_value(vsc->vscf_prop[idx],
671 vsc->vscf_val[idx])) == -1) {
683 if ((scf_value_get_astring(vsc->vscf_val[idx],
689 if ((scf_value_get_boolean(vsc->vscf_val[idx],
696 if ((scf_value_get_astring(vsc->vscf_val[idx],
702 if ((scf_value_get_astring(vsc->vscf_val[idx],
708 if ((scf_value_get_boolean(vsc->vscf_val[idx],
715 (void) scf_value_get_as_string_typed(vsc->vscf_val[idx],
719 if ((scf_value_get_integer(vsc->vscf_val[idx], &port)) == -1)
727 if ((scf_value_get_integer(vsc->vscf_val[idx],
753 vs_scfctx_t vsc;
759 if (vs_scf_ctx_open(&vsc) != 0) {
760 vs_scf_ctx_close(&vsc);
764 if (scf_instance_add_pg(vsc.vscf_inst, pgname,
765 SCF_GROUP_APPLICATION, 0, vsc.vscf_pgroup) == -1) {
766 vs_scf_ctx_close(&vsc);
771 vs_scf_ctx_close(&vsc);
797 vs_scfctx_t vsc;
803 if (vs_scf_ctx_open(&vsc) != 0) {
804 vs_scf_ctx_close(&vsc);
808 if (scf_instance_get_pg(vsc.vscf_inst, pgname, vsc.vscf_pgroup) == -1) {
809 vs_scf_ctx_close(&vsc);
818 if (scf_pg_delete(vsc.vscf_pgroup) == -1) {
819 vs_scf_ctx_close(&vsc);
828 vs_scf_ctx_close(&vsc);
858 vs_scfctx_t vsc;
864 if (vs_scf_ctx_open(&vsc) != 0) {
865 vs_scf_ctx_close(&vsc);
869 if (scf_instance_get_pg(vsc.vscf_inst, pgname, vsc.vscf_pgroup) == -1) {
870 vs_scf_ctx_close(&vsc);
880 if (((vsc.vscf_tx = scf_transaction_create(vsc.vscf_handle)) == NULL) ||
881 (scf_transaction_start(vsc.vscf_tx, vsc.vscf_pgroup) == -1)) {
882 vs_scf_ctx_close(&vsc);
898 vsc.vscf_val[np] = scf_value_create(vsc.vscf_handle);
899 vsc.vscf_ent[np] = scf_entry_create(vsc.vscf_handle);
901 if (vsc.vscf_val[np] == NULL || vsc.vscf_ent[np] == NULL) {
906 if ((rc = scf_transaction_property_change(vsc.vscf_tx,
907 vsc.vscf_ent[np], vpd->vpd_name, vpd->vpd_type)) == -1) {
908 rc = scf_transaction_property_new(vsc.vscf_tx,
909 vsc.vscf_ent[np], vpd->vpd_name, vpd->vpd_type);
916 if ((rc = vs_scf_set(vpd, prop_hd, &vsc, np)) != VS_ERR_NONE)
923 vs_scf_ctx_close(&vsc);
928 if (scf_transaction_commit(vsc.vscf_tx) == -1) {
929 vs_scf_ctx_close(&vsc);
932 vs_scf_ctx_close(&vsc);
953 vs_scfctx_t *vsc, int idx)
965 if ((scf_value_set_astring(vsc->vscf_val[idx],
971 scf_value_set_boolean(vsc->vscf_val[idx],
975 if ((scf_value_set_astring(vsc->vscf_val[idx],
981 scf_value_set_boolean(vsc->vscf_val[idx],
985 if ((scf_value_set_from_string(vsc->vscf_val[idx],
991 scf_value_set_integer(vsc->vscf_val[idx], vep->vep_port);
994 scf_value_set_integer(vsc->vscf_val[idx],
998 if ((scf_value_set_astring(vsc->vscf_val[idx],
1007 if ((scf_entry_add_value(vsc->vscf_ent[idx],
1008 vsc->vscf_val[idx])) == -1) {
1028 vs_scf_ctx_open(vs_scfctx_t *vsc)
1030 (void) memset(vsc, 0, sizeof (vs_scfctx_t));
1032 if ((vsc->vscf_handle = scf_handle_create(SCF_VERSION)) == NULL)
1035 if (scf_handle_bind(vsc->vscf_handle) == -1)
1038 if ((vsc->vscf_inst = scf_instance_create(vsc->vscf_handle)) == NULL)
1041 if (scf_handle_decode_fmri(vsc->vscf_handle, VS_INSTANCE_FMRI,
1042 NULL, NULL, vsc->vscf_inst, NULL, NULL,
1047 if ((vsc->vscf_pgroup = scf_pg_create(vsc->vscf_handle)) == NULL)
1060 vs_scf_ctx_close(vs_scfctx_t *vsc)
1065 if (vsc->vscf_val[i])
1066 scf_value_destroy(vsc->vscf_val[i]);
1067 if (vsc->vscf_ent[i])
1068 scf_entry_destroy(vsc->vscf_ent[i]);
1069 if (vsc->vscf_prop[i])
1070 scf_property_destroy(vsc->vscf_prop[i]);
1073 if (vsc->vscf_iter)
1074 scf_iter_destroy(vsc->vscf_iter);
1075 if (vsc->vscf_tx)
1076 scf_transaction_destroy(vsc->vscf_tx);
1077 if (vsc->vscf_pgroup)
1078 scf_pg_destroy(vsc->vscf_pgroup);
1079 if (vsc->vscf_inst)
1080 scf_instance_destroy(vsc->vscf_inst);
1081 if (vsc->vscf_handle)
1082 scf_handle_destroy(vsc->vscf_handle);
1490 vs_scfctx_t vsc;
1493 if (((vs_scf_ctx_open(&vsc)) != 0) ||
1494 ((vsc.vscf_iter = scf_iter_create(vsc.vscf_handle)) == NULL) ||
1495 (scf_iter_instance_pgs_typed(vsc.vscf_iter, vsc.vscf_inst,
1497 vs_scf_ctx_close(&vsc);
1508 (scf_iter_next_pg(vsc.vscf_iter, vsc.vscf_pgroup) == 1)) {
1509 if (scf_pg_get_name(vsc.vscf_pgroup, pgname,
1511 vs_scf_ctx_close(&vsc);
1522 vs_scf_ctx_close(&vsc);
1536 vs_scfctx_t vsc;
1538 if ((vs_scf_ctx_open(&vsc) != 0) ||
1539 ((vsc.vscf_iter = scf_iter_create(vsc.vscf_handle)) == NULL) ||
1540 (scf_iter_instance_pgs_typed(vsc.vscf_iter, vsc.vscf_inst,
1542 vs_scf_ctx_close(&vsc);
1546 while (scf_iter_next_pg(vsc.vscf_iter, vsc.vscf_pgroup) == 1)
1549 vs_scf_ctx_close(&vsc);