| 820 | } |
| 821 | |
| 822 | xmlNode * |
| 823 | cib_construct_reply(xmlNode * request, xmlNode * output, int rc) |
| 824 | { |
| 825 | int lpc = 0; |
| 826 | xmlNode *reply = NULL; |
| 827 | const char *name = NULL; |
| 828 | const char *value = NULL; |
| 829 | |
| 830 | const char *names[] = { |
| 831 | F_CIB_OPERATION, |
| 832 | F_CIB_CALLID, |
| 833 | F_CIB_CLIENTID, |
| 834 | F_CIB_CALLOPTS |
| 835 | }; |
| 836 | static int max = DIMOF(names); |
| 837 | |
| 838 | crm_trace("Creating a basic reply"); |
| 839 | reply = create_xml_node(NULL, "cib-reply"); |
| 840 | crm_xml_add(reply, F_TYPE, T_CIB); |
| 841 | |
| 842 | for (lpc = 0; lpc < max; lpc++) { |
| 843 | name = names[lpc]; |
| 844 | value = crm_element_value(request, name); |
| 845 | crm_xml_add(reply, name, value); |
| 846 | } |
| 847 | |
| 848 | crm_xml_add_int(reply, F_CIB_RC, rc); |
| 849 | |
| 850 | if (output != NULL) { |
| 851 | crm_trace("Attaching reply output"); |
| 852 | add_message_xml(reply, F_CIB_CALLDATA, output); |
| 853 | } |
| 854 | return reply; |
| 855 | } |
| 856 | |
| 857 | int |
| 858 | cib_process_command(xmlNode * request, xmlNode ** reply, xmlNode ** cib_diff, gboolean privileged) |
no test coverage detected