wscript: separate embedded_heimdal from system_heimdal
[Samba.git] / ctdb / event / event_protocol.h
blobe7680fc3cb17af6b7bfa4883170e254e21d827e2
1 /*
2 CTDB event daemon protocol
3 Based on eventd code
5 Copyright (C) Amitay Isaacs 2018
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef __CTDB_EVENT_PROTOCOL_H__
22 #define __CTDB_EVENT_PROTOCOL_H__
24 #define CTDB_EVENT_PROTOCOL_VERSION 1
26 enum ctdb_event_script_action {
27 CTDB_EVENT_SCRIPT_DISABLE = 0,
28 CTDB_EVENT_SCRIPT_ENABLE = 1,
31 enum ctdb_event_command {
32 CTDB_EVENT_CMD_RUN = 1,
33 CTDB_EVENT_CMD_STATUS = 2,
34 CTDB_EVENT_CMD_SCRIPT = 3,
35 CTDB_EVENT_CMD_MAX = 4,
38 struct ctdb_event_script {
39 const char *name;
40 struct timeval begin;
41 struct timeval end;
42 int result;
43 const char *output;
46 struct ctdb_event_script_list {
47 int num_scripts;
48 struct ctdb_event_script *script;
51 #define CTDB_EVENT_RUN_ALL 1
53 struct ctdb_event_request_run {
54 const char *component;
55 const char *event;
56 const char *args;
57 uint32_t timeout;
58 uint32_t flags;
61 struct ctdb_event_request_status {
62 const char *component;
63 const char *event;
66 struct ctdb_event_request_script {
67 const char *component;
68 const char *script;
69 enum ctdb_event_script_action action;
72 struct ctdb_event_reply_status {
73 int32_t summary;
74 struct ctdb_event_script_list *script_list;
77 struct ctdb_event_header {
78 uint32_t length;
79 uint32_t version;
80 uint32_t reqid;
83 struct ctdb_event_request {
84 enum ctdb_event_command cmd;
85 union {
86 struct ctdb_event_request_run *run;
87 struct ctdb_event_request_status *status;
88 struct ctdb_event_request_script *script;
89 } data;
92 struct ctdb_event_reply {
93 enum ctdb_event_command cmd;
94 int32_t result;
95 union {
96 struct ctdb_event_reply_status *status;
97 } data;
100 #endif /* __CTDB_EVENT_PROTOCOL_H__ */