2 Unix SMB/CIFS implementation.
4 Samba internal rpc code - header
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 an incoming irpc message
30 /* don't allow calls to take too long */
31 #define IRPC_CALL_TIMEOUT 10
34 /* the server function type */
35 typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r);
37 /* register a server function with the irpc messaging system */
38 #define IRPC_REGISTER(msg_ctx, pipename, funcname, function) \
39 irpc_register(msg_ctx, &dcerpc_table_ ## pipename, \
40 DCERPC_ ## funcname, \
41 (irpc_function_t)function)
43 /* make a irpc call */
44 #define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr) \
45 irpc_call(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr)
52 struct messaging_context *msg_ctx;
53 const struct dcerpc_interface_table *table;
60 void (*fn)(struct irpc_request *);
66 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id,
67 struct event_context *ev);
68 NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server,
69 uint32_t msg_type, DATA_BLOB *data);
70 void messaging_register(struct messaging_context *msg, void *private,
72 void (*fn)(struct messaging_context *, void *, uint32_t, uint32_t, DATA_BLOB *));
73 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id,
74 struct event_context *ev);
75 NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server,
76 uint32_t msg_type, void *ptr);
77 void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private);
82 NTSTATUS irpc_register(struct messaging_context *msg_ctx,
83 const struct dcerpc_interface_table *table,
84 int call, irpc_function_t fn);
85 struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx,
87 const struct dcerpc_interface_table *table,
88 int callnum, void *r);
89 NTSTATUS irpc_call_recv(struct irpc_request *irpc);
90 NTSTATUS irpc_call(struct messaging_context *msg_ctx,
92 const struct dcerpc_interface_table *table,
93 int callnum, void *r);