1 #ifndef _LIBCTDB_PRIVATE_H
2 #define _LIBCTDB_PRIVATE_H
9 struct message_handler_info;
10 struct ctdb_reply_call;
13 struct ctdb_request *next, *prev;
16 struct ctdb_req_header *hdr;
17 struct ctdb_req_call *call;
18 struct ctdb_req_control *control;
19 struct ctdb_req_message *message;
23 ctdb_getrecmaster_cb getrecmaster;
24 ctdb_getpnn_cb getpnn;
25 void (*register_srvid)(int, struct message_handler_info *);
26 void (*attachdb)(int, uint32_t id, struct ctdb_db *);
27 void (*getdbpath)(int, const char *, void *);
28 void (*nullfunc)(int, struct ctdb_reply_call *, void *);
29 void (*immediate)(struct ctdb_request *, void *);
34 struct ctdb_connection {
35 /* Socket to ctdbd. */
37 /* Currently our failure mode is simple; return -1 from ctdb_service */
39 /* Linked list of pending outgoings. */
40 struct ctdb_request *outq;
41 /* Finished outgoings (awaiting response) */
42 struct ctdb_request *doneq;
43 /* Successful sync requests, waiting for next service. */
44 struct ctdb_request *immediateq;
45 /* Current incoming. */
47 /* Guess at a good reqid to try next. */
49 /* List of messages */
50 struct message_handler_info *message_handlers;
51 /* PNN of this ctdb: valid by the time we do our first db connection. */
56 struct ctdb_request *new_ctdb_request(size_t len);
57 struct ctdb_request *new_ctdb_control_request(struct ctdb_connection *ctdb,
60 const void *extra_data,
62 uint32_t new_reqid(struct ctdb_connection *ctdb);
63 #endif /* _LIBCTDB_PRIVATE_H */