pacemaker  2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
cib_types.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2019 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #ifndef CIB_TYPES__H
11 # define CIB_TYPES__H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
23 # include <glib.h> // gboolean, GList
24 # include <libxml/tree.h> // xmlNode
25 # include <crm/common/ipc.h>
26 # include <crm/common/xml.h>
27 
34 };
35 
36 enum cib_state {
40 };
41 
47 };
48 
50  cib_none = 0x00000000,
51  cib_verbose = 0x00000001,
52  cib_xpath = 0x00000002,
53  cib_multiple = 0x00000004,
54  cib_can_create = 0x00000008,
55  cib_discard_reply = 0x00000010,
56  cib_no_children = 0x00000020,
57  cib_xpath_address = 0x00000040,
58  cib_mixed_update = 0x00000080,
59  cib_scope_local = 0x00000100,
60  cib_dryrun = 0x00000200,
61  cib_sync_call = 0x00001000,
62  cib_no_mtime = 0x00002000,
63  cib_zero_copy = 0x00004000,
64  cib_inhibit_notify = 0x00010000,
65  cib_quorum_override = 0x00100000,
66  cib_inhibit_bcast = 0x01000000,
67  cib_force_diff = 0x10000000
68 };
69 
70 typedef struct cib_s cib_t;
71 
72 typedef struct cib_api_operations_s {
73  int (*signon) (cib_t *cib, const char *name, enum cib_conn_type type);
74  int (*signon_raw) (cib_t *cib, const char *name, enum cib_conn_type type,
75  int *event_fd);
76  int (*signoff) (cib_t *cib);
77  int (*free) (cib_t *cib);
78  int (*set_op_callback) (cib_t *cib, void (*callback) (const xmlNode *msg,
79  int callid, int rc,
80  xmlNode *output));
81  int (*add_notify_callback) (cib_t *cib, const char *event,
82  void (*callback) (const char *event,
83  xmlNode *msg));
84  int (*del_notify_callback) (cib_t *cib, const char *event,
85  void (*callback) (const char *event,
86  xmlNode *msg));
88  void (*dnotify) (gpointer user_data));
89  int (*inputfd) (cib_t *cib);
90  int (*noop) (cib_t *cib, int call_options);
91  int (*ping) (cib_t *cib, xmlNode **output_data, int call_options);
92  int (*query) (cib_t *cib, const char *section, xmlNode **output_data,
93  int call_options);
94  int (*query_from) (cib_t *cib, const char *host, const char *section,
95  xmlNode **output_data, int call_options);
96  int (*is_master) (cib_t *cib);
97  int (*set_master) (cib_t *cib, int call_options);
98  int (*set_slave) (cib_t *cib, int call_options);
99  int (*set_slave_all) (cib_t *cib, int call_options);
100  int (*sync) (cib_t *cib, const char *section, int call_options);
101  int (*sync_from) (cib_t *cib, const char *host, const char *section,
102  int call_options);
103  int (*upgrade) (cib_t *cib, int call_options);
104  int (*bump_epoch) (cib_t *cib, int call_options);
105  int (*create) (cib_t *cib, const char *section, xmlNode *data,
106  int call_options);
107  int (*modify) (cib_t *cib, const char *section, xmlNode *data,
108  int call_options);
109  int (*update) (cib_t *cib, const char *section, xmlNode *data,
110  int call_options);
111  int (*replace) (cib_t *cib, const char *section, xmlNode *data,
112  int call_options);
113  int (*remove) (cib_t *cib, const char *section, xmlNode *data,
114  int call_options);
115  int (*erase) (cib_t *cib, xmlNode **output_data, int call_options);
116  int (*delete_absolute) (cib_t *cib, const char *section, xmlNode *data,
117  int call_options);
118  int (*quit) (cib_t *cib, int call_options);
119  int (*register_notification) (cib_t *cib, const char *callback,
120  int enabled);
121  gboolean (*register_callback) (cib_t *cib, int call_id, int timeout,
122  gboolean only_success, void *user_data,
123  const char *callback_name,
124  void (*callback) (xmlNode*, int, int,
125  xmlNode*, void *));
126  gboolean (*register_callback_full)(cib_t *cib, int call_id, int timeout,
127  gboolean only_success, void *user_data,
128  const char *callback_name,
129  void (*callback)(xmlNode *, int, int,
130  xmlNode *, void *),
131  void (*free_func)(void *));
133 
134 struct cib_s {
138 
139  int call_id;
142  void *delegate_fn;
143 
144  GList *notify_list;
145  void (*op_callback) (const xmlNode *msg, int call_id, int rc,
146  xmlNode *output);
148 };
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 #endif // CIB_TYPES__H
cib_api_operations_t
struct cib_api_operations_s cib_api_operations_t
cib_api_operations_s
Definition: cib_types.h:72
cib_api_operations_s::register_callback_full
gboolean(* register_callback_full)(cib_t *cib, int call_id, int timeout, gboolean only_success, void *user_data, const char *callback_name, void(*callback)(xmlNode *, int, int, xmlNode *, void *), void(*free_func)(void *))
Definition: cib_types.h:126
cib_s::call_timeout
int call_timeout
Definition: cib_types.h:140
cib_no_connection
Definition: cib_types.h:45
cib_xpath
Definition: cib_types.h:52
cib_connected_query
Definition: cib_types.h:38
cib_force_diff
Definition: cib_types.h:67
cib_api_operations_s::sync_from
int(* sync_from)(cib_t *cib, const char *host, const char *section, int call_options)
Definition: cib_types.h:101
cib_mixed_update
Definition: cib_types.h:58
cib_s::cmds
cib_api_operations_t * cmds
Definition: cib_types.h:147
cib_api_operations_s::noop
int(* noop)(cib_t *cib, int call_options)
Definition: cib_types.h:90
cib_remote
Definition: cib_types.h:32
cib_api_operations_s::signoff
int(* signoff)(cib_t *cib)
Definition: cib_types.h:76
cib_api_operations_s::remove
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition: cib_types.h:113
cib_api_operations_s::free
int(* free)(cib_t *cib)
Definition: cib_types.h:77
data
char data[0]
Definition: internal.h:90
cib_conn_type
cib_conn_type
Definition: cib_types.h:42
cib_api_operations_s::del_notify_callback
int(* del_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition: cib_types.h:84
cib_query
Definition: cib_types.h:44
cib_api_operations_s::modify
int(* modify)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition: cib_types.h:107
cib_inhibit_notify
Definition: cib_types.h:64
cib_state
cib_state
Definition: cib_types.h:36
cib_xpath_address
Definition: cib_types.h:57
cib_api_operations_s::register_notification
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition: cib_types.h:119
type
enum crm_ais_msg_types type
Definition: internal.h:83
cib_dryrun
Definition: cib_types.h:60
cib_sync_call
Definition: cib_types.h:61
cib_api_operations_s::set_op_callback
int(* set_op_callback)(cib_t *cib, void(*callback)(const xmlNode *msg, int callid, int rc, xmlNode *output))
Definition: cib_types.h:78
cib_inhibit_bcast
Definition: cib_types.h:66
cib_api_operations_s::sync
int(* sync)(cib_t *cib, const char *section, int call_options)
Definition: cib_types.h:100
xml.h
Wrappers for and extensions to libxml2.
cib_api_operations_s::erase
int(* erase)(cib_t *cib, xmlNode **output_data, int call_options)
Definition: cib_types.h:115
cib_quorum_override
Definition: cib_types.h:65
cib_api_operations_s::upgrade
int(* upgrade)(cib_t *cib, int call_options)
Definition: cib_types.h:103
cib_api_operations_s::update
int(* update)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition: cib_types.h:109
cib_api_operations_s::query_from
int(* query_from)(cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)
Definition: cib_types.h:94
cib_no_children
Definition: cib_types.h:56
cib_s::variant_opaque
void * variant_opaque
Definition: cib_types.h:141
cib_connected_command
Definition: cib_types.h:37
cib_none
Definition: cib_types.h:50
cib_api_operations_s::set_slave_all
int(* set_slave_all)(cib_t *cib, int call_options)
Definition: cib_types.h:99
cib_api_operations_s::create
int(* create)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition: cib_types.h:105
cib_s::notify_list
GList * notify_list
Definition: cib_types.h:144
cib_command_nonblocking
Definition: cib_types.h:46
cib_s::delegate_fn
void * delegate_fn
Definition: cib_types.h:142
cib_s::variant
enum cib_variant variant
Definition: cib_types.h:137
cib_variant
cib_variant
Definition: cib_types.h:28
cib_api_operations_s::query
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
Definition: cib_types.h:92
ipc.h
Wrappers for and extensions to libqb IPC.
cib_api_operations_s::signon_raw
int(* signon_raw)(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Definition: cib_types.h:74
cib_api_operations_s::inputfd
int(* inputfd)(cib_t *cib)
Definition: cib_types.h:89
cib_zero_copy
Definition: cib_types.h:63
cib_database
Definition: cib_types.h:33
cib_api_operations_s::set_connection_dnotify
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition: cib_types.h:87
cib_disconnected
Definition: cib_types.h:39
cib_scope_local
Definition: cib_types.h:59
host
AIS_Host host
Definition: internal.h:84
cib_undefined
Definition: cib_types.h:29
cib_api_operations_s::is_master
int(* is_master)(cib_t *cib)
Definition: cib_types.h:96
cib_s::call_id
int call_id
Definition: cib_types.h:139
cib_api_operations_s::set_slave
int(* set_slave)(cib_t *cib, int call_options)
Definition: cib_types.h:98
cib_api_operations_s::add_notify_callback
int(* add_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition: cib_types.h:81
cib_can_create
Definition: cib_types.h:54
cib_native
Definition: cib_types.h:30
cib_call_options
cib_call_options
Definition: cib_types.h:49
cib_api_operations_s::bump_epoch
int(* bump_epoch)(cib_t *cib, int call_options)
Definition: cib_types.h:104
cib_s::type
enum cib_conn_type type
Definition: cib_types.h:136
cib_s
Definition: cib_types.h:134
cib_s::state
enum cib_state state
Definition: cib_types.h:135
cib_api_operations_s::set_master
int(* set_master)(cib_t *cib, int call_options)
Definition: cib_types.h:97
cib_api_operations_s::delete_absolute
int(* delete_absolute)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition: cib_types.h:116
cib_api_operations_s::ping
int(* ping)(cib_t *cib, xmlNode **output_data, int call_options)
Definition: cib_types.h:91
cib_api_operations_s::signon
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition: cib_types.h:73
cib_verbose
Prefer stderr to logs.
Definition: cib_types.h:51
cib_s::op_callback
void(* op_callback)(const xmlNode *msg, int call_id, int rc, xmlNode *output)
Definition: cib_types.h:145
cib_file
Definition: cib_types.h:31
cib_api_operations_s::quit
int(* quit)(cib_t *cib, int call_options)
Definition: cib_types.h:118
cib_discard_reply
Definition: cib_types.h:55
cib_api_operations_s::register_callback
gboolean(* register_callback)(cib_t *cib, int call_id, int timeout, gboolean only_success, void *user_data, const char *callback_name, void(*callback)(xmlNode *, int, int, xmlNode *, void *))
Definition: cib_types.h:121
cib_api_operations_s::replace
int(* replace)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition: cib_types.h:111
cib_no_mtime
Definition: cib_types.h:62
cib_multiple
Definition: cib_types.h:53
cib_command
Definition: cib_types.h:43