diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /ctdb/event/event_private.h | |
parent | Initial commit. (diff) | |
download | samba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ctdb/event/event_private.h')
-rw-r--r-- | ctdb/event/event_private.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/ctdb/event/event_private.h b/ctdb/event/event_private.h new file mode 100644 index 0000000..0cc8d80 --- /dev/null +++ b/ctdb/event/event_private.h @@ -0,0 +1,103 @@ +/* + CTDB event daemon + + Copyright (C) Amitay Isaacs 2018 + + 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 3 of the License, or + (at your option) any later version. + + This program 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 program; if not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __CTDB_EVENT_PRIVATE_H__ +#define __CTDB_EVENT_PRIVATE_H__ + +#include <talloc.h> +#include <tevent.h> + +#include "common/run_event.h" +#include "common/sock_daemon.h" + +#include "event/event_protocol.h" + +struct event_config; +struct event_context; + +/* From event/event_cmd.c */ + +struct tevent_req *event_cmd_dispatch_send( + TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct event_context *eventd, + struct ctdb_event_request *request); +bool event_cmd_dispatch_recv(struct tevent_req *req, + int *perr, + TALLOC_CTX *mem_ctx, + struct ctdb_event_reply **reply); + +/* From event/event_config.c */ + +int event_config_init(TALLOC_CTX *mem_ctx, struct event_config **result); + +const char *event_config_log_location(struct event_config *config); +const char *event_config_log_level(struct event_config *config); +const char *event_config_debug_script(struct event_config *config); + +int event_config_reload(struct event_config *config); + +/* From event/event_context.c */ + +int eventd_client_add(struct event_context *eventd, + struct sock_client_context *client); +void eventd_client_del(struct event_context *eventd, + struct sock_client_context *client); +bool eventd_client_exists(struct event_context *eventd, + struct sock_client_context *client); + +int event_context_init(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct event_config *config, + struct event_context **result); + +struct event_config *eventd_config(struct event_context *eventd); +int eventd_run_ctx(struct event_context *eventd, + const char *comp_name, + struct run_event_context **result); + +int eventd_set_event_result(struct event_context *eventd, + const char *comp_name, + const char *event_name, + struct run_event_script_list *script_list); +int eventd_get_event_result(struct event_context *eventd, + const char *comp_name, + const char *event_name, + struct run_event_script_list **result); + +struct ctdb_event_script_list *eventd_script_list( + TALLOC_CTX *mem_ctx, + struct run_event_script_list *script_list); + + +/* From event/event_request.c */ + +struct tevent_req *event_pkt_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct event_context *eventd, + uint8_t *buf, + size_t buflen); + +bool event_pkt_recv(struct tevent_req *req, + int *perr, + TALLOC_CTX *mem_ctx, + uint8_t **buf, + size_t *buflen); + +#endif /* __CTDB_EVENT_PRIVATE_H__ */ |