Lines Matching defs:wip
700 * the appropriate filename using wip->fmri and stores that in the
712 * during the generation of the wip->fmri based filename
779 ctids_by_restarter(scf_walkinfo_t *wip, uint64_t *cp, int print_flag,
796 rest_ret = common_by_restarter(wip->inst, wip->fmri, restarter_specp);
827 wip->fmri);
1009 sprint_ctid(char **buf, scf_walkinfo_t *wip)
1019 * Only check for non-legacy services (wip->pg == 0).
1021 if (wip->pg != NULL) {
1022 r = pg_get_single_val(wip->pg, scf_property_contract,
1025 r = ctids_by_restarter(wip, &c, 0, MULTI_OK, &restarter_spec,
1029 r = get_restarter_count_prop(wip->inst,
1051 sortkey_ctid(char *buf, int reverse, scf_walkinfo_t *wip)
1059 * Only check for non-legacy services (wip->pg == 0).
1061 if (wip->pg != NULL) {
1062 r = pg_get_single_val(wip->pg, scf_property_contract,
1065 r = ctids_by_restarter(wip, &c, 0, MULTI_OK, &restarter_spec,
1069 r = get_restarter_count_prop(wip->inst,
1094 sprint_desc(char **buf, scf_walkinfo_t *wip)
1105 if (wip->pg != NULL) {
1107 } else if (inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, locale,
1110 inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, "C",
1138 sortkey_desc(char *buf, int reverse, scf_walkinfo_t *wip)
1186 sortkey_states(const char *pname, char *buf, int reverse, scf_walkinfo_t *wip)
1194 if (wip->pg == NULL) {
1195 get_restarter_string_prop(wip->inst, pname, state_name,
1220 sprint_state(char **buf, scf_walkinfo_t *wip)
1226 if (wip->pg == NULL) {
1227 get_restarter_string_prop(wip->inst, scf_property_state,
1236 if (!opt_nstate_shown && transitioning(wip->inst)) {
1254 sortkey_state(char *buf, int reverse, scf_walkinfo_t *wip)
1256 sortkey_states(scf_property_state, buf, reverse, wip);
1260 sprint_nstate(char **buf, scf_walkinfo_t *wip)
1267 if (wip->pg == NULL) {
1268 get_restarter_string_prop(wip->inst, scf_property_next_state,
1293 sortkey_nstate(char *buf, int reverse, scf_walkinfo_t *wip)
1295 sortkey_states(scf_property_next_state, buf, reverse, wip);
1299 sprint_s(char **buf, scf_walkinfo_t *wip)
1306 if (wip->pg == NULL) {
1307 get_restarter_string_prop(wip->inst, scf_property_state,
1311 if (!opt_nstate_shown && transitioning(wip->inst))
1328 sprint_n(char **buf, scf_walkinfo_t *wip)
1335 if (wip->pg == NULL) {
1336 get_restarter_string_prop(wip->inst, scf_property_next_state,
1354 sprint_sn(char **buf, scf_walkinfo_t *wip)
1362 if (wip->pg == NULL) {
1363 get_restarter_string_prop(wip->inst, scf_property_state,
1365 get_restarter_string_prop(wip->inst, scf_property_next_state,
1388 sortkey_sn(char *buf, int reverse, scf_walkinfo_t *wip)
1390 sortkey_state(buf, reverse, wip);
1391 sortkey_nstate(buf + 1, reverse, wip);
1416 sprint_sta(char **buf, scf_walkinfo_t *wip)
1423 if (wip->pg == NULL)
1424 get_restarter_string_prop(wip->inst, scf_property_state,
1431 if (wip->pg == NULL && !opt_nstate_shown && transitioning(wip->inst))
1441 sprint_nsta(char **buf, scf_walkinfo_t *wip)
1447 if (wip->pg == NULL)
1448 get_restarter_string_prop(wip->inst, scf_property_next_state,
1467 sprint_fmri(char **buf, scf_walkinfo_t *wip)
1473 if (wip->pg == NULL) {
1474 if (scf_instance_to_fmri(wip->inst, fmri_buf,
1479 if (pg_get_single_val(wip->pg, SCF_LEGACY_PROPERTY_NAME,
1501 sortkey_fmri(char *buf, int reverse, scf_walkinfo_t *wip)
1505 sprint_fmri(&tmp, wip);
1515 sprint_scope(char **buf, scf_walkinfo_t *wip)
1521 assert(wip->scope != NULL);
1523 if (scf_scope_get_name(wip->scope, scope_buf, max_scf_name_length) < 0)
1535 sortkey_scope(char *buf, int reverse, scf_walkinfo_t *wip)
1539 sprint_scope(&tmp, wip);
1547 sprint_service(char **buf, scf_walkinfo_t *wip)
1553 if (wip->pg == NULL) {
1554 if (scf_service_get_name(wip->svc, svc_buf,
1558 if (pg_get_single_val(wip->pg, "name", SCF_TYPE_ASTRING,
1579 sortkey_service(char *buf, int reverse, scf_walkinfo_t *wip)
1583 sprint_service(&tmp, wip);
1592 sprint_instance(char **buf, scf_walkinfo_t *wip)
1598 if (wip->pg == NULL) {
1599 if (scf_instance_get_name(wip->inst, tmp,
1616 sortkey_instance(char *buf, int reverse, scf_walkinfo_t *wip)
1620 sprint_instance(&tmp, wip);
1639 sprint_stime(char **buf, scf_walkinfo_t *wip)
1649 if (wip->pg == NULL) {
1650 r = get_restarter_time_prop(wip->inst,
1653 r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP,
1696 sortkey_stime(char *buf, int reverse, scf_walkinfo_t *wip)
1701 if (wip->pg == NULL)
1702 r = get_restarter_time_prop(wip->inst,
1705 r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP,
1732 sprint_zone(char **buf, scf_walkinfo_t *wip)
1761 sortkey_zone(char *buf, int reverse, scf_walkinfo_t *wip)
1765 sprint_zone(&tmp, wip);
2038 detailed_list_processes(scf_walkinfo_t *wip)
2045 if (get_restarter_count_prop(wip->inst, scf_property_contract, &c,
2049 if (instance_processes(wip->inst, wip->fmri, &pids, &n) != 0)
2210 print_application_properties(scf_walkinfo_t *wip, scf_snapshot_t *snap)
2237 if (scf_iter_instance_pgs_typed_composed(pg_iter, wip->inst, snap,
2257 if (scf_tmpl_get_by_pg_name(wip->fmri, snap_name, pg_name_buf,
2418 print_detailed(void *unused, scf_walkinfo_t *wip)
2438 assert(wip->pg == NULL);
2451 if (scf_instance_to_fmri(wip->inst, buf, max_scf_fmri_length + 1) != -1)
2457 if (inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, locale,
2462 else if (inst_get_single_val(wip->inst, SCF_PG_TM_COMMON_NAME, "C",
2477 perm = instance_enabled(wip->inst, B_FALSE);
2478 temp = instance_enabled(wip->inst, B_TRUE);
2498 if (scf_instance_get_pg(wip->inst, SCF_PG_RESTARTER, rpg) != 0) {
2544 if (inst_get_single_val(wip->inst, SCF_PG_GENERAL,
2558 restarter_ret = ctids_by_restarter(wip, &c, 1, 0,
2563 wip->fmri);
2620 snap = get_running_snapshot(wip->inst);
2622 if (scf_iter_instance_pgs_typed_composed(pg_iter, wip->inst, snap,
2634 detailed_list_processes(wip);
2638 print_application_properties(wip, snap);
2647 print_log(void *unused, scf_walkinfo_t *wip)
2655 if (scf_instance_get_pg(wip->inst, SCF_PG_RESTARTER, rpg) != 0) {
2886 print_notify(void *unused, scf_walkinfo_t *wip)
2888 if (strcmp(SCF_INSTANCE_GLOBAL, wip->fmri) == 0 ||
2889 strcmp(SCF_NOTIFY_PARAMS_INST, wip->fmri) == 0)
2892 print_notify_fmri(wip->fmri);
2902 add_processes(scf_walkinfo_t *wip, char *line, scf_propertygroup_t *lpg)
2908 if (instance_processes(wip->inst, wip->fmri, &pids, &n) != 0)
2971 list_instance(void *unused, scf_walkinfo_t *wip)
2988 if (wip->pg != NULL)
2993 if (inst_get_single_val(wip->inst, SCF_PG_GENERAL,
3018 if (wip->pg == NULL && ht_buckets != NULL && ht_add(wip->fmri)) {
3027 columns[opt_columns[i]].sprint(&lp->str, wip);
3037 lp->str = add_processes(wip, lp->str, wip->pg);
3045 columns[j].get_sortkey(cp, opt_sort[i] & ~0xff, wip);
3058 list_if_enabled(void *unused, scf_walkinfo_t *wip)
3060 if (wip->pg != NULL ||
3061 instance_enabled(wip->inst, B_FALSE) == 1 ||
3062 instance_enabled(wip->inst, B_TRUE) == 1)
3063 return (list_instance(unused, wip));
3076 list_svc_or_inst_fmri(void *complain, scf_walkinfo_t *wip)
3083 fmri = safe_strdup(wip->fmri);
3089 wip->fmri);
3104 "service or instance.\n"), wip->fmri);
3110 if (scf_handle_decode_fmri(h, wip->fmri, wip->scope, wip->svc,
3111 wip->inst, NULL, NULL, 0) != SCF_SUCCESS) {
3118 wip->fmri);
3122 return (list_instance(NULL, wip));
3126 if (scf_handle_decode_fmri(h, wip->fmri, wip->scope, wip->svc, NULL,
3133 wip->fmri);
3144 if (scf_iter_service_instances(iter, wip->svc) != SCF_SUCCESS)
3153 save = wip->fmri;
3154 wip->fmri = fmri;
3155 while ((ret = scf_iter_next_instance(iter, wip->inst)) == 1) {
3156 if (scf_instance_to_fmri(wip->inst, fmri,
3159 (void) list_instance(NULL, wip);
3162 wip->fmri = save;
3179 walk_dependencies(scf_walkinfo_t *wip, scf_walk_callback callback, void *data)
3186 assert(wip->inst != NULL);
3192 snap = get_running_snapshot(wip->inst);
3194 if (scf_iter_instance_pgs_typed_composed(iter, wip->inst, snap,
3248 wip->fmri = dep;
3249 if (callback(data, wip) != 0)
3265 list_dependencies(void *data, scf_walkinfo_t *wip)
3267 walk_dependencies(wip, list_svc_or_inst_fmri, data);
3285 check_against_provider(void *arg, scf_walkinfo_t *wip)
3291 cfmri = safe_strdup(wip->fmri);
3320 list_if_dependent(void *unused, scf_walkinfo_t *wip)
3325 (void) walk_dependencies(wip, check_against_provider, &match);
3328 return (list_instance(unused, wip));
3335 list_dependents(void *unused, scf_walkinfo_t *wip)
3340 if (scf_scope_get_name(wip->scope, provider_scope,
3342 scf_service_get_name(wip->svc, provider_svc,
3347 if (wip->inst == NULL)
3349 else if (scf_instance_get_name(wip->inst, provider_inst,