| 1 | /*
|
|---|
| 2 | Unix SMB/CIFS implementation.
|
|---|
| 3 | messages.c header
|
|---|
| 4 | Copyright (C) Andrew Tridgell 2000
|
|---|
| 5 | Copyright (C) 2001, 2002 by Martin Pool
|
|---|
| 6 |
|
|---|
| 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.
|
|---|
| 11 |
|
|---|
| 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.
|
|---|
| 16 |
|
|---|
| 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/>.
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef _MESSAGES_H_
|
|---|
| 22 | #define _MESSAGES_H_
|
|---|
| 23 |
|
|---|
| 24 | #include "librpc/gen_ndr/server_id4.h"
|
|---|
| 25 |
|
|---|
| 26 | struct messaging_context;
|
|---|
| 27 |
|
|---|
| 28 | /* general messages */
|
|---|
| 29 | #define MSG_DEBUG 1
|
|---|
| 30 | #define MSG_PING 2
|
|---|
| 31 | #define MSG_PONG 3
|
|---|
| 32 | #define MSG_BRL_RETRY 4
|
|---|
| 33 | #define MSG_PVFS_RETRY_OPEN 5
|
|---|
| 34 | #define MSG_IRPC 6
|
|---|
| 35 | #define MSG_PVFS_NOTIFY 7
|
|---|
| 36 | #define MSG_NTVFS_OPLOCK_BREAK 8
|
|---|
| 37 | #define MSG_DREPL_ALLOCATE_RID 9
|
|---|
| 38 |
|
|---|
| 39 | /* temporary messaging endpoints are allocated above this line */
|
|---|
| 40 | #define MSG_TMP_BASE 1000
|
|---|
| 41 |
|
|---|
| 42 | /* taskid for messaging of parent process */
|
|---|
| 43 | #define SAMBA_PARENT_TASKID 0
|
|---|
| 44 |
|
|---|
| 45 | typedef void (*msg_callback_t)(struct messaging_context *msg, void *private_data,
|
|---|
| 46 | uint32_t msg_type,
|
|---|
| 47 | struct server_id server_id, DATA_BLOB *data);
|
|---|
| 48 |
|
|---|
| 49 | NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server,
|
|---|
| 50 | uint32_t msg_type, const DATA_BLOB *data);
|
|---|
| 51 | NTSTATUS messaging_register(struct messaging_context *msg, void *private_data,
|
|---|
| 52 | uint32_t msg_type,
|
|---|
| 53 | msg_callback_t fn);
|
|---|
| 54 | NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private_data,
|
|---|
| 55 | msg_callback_t fn, uint32_t *msg_type);
|
|---|
| 56 | struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
|---|
| 57 | const char *dir,
|
|---|
| 58 | struct server_id server_id,
|
|---|
| 59 | struct tevent_context *ev);
|
|---|
| 60 | struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx,
|
|---|
| 61 | const char *dir,
|
|---|
| 62 | struct tevent_context *ev);
|
|---|
| 63 | NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server,
|
|---|
| 64 | uint32_t msg_type, void *ptr);
|
|---|
| 65 | void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private_data);
|
|---|
| 66 | struct server_id messaging_get_server_id(struct messaging_context *msg_ctx);
|
|---|
| 67 |
|
|---|
| 68 | #endif
|
|---|