2 Unix SMB/CIFS implementation.
3 Samba internal messaging functions
4 Copyright (C) Andrew Tridgell 2000
5 Copyright (C) 2001 by Martin Pool
6 Copyright (C) 2002 by Jeremy Allison
7 Copyright (C) 2007 by Volker Lendecke
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 @defgroup messages Internal messaging framework
28 @brief Module for internal messaging between Samba daemons.
30 The idea is that if a part of Samba wants to do communication with
31 another Samba process then it will do a message_register() of a
32 dispatch function, and use message_send_pid() to send messages to
35 The dispatch function is given the pid of the sender, and it can
36 use that to reply by message_send_pid(). See ping_message() for a
39 @caution Dispatch functions must be able to cope with incoming
40 messages on an *odd* byte boundary.
42 This system doesn't have any inherent size limitations but is not
43 very efficient for large messages or when messages are sent in very
49 #include "dbwrap/dbwrap.h"
52 #include "lib/util/tevent_unix.h"
53 #include "lib/background.h"
54 #include "lib/messages_dgm.h"
55 #include "lib/util/iov_buf.h"
56 #include "lib/util/server_id_db.h"
57 #include "lib/messages_dgm_ref.h"
58 #include "lib/messages_util.h"
60 struct messaging_callback {
61 struct messaging_callback *prev, *next;
63 void (*fn)(struct messaging_context *msg, void *private_data,
65 struct server_id server_id, DATA_BLOB *data);
69 struct messaging_context {
71 struct tevent_context *event_ctx;
72 struct messaging_callback *callbacks;
74 struct tevent_req **new_waiters;
75 unsigned num_new_waiters;
77 struct tevent_req **waiters;
81 struct messaging_backend *remote;
83 struct server_id_db *names_db;
86 static void messaging_dispatch_rec(struct messaging_context *msg_ctx,
87 struct messaging_rec *rec);
89 /****************************************************************************
90 A useful function for testing the message system.
91 ****************************************************************************/
93 static void ping_message(struct messaging_context *msg_ctx,
99 struct server_id_buf idbuf;
101 DEBUG(1, ("INFO: Received PING message from PID %s [%.*s]\n",
102 server_id_str_buf(src, &idbuf), (int)data->length,
103 data->data ? (char *)data->data : ""));
105 messaging_send(msg_ctx, src, MSG_PONG, data);
108 static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
109 int *fds, size_t num_fds,
112 struct messaging_context *msg_ctx = talloc_get_type_abort(
113 private_data, struct messaging_context);
114 struct server_id_buf idbuf;
115 struct messaging_rec rec;
116 int64_t fds64[MIN(num_fds, INT8_MAX)];
119 if (msg_len < MESSAGE_HDR_LENGTH) {
120 DEBUG(1, ("message too short: %u\n", (unsigned)msg_len));
124 if (num_fds > INT8_MAX) {
125 DEBUG(1, ("too many fds: %u\n", (unsigned)num_fds));
130 * "consume" the fds by copying them and setting
131 * the original variable to -1
133 for (i=0; i < num_fds; i++) {
138 rec = (struct messaging_rec) {
139 .msg_version = MESSAGE_VERSION,
140 .buf.data = discard_const_p(uint8_t, msg) + MESSAGE_HDR_LENGTH,
141 .buf.length = msg_len - MESSAGE_HDR_LENGTH,
146 message_hdr_get(&rec.msg_type, &rec.src, &rec.dest, msg);
148 DEBUG(10, ("%s: Received message 0x%x len %u (num_fds:%u) from %s\n",
149 __func__, (unsigned)rec.msg_type,
150 (unsigned)rec.buf.length,
152 server_id_str_buf(rec.src, &idbuf)));
154 messaging_dispatch_rec(msg_ctx, &rec);
158 for (i=0; i < num_fds; i++) {
163 static int messaging_context_destructor(struct messaging_context *ctx)
167 for (i=0; i<ctx->num_new_waiters; i++) {
168 if (ctx->new_waiters[i] != NULL) {
169 tevent_req_set_cleanup_fn(ctx->new_waiters[i], NULL);
170 ctx->new_waiters[i] = NULL;
173 for (i=0; i<ctx->num_waiters; i++) {
174 if (ctx->waiters[i] != NULL) {
175 tevent_req_set_cleanup_fn(ctx->waiters[i], NULL);
176 ctx->waiters[i] = NULL;
183 static const char *private_path(const char *name)
185 return talloc_asprintf(talloc_tos(), "%s/%s", lp_private_dir(), name);
188 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
189 struct tevent_context *ev)
191 struct messaging_context *ctx;
193 const char *lck_path;
194 const char *priv_path;
197 if (!(ctx = talloc_zero(mem_ctx, struct messaging_context))) {
201 ctx->id = (struct server_id) {
202 .pid = getpid(), .vnn = NONCLUSTER_VNN
209 lck_path = lock_path("msg.lock");
210 if (lck_path == NULL) {
215 ok = directory_create_or_exist_strict(lck_path, sec_initial_uid(),
218 DEBUG(10, ("%s: Could not create lock directory: %s\n",
219 __func__, strerror(errno)));
224 priv_path = private_path("msg.sock");
225 if (priv_path == NULL) {
230 ok = directory_create_or_exist_strict(priv_path, sec_initial_uid(),
233 DEBUG(10, ("%s: Could not create msg directory: %s\n",
234 __func__, strerror(errno)));
239 ctx->msg_dgm_ref = messaging_dgm_ref(
240 ctx, ctx->event_ctx, &ctx->id.unique_id,
241 priv_path, lck_path, messaging_recv_cb, ctx, &ret);
243 if (ctx->msg_dgm_ref == NULL) {
244 DEBUG(2, ("messaging_dgm_ref failed: %s\n", strerror(ret)));
249 talloc_set_destructor(ctx, messaging_context_destructor);
251 if (lp_clustering()) {
252 ret = messaging_ctdbd_init(ctx, ctx, &ctx->remote);
255 DEBUG(2, ("messaging_ctdbd_init failed: %s\n",
261 ctx->id.vnn = get_my_vnn();
263 ctx->names_db = server_id_db_init(
264 ctx, ctx->id, lp_lock_directory(), 0,
265 TDB_INCOMPATIBLE_HASH|TDB_CLEAR_IF_FIRST);
266 if (ctx->names_db == NULL) {
267 DEBUG(10, ("%s: server_id_db_init failed\n", __func__));
272 messaging_register(ctx, NULL, MSG_PING, ping_message);
274 /* Register some debugging related messages */
276 register_msg_pool_usage(ctx);
277 register_dmalloc_msgs(ctx);
278 debug_register_msgs(ctx);
281 struct server_id_buf tmp;
282 DBG_DEBUG("my id: %s\n", server_id_str_buf(ctx->id, &tmp));
288 struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
294 * re-init after a fork
296 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
301 TALLOC_FREE(msg_ctx->msg_dgm_ref);
303 msg_ctx->id = (struct server_id) {
304 .pid = getpid(), .vnn = msg_ctx->id.vnn
307 lck_path = lock_path("msg.lock");
308 if (lck_path == NULL) {
309 return NT_STATUS_NO_MEMORY;
312 msg_ctx->msg_dgm_ref = messaging_dgm_ref(
313 msg_ctx, msg_ctx->event_ctx, &msg_ctx->id.unique_id,
314 private_path("msg.sock"), lck_path,
315 messaging_recv_cb, msg_ctx, &ret);
317 if (msg_ctx->msg_dgm_ref == NULL) {
318 DEBUG(2, ("messaging_dgm_ref failed: %s\n", strerror(ret)));
319 return map_nt_error_from_unix(ret);
322 if (lp_clustering()) {
323 ret = messaging_ctdbd_reinit(msg_ctx, msg_ctx,
327 DEBUG(1, ("messaging_ctdbd_init failed: %s\n",
329 return map_nt_error_from_unix(ret);
333 server_id_db_reinit(msg_ctx->names_db, msg_ctx->id);
340 * Register a dispatch function for a particular message type. Allow multiple
343 NTSTATUS messaging_register(struct messaging_context *msg_ctx,
346 void (*fn)(struct messaging_context *msg,
349 struct server_id server_id,
352 struct messaging_callback *cb;
354 DEBUG(5, ("Registering messaging pointer for type %u - "
356 (unsigned)msg_type, private_data));
359 * Only one callback per type
362 for (cb = msg_ctx->callbacks; cb != NULL; cb = cb->next) {
363 /* we allow a second registration of the same message
364 type if it has a different private pointer. This is
365 needed in, for example, the internal notify code,
366 which creates a new notify context for each tree
367 connect, and expects to receive messages to each of
369 if (cb->msg_type == msg_type && private_data == cb->private_data) {
370 DEBUG(5,("Overriding messaging pointer for type %u - private_data=%p\n",
371 (unsigned)msg_type, private_data));
373 cb->private_data = private_data;
378 if (!(cb = talloc(msg_ctx, struct messaging_callback))) {
379 return NT_STATUS_NO_MEMORY;
382 cb->msg_type = msg_type;
384 cb->private_data = private_data;
386 DLIST_ADD(msg_ctx->callbacks, cb);
391 De-register the function for a particular message type.
393 void messaging_deregister(struct messaging_context *ctx, uint32_t msg_type,
396 struct messaging_callback *cb, *next;
398 for (cb = ctx->callbacks; cb; cb = next) {
400 if ((cb->msg_type == msg_type)
401 && (cb->private_data == private_data)) {
402 DEBUG(5,("Deregistering messaging pointer for type %u - private_data=%p\n",
403 (unsigned)msg_type, private_data));
404 DLIST_REMOVE(ctx->callbacks, cb);
411 Send a message to a particular server
413 NTSTATUS messaging_send(struct messaging_context *msg_ctx,
414 struct server_id server, uint32_t msg_type,
415 const DATA_BLOB *data)
417 struct iovec iov = {0};
420 iov.iov_base = data->data;
421 iov.iov_len = data->length;
424 return messaging_send_iov(msg_ctx, server, msg_type, &iov, 1, NULL, 0);
427 NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx,
428 struct server_id server, uint32_t msg_type,
429 const uint8_t *buf, size_t len)
431 DATA_BLOB blob = data_blob_const(buf, len);
432 return messaging_send(msg_ctx, server, msg_type, &blob);
435 int messaging_send_iov_from(struct messaging_context *msg_ctx,
436 struct server_id src, struct server_id dst,
438 const struct iovec *iov, int iovlen,
439 const int *fds, size_t num_fds)
442 uint8_t hdr[MESSAGE_HDR_LENGTH];
443 struct iovec iov2[iovlen+1];
445 if (server_id_is_disconnected(&dst)) {
449 if (num_fds > INT8_MAX) {
453 if (dst.vnn != msg_ctx->id.vnn) {
458 ret = msg_ctx->remote->send_fn(src, dst,
459 msg_type, iov, iovlen,
465 message_hdr_put(hdr, msg_type, src, dst);
466 iov2[0] = (struct iovec){ .iov_base = hdr, .iov_len = sizeof(hdr) };
467 memcpy(&iov2[1], iov, iovlen * sizeof(*iov));
470 ret = messaging_dgm_send(dst.pid, iov2, iovlen+1, fds, num_fds);
476 NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx,
477 struct server_id dst, uint32_t msg_type,
478 const struct iovec *iov, int iovlen,
479 const int *fds, size_t num_fds)
483 ret = messaging_send_iov_from(msg_ctx, msg_ctx->id, dst, msg_type,
484 iov, iovlen, fds, num_fds);
486 return map_nt_error_from_unix(ret);
491 static struct messaging_rec *messaging_rec_dup(TALLOC_CTX *mem_ctx,
492 struct messaging_rec *rec)
494 struct messaging_rec *result;
495 size_t fds_size = sizeof(int64_t) * rec->num_fds;
497 result = talloc_pooled_object(mem_ctx, struct messaging_rec, 2,
498 rec->buf.length + fds_size);
499 if (result == NULL) {
504 /* Doesn't fail, see talloc_pooled_object */
506 result->buf.data = talloc_memdup(result, rec->buf.data,
510 if (result->num_fds > 0) {
511 result->fds = talloc_memdup(result, rec->fds, fds_size);
517 struct messaging_filtered_read_state {
518 struct tevent_context *ev;
519 struct messaging_context *msg_ctx;
522 bool (*filter)(struct messaging_rec *rec, void *private_data);
525 struct messaging_rec *rec;
528 static void messaging_filtered_read_cleanup(struct tevent_req *req,
529 enum tevent_req_state req_state);
531 struct tevent_req *messaging_filtered_read_send(
532 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
533 struct messaging_context *msg_ctx,
534 bool (*filter)(struct messaging_rec *rec, void *private_data),
537 struct tevent_req *req;
538 struct messaging_filtered_read_state *state;
539 size_t new_waiters_len;
541 req = tevent_req_create(mem_ctx, &state,
542 struct messaging_filtered_read_state);
547 state->msg_ctx = msg_ctx;
548 state->filter = filter;
549 state->private_data = private_data;
552 * We have to defer the callback here, as we might be called from
553 * within a different tevent_context than state->ev
555 tevent_req_defer_callback(req, state->ev);
557 state->tevent_handle = messaging_dgm_register_tevent_context(
559 if (tevent_req_nomem(state->tevent_handle, req)) {
560 return tevent_req_post(req, ev);
564 * We add ourselves to the "new_waiters" array, not the "waiters"
565 * array. If we are called from within messaging_read_done,
566 * messaging_dispatch_rec will be in an active for-loop on
567 * "waiters". We must be careful not to mess with this array, because
568 * it could mean that a single event is being delivered twice.
571 new_waiters_len = talloc_array_length(msg_ctx->new_waiters);
573 if (new_waiters_len == msg_ctx->num_new_waiters) {
574 struct tevent_req **tmp;
576 tmp = talloc_realloc(msg_ctx, msg_ctx->new_waiters,
577 struct tevent_req *, new_waiters_len+1);
578 if (tevent_req_nomem(tmp, req)) {
579 return tevent_req_post(req, ev);
581 msg_ctx->new_waiters = tmp;
584 msg_ctx->new_waiters[msg_ctx->num_new_waiters] = req;
585 msg_ctx->num_new_waiters += 1;
586 tevent_req_set_cleanup_fn(req, messaging_filtered_read_cleanup);
591 static void messaging_filtered_read_cleanup(struct tevent_req *req,
592 enum tevent_req_state req_state)
594 struct messaging_filtered_read_state *state = tevent_req_data(
595 req, struct messaging_filtered_read_state);
596 struct messaging_context *msg_ctx = state->msg_ctx;
599 tevent_req_set_cleanup_fn(req, NULL);
601 TALLOC_FREE(state->tevent_handle);
604 * Just set the [new_]waiters entry to NULL, be careful not to mess
605 * with the other "waiters" array contents. We are often called from
606 * within "messaging_dispatch_rec", which loops over
607 * "waiters". Messing with the "waiters" array will mess up that
611 for (i=0; i<msg_ctx->num_waiters; i++) {
612 if (msg_ctx->waiters[i] == req) {
613 msg_ctx->waiters[i] = NULL;
618 for (i=0; i<msg_ctx->num_new_waiters; i++) {
619 if (msg_ctx->new_waiters[i] == req) {
620 msg_ctx->new_waiters[i] = NULL;
626 static void messaging_filtered_read_done(struct tevent_req *req,
627 struct messaging_rec *rec)
629 struct messaging_filtered_read_state *state = tevent_req_data(
630 req, struct messaging_filtered_read_state);
632 state->rec = messaging_rec_dup(state, rec);
633 if (tevent_req_nomem(state->rec, req)) {
636 tevent_req_done(req);
639 int messaging_filtered_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
640 struct messaging_rec **presult)
642 struct messaging_filtered_read_state *state = tevent_req_data(
643 req, struct messaging_filtered_read_state);
646 if (tevent_req_is_unix_error(req, &err)) {
647 tevent_req_received(req);
650 *presult = talloc_move(mem_ctx, &state->rec);
654 struct messaging_read_state {
656 struct messaging_rec *rec;
659 static bool messaging_read_filter(struct messaging_rec *rec,
661 static void messaging_read_done(struct tevent_req *subreq);
663 struct tevent_req *messaging_read_send(TALLOC_CTX *mem_ctx,
664 struct tevent_context *ev,
665 struct messaging_context *msg,
668 struct tevent_req *req, *subreq;
669 struct messaging_read_state *state;
671 req = tevent_req_create(mem_ctx, &state,
672 struct messaging_read_state);
676 state->msg_type = msg_type;
678 subreq = messaging_filtered_read_send(state, ev, msg,
679 messaging_read_filter, state);
680 if (tevent_req_nomem(subreq, req)) {
681 return tevent_req_post(req, ev);
683 tevent_req_set_callback(subreq, messaging_read_done, req);
687 static bool messaging_read_filter(struct messaging_rec *rec,
690 struct messaging_read_state *state = talloc_get_type_abort(
691 private_data, struct messaging_read_state);
693 if (rec->num_fds != 0) {
697 return rec->msg_type == state->msg_type;
700 static void messaging_read_done(struct tevent_req *subreq)
702 struct tevent_req *req = tevent_req_callback_data(
703 subreq, struct tevent_req);
704 struct messaging_read_state *state = tevent_req_data(
705 req, struct messaging_read_state);
708 ret = messaging_filtered_read_recv(subreq, state, &state->rec);
710 if (tevent_req_error(req, ret)) {
713 tevent_req_done(req);
716 int messaging_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
717 struct messaging_rec **presult)
719 struct messaging_read_state *state = tevent_req_data(
720 req, struct messaging_read_state);
723 if (tevent_req_is_unix_error(req, &err)) {
726 if (presult != NULL) {
727 *presult = talloc_move(mem_ctx, &state->rec);
732 struct messaging_handler_state {
733 struct tevent_context *ev;
734 struct messaging_context *msg_ctx;
736 bool (*handler)(struct messaging_context *msg_ctx,
737 struct messaging_rec **rec, void *private_data);
741 static void messaging_handler_got_msg(struct tevent_req *subreq);
743 struct tevent_req *messaging_handler_send(
744 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
745 struct messaging_context *msg_ctx, uint32_t msg_type,
746 bool (*handler)(struct messaging_context *msg_ctx,
747 struct messaging_rec **rec, void *private_data),
750 struct tevent_req *req, *subreq;
751 struct messaging_handler_state *state;
753 req = tevent_req_create(mem_ctx, &state,
754 struct messaging_handler_state);
759 state->msg_ctx = msg_ctx;
760 state->msg_type = msg_type;
761 state->handler = handler;
762 state->private_data = private_data;
764 subreq = messaging_read_send(state, state->ev, state->msg_ctx,
766 if (tevent_req_nomem(subreq, req)) {
767 return tevent_req_post(req, ev);
769 tevent_req_set_callback(subreq, messaging_handler_got_msg, req);
773 static void messaging_handler_got_msg(struct tevent_req *subreq)
775 struct tevent_req *req = tevent_req_callback_data(
776 subreq, struct tevent_req);
777 struct messaging_handler_state *state = tevent_req_data(
778 req, struct messaging_handler_state);
779 struct messaging_rec *rec;
783 ret = messaging_read_recv(subreq, state, &rec);
785 if (tevent_req_error(req, ret)) {
789 subreq = messaging_read_send(state, state->ev, state->msg_ctx,
791 if (tevent_req_nomem(subreq, req)) {
794 tevent_req_set_callback(subreq, messaging_handler_got_msg, req);
796 ok = state->handler(state->msg_ctx, &rec, state->private_data);
805 tevent_req_done(req);
808 int messaging_handler_recv(struct tevent_req *req)
810 return tevent_req_simple_recv_unix(req);
813 static bool messaging_append_new_waiters(struct messaging_context *msg_ctx)
815 if (msg_ctx->num_new_waiters == 0) {
819 if (talloc_array_length(msg_ctx->waiters) <
820 (msg_ctx->num_waiters + msg_ctx->num_new_waiters)) {
821 struct tevent_req **tmp;
822 tmp = talloc_realloc(
823 msg_ctx, msg_ctx->waiters, struct tevent_req *,
824 msg_ctx->num_waiters + msg_ctx->num_new_waiters);
826 DEBUG(1, ("%s: talloc failed\n", __func__));
829 msg_ctx->waiters = tmp;
832 memcpy(&msg_ctx->waiters[msg_ctx->num_waiters], msg_ctx->new_waiters,
833 sizeof(struct tevent_req *) * msg_ctx->num_new_waiters);
835 msg_ctx->num_waiters += msg_ctx->num_new_waiters;
836 msg_ctx->num_new_waiters = 0;
842 Dispatch one messaging_rec
844 static void messaging_dispatch_rec(struct messaging_context *msg_ctx,
845 struct messaging_rec *rec)
847 struct messaging_callback *cb, *next;
851 for (cb = msg_ctx->callbacks; cb != NULL; cb = next) {
853 if (cb->msg_type != rec->msg_type) {
858 * the old style callbacks don't support fd passing
860 for (j=0; j < rec->num_fds; j++) {
861 int fd = rec->fds[j];
867 cb->fn(msg_ctx, cb->private_data, rec->msg_type,
868 rec->src, &rec->buf);
871 * we continue looking for matching messages after finding
872 * one. This matters for subsystems like the internal notify
873 * code which register more than one handler for the same
878 if (!messaging_append_new_waiters(msg_ctx)) {
879 for (j=0; j < rec->num_fds; j++) {
880 int fd = rec->fds[j];
889 while (i < msg_ctx->num_waiters) {
890 struct tevent_req *req;
891 struct messaging_filtered_read_state *state;
893 req = msg_ctx->waiters[i];
896 * This got cleaned up. In the meantime,
897 * move everything down one. We need
898 * to keep the order of waiters, as
899 * other code may depend on this.
901 if (i < msg_ctx->num_waiters - 1) {
902 memmove(&msg_ctx->waiters[i],
903 &msg_ctx->waiters[i+1],
904 sizeof(struct tevent_req *) *
905 (msg_ctx->num_waiters - i - 1));
907 msg_ctx->num_waiters -= 1;
911 state = tevent_req_data(
912 req, struct messaging_filtered_read_state);
913 if (state->filter(rec, state->private_data)) {
914 messaging_filtered_read_done(req, rec);
917 * Only the first one gets the fd-array
927 * If the fd-array isn't used, just close it.
929 for (j=0; j < rec->num_fds; j++) {
930 int fd = rec->fds[j];
937 static int mess_parent_dgm_cleanup(void *private_data);
938 static void mess_parent_dgm_cleanup_done(struct tevent_req *req);
940 bool messaging_parent_dgm_cleanup_init(struct messaging_context *msg)
942 struct tevent_req *req;
944 req = background_job_send(
945 msg, msg->event_ctx, msg, NULL, 0,
946 lp_parm_int(-1, "messaging", "messaging dgm cleanup interval",
948 mess_parent_dgm_cleanup, msg);
952 tevent_req_set_callback(req, mess_parent_dgm_cleanup_done, msg);
956 static int mess_parent_dgm_cleanup(void *private_data)
960 ret = messaging_dgm_wipe();
961 DEBUG(10, ("messaging_dgm_wipe returned %s\n",
962 ret ? strerror(ret) : "ok"));
963 return lp_parm_int(-1, "messaging", "messaging dgm cleanup interval",
967 static void mess_parent_dgm_cleanup_done(struct tevent_req *req)
969 struct messaging_context *msg = tevent_req_callback_data(
970 req, struct messaging_context);
973 status = background_job_recv(req);
975 DEBUG(1, ("messaging dgm cleanup job ended with %s\n",
978 req = background_job_send(
979 msg, msg->event_ctx, msg, NULL, 0,
980 lp_parm_int(-1, "messaging", "messaging dgm cleanup interval",
982 mess_parent_dgm_cleanup, msg);
984 DEBUG(1, ("background_job_send failed\n"));
987 tevent_req_set_callback(req, mess_parent_dgm_cleanup_done, msg);
990 int messaging_cleanup(struct messaging_context *msg_ctx, pid_t pid)
995 ret = messaging_dgm_wipe();
997 ret = messaging_dgm_cleanup(pid);
1003 struct tevent_context *messaging_tevent_context(
1004 struct messaging_context *msg_ctx)
1006 return msg_ctx->event_ctx;
1009 struct server_id_db *messaging_names_db(struct messaging_context *msg_ctx)
1011 return msg_ctx->names_db;