| 562 | # include <corosync/quorum.h> |
| 563 | # include <corosync/cpg.h> |
| 564 | static int |
| 565 | node_mcp_dispatch(const char *buffer, ssize_t length, gpointer userdata) |
| 566 | { |
| 567 | xmlNode *msg = string2xml(buffer); |
| 568 | |
| 569 | if (msg) { |
| 570 | xmlNode *node = NULL; |
| 571 | |
| 572 | crm_log_xml_trace(msg, "message"); |
| 573 | |
| 574 | for (node = __xml_first_child(msg); node != NULL; node = __xml_next(node)) { |
| 575 | const char *uname = crm_element_value(node, "uname"); |
| 576 | if (command == 'l') { |
| 577 | int id = 0; |
| 578 | crm_element_value_int(node, "id", &id); |
| 579 | fprintf(stdout, "%u %s\n", id, uname); |
| 580 | |
| 581 | } else if (command == 'p') { |
| 582 | fprintf(stdout, "%s ", uname); |
| 583 | } |
| 584 | } |
| 585 | free_xml(msg); |
| 586 | |
| 587 | if (command == 'p') { |
| 588 | fprintf(stdout, "\n"); |
| 589 | } |
| 590 | |
| 591 | crm_exit(0); |
| 592 | } |
| 593 | |
| 594 | return 0; |
| 595 | } |
| 596 | |
| 597 | static void |
| 598 | node_mcp_destroy(gpointer user_data) |
nothing calls this directly
no test coverage detected