diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 123294ff782..7ae2ec40139 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -104,6 +104,10 @@ int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid, void *private_data); int ctdbd_probe(const char *sockname, int timeout); +struct ctdb_req_header; +void ctdbd_prep_hdr_next_reqid( + struct ctdbd_connection *conn, struct ctdb_req_header *hdr); + struct tevent_req *ctdbd_parse_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct ctdbd_connection *conn, diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 35e5e34f49c..20f47aae173 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -1839,6 +1839,17 @@ static int ctdbd_connection_destructor(struct ctdbd_connection *c) return 0; } +void ctdbd_prep_hdr_next_reqid( + struct ctdbd_connection *conn, struct ctdb_req_header *hdr) +{ + *hdr = (struct ctdb_req_header) { + .ctdb_magic = CTDB_MAGIC, + .ctdb_version = CTDB_PROTOCOL, + .reqid = ctdbd_next_reqid(conn), + .destnode = CTDB_CURRENT_NODE, + }; +} + struct ctdbd_parse_state { struct tevent_context *ev; struct ctdbd_connection *conn;