2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 2000
5 Copyright (C) 2001, 2002 by Martin Pool
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _SOURCE4_LIB_MESSAGING_MESSAGES_H_
22 #define _SOURCE4_LIB_MESSAGING_MESSAGES_H_
24 #include "librpc/gen_ndr/server_id.h"
26 struct imessaging_context;
28 /* general messages */
32 #define MSG_BRL_RETRY 4
33 #define MSG_PVFS_RETRY_OPEN 5
35 #define MSG_PVFS_NOTIFY 7
36 #define MSG_NTVFS_OPLOCK_BREAK 8
37 #define MSG_REQ_POOL_USAGE 9
38 #define MSG_POOL_USAGE 10
39 #define MSG_DREPL_ALLOCATE_RID 11
41 /* temporary messaging endpoints are allocated above this line */
42 #define MSG_TMP_BASE 1000
44 /* taskid for messaging of parent process */
45 #define SAMBA_PARENT_TASKID 0
47 typedef void (*msg_callback_t)(struct imessaging_context *msg, void *private_data,
49 struct server_id server_id, DATA_BLOB *data);
51 NTSTATUS imessaging_send(struct imessaging_context *msg, struct server_id server,
52 uint32_t msg_type, const DATA_BLOB *data);
53 NTSTATUS imessaging_register(struct imessaging_context *msg, void *private_data,
56 NTSTATUS imessaging_register_tmp(struct imessaging_context *msg, void *private_data,
57 msg_callback_t fn, uint32_t *msg_type);
58 struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
59 struct loadparm_context *lp_ctx,
60 struct server_id server_id,
61 struct tevent_context *ev,
63 int imessaging_cleanup(struct imessaging_context *msg);
64 struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx,
65 struct loadparm_context *lp_ctx,
66 struct tevent_context *ev);
67 NTSTATUS imessaging_send_ptr(struct imessaging_context *msg, struct server_id server,
68 uint32_t msg_type, void *ptr);
69 void imessaging_deregister(struct imessaging_context *msg, uint32_t msg_type, void *private_data);
70 struct server_id imessaging_get_server_id(struct imessaging_context *msg_ctx);