4 Copyright (C) Amitay Isaacs 2018
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_EVENT_PRIVATE_H__
21 #define __CTDB_EVENT_PRIVATE_H__
26 #include "common/run_event.h"
27 #include "common/sock_daemon.h"
29 #include "event/event_protocol.h"
34 /* From event/event_cmd.c */
36 struct tevent_req
*event_cmd_dispatch_send(
38 struct tevent_context
*ev
,
39 struct event_context
*eventd
,
40 struct ctdb_event_request
*request
);
41 bool event_cmd_dispatch_recv(struct tevent_req
*req
,
44 struct ctdb_event_reply
**reply
);
46 /* From event/event_config.c */
48 int event_config_init(TALLOC_CTX
*mem_ctx
, struct event_config
**result
);
50 const char *event_config_log_location(struct event_config
*config
);
51 const char *event_config_log_level(struct event_config
*config
);
52 const char *event_config_debug_script(struct event_config
*config
);
54 int event_config_reload(struct event_config
*config
);
56 /* From event/event_context.c */
58 int eventd_client_add(struct event_context
*eventd
,
59 struct sock_client_context
*client
);
60 void eventd_client_del(struct event_context
*eventd
,
61 struct sock_client_context
*client
);
62 bool eventd_client_exists(struct event_context
*eventd
,
63 struct sock_client_context
*client
);
65 int event_context_init(TALLOC_CTX
*mem_ctx
,
66 struct tevent_context
*ev
,
67 struct event_config
*config
,
68 struct event_context
**result
);
70 struct event_config
*eventd_config(struct event_context
*eventd
);
71 int eventd_run_ctx(struct event_context
*eventd
,
72 const char *comp_name
,
73 struct run_event_context
**result
);
75 int eventd_set_event_result(struct event_context
*eventd
,
76 const char *comp_name
,
77 const char *event_name
,
78 struct run_event_script_list
*script_list
);
79 int eventd_get_event_result(struct event_context
*eventd
,
80 const char *comp_name
,
81 const char *event_name
,
82 struct run_event_script_list
**result
);
84 struct ctdb_event_script_list
*eventd_script_list(
86 struct run_event_script_list
*script_list
);
89 /* From event/event_request.c */
91 struct tevent_req
*event_pkt_send(TALLOC_CTX
*mem_ctx
,
92 struct tevent_context
*ev
,
93 struct event_context
*eventd
,
97 bool event_pkt_recv(struct tevent_req
*req
,
103 #endif /* __CTDB_EVENT_PRIVATE_H__ */