File: crmd_messages.h

package info (click to toggle)
pacemaker 1.0.9.1%2Bhg15626-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 34,668 kB
  • ctags: 5,645
  • sloc: xml: 87,444; ansic: 57,853; python: 11,479; sh: 5,255; makefile: 663; perl: 387; sed: 262
file content (115 lines) | stat: -rwxr-xr-x 4,042 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* 
 * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef XML_CRM_MESSAGES__H
#define XML_CRM_MESSAGES__H


#include <crm/crm.h>
#include <crm/common/ipc.h>
#include <crm/common/xml.h>
#include <crm/common/cluster.h>
#include <crmd_fsa.h>

extern void *fsa_typed_data_adv(
	fsa_data_t *fsa_data, enum fsa_data_type a_type, const char *caller);

#define fsa_typed_data(x) fsa_typed_data_adv(msg_data, x, __FUNCTION__)

extern void register_fsa_error_adv(
	enum crmd_fsa_cause cause, enum crmd_fsa_input input,
	fsa_data_t *cur_data, void *new_data, const char *raised_from);

#define register_fsa_error(cause, input, new_data) register_fsa_error_adv(cause, input, msg_data, new_data, __FUNCTION__)

extern int register_fsa_input_adv(
	enum crmd_fsa_cause cause, enum crmd_fsa_input input,
	void *data, long long with_actions,
	gboolean prepend, const char *raised_from);

extern void fsa_dump_queue(int log_level);
extern void route_message(enum crmd_fsa_cause cause, xmlNode *input);

#define crmd_fsa_stall(cur_input) if(cur_input != NULL) {		\
		register_fsa_input_adv(					\
			((fsa_data_t*)cur_input)->fsa_cause, I_WAIT_FOR_EVENT, \
			((fsa_data_t*)cur_input)->data, action, TRUE, __FUNCTION__);	\
	} else {							\
		register_fsa_input_adv(					\
			C_FSA_INTERNAL, I_WAIT_FOR_EVENT,		\
			NULL, action, TRUE, __FUNCTION__);		\
	}								\

#define register_fsa_input(cause, input, data) register_fsa_input_adv(cause, input, data, A_NOTHING, FALSE, __FUNCTION__)

#define register_fsa_action(action) {					\
		fsa_actions |= action;					\
		if(fsa_source) {					\
			mainloop_set_trigger(fsa_source);			\
		}							\
		crm_debug("%s added action %s to the FSA",		\
			  __FUNCTION__, fsa_action2string(action));	\
	}


#define register_fsa_input_before(cause, input, data) register_fsa_input_adv(cause, input, data, A_NOTHING, TRUE, __FUNCTION__)

#define register_fsa_input_later(cause, input, data) register_fsa_input_adv(cause, input, data, A_NOTHING, FALSE, __FUNCTION__)

void delete_fsa_input(fsa_data_t *fsa_data);

GListPtr put_message(fsa_data_t *new_message);
fsa_data_t *get_message(void);
gboolean is_message(void);
gboolean have_wait_message(void);

extern gboolean relay_message(
	xmlNode *relay_message, gboolean originated_locally);

extern gboolean crmd_ipc_msg_callback(IPC_Channel *client, gpointer user_data);

extern void process_message(
	xmlNode *msg, gboolean originated_locally,const char *src_node_name);

extern gboolean crm_dc_process_message(xmlNode *whole_message,
				       xmlNode *action,
				       const char *host_from,
				       const char *sys_from,
				       const char *sys_to,
				       const char *op,
				       gboolean dc_mode);

extern gboolean send_msg_via_ipc(xmlNode *msg, const char *sys);

extern gboolean add_pending_outgoing_reply(const char *originating_node_name,
					   const char *crm_msg_reference,
					   const char *sys_to,
					   const char *sys_from);

extern gboolean crmd_authorize_message(xmlNode *client_msg, crmd_client_t *curr_client);

extern gboolean send_request(xmlNode *msg, char **msg_reference);

extern enum crmd_fsa_input handle_message(xmlNode *stored_msg);

extern void lrm_op_callback(lrm_op_t* op);

extern void msg_queue_helper(void);

extern ha_msg_input_t *copy_ha_msg_input(ha_msg_input_t *orig);

#endif