-
Notifications
You must be signed in to change notification settings - Fork 15
/
callbacks.h
82 lines (69 loc) · 2.5 KB
/
callbacks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
*
* 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 2.1 of the License, or (at your option) any later version.
*
* This software 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 library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <crm/crm.h>
#include <crm/cib.h>
#include <crm/common/xml.h>
#include <crm/common/cluster.h>
extern gboolean cib_is_master;
extern GHashTable *client_list;
extern GHashTable *peer_hash;
typedef struct cib_client_s
{
char *id;
char *name;
char *callback_id;
const char *channel_name;
IPC_Channel *channel;
GCHSource *source;
gboolean encrypted;
unsigned long num_calls;
int pre_notify;
int post_notify;
int confirmations;
int replace;
int diffs;
GList *delegated_calls;
} cib_client_t;
typedef struct cib_operation_s
{
const char* operation;
gboolean modifies_cib;
gboolean needs_privileges;
gboolean needs_quorum;
enum cib_errors (*prepare)(xmlNode *, xmlNode**, const char **);
enum cib_errors (*cleanup)(int, xmlNode**, xmlNode**);
enum cib_errors (*fn)(
const char *, int, const char *, xmlNode *,
xmlNode*, xmlNode*, xmlNode**, xmlNode**);
} cib_operation_t;
extern gboolean cib_client_connect(IPC_Channel *channel, gpointer user_data);
extern gboolean cib_null_callback (IPC_Channel *channel, gpointer user_data);
extern gboolean cib_rw_callback (IPC_Channel *channel, gpointer user_data);
extern gboolean cib_ro_callback (IPC_Channel *channel, gpointer user_data);
extern void cib_ha_peer_callback(HA_Message * msg, void* private_data);
extern void cib_peer_callback(xmlNode * msg, void* private_data);
extern void cib_client_status_callback(const char * node, const char * client,
const char * status, void * private);
#if SUPPORT_HEARTBEAT
extern gboolean cib_ccm_dispatch(int fd, gpointer user_data);
extern void cib_ccm_msg_callback(
oc_ed_t event, void *cookie, size_t size, const void *data);
#endif