r8272: added the hooks for adding a name to a messaging context, so we will
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Jul 2005 01:08:10 +0000 (01:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:19:29 +0000 (13:19 -0500)
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/cldap_server/cldap_server.c
source4/ldap_server/ldap_server.c
source4/lib/messaging/irpc.h
source4/lib/messaging/messaging.c
source4/nbt_server/nbt_server.c
source4/smb_server/smb_server.c

index 62b6f5902029d3096b3bc07f1e6377781b69d561..31b59ebbe9c7a6368dd44fc55a9f408b9bcb353a 100644 (file)
@@ -24,6 +24,7 @@
 #include "libcli/ldap/ldap.h"
 #include "lib/events/events.h"
 #include "lib/socket/socket.h"
+#include "lib/messaging/irpc.h"
 #include "smbd/service_task.h"
 #include "cldap_server/cldap_server.h"
 
@@ -139,6 +140,8 @@ static void cldapd_task_init(struct task_server *task)
                task_server_terminate(task, "cldapd failed to setup interfaces");
                return;
        }
+
+       irpc_add_name(task->msg_ctx, "cldap_server");
 }
 
 
index 9c0e883e36357bab4e7da2dbf72cc64ea789c1bf..c898471e27bc3f5b4b7fd84a8401e9908e33f6f8 100644 (file)
@@ -32,6 +32,7 @@
 #include "smbd/service_stream.h"
 #include "lib/socket/socket.h"
 #include "lib/tls/tls.h"
+#include "lib/messaging/irpc.h"
 
 /*
   close the socket and shutdown a server_context
@@ -358,6 +359,8 @@ static void ldapsrv_accept(struct stream_connection *c)
                                    c->event.fde, NULL, port != 389);
        if (conn->tls == NULL) goto failed;
 
+       irpc_add_name(c->msg_ctx, "ldap_server");
+
        return;
 
 failed:
index cba17a2c97104a47b43b0bb12daafd295875b0aa..0482e9a9579d486ccfe2f936fe8e8451926d5d6c 100644 (file)
@@ -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, 
index 7cf488c7d00779567bebcc489c41d7965b259a2c..9bf5071e9062b93c29a99f0645c47de8229bebc5 100644 (file)
@@ -690,3 +690,13 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx,
                                                   table, callnum, r);
        return irpc_call_recv(irpc);
 }
+
+/*
+  add a string name that this irpc server can be called on
+*/
+NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name)
+{
+       return NT_STATUS_OK;
+}
+
+
index 19707a234f8a07020be9bbdf06add4455b39161e..211961098810da0cce4cf8a51e0add5e5707d91f 100644 (file)
@@ -93,6 +93,8 @@ static void nbtd_task_init(struct task_server *task)
 
        /* start the process of registering our names on all interfaces */
        nbtd_register_names(nbtsrv);
+
+       irpc_add_name(task->msg_ctx, "nbt_server");
 }
 
 
index 550234e1da3489c00e748584bc1ca42d4dd3d028..539627f36121ed2f67cbe251df43e51ed6298a3c 100644 (file)
@@ -26,6 +26,7 @@
 #include "dlinklist.h"
 #include "smbd/service_stream.h"
 #include "smb_server/smb_server.h"
+#include "lib/messaging/irpc.h"
 
 
 /*
@@ -771,6 +772,8 @@ static void smbsrv_accept(struct stream_connection *conn)
        smb_conn->processing = False;
 
        conn->private = smb_conn;
+
+       irpc_add_name(conn->msg_ctx, "smb_server");
 }