1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef STONITH_NG_INTERNAL__H
19 # define STONITH_NG_INTERNAL__H
20
21 # include <crm/common/ipc.h>
22 # include <crm/common/xml.h>
23
24 struct stonith_action_s;
25 typedef struct stonith_action_s stonith_action_t;
26
27 stonith_action_t *stonith_action_create(const char *agent,
28 const char *_action,
29 const char *victim,
30 uint32_t victim_nodeid,
31 int timeout,
32 GHashTable * device_args, GHashTable * port_map);
33
34 GPid
35 stonith_action_execute_async(stonith_action_t * action,
36 void *userdata,
37 void (*done) (GPid pid, int rc, const char *output,
38 gpointer user_data));
39
40 int
41 stonith_action_execute(stonith_action_t * action, int *agent_result, char **output);
42
43 gboolean is_redhat_agent(const char *agent);
44
45 xmlNode *create_level_registration_xml(const char *node, const char *pattern,
46 const char *attr, const char *value,
47 int level,
48 stonith_key_value_t *device_list);
49
50 xmlNode *create_device_registration_xml(const char *id, const char *namespace, const char *agent,
51 stonith_key_value_t * params, const char *rsc_provides);
52
53 # define ST_LEVEL_MAX 10
54
55 # define F_STONITH_CLIENTID "st_clientid"
56 # define F_STONITH_CALLOPTS "st_callopt"
57 # define F_STONITH_CALLID "st_callid"
58 # define F_STONITH_CALLDATA "st_calldata"
59 # define F_STONITH_OPERATION "st_op"
60 # define F_STONITH_TARGET "st_target"
61 # define F_STONITH_REMOTE_OP_ID "st_remote_op"
62 # define F_STONITH_RC "st_rc"
63
64 # define F_STONITH_TIMEOUT "st_timeout"
65 # define F_STONITH_TOLERANCE "st_tolerance"
66
67 # define F_STONITH_ACTION_TIMEOUT "st_action_timeout"
68
69 # define F_STONITH_ACTION_DISALLOWED "st_action_disallowed"
70
71 # define F_STONITH_DELAY_MAX "st_delay_max"
72
73 # define F_STONITH_DELAY_BASE "st_delay_base"
74
75
76 # define F_STONITH_DEVICE_VERIFIED "st_monitor_verified"
77
78 # define F_STONITH_DEVICE_REQUIRED "st_required"
79
80 # define F_STONITH_AVAILABLE_DEVICES "st-available-devices"
81 # define F_STONITH_CALLBACK_TOKEN "st_async_id"
82 # define F_STONITH_CLIENTNAME "st_clientname"
83 # define F_STONITH_CLIENTNODE "st_clientnode"
84 # define F_STONITH_NOTIFY_TYPE "st_notify_type"
85 # define F_STONITH_NOTIFY_ACTIVATE "st_notify_activate"
86 # define F_STONITH_NOTIFY_DEACTIVATE "st_notify_deactivate"
87 # define F_STONITH_DELEGATE "st_delegate"
88
89
90
91
92 # define F_STONITH_ORIGIN "st_origin"
93 # define F_STONITH_HISTORY_LIST "st_history"
94 # define F_STONITH_DATE "st_date"
95 # define F_STONITH_STATE "st_state"
96 # define F_STONITH_ACTIVE "st_active"
97
98 # define F_STONITH_DEVICE "st_device_id"
99 # define F_STONITH_ACTION "st_device_action"
100 # define F_STONITH_MODE "st_mode"
101
102 # define T_STONITH_NG "stonith-ng"
103 # define T_STONITH_REPLY "st-reply"
104
105
106
107 # define T_STONITH_TIMEOUT_VALUE "st-async-timeout-value"
108 # define T_STONITH_NOTIFY "st_notify"
109
110 # define STONITH_ATTR_ARGMAP "pcmk_arg_map"
111 # define STONITH_ATTR_HOSTARG "pcmk_host_argument"
112 # define STONITH_ATTR_HOSTMAP "pcmk_host_map"
113 # define STONITH_ATTR_HOSTLIST "pcmk_host_list"
114 # define STONITH_ATTR_HOSTCHECK "pcmk_host_check"
115 # define STONITH_ATTR_DELAY_MAX "pcmk_delay_max"
116 # define STONITH_ATTR_DELAY_BASE "pcmk_delay_base"
117 # define STONITH_ATTR_ACTION_LIMIT "pcmk_action_limit"
118
119 # define STONITH_ATTR_ACTION_OP "action"
120
121 # define STONITH_OP_EXEC "st_execute"
122 # define STONITH_OP_TIMEOUT_UPDATE "st_timeout_update"
123 # define STONITH_OP_QUERY "st_query"
124 # define STONITH_OP_FENCE "st_fence"
125 # define STONITH_OP_RELAY "st_relay"
126 # define STONITH_OP_CONFIRM "st_confirm"
127 # define STONITH_OP_DEVICE_ADD "st_device_register"
128 # define STONITH_OP_DEVICE_DEL "st_device_remove"
129 # define STONITH_OP_DEVICE_METADATA "st_device_metadata"
130 # define STONITH_OP_FENCE_HISTORY "st_fence_history"
131 # define STONITH_OP_LEVEL_ADD "st_level_add"
132 # define STONITH_OP_LEVEL_DEL "st_level_remove"
133
134 # define stonith_channel "st_command"
135 # define stonith_channel_callback "st_callback"
136
137 # define STONITH_WATCHDOG_AGENT "#watchdog"
138
139 #endif