std::ostream& operator<<(std::ostream &os, turn_info<P> const& info) { typename geometry::coordinate_type<P>::type d = info.distance; os << "\t" << " src " << info.seg_id.source_index << " seg " << info.seg_id.segment_index << " (// " << info.other_id.source_index << "." << info.other_id.segment_index << ")" << " how " << info.how << "[" << how_str(info.arrival) << " " << dir(info.direction) << (info.opposite ? " o" : "") << "]" << " sd " << dir(info.sides.get<0,0>()) << dir(info.sides.get<0,1>()) << dir(info.sides.get<1,0>()) << dir(info.sides.get<1,1>()) << " nxt seg " << info.travels_to_vertex_index << " , ip " << info.travels_to_ip_index << " , or " << info.next_ip_index << " dst " << double(d) << info.visit_state; if (info.flagged) { os << " FLAGGED"; } return os; }
static int do_list(void) { struct fenced_domain d; struct fenced_node *np; int node_count; int rv, i; rv = fenced_domain_info(&d); if (rv < 0) exit(EXIT_FAILURE); /* fenced probably not running */ printf("fence domain\n"); printf("member count %d\n", d.member_count); printf("victim count %d\n", d.victim_count); printf("victim now %d\n", d.current_victim); printf("master nodeid %d\n", d.master_nodeid); printf("wait state %s\n", wait_str(d.state)); printf("members "); node_count = 0; memset(&nodes, 0, sizeof(nodes)); rv = fenced_domain_nodes(FENCED_NODES_MEMBERS, MAX_NODES, &node_count, nodes); if (rv < 0) { printf("error\n"); goto fail; } qsort(&nodes, node_count, sizeof(struct fenced_node), node_compare); np = nodes; for (i = 0; i < node_count; i++) { printf("%d ", np->nodeid); np++; } printf("\n"); if (!opt_all_nodes) { printf("\n"); exit(EXIT_SUCCESS); } node_count = 0; memset(&nodes, 0, sizeof(nodes)); rv = fenced_domain_nodes(FENCED_NODES_ALL, MAX_NODES, &node_count, nodes); if (rv < 0) goto fail; qsort(&nodes, node_count, sizeof(struct fenced_node), node_compare); printf("all nodes\n"); np = nodes; for (i = 0; i < node_count; i++) { printf("nodeid %d member %d victim %d last fence master %d how %s\n", np->nodeid, np->member, np->victim, np->last_fenced_master, how_str(np->last_fenced_how)); np++; } printf("\n"); exit(EXIT_SUCCESS); fail: fprintf(stderr, "fenced query error %d\n", rv); printf("\n"); exit(EXIT_FAILURE); }