From bf1ffa283caef6a3c98b5cc7f5bc8205c2818b06 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 Jun 2005 06:53:07 +0000 Subject: r7294: implemented the irpc messaging system. This is the core of the management system I proposed on samba-technical a couple of days ago. Essentially it is a very lightweight way for any code in Samba to make IDL based rpc calls to anywhere else in the code, without the client or server having to go to the trouble of setting up a full rpc service. It can be used with any of our existing IDL, but I expect it will mostly be used for a new set of Samba specific management calls. The LOCAL-IRPC torture test demonstrates how it can be used by calling the echo_AddOne() call over this transport. (This used to be commit 3d589a09954eb8b318f567e1150b0c27412fb942) --- source4/lib/messaging/irpc.h | 94 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 source4/lib/messaging/irpc.h (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h new file mode 100644 index 0000000000..a483c78c70 --- /dev/null +++ b/source4/lib/messaging/irpc.h @@ -0,0 +1,94 @@ +/* + Unix SMB/CIFS implementation. + + Samba internal rpc code - header + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + an incoming irpc message +*/ +struct irpc_message { + uint32_t from; +}; + +/* don't allow calls to take too long */ +#define IRPC_CALL_TIMEOUT 10 + + +/* the server function type */ +typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); + +/* register a server function with the irpc messaging system */ +#define IRPC_REGISTER(msg_ctx, pipename, funcname, function) \ + irpc_register(msg_ctx, &dcerpc_table_ ## pipename, \ + DCERPC_ ## funcname, \ + (irpc_function_t)function) + +/* make a irpc call */ +#define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr) \ + irpc_call(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr) + + +/* + a pending irpc call +*/ +struct irpc_request { + struct messaging_context *msg_ctx; + const struct dcerpc_interface_table *table; + int callnum; + int callid; + void *r; + NTSTATUS status; + BOOL done; + struct { + void (*fn)(struct irpc_request *); + void *private; + } async; +}; + + +struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, + struct event_context *ev); +NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server, + uint32_t msg_type, DATA_BLOB *data); +void messaging_register(struct messaging_context *msg, void *private, + uint32_t msg_type, + void (*fn)(struct messaging_context *, void *, uint32_t, uint32_t, DATA_BLOB *)); +struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, + struct event_context *ev); +NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, + uint32_t msg_type, void *ptr); +void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private); + + + + +NTSTATUS irpc_register(struct messaging_context *msg_ctx, + const struct dcerpc_interface_table *table, + int call, irpc_function_t fn); +struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, + uint32_t server_id, + const struct dcerpc_interface_table *table, + int callnum, void *r); +NTSTATUS irpc_call_recv(struct irpc_request *irpc); +NTSTATUS irpc_call(struct messaging_context *msg_ctx, + uint32_t server_id, + const struct dcerpc_interface_table *table, + int callnum, void *r); + -- cgit From d934cb71d0bd2d6ad7a2908cc3c3802cb37e922c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 Jun 2005 07:30:44 +0000 Subject: r7295: added an irpc benchmark. It gets about 16k messages/sec on my laptop, compared to about 20k messages/sec for the raw messaging layer. I think that is quite acceptable given the extra functionality. (This used to be commit a05d38d1d91f1f54d3e3794a596b468992594852) --- source4/lib/messaging/irpc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index a483c78c70..93cadddd34 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -28,7 +28,7 @@ struct irpc_message { }; /* don't allow calls to take too long */ -#define IRPC_CALL_TIMEOUT 10 +#define IRPC_CALL_TIMEOUT 20 /* the server function type */ @@ -44,6 +44,9 @@ typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); #define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr) \ irpc_call(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr) +#define IRPC_CALL_SEND(msg_ctx, server_id, pipename, funcname, ptr) \ + irpc_call_send(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr) + /* a pending irpc call -- cgit From 37fdb858b069d862d53edae11dff42a4696c78a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 Jun 2005 07:44:51 +0000 Subject: r7298: ensure messages are sent in order even when under extreme load. This fixes a IO_TIMEOUT problem in the messaging benchmarks (This used to be commit c8b220b65de00418d19347cf298cc80d86e8accb) --- source4/lib/messaging/irpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 93cadddd34..99a2d60f35 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -28,7 +28,7 @@ struct irpc_message { }; /* don't allow calls to take too long */ -#define IRPC_CALL_TIMEOUT 20 +#define IRPC_CALL_TIMEOUT 10 /* the server function type */ -- cgit From 0093e1b62cf02d1c3bdc3f18c8c4cc3d0abbf776 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 6 Jun 2005 05:47:14 +0000 Subject: r7320: added support for a private pointer in irpc registered handlers (This used to be commit eec521dffd4ca9efa7f6e31c50cf1ff365aae209) --- source4/lib/messaging/irpc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 99a2d60f35..cba17a2c97 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -25,6 +25,7 @@ */ struct irpc_message { uint32_t from; + void *private; }; /* don't allow calls to take too long */ @@ -35,10 +36,10 @@ struct irpc_message { typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); /* register a server function with the irpc messaging system */ -#define IRPC_REGISTER(msg_ctx, pipename, funcname, function) \ +#define IRPC_REGISTER(msg_ctx, pipename, funcname, function, private) \ irpc_register(msg_ctx, &dcerpc_table_ ## pipename, \ DCERPC_ ## funcname, \ - (irpc_function_t)function) + (irpc_function_t)function, private) /* make a irpc call */ #define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr) \ @@ -84,7 +85,7 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void NTSTATUS irpc_register(struct messaging_context *msg_ctx, const struct dcerpc_interface_table *table, - int call, irpc_function_t fn); + int call, irpc_function_t fn, void *private); struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, uint32_t server_id, const struct dcerpc_interface_table *table, -- cgit From c6881d1e650fd284a366af76f5a214a5de05cc0c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2005 01:08:10 +0000 Subject: r8272: added the hooks for adding a name to a messaging context, so we will be able to send a message to the "ldap_server" task without having to know its task ID. (This used to be commit 8f69867867857e0c9a9246c2dec9612ccc234724) --- source4/lib/messaging/irpc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index cba17a2c97..0482e9a957 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -86,6 +86,7 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void NTSTATUS irpc_register(struct messaging_context *msg_ctx, const struct dcerpc_interface_table *table, int call, irpc_function_t fn, void *private); +NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, uint32_t server_id, const struct dcerpc_interface_table *table, -- cgit From 144b88b3a0ac91ef8263cdb8cc044d04c2d65f62 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2005 04:54:21 +0000 Subject: r8277: filled in the code for finding irpc server ids by name, storing the names in a tdb (This used to be commit b603a52f27bf90e71d605440d44267dcd94c6939) --- source4/lib/messaging/irpc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 0482e9a957..4fb1acfedb 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -86,7 +86,6 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void NTSTATUS irpc_register(struct messaging_context *msg_ctx, const struct dcerpc_interface_table *table, int call, irpc_function_t fn, void *private); -NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, uint32_t server_id, const struct dcerpc_interface_table *table, @@ -97,3 +96,7 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx, const struct dcerpc_interface_table *table, int callnum, void *r); +NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); +uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); +void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); + -- cgit From fc585709402e6840a5dd16c9a3fb22792ddacf3e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Aug 2005 17:33:43 +0000 Subject: r8887: fixed the irpc error that caused ia64 to fail the LOCAL-IRPC test (This used to be commit ce9a262d379b946717d0d4be4731c837e6f7373d) --- source4/lib/messaging/irpc.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 4fb1acfedb..7398453612 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -29,7 +29,7 @@ struct irpc_message { }; /* don't allow calls to take too long */ -#define IRPC_CALL_TIMEOUT 10 +#define IRPC_CALL_TIMEOUT 1000 /* the server function type */ @@ -42,11 +42,11 @@ typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); (irpc_function_t)function, private) /* make a irpc call */ -#define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr) \ - irpc_call(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr) +#define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr, ctx) \ + irpc_call(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) -#define IRPC_CALL_SEND(msg_ctx, server_id, pipename, funcname, ptr) \ - irpc_call_send(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr) +#define IRPC_CALL_SEND(msg_ctx, server_id, pipename, funcname, ptr, ctx) \ + irpc_call_send(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) /* @@ -60,6 +60,7 @@ struct irpc_request { void *r; NTSTATUS status; BOOL done; + TALLOC_CTX *mem_ctx; struct { void (*fn)(struct irpc_request *); void *private; @@ -89,12 +90,12 @@ NTSTATUS irpc_register(struct messaging_context *msg_ctx, struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, uint32_t server_id, const struct dcerpc_interface_table *table, - int callnum, void *r); + int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_call_recv(struct irpc_request *irpc); NTSTATUS irpc_call(struct messaging_context *msg_ctx, uint32_t server_id, const struct dcerpc_interface_table *table, - int callnum, void *r); + int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); -- cgit From 08b2b7e3e1557ec7b0ddca09695844b7839a7ddf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Aug 2005 16:58:52 +0000 Subject: r8923: put the IRPC default timeout back to 10s (I didn't mean to commit this, it was changed just for deugging) (This used to be commit a7c260e61feec210bcb5cad0f8f759544dc9dd1e) --- source4/lib/messaging/irpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 7398453612..f015215940 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -29,7 +29,7 @@ struct irpc_message { }; /* don't allow calls to take too long */ -#define IRPC_CALL_TIMEOUT 1000 +#define IRPC_CALL_TIMEOUT 10 /* the server function type */ -- cgit From 87f71eb8ad90cdf9ed7d3cd79d6211908a7d2d92 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 25 Sep 2005 13:01:26 +0000 Subject: r10489: added the ability for irpc server to defer replies instead of replying immediately. They set m->defer_reply = True; (This used to be commit 3dcd800a5d3340d0f4855f9f08e73896ad8c3d83) --- source4/lib/messaging/irpc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index f015215940..aa06a2de06 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -20,12 +20,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "librpc/gen_ndr/irpc.h" + /* an incoming irpc message */ struct irpc_message { uint32_t from; void *private; + struct irpc_header header; + struct ndr_pull *ndr; + BOOL defer_reply; + struct messaging_context *msg_ctx; + struct irpc_list *irpc; + void *data; }; /* don't allow calls to take too long */ @@ -100,4 +108,6 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx, NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); +NTSTATUS irpc_send_reply(struct irpc_message *m); + -- cgit From 06085e7bc09e46c74fbe050633203fab619d501c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 25 Sep 2005 13:17:03 +0000 Subject: r10490: - allow deferred irpc replies to set the status - add an example of deferred reply for echodata in LOCAL-IRPC (This used to be commit 858a757a6d0a614b8f13bfb6217034e8a8b69554) --- source4/lib/messaging/irpc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index aa06a2de06..e83e7dce65 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -34,6 +34,7 @@ struct irpc_message { struct messaging_context *msg_ctx; struct irpc_list *irpc; void *data; + struct event_context *ev; }; /* don't allow calls to take too long */ @@ -108,6 +109,6 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx, NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); -NTSTATUS irpc_send_reply(struct irpc_message *m); +NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); -- cgit From 34aa19cafe8d19412123d92b735e8afda5e0a87d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 3 Feb 2006 22:30:30 +0000 Subject: r13317: Create a new function messaging_client_init() which can be used when we don't have a server messaging context. We should replace the datagram messages with stream sockets in this case, so we don't have to create a unique socket. Andrew Bartlett (This used to be commit fd974fb64792f8f6c532b01d2a2e012be18eef7e) --- source4/lib/messaging/irpc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index e83e7dce65..5b4abc556f 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -86,6 +86,8 @@ void messaging_register(struct messaging_context *msg, void *private, void (*fn)(struct messaging_context *, void *, uint32_t, uint32_t, DATA_BLOB *)); struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, struct event_context *ev); +struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, + struct event_context *ev); NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, uint32_t msg_type, void *ptr); void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private); -- cgit From c8610144f73a6cbc26c58f57a527f7cbcb44b265 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Apr 2006 06:08:24 +0000 Subject: r15049: for really efficient oplock handling with thousands of open files we will need a separate messaging endpoint per open file. To make this efficient extend the messaging layer to have a new registration function for temporary message types that maps via an idtree. I have updated the LOCAL-MESSAGING test to use the new function. (This used to be commit 4b976851d8b7ccd2c40010be095cef7fecf9e722) --- source4/lib/messaging/irpc.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 5b4abc556f..4e775bfe06 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -76,14 +76,18 @@ struct irpc_request { } async; }; +typedef void (*msg_callback_t)(struct messaging_context *msg, void *private, + uint32_t msg_type, uint32_t server_id, DATA_BLOB *data); struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, struct event_context *ev); NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server, uint32_t msg_type, DATA_BLOB *data); -void messaging_register(struct messaging_context *msg, void *private, - uint32_t msg_type, - void (*fn)(struct messaging_context *, void *, uint32_t, uint32_t, DATA_BLOB *)); +NTSTATUS messaging_register(struct messaging_context *msg, void *private, + uint32_t msg_type, + msg_callback_t fn); +NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private, + msg_callback_t fn, uint32_t *msg_type); struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, struct event_context *ev); struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, -- cgit From 1cd4339b9a2786aa26691ca4f02fa93ab0958b88 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 Jan 2007 10:52:09 +0000 Subject: r20646: first preparations for cluster enablement. This changes " uint32_t server_id to struct server_id server_id; which allows a server ID to have an node number. The node number will be zero in non-clustered case. This is the most basic hook needed for clustering, and ctdb. (This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb) --- source4/lib/messaging/irpc.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 4e775bfe06..1d704ad943 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -26,7 +26,7 @@ an incoming irpc message */ struct irpc_message { - uint32_t from; + struct server_id from; void *private; struct irpc_header header; struct ndr_pull *ndr; @@ -77,22 +77,25 @@ struct irpc_request { }; typedef void (*msg_callback_t)(struct messaging_context *msg, void *private, - uint32_t msg_type, uint32_t server_id, DATA_BLOB *data); + uint32_t msg_type, + struct server_id server_id, DATA_BLOB *data); -struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, +struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, + struct server_id server_id, struct event_context *ev); -NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server, +NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, uint32_t msg_type, DATA_BLOB *data); NTSTATUS messaging_register(struct messaging_context *msg, void *private, uint32_t msg_type, msg_callback_t fn); NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private, msg_callback_t fn, uint32_t *msg_type); -struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, +struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, + struct server_id server_id, struct event_context *ev); struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, struct event_context *ev); -NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, +NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, uint32_t msg_type, void *ptr); void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private); @@ -103,17 +106,17 @@ NTSTATUS irpc_register(struct messaging_context *msg_ctx, const struct dcerpc_interface_table *table, int call, irpc_function_t fn, void *private); struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, - uint32_t server_id, + struct server_id server_id, const struct dcerpc_interface_table *table, int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_call_recv(struct irpc_request *irpc); NTSTATUS irpc_call(struct messaging_context *msg_ctx, - uint32_t server_id, + struct server_id server_id, const struct dcerpc_interface_table *table, int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); -uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); +struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); -- cgit From de9768764d08e954cd000a04e9646a828917d876 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 1 May 2007 09:55:36 +0000 Subject: r22629: if irpc gets freed within event_loop_once() we crash... so deferr the freeing metze (This used to be commit 3a30bc0d6137fe2b7440106b35dd0a9175cc8057) --- source4/lib/messaging/irpc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 1d704ad943..6873f014a6 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -69,6 +69,7 @@ struct irpc_request { void *r; NTSTATUS status; BOOL done; + BOOL reject_free; TALLOC_CTX *mem_ctx; struct { void (*fn)(struct irpc_request *); -- cgit From 68b531e81784d218b598e4ec403443bbc039ca77 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 7 May 2007 15:19:53 +0000 Subject: r22748: fix memleaks by passing an mem_ctx to irpc_servers_byname() metze (This used to be commit b54584dfabee77ec7743cab431bda9765057a295) --- source4/lib/messaging/irpc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 6873f014a6..0ea1d5d69f 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -117,7 +117,7 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx, int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); -struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); +struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name); void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/lib/messaging/irpc.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 0ea1d5d69f..b8081b544d 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "librpc/gen_ndr/irpc.h" -- cgit From b8cdadced4d2a26a63b8bbe397c12df949783ed4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 20:46:45 +0000 Subject: r24551: rename dcerpc_interface_table -> ndr_interface_table rename dcerpc_interface_list -> ndr_interface_list and move them to libndr.h metze (This used to be commit 4adbebef5df2f833d2d4bfcdda72a34179d52f5c) --- source4/lib/messaging/irpc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index b8081b544d..2f75857e06 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -62,7 +62,7 @@ typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); */ struct irpc_request { struct messaging_context *msg_ctx; - const struct dcerpc_interface_table *table; + const struct ndr_interface_table *table; int callnum; int callid; void *r; @@ -103,16 +103,16 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void NTSTATUS irpc_register(struct messaging_context *msg_ctx, - const struct dcerpc_interface_table *table, + const struct ndr_interface_table *table, int call, irpc_function_t fn, void *private); struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, struct server_id server_id, - const struct dcerpc_interface_table *table, + const struct ndr_interface_table *table, int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_call_recv(struct irpc_request *irpc); NTSTATUS irpc_call(struct messaging_context *msg_ctx, struct server_id server_id, - const struct dcerpc_interface_table *table, + const struct ndr_interface_table *table, int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); -- cgit From f14bd1a90ab47a418c0ec2492990a417a0bb3bf6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 21:23:03 +0000 Subject: r24557: rename 'dcerpc_table_' -> 'ndr_table_' metze (This used to be commit 84651aee81aaabbebf52ffc3fbcbabb2eec6eed5) --- source4/lib/messaging/irpc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 2f75857e06..ba23b19430 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -45,16 +45,16 @@ typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); /* register a server function with the irpc messaging system */ #define IRPC_REGISTER(msg_ctx, pipename, funcname, function, private) \ - irpc_register(msg_ctx, &dcerpc_table_ ## pipename, \ + irpc_register(msg_ctx, &ndr_table_ ## pipename, \ DCERPC_ ## funcname, \ (irpc_function_t)function, private) /* make a irpc call */ #define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr, ctx) \ - irpc_call(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) + irpc_call(msg_ctx, server_id, &ndr_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) #define IRPC_CALL_SEND(msg_ctx, server_id, pipename, funcname, ptr, ctx) \ - irpc_call_send(msg_ctx, server_id, &dcerpc_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) + irpc_call_send(msg_ctx, server_id, &ndr_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) /* -- cgit From 0d7d5a6d492253f184ac58fe45ca22af5a3731de Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 22:09:21 +0000 Subject: r24560: rename some DCERPC_ prefixes into NDR_ metze (This used to be commit f874eca5dab74e930d0ec52abeb06295d2d90476) --- source4/lib/messaging/irpc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index ba23b19430..40640c8545 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -46,15 +46,15 @@ typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r); /* register a server function with the irpc messaging system */ #define IRPC_REGISTER(msg_ctx, pipename, funcname, function, private) \ irpc_register(msg_ctx, &ndr_table_ ## pipename, \ - DCERPC_ ## funcname, \ + NDR_ ## funcname, \ (irpc_function_t)function, private) /* make a irpc call */ #define IRPC_CALL(msg_ctx, server_id, pipename, funcname, ptr, ctx) \ - irpc_call(msg_ctx, server_id, &ndr_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) + irpc_call(msg_ctx, server_id, &ndr_table_ ## pipename, NDR_ ## funcname, ptr, ctx) #define IRPC_CALL_SEND(msg_ctx, server_id, pipename, funcname, ptr, ctx) \ - irpc_call_send(msg_ctx, server_id, &ndr_table_ ## pipename, DCERPC_ ## funcname, ptr, ctx) + irpc_call_send(msg_ctx, server_id, &ndr_table_ ## pipename, NDR_ ## funcname, ptr, ctx) /* -- cgit From 61ffa08f4c95e29d301de9fbabd6e71c2dbc1056 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 27 Aug 2007 18:10:19 +0000 Subject: r24712: No longer expose the 'BOOL' data type in any interfaces. (This used to be commit 1ce32673d960c8b05b6c1b1b99e1976a402417ae) --- source4/lib/messaging/irpc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 40640c8545..bcfc1f1ab4 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -29,7 +29,7 @@ struct irpc_message { void *private; struct irpc_header header; struct ndr_pull *ndr; - BOOL defer_reply; + bool defer_reply; struct messaging_context *msg_ctx; struct irpc_list *irpc; void *data; @@ -67,8 +67,8 @@ struct irpc_request { int callid; void *r; NTSTATUS status; - BOOL done; - BOOL reject_free; + bool done; + bool reject_free; TALLOC_CTX *mem_ctx; struct { void (*fn)(struct irpc_request *); -- cgit From 2f3551ca7cee59d4d053cceb87abdf1da1b3a1ad Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 1 Oct 2007 18:52:55 +0000 Subject: r25446: Merge some changes I made on the way home from SFO: 2007-09-29 More higher-level passing around of lp_ctx. 2007-09-29 Fix warning. 2007-09-29 Pass loadparm contexts on a higher level. 2007-09-29 Avoid using global loadparm context. (This used to be commit 3468952e771ab31f90b6c374ade01c5550810f42) --- source4/lib/messaging/irpc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index bcfc1f1ab4..989e5d4255 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -76,13 +76,12 @@ struct irpc_request { } async; }; +struct loadparm_context; + typedef void (*msg_callback_t)(struct messaging_context *msg, void *private, uint32_t msg_type, struct server_id server_id, DATA_BLOB *data); -struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, - struct server_id server_id, - struct event_context *ev); NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, uint32_t msg_type, DATA_BLOB *data); NTSTATUS messaging_register(struct messaging_context *msg, void *private, @@ -91,9 +90,11 @@ NTSTATUS messaging_register(struct messaging_context *msg, void *private, NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private, msg_callback_t fn, uint32_t *msg_type); struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, + const char *dir, struct server_id server_id, struct event_context *ev); struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, + const char *dir, struct event_context *ev); NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, uint32_t msg_type, void *ptr); -- cgit From 84b476394713d4f2b84782c59dcc084a25af360f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 13 Dec 2007 23:23:25 +0100 Subject: r26441: Remove global_loadparm uses. (This used to be commit 32007c6277efa46341da7741b749a98633d71640) --- source4/lib/messaging/irpc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 989e5d4255..d596c6721e 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -92,9 +92,11 @@ NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private, struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, const char *dir, struct server_id server_id, + struct smb_iconv_convenience *iconv_convenience, struct event_context *ev); struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, const char *dir, + struct smb_iconv_convenience *iconv_convenience, struct event_context *ev); NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, uint32_t msg_type, void *ptr); -- cgit From 294c55faf6880251ad67f5a5c7fbefb5e066cef6 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Sat, 29 Mar 2008 00:31:37 +0100 Subject: IRPC: Add include guards for the header. (This used to be commit 0e66e443ad42f9644aafc1858ac8d01c7c699337) --- source4/lib/messaging/irpc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index d596c6721e..f44c0af3ec 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -19,6 +19,9 @@ along with this program. If not, see . */ +#ifndef IRPC_H +#define IRPC_H + #include "librpc/gen_ndr/irpc.h" /* @@ -123,4 +126,5 @@ struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); +#endif -- cgit From d9a6f04ddd8074c36fc8073ec9bd183438801817 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 May 2008 01:52:35 +0200 Subject: Provide access to server_id from python bindings, add more tests. (This used to be commit adcd87ad07abbf60a0152deae4b975a2401d701b) --- source4/lib/messaging/irpc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/messaging/irpc.h') diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index f44c0af3ec..65e98dce2c 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -125,6 +125,7 @@ NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name); void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); +struct server_id messaging_get_server_id(struct messaging_context *msg_ctx); #endif -- cgit