Lines Matching refs:prop

75     const char *prop)
81 if (prop == NULL) {
100 strlen(prop) + 1;
124 (void) strcat(fmri_buf, prop);
134 fill_prop(scf_property_t *prop, const char *pgname, const char *propname,
171 if (scf_property_type(prop, &ret->pr_type) == -1)
181 if (scf_iter_property_values(iter, prop) == -1)
358 scf_simple_pg *thispg, scf_property_t *prop, size_t namelen,
365 while ((propiter_ret = scf_iter_next_property(propiter, prop)) == 1) {
367 if (scf_property_get_name(prop, propname, namelen) < 0) {
380 if ((newprop = fill_prop(prop, pgname,
401 if ((newprop = fill_prop(prop, pgname, propname, h)) ==
716 scf_property_t *prop = NULL;
724 (prop = scf_property_create(h)) == NULL ||
777 if (scf_pg_get_property(pg, action, prop) != 0) {
795 } else if (scf_property_get_value(prop, v) != 0) {
909 scf_property_destroy(prop);
963 scf_property_t *prop = NULL;
969 ((prop = scf_property_create(h)) == NULL) ||
976 scf_pg_get_property(pg, SCF_PROPERTY_STATE, prop) == -1 ||
977 scf_property_get_value(prop, val) == -1) {
1004 scf_property_destroy(prop);
1224 scf_simple_prop_t *prop;
1230 if ((prop = scf_simple_prop_get(NULL, instance, SCF_PG_RESTARTER,
1234 if ((state_str = scf_simple_prop_next_astring(prop)) == NULL) {
1235 scf_simple_prop_free(prop);
1240 scf_simple_prop_free(prop);
1243 scf_simple_prop_free(prop);
1252 scf_simple_prop_t *prop;
1256 if ((prop = scf_simple_prop_get(NULL, instance, SCF_PG_RESTARTER,
1260 if ((state_str = scf_simple_prop_next_astring(prop)) == NULL) {
1261 scf_simple_prop_free(prop);
1273 scf_simple_prop_free(prop);
1280 scf_simple_prop_t *prop;
1284 if ((prop = scf_simple_prop_get(NULL, instance, SCF_PG_RESTARTER,
1288 if ((state_str = scf_simple_prop_next_astring(prop)) == NULL) {
1289 scf_simple_prop_free(prop);
1296 scf_simple_prop_free(prop);
1450 scf_property_t *prop = scf_property_create(simple_h->h);
1454 if ((val == NULL) || (prop == NULL)) {
1462 if (scf_pg_get_property(simple_h->running_pg, prop_name, prop) != 0) {
1467 if (scf_property_get_value(prop, val) == -1) {
1481 scf_property_destroy(prop);
1653 scf_property_t *prop = NULL;
1674 (prop = scf_property_create(h)) == NULL)
1677 if (scf_handle_decode_fmri(h, fmri_buf, NULL, NULL, NULL, NULL, prop,
1700 NULL, NULL, prop, 0) == -1) {
1716 scf_property_destroy(prop);
1717 prop = NULL;
1726 return (prop);
1733 scf_property_t *prop = NULL;
1747 if ((prop = scf_prop_get(h, instance, pgname, propname)) != NULL) {
1748 ret = fill_prop(prop, pgname, propname, h);
1749 scf_property_destroy(prop);
1760 scf_simple_prop_free(scf_simple_prop_t *prop)
1764 if (prop == NULL)
1767 free(prop->pr_propname);
1768 free(prop->pr_pgname);
1769 switch (prop->pr_type) {
1771 for (i = 0; i < prop->pr_numvalues; i++) {
1772 free(prop->pr_vallist[i].pv_opaque.o_value);
1785 for (i = 0; i < prop->pr_numvalues; i++) {
1786 free(prop->pr_vallist[i].pv_str);
1793 free(prop->pr_vallist);
1794 free(prop);
1804 scf_property_t *prop = NULL;
1860 (prop = scf_property_create(h)) == NULL)
1930 while ((propiter_ret = scf_iter_next_property(propiter, prop))
1932 if (scf_property_get_name(prop, propname, namelen) <
1940 if ((nextprop = fill_prop(prop,
1947 if ((thisprop = fill_prop(prop,
2030 thispg, prop, namelen, h) == -1)
2062 scf_iter_next_property(propiter, prop)) == 1) {
2063 if (scf_property_get_name(prop, propname,
2071 if ((nextprop = fill_prop(prop,
2079 if ((thisprop = fill_prop(prop,
2109 scf_property_destroy(prop);
2134 scf_property_destroy(prop);
2213 * If last isn't NULL, then return the next prop in the property group,
2243 scf_simple_prop_t *prop;
2270 prop = pg->pg_proplist;
2272 while ((prop != NULL) && (strcmp(propname, prop->pr_propname) != 0))
2273 prop = prop->pr_next;
2275 if (prop == NULL) {
2280 return (prop);
2284 scf_simple_prop_next_reset(scf_simple_prop_t *prop)
2286 if (prop == NULL)
2288 prop->pr_iter = 0;
2292 scf_simple_prop_numvalues(const scf_simple_prop_t *prop)
2294 if (prop == NULL)
2297 return (prop->pr_numvalues);
2302 scf_simple_prop_type(const scf_simple_prop_t *prop)
2304 if (prop == NULL)
2307 return (prop->pr_type);
2312 scf_simple_prop_name(const scf_simple_prop_t *prop)
2314 if ((prop == NULL) || (prop->pr_propname == NULL)) {
2319 return (prop->pr_propname);
2324 scf_simple_prop_pgname(const scf_simple_prop_t *prop)
2326 if ((prop == NULL) || (prop->pr_pgname == NULL)) {
2331 return (prop->pr_pgname);
2336 scf_next_val(scf_simple_prop_t *prop, scf_type_t type)
2338 if (prop == NULL) {
2343 switch (prop->pr_type) {
2359 if (type != prop->pr_type) {
2367 if (prop->pr_iter >= prop->pr_numvalues) {
2372 return (&prop->pr_vallist[prop->pr_iter++]);
2377 scf_simple_prop_next_boolean(scf_simple_prop_t *prop)
2381 ret = scf_next_val(prop, SCF_TYPE_BOOLEAN);
2391 scf_simple_prop_next_count(scf_simple_prop_t *prop)
2395 ret = scf_next_val(prop, SCF_TYPE_COUNT);
2405 scf_simple_prop_next_integer(scf_simple_prop_t *prop)
2409 ret = scf_next_val(prop, SCF_TYPE_INTEGER);
2418 scf_simple_prop_next_time(scf_simple_prop_t *prop, int32_t *nsec)
2422 ret = scf_next_val(prop, SCF_TYPE_TIME);
2434 scf_simple_prop_next_astring(scf_simple_prop_t *prop)
2438 ret = scf_next_val(prop, SCF_TYPE_ASTRING);
2447 scf_simple_prop_next_ustring(scf_simple_prop_t *prop)
2451 ret = scf_next_val(prop, SCF_TYPE_USTRING);
2460 scf_simple_prop_next_opaque(scf_simple_prop_t *prop, size_t *length)
2464 ret = scf_next_val(prop, SCF_TYPE_OPAQUE);
2540 scf_clean_propvec_mval(scf_propvec_t *prop)
2542 scf_propvec_mval_t *pv_ptr_node = prop->pv_ptr;
2545 assert(prop->pv_mval);
2547 prop->pv_ptr = NULL;
2549 if (prop->pv_type == SCF_TYPE_OPAQUE) {
2570 scf_propvec_t *prop;
2572 for (prop = propvec; prop->pv_prop != NULL; prop++) {
2573 assert(prop->pv_type != SCF_TYPE_INVALID);
2574 if (prop->pv_mval) {
2575 scf_clean_propvec_mval(prop);
2578 if (prop->pv_type == SCF_TYPE_OPAQUE) {
2579 scf_opaque_t *o = prop->pv_ptr;
2583 } else if (scf_true_base_type(prop->pv_type) ==
2585 if (*(char **)prop->pv_ptr != NULL)
2586 free(*(char **)prop->pv_ptr);
2599 scf_read_propvec_mval(scf_handle_t *h, scf_propvec_t *prop,
2630 prop->pv_ptr = pv_ptr_node;
2634 switch (prop->pv_type) {
2706 assert(scf_true_base_type(prop->pv_type) ==
2785 scf_propvec_t *prop;
2788 for (prop = properties; prop->pv_prop != NULL; prop++) {
2789 if (prop->pv_mval)
2790 prop->pv_ptr = NULL;
2791 else if (prop->pv_type == SCF_TYPE_OPAQUE)
2792 ((scf_opaque_t *)prop->pv_ptr)->so_addr = NULL;
2793 else if (scf_true_base_type(prop->pv_type) == SCF_TYPE_ASTRING)
2794 *((char **)prop->pv_ptr) = NULL;
2825 for (prop = properties; prop->pv_prop != NULL; prop++) {
2828 if (scf_pg_get_property(pg, prop->pv_prop, p) == -1) {
2829 *badprop = prop;
2833 if (prop->pv_mval) {
2834 if (scf_read_propvec_mval(h, prop, p) != SCF_SUCCESS) {
2835 *badprop = prop;
2842 *badprop = prop;
2846 switch (prop->pv_type) {
2853 if (prop->pv_aux != 0) {
2854 uint64_t *bits = prop->pv_ptr;
2855 *bits = b ? (*bits | prop->pv_aux) :
2856 (*bits & ~prop->pv_aux);
2858 boolean_t *bool = prop->pv_ptr;
2864 ret = scf_value_get_count(v, prop->pv_ptr);
2867 ret = scf_value_get_integer(v, prop->pv_ptr);
2870 scf_time_t *time = prop->pv_ptr;
2877 scf_opaque_t *opaque = prop->pv_ptr;
2880 *badprop = prop;
2897 assert(scf_true_base_type(prop->pv_type) ==
2902 *badprop = prop;
2911 *(char **)prop->pv_ptr = s;
2917 *badprop = prop;
2951 scf_write_propvec_mval(scf_handle_t *h, scf_propvec_t *prop,
2956 scf_propvec_mval_t *pv_ptr_node = prop->pv_ptr;
2958 assert(prop->pv_mval);
2965 switch (prop->pv_type) {
2995 ret = scf_value_set_from_string(v, prop->pv_type,
3033 scf_propvec_t *prop;
3058 for (prop = properties, i = 0; prop->pv_prop != NULL; prop++, i++) {
3060 *badprop = prop;
3064 ret = scf_transaction_property_change(tx, e, prop->pv_prop,
3065 prop->pv_type);
3068 prop->pv_prop, prop->pv_type);
3071 *badprop = prop;
3076 if (prop->pv_mval) {
3077 if (scf_write_propvec_mval(h, prop, e) != SCF_SUCCESS) {
3078 *badprop = prop;
3085 *badprop = prop;
3089 switch (prop->pv_type) {
3091 boolean_t b = (prop->pv_aux != 0) ?
3092 (*(uint64_t *)prop->pv_ptr & prop->pv_aux) != 0 :
3093 *(boolean_t *)prop->pv_ptr;
3099 scf_value_set_count(v, *(uint64_t *)prop->pv_ptr);
3102 scf_value_set_integer(v, *(int64_t *)prop->pv_ptr);
3105 scf_time_t *time = prop->pv_ptr;
3112 scf_opaque_t *opaque = prop->pv_ptr;
3120 (const char *)prop->pv_ptr);
3123 ret = scf_value_set_from_string(v, prop->pv_type,
3124 (const char *)prop->pv_ptr);
3128 *badprop = prop;
3291 scf_simple_prop_t *prop;
3295 prop = scf_simple_prop_get(NULL, fmri, SCF_GROUP_APPLICATION,
3297 if (!prop)
3299 ret = scf_simple_prop_next_boolean(prop);
3301 scf_simple_prop_free(prop);
3574 scf_property_t *prop = NULL;
3590 (prop = scf_property_create(h)) == NULL ||
3623 if (scf_pg_get_property(pg, SCF_PROPERTY_RESTARTER, prop) == -1) {
3643 if (scf_property_get_value(prop, v) == -1) {
3671 scf_property_destroy(prop);
3716 scf_property_t *prop = NULL;
3726 prop = scf_prop_get(h, inst, SCF_PG_GENERAL,
3729 if (prop == NULL) {
3740 scf_property_destroy(prop);
3749 if (scf_iter_property_decorations(iter, prop, 0)) {
3751 scf_property_destroy(prop);
3761 scf_property_destroy(prop);
3794 scf_property_destroy(prop);