1 #ifndef _LIBCTDB_PRIVATE_H
2 #define _LIBCTDB_PRIVATE_H
8 #include <ctdb_protocol.h>
10 struct message_handler_info;
11 struct ctdb_reply_call;
14 struct ctdb_connection *ctdb;
15 struct ctdb_request *next, *prev;
20 struct ctdb_req_header *hdr;
21 struct ctdb_req_call *call;
22 struct ctdb_req_control *control;
23 struct ctdb_req_message *message;
26 struct io_elem *reply;
28 ctdb_callback_t callback;
31 /* Extra per-request info. */
32 void (*extra_destructor)(struct ctdb_request *);
36 struct ctdb_connection {
37 /* Socket to ctdbd. */
39 /* Currently our failure mode is simple; return -1 from ctdb_service */
41 /* Linked list of pending outgoings. */
42 struct ctdb_request *outq;
43 /* Finished outgoings (awaiting response) */
44 struct ctdb_request *doneq;
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, ctdb_callback_t, void *);
57 struct ctdb_request *new_ctdb_control_request(struct ctdb_connection *ctdb,
60 const void *extra_data,
62 ctdb_callback_t, void *);
63 uint32_t new_reqid(struct ctdb_connection *ctdb);
65 struct ctdb_reply_control *unpack_reply_control(struct ctdb_request *req,
66 enum ctdb_controls control);
67 void ctdb_cancel_callback(struct ctdb_connection *ctdb,
68 struct ctdb_request *req,
70 #endif /* _LIBCTDB_PRIVATE_H */