Lines Matching refs:wip
789 ctids_by_restarter(scf_walkinfo_t *wip, uint64_t *cp, int print_flag, in ctids_by_restarter() argument
806 rest_ret = common_by_restarter(wip->inst, wip->fmri, restarter_specp); in ctids_by_restarter()
837 wip->fmri); in ctids_by_restarter()
997 sprint_ctid(char **buf, scf_walkinfo_t *wip) in sprint_ctid() argument
1009 if (wip->pg != NULL) { in sprint_ctid()
1010 r = pg_get_single_val(wip->pg, scf_property_contract, in sprint_ctid()
1013 r = ctids_by_restarter(wip, &c, 0, MULTI_OK, &restarter_spec, in sprint_ctid()
1017 r = get_restarter_count_prop(wip->inst, in sprint_ctid()
1039 sortkey_ctid(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_ctid() argument
1049 if (wip->pg != NULL) { in sortkey_ctid()
1050 r = pg_get_single_val(wip->pg, scf_property_contract, in sortkey_ctid()
1053 r = ctids_by_restarter(wip, &c, 0, MULTI_OK, &restarter_spec, in sortkey_ctid()
1057 r = get_restarter_count_prop(wip->inst, in sortkey_ctid()
1082 sprint_desc(char **buf, scf_walkinfo_t *wip) in sprint_desc() argument
1093 if (wip->pg != NULL) { in sprint_desc()
1095 } else if (inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, locale, in sprint_desc()
1098 inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, "C", in sprint_desc()
1126 sortkey_desc(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_desc() argument
1174 sortkey_states(const char *pname, char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_states() argument
1182 if (wip->pg == NULL) { in sortkey_states()
1183 get_restarter_string_prop(wip->inst, pname, state_name, in sortkey_states()
1208 sprint_state(char **buf, scf_walkinfo_t *wip) in sprint_state() argument
1214 if (wip->pg == NULL) { in sprint_state()
1215 get_restarter_string_prop(wip->inst, scf_property_state, in sprint_state()
1224 if (!opt_nstate_shown && transitioning(wip->inst)) { in sprint_state()
1242 sortkey_state(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_state() argument
1244 sortkey_states(scf_property_state, buf, reverse, wip); in sortkey_state()
1248 sprint_nstate(char **buf, scf_walkinfo_t *wip) in sprint_nstate() argument
1255 if (wip->pg == NULL) { in sprint_nstate()
1256 get_restarter_string_prop(wip->inst, scf_property_next_state, in sprint_nstate()
1281 sortkey_nstate(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_nstate() argument
1283 sortkey_states(scf_property_next_state, buf, reverse, wip); in sortkey_nstate()
1287 sprint_s(char **buf, scf_walkinfo_t *wip) in sprint_s() argument
1294 if (wip->pg == NULL) { in sprint_s()
1295 get_restarter_string_prop(wip->inst, scf_property_state, in sprint_s()
1299 if (!opt_nstate_shown && transitioning(wip->inst)) in sprint_s()
1316 sprint_n(char **buf, scf_walkinfo_t *wip) in sprint_n() argument
1323 if (wip->pg == NULL) { in sprint_n()
1324 get_restarter_string_prop(wip->inst, scf_property_next_state, in sprint_n()
1342 sprint_sn(char **buf, scf_walkinfo_t *wip) in sprint_sn() argument
1350 if (wip->pg == NULL) { in sprint_sn()
1351 get_restarter_string_prop(wip->inst, scf_property_state, in sprint_sn()
1353 get_restarter_string_prop(wip->inst, scf_property_next_state, in sprint_sn()
1376 sortkey_sn(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_sn() argument
1378 sortkey_state(buf, reverse, wip); in sortkey_sn()
1379 sortkey_nstate(buf + 1, reverse, wip); in sortkey_sn()
1404 sprint_sta(char **buf, scf_walkinfo_t *wip) in sprint_sta() argument
1411 if (wip->pg == NULL) in sprint_sta()
1412 get_restarter_string_prop(wip->inst, scf_property_state, in sprint_sta()
1419 if (wip->pg == NULL && !opt_nstate_shown && transitioning(wip->inst)) in sprint_sta()
1429 sprint_nsta(char **buf, scf_walkinfo_t *wip) in sprint_nsta() argument
1435 if (wip->pg == NULL) in sprint_nsta()
1436 get_restarter_string_prop(wip->inst, scf_property_next_state, in sprint_nsta()
1455 sprint_fmri(char **buf, scf_walkinfo_t *wip) in sprint_fmri() argument
1461 if (wip->pg == NULL) { in sprint_fmri()
1462 if (scf_instance_to_fmri(wip->inst, fmri_buf, in sprint_fmri()
1467 if (pg_get_single_val(wip->pg, SCF_LEGACY_PROPERTY_NAME, in sprint_fmri()
1489 sortkey_fmri(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_fmri() argument
1493 sprint_fmri(&tmp, wip); in sortkey_fmri()
1503 sprint_scope(char **buf, scf_walkinfo_t *wip) in sprint_scope() argument
1509 assert(wip->scope != NULL); in sprint_scope()
1511 if (scf_scope_get_name(wip->scope, scope_buf, max_scf_name_length) < 0) in sprint_scope()
1523 sortkey_scope(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_scope() argument
1527 sprint_scope(&tmp, wip); in sortkey_scope()
1535 sprint_service(char **buf, scf_walkinfo_t *wip) in sprint_service() argument
1541 if (wip->pg == NULL) { in sprint_service()
1542 if (scf_service_get_name(wip->svc, svc_buf, in sprint_service()
1546 if (pg_get_single_val(wip->pg, "name", SCF_TYPE_ASTRING, in sprint_service()
1567 sortkey_service(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_service() argument
1571 sprint_service(&tmp, wip); in sortkey_service()
1580 sprint_instance(char **buf, scf_walkinfo_t *wip) in sprint_instance() argument
1586 if (wip->pg == NULL) { in sprint_instance()
1587 if (scf_instance_get_name(wip->inst, tmp, in sprint_instance()
1604 sortkey_instance(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_instance() argument
1608 sprint_instance(&tmp, wip); in sortkey_instance()
1627 sprint_stime(char **buf, scf_walkinfo_t *wip) in sprint_stime() argument
1637 if (wip->pg == NULL) { in sprint_stime()
1638 r = get_restarter_time_prop(wip->inst, in sprint_stime()
1641 r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP, in sprint_stime()
1684 sortkey_stime(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_stime() argument
1689 if (wip->pg == NULL) in sortkey_stime()
1690 r = get_restarter_time_prop(wip->inst, in sortkey_stime()
1693 r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP, in sortkey_stime()
1720 sprint_zone(char **buf, scf_walkinfo_t *wip) in sprint_zone() argument
1749 sortkey_zone(char *buf, int reverse, scf_walkinfo_t *wip) in sortkey_zone() argument
1753 sprint_zone(&tmp, wip); in sortkey_zone()
2028 detailed_list_processes(scf_walkinfo_t *wip) in detailed_list_processes() argument
2035 if (get_restarter_count_prop(wip->inst, scf_property_contract, &c, in detailed_list_processes()
2039 if (instance_processes(wip->inst, wip->fmri, &pids, &n) != 0) in detailed_list_processes()
2200 print_application_properties(scf_walkinfo_t *wip, scf_snapshot_t *snap) in print_application_properties() argument
2227 if (scf_iter_instance_pgs_typed_composed(pg_iter, wip->inst, snap, in print_application_properties()
2247 if (scf_tmpl_get_by_pg_name(wip->fmri, snap_name, pg_name_buf, in print_application_properties()
2408 print_detailed(void *unused, scf_walkinfo_t *wip) in print_detailed() argument
2428 assert(wip->pg == NULL); in print_detailed()
2441 if (scf_instance_to_fmri(wip->inst, buf, max_scf_fmri_length + 1) != -1) in print_detailed()
2447 if (inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, locale, in print_detailed()
2452 else if (inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, "C", in print_detailed()
2467 perm = instance_enabled(wip->inst, B_FALSE); in print_detailed()
2468 temp = instance_enabled(wip->inst, B_TRUE); in print_detailed()
2488 (void) inst_get_single_val(wip->inst, pg, SCF_PROPERTY_COMMENT, in print_detailed()
2503 if (scf_instance_get_pg(wip->inst, SCF_PG_RESTARTER, rpg) != 0) { in print_detailed()
2549 if (inst_get_single_val(wip->inst, SCF_PG_GENERAL, in print_detailed()
2563 restarter_ret = ctids_by_restarter(wip, &c, 1, 0, in print_detailed()
2568 wip->fmri); in print_detailed()
2625 snap = get_running_snapshot(wip->inst); in print_detailed()
2627 if (scf_iter_instance_pgs_typed_composed(pg_iter, wip->inst, snap, in print_detailed()
2639 detailed_list_processes(wip); in print_detailed()
2643 print_application_properties(wip, snap); in print_detailed()
2651 print_log(void *unused __unused, scf_walkinfo_t *wip) in print_log() argument
2659 if (scf_instance_get_pg(wip->inst, SCF_PG_RESTARTER, rpg) != 0) { in print_log()
2893 print_notify(void *unused, scf_walkinfo_t *wip) in print_notify() argument
2895 if (strcmp(SCF_INSTANCE_GLOBAL, wip->fmri) == 0 || in print_notify()
2896 strcmp(SCF_NOTIFY_PARAMS_INST, wip->fmri) == 0) in print_notify()
2899 print_notify_fmri(wip->fmri); in print_notify()
2909 add_processes(scf_walkinfo_t *wip, char *line, scf_propertygroup_t *lpg) in add_processes() argument
2915 if (instance_processes(wip->inst, wip->fmri, &pids, &n) != 0) in add_processes()
2993 list_instance(void *unused, scf_walkinfo_t *wip) in list_instance() argument
3010 if (wip->pg != NULL) in list_instance()
3015 if (inst_get_single_val(wip->inst, SCF_PG_GENERAL, in list_instance()
3040 if (wip->pg == NULL && ht_buckets != NULL && ht_add(wip->fmri)) { in list_instance()
3049 columns[opt_columns[i]].sprint(&lp->str, wip); in list_instance()
3059 lp->str = add_processes(wip, lp->str, wip->pg); in list_instance()
3067 columns[j].get_sortkey(cp, opt_sort[i] & ~0xff, wip); in list_instance()
3080 list_if_enabled(void *unused, scf_walkinfo_t *wip) in list_if_enabled() argument
3082 if (wip->pg != NULL || in list_if_enabled()
3083 instance_enabled(wip->inst, B_FALSE) == 1 || in list_if_enabled()
3084 instance_enabled(wip->inst, B_TRUE) == 1) in list_if_enabled()
3085 return (list_instance(unused, wip)); in list_if_enabled()
3098 list_svc_or_inst_fmri(void *complain, scf_walkinfo_t *wip) in list_svc_or_inst_fmri() argument
3105 fmri = safe_strdup(wip->fmri); in list_svc_or_inst_fmri()
3111 wip->fmri); in list_svc_or_inst_fmri()
3135 "service or instance.\n"), wip->fmri); in list_svc_or_inst_fmri()
3141 if (scf_handle_decode_fmri(h, wip->fmri, wip->scope, wip->svc, in list_svc_or_inst_fmri()
3142 wip->inst, NULL, NULL, 0) != SCF_SUCCESS) { in list_svc_or_inst_fmri()
3149 wip->fmri); in list_svc_or_inst_fmri()
3153 return (list_instance(NULL, wip)); in list_svc_or_inst_fmri()
3157 if (scf_handle_decode_fmri(h, wip->fmri, wip->scope, wip->svc, NULL, in list_svc_or_inst_fmri()
3164 wip->fmri); in list_svc_or_inst_fmri()
3175 if (scf_iter_service_instances(iter, wip->svc) != SCF_SUCCESS) in list_svc_or_inst_fmri()
3184 save = wip->fmri; in list_svc_or_inst_fmri()
3185 wip->fmri = fmri; in list_svc_or_inst_fmri()
3186 while ((ret = scf_iter_next_instance(iter, wip->inst)) == 1) { in list_svc_or_inst_fmri()
3187 if (scf_instance_to_fmri(wip->inst, fmri, in list_svc_or_inst_fmri()
3190 (void) list_instance(NULL, wip); in list_svc_or_inst_fmri()
3193 wip->fmri = save; in list_svc_or_inst_fmri()
3210 walk_dependencies(scf_walkinfo_t *wip, scf_walk_callback callback, void *data) in walk_dependencies() argument
3217 assert(wip->inst != NULL); in walk_dependencies()
3223 snap = get_running_snapshot(wip->inst); in walk_dependencies()
3225 if (scf_iter_instance_pgs_typed_composed(iter, wip->inst, snap, in walk_dependencies()
3279 wip->fmri = dep; in walk_dependencies()
3280 if (callback(data, wip) != 0) in walk_dependencies()
3296 list_dependencies(void *data, scf_walkinfo_t *wip) in list_dependencies() argument
3298 walk_dependencies(wip, list_svc_or_inst_fmri, data); in list_dependencies()
3316 check_against_provider(void *arg, scf_walkinfo_t *wip) in check_against_provider() argument
3322 cfmri = safe_strdup(wip->fmri); in check_against_provider()
3351 list_if_dependent(void *unused, scf_walkinfo_t *wip) in list_if_dependent() argument
3356 (void) walk_dependencies(wip, check_against_provider, &match); in list_if_dependent()
3359 return (list_instance(unused, wip)); in list_if_dependent()
3366 list_dependents(void *unused, scf_walkinfo_t *wip) in list_dependents() argument
3371 if (scf_scope_get_name(wip->scope, provider_scope, in list_dependents()
3373 scf_service_get_name(wip->svc, provider_svc, in list_dependents()
3378 if (wip->inst == NULL) in list_dependents()
3380 else if (scf_instance_get_name(wip->inst, provider_inst, in list_dependents()