4 Copyright (C) Andrew Tridgell 2006
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 an installed ctdb remote call
25 struct ctdb_registered_call {
26 struct ctdb_registered_call *next, *prev;
32 this address structure might need to be generalised later for some
41 state associated with one node
44 struct ctdb_context *ctdb;
45 struct ctdb_node *next, *prev;
46 struct ctdb_address address;
47 void *private; /* private to transport */
51 transport specific methods
54 int (*start)(struct ctdb_context *); /* start protocol processing */
55 int (*add_node)(struct ctdb_node *); /* setup a new node */
58 /* main state of the ctdb daemon */
60 struct event_context *ev;
61 struct ctdb_address address;
62 struct ctdb_node *nodes; /* list of nodes in the cluster */
63 struct ctdb_registered_call *calls; /* list of registered calls */
65 struct tdb_context *ltdb;
66 const struct ctdb_methods *methods; /* transport methods */
67 void *private; /* private to transport */
70 #define CTDB_NO_MEMORY(ctdb, p) do { if (!(p)) { \
71 ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
72 return -1; }} while (0)
75 /* internal prototypes */
76 void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...);
77 bool ctdb_same_address(struct ctdb_address *a1, struct ctdb_address *a2);