source4 messaging: clean up terminated processes
[kai/samba-autobuild/.git] / source4 / lib / messaging / messaging.h
index 14a112f87853e6c0726b78392b250f0732c2ee60..8eb195dfb2e72788682e5c61d629d26f71af95e1 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef _MESSAGES_H_
-#define _MESSAGES_H_
+#ifndef _SOURCE4_LIB_MESSAGING_MESSAGES_H_
+#define _SOURCE4_LIB_MESSAGING_MESSAGES_H_
 
-#include "librpc/gen_ndr/server_id4.h"
+#include "librpc/gen_ndr/server_id.h"
+#include "librpc/gen_ndr/messaging.h"
 
 struct imessaging_context;
 
-/* general messages */
-#define MSG_DEBUG              1
-#define MSG_PING               2
-#define MSG_PONG               3
-#define MSG_BRL_RETRY          4
-#define MSG_PVFS_RETRY_OPEN    5
-#define MSG_IRPC                6
-#define MSG_PVFS_NOTIFY                7
-#define MSG_NTVFS_OPLOCK_BREAK 8
-#define MSG_DREPL_ALLOCATE_RID 9
-
-/* temporary messaging endpoints are allocated above this line */
-#define MSG_TMP_BASE           1000
-
 /* taskid for messaging of parent process */
 #define SAMBA_PARENT_TASKID     0
 
@@ -54,15 +41,20 @@ NTSTATUS imessaging_register(struct imessaging_context *msg, void *private_data,
 NTSTATUS imessaging_register_tmp(struct imessaging_context *msg, void *private_data,
                                msg_callback_t fn, uint32_t *msg_type);
 struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
-                                        const char *dir,
-                                        struct server_id server_id,
-                                        struct tevent_context *ev);
+                                          struct loadparm_context *lp_ctx,
+                                          struct server_id server_id,
+                                          struct tevent_context *ev);
+void imessaging_dgm_unref_ev(struct tevent_context *ev);
+NTSTATUS imessaging_reinit_all(void);
+int imessaging_cleanup(struct imessaging_context *msg);
 struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx,
-                                        const char *dir,
+                                          struct loadparm_context *lp_ctx,
                                         struct tevent_context *ev);
 NTSTATUS imessaging_send_ptr(struct imessaging_context *msg, struct server_id server,
                            uint32_t msg_type, void *ptr);
 void imessaging_deregister(struct imessaging_context *msg, uint32_t msg_type, void *private_data);
 struct server_id imessaging_get_server_id(struct imessaging_context *msg_ctx);
+NTSTATUS imessaging_process_cleanup(struct imessaging_context *msg_ctx,
+                                   pid_t pid);
 
 #endif