~ubuntu-branches/ubuntu/utopic/pacemaker/utopic-proposed

« back to all changes in this revision

Viewing changes to cib/callbacks.h

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2013-07-16 16:40:24 UTC
  • mfrom: (1.1.11) (2.2.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130716164024-lvwrf4xivk1wdr3c
Tags: 1.1.9+git20130321-1ubuntu1
* Resync from debian expiremental.
* debian/control:
  - Use lower version for Build-Depends on libcorosync-dev
    and libqb-dev.
  - Build-Depends on libcfg-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
 
1
/*
2
2
 * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3
 
 * 
 
3
 *
4
4
 * This program is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU General Public
6
6
 * License as published by the Free Software Foundation; either
7
7
 * version 2 of the License, or (at your option) any later version.
8
 
 * 
 
8
 *
9
9
 * This software is distributed in the hope that it will be useful,
10
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
12
 * General Public License for more details.
13
 
 * 
 
13
 *
14
14
 * You should have received a copy of the GNU General Public
15
15
 * License along with this library; if not, write to the Free Software
16
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
23
#include <crm/crm.h>
24
24
#include <crm/cib.h>
25
25
#include <crm/common/xml.h>
26
 
#include <crm/common/cluster.h>
 
26
#include <crm/cluster.h>
 
27
#include <crm/common/ipcs.h>
 
28
#include <crm/common/mainloop.h>
 
29
#ifdef HAVE_GNUTLS_GNUTLS_H
 
30
#  undef KEYFILE
 
31
#  include <gnutls/gnutls.h>
 
32
#endif
27
33
 
28
34
extern gboolean cib_is_master;
29
 
extern GHashTable *client_list;
30
35
extern GHashTable *peer_hash;
31
36
extern GHashTable *config_hash;
32
37
 
33
 
typedef struct cib_client_s {
34
 
    char *id;
35
 
    char *name;
36
 
    char *callback_id;
37
 
    char *user;
38
 
 
39
 
    const char *channel_name;
40
 
 
41
 
    IPC_Channel *channel;
42
 
    GCHSource *source;
43
 
    gboolean encrypted;
44
 
    unsigned long num_calls;
45
 
 
46
 
    int pre_notify;
47
 
    int post_notify;
48
 
    int confirmations;
49
 
    int replace;
50
 
    int diffs;
51
 
 
52
 
    GList *delegated_calls;
53
 
} cib_client_t;
 
38
/* *INDENT-OFF* */
 
39
enum cib_notifications
 
40
{
 
41
    cib_notify_pre     = 0x0001,
 
42
    cib_notify_post    = 0x0002,
 
43
    cib_notify_replace = 0x0004,
 
44
    cib_notify_confirm = 0x0008,
 
45
    cib_notify_diff    = 0x0010,
 
46
};
 
47
/* *INDENT-ON* */
54
48
 
55
49
typedef struct cib_operation_s {
56
50
    const char *operation;
57
51
    gboolean modifies_cib;
58
52
    gboolean needs_privileges;
59
53
    gboolean needs_quorum;
60
 
    enum cib_errors (*prepare) (xmlNode *, xmlNode **, const char **);
61
 
    enum cib_errors (*cleanup) (int, xmlNode **, xmlNode **);
62
 
    enum cib_errors (*fn) (const char *, int, const char *, xmlNode *,
63
 
                           xmlNode *, xmlNode *, xmlNode **, xmlNode **);
 
54
    int (*prepare) (xmlNode *, xmlNode **, const char **);
 
55
    int (*cleanup) (int, xmlNode **, xmlNode **);
 
56
    int (*fn) (const char *, int, const char *, xmlNode *,
 
57
               xmlNode *, xmlNode *, xmlNode **, xmlNode **);
64
58
} cib_operation_t;
65
59
 
66
 
extern gboolean cib_client_connect(IPC_Channel * channel, gpointer user_data);
67
 
extern gboolean cib_null_callback(IPC_Channel * channel, gpointer user_data);
68
 
extern gboolean cib_rw_callback(IPC_Channel * channel, gpointer user_data);
69
 
extern gboolean cib_ro_callback(IPC_Channel * channel, gpointer user_data);
 
60
extern struct qb_ipcs_service_handlers ipc_ro_callbacks;
 
61
extern struct qb_ipcs_service_handlers ipc_rw_callbacks;
 
62
extern qb_ipcs_service_t *ipcs_ro;
 
63
extern qb_ipcs_service_t *ipcs_rw;
 
64
extern qb_ipcs_service_t *ipcs_shm;
70
65
 
71
 
extern void cib_ha_peer_callback(HA_Message * msg, void *private_data);
72
66
extern void cib_peer_callback(xmlNode * msg, void *private_data);
73
67
extern void cib_client_status_callback(const char *node, const char *client,
74
68
                                       const char *status, void *private);
 
69
extern void cib_common_callback_worker(uint32_t id, uint32_t flags, xmlNode * op_request,
 
70
                                       crm_client_t * cib_client, gboolean privileged);
 
71
 
 
72
void cib_shutdown(int nsig);
 
73
void initiate_exit(void);
 
74
void terminate_cib(const char *caller, gboolean fast);
75
75
 
76
76
#if SUPPORT_HEARTBEAT
77
 
extern gboolean cib_ccm_dispatch(int fd, gpointer user_data);
78
 
 
 
77
extern void cib_ha_peer_callback(HA_Message * msg, void *private_data);
 
78
extern int cib_ccm_dispatch(gpointer user_data);
79
79
extern void cib_ccm_msg_callback(oc_ed_t event, void *cookie, size_t size, const void *data);
80
80
#endif