This source file includes following definitions.
- cib_config_lookup
1
2
3
4
5
6
7
8
9
10 #ifndef PACEMAKER_BASED__H
11 # define PACEMAKER_BASED__H
12
13 #include <stdio.h>
14 #include <sys/types.h>
15 #include <unistd.h>
16 #include <stdlib.h>
17 #include <glib.h>
18 #include <errno.h>
19 #include <fcntl.h>
20
21 #include <glib.h>
22 #include <libxml/tree.h>
23
24 #include <crm/crm.h>
25 #include <crm/cib.h>
26 #include <crm/common/xml.h>
27 #include <crm/cluster.h>
28 #include <crm/common/ipc_internal.h>
29 #include <crm/common/mainloop.h>
30 #include <crm/cib/internal.h>
31
32 #include "based_transaction.h"
33
34 #include <gnutls/gnutls.h>
35
36 #define OUR_NODENAME (stand_alone? "localhost" : crm_cluster->priv->node_name)
37
38
39 enum cib_client_flags {
40
41 cib_notify_pre = (UINT64_C(1) << 0),
42 cib_notify_post = (UINT64_C(1) << 1),
43 cib_notify_confirm = (UINT64_C(1) << 3),
44 cib_notify_diff = (UINT64_C(1) << 4),
45
46
47 cib_is_daemon = (UINT64_C(1) << 12),
48 };
49
50 extern bool based_is_primary;
51 extern GHashTable *config_hash;
52 extern xmlNode *the_cib;
53 extern crm_trigger_t *cib_writer;
54 extern gboolean cib_writes_enabled;
55
56 extern GMainLoop *mainloop;
57 extern pcmk_cluster_t *crm_cluster;
58 extern gboolean stand_alone;
59 extern gboolean cib_shutdown_flag;
60 extern gchar *cib_root;
61 extern int cib_status;
62
63 extern struct qb_ipcs_service_handlers ipc_ro_callbacks;
64 extern struct qb_ipcs_service_handlers ipc_rw_callbacks;
65 extern qb_ipcs_service_t *ipcs_ro;
66 extern qb_ipcs_service_t *ipcs_rw;
67 extern qb_ipcs_service_t *ipcs_shm;
68
69 void cib_peer_callback(xmlNode *msg, void *private_data);
70 void cib_common_callback_worker(uint32_t id, uint32_t flags,
71 xmlNode *op_request, pcmk__client_t *cib_client,
72 gboolean privileged);
73 int cib_process_request(xmlNode *request, gboolean privileged,
74 const pcmk__client_t *cib_client);
75 void cib_shutdown(int nsig);
76 void terminate_cib(const char *caller, int fast);
77
78 gboolean uninitializeCib(void);
79 xmlNode *readCibXmlFile(const char *dir, const char *file,
80 gboolean discard_status);
81 int activateCibXml(xmlNode *doc, gboolean to_disk, const char *op);
82
83 int cib_process_shutdown_req(const char *op, int options, const char *section,
84 xmlNode *req, xmlNode *input,
85 xmlNode *existing_cib, xmlNode **result_cib,
86 xmlNode **answer);
87 int cib_process_noop(const char *op, int options, const char *section,
88 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
89 xmlNode **result_cib, xmlNode **answer);
90 int cib_process_ping(const char *op, int options, const char *section,
91 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
92 xmlNode **result_cib, xmlNode **answer);
93 int cib_process_readwrite(const char *op, int options, const char *section,
94 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
95 xmlNode **result_cib, xmlNode **answer);
96 int cib_process_replace_svr(const char *op, int options, const char *section,
97 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
98 xmlNode **result_cib, xmlNode **answer);
99 int cib_server_process_diff(const char *op, int options, const char *section,
100 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
101 xmlNode **result_cib, xmlNode **answer);
102 int cib_process_sync(const char *op, int options, const char *section,
103 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
104 xmlNode **result_cib, xmlNode **answer);
105 int cib_process_sync_one(const char *op, int options, const char *section,
106 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
107 xmlNode **result_cib, xmlNode **answer);
108 int cib_process_delete_absolute(const char *op, int options,
109 const char *section, xmlNode *req,
110 xmlNode *input, xmlNode *existing_cib,
111 xmlNode **result_cib, xmlNode **answer);
112 int cib_process_upgrade_server(const char *op, int options, const char *section,
113 xmlNode *req, xmlNode *input,
114 xmlNode *existing_cib, xmlNode **result_cib,
115 xmlNode **answer);
116 int cib_process_commit_transaction(const char *op, int options,
117 const char *section, xmlNode *req,
118 xmlNode *input, xmlNode *existing_cib,
119 xmlNode **result_cib, xmlNode **answer);
120 int cib_process_schemas(const char *op, int options, const char *section,
121 xmlNode *req, xmlNode *input, xmlNode *existing_cib,
122 xmlNode **result_cib, xmlNode **answer);
123
124 void send_sync_request(const char *host);
125 int sync_our_cib(xmlNode *request, gboolean all);
126
127 cib__op_fn_t based_get_op_function(const cib__operation_t *operation);
128 void cib_diff_notify(const char *op, int result, const char *call_id,
129 const char *client_id, const char *client_name,
130 const char *origin, xmlNode *update, xmlNode *diff);
131
132 static inline const char *
133 cib_config_lookup(const char *opt)
134 {
135 return g_hash_table_lookup(config_hash, opt);
136 }
137
138 #endif