2 CTDB client code - event daemon
4 Copyright (C) Amitay Isaacs 2017
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef __CTDB_CLIENT_EVENT_H__
21 #define __CTDB_CLIENT_EVENT_H__
23 #include "client/client.h"
25 /* from client/client_event.c */
27 struct ctdb_event_context
;
29 int ctdb_event_init(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
30 const char *sockpath
, struct ctdb_event_context
**out
);
32 void ctdb_event_set_disconnect_callback(struct ctdb_event_context
*eclient
,
33 ctdb_client_callback_func_t callback
,
36 struct tevent_req
*ctdb_event_msg_send(TALLOC_CTX
*mem_ctx
,
37 struct tevent_context
*ev
,
38 struct ctdb_event_context
*eclient
,
39 struct ctdb_event_request
*request
);
41 bool ctdb_event_msg_recv(struct tevent_req
*req
, int *perr
,
43 struct ctdb_event_reply
**reply
);
45 struct tevent_req
*ctdb_event_run_send(TALLOC_CTX
*mem_ctx
,
46 struct tevent_context
*ev
,
47 struct ctdb_event_context
*eclient
,
48 enum ctdb_event event
,
49 uint32_t timeout
, const char *arg_str
);
51 bool ctdb_event_run_recv(struct tevent_req
*req
, int *perr
, int32_t *result
);
53 struct tevent_req
*ctdb_event_status_send(TALLOC_CTX
*mem_ctx
,
54 struct tevent_context
*ev
,
55 struct ctdb_event_context
*eclient
,
56 enum ctdb_event event
,
57 enum ctdb_event_status_state state
);
59 bool ctdb_event_status_recv(struct tevent_req
*req
, int *perr
,
60 int32_t *result
, int *event_result
,
62 struct ctdb_script_list
**script_list
);
64 struct tevent_req
*ctdb_event_script_list_send(
66 struct tevent_context
*ev
,
67 struct ctdb_event_context
*eclient
);
69 bool ctdb_event_script_list_recv(struct tevent_req
*req
, int *perr
,
70 int32_t *result
, TALLOC_CTX
*mem_ctx
,
71 struct ctdb_script_list
**script_list
);
73 struct tevent_req
*ctdb_event_script_enable_send(
75 struct tevent_context
*ev
,
76 struct ctdb_event_context
*eclient
,
77 const char *script_name
);
79 bool ctdb_event_script_enable_recv(struct tevent_req
*req
, int *perr
,
82 struct tevent_req
*ctdb_event_script_disable_send(
84 struct tevent_context
*ev
,
85 struct ctdb_event_context
*eclient
,
86 const char *script_name
);
88 bool ctdb_event_script_disable_recv(struct tevent_req
*req
, int *perr
,
92 #endif /* __CTDB_CLIENT_EVENT_H__ */