svn commit: samba r7321 - in branches/SAMBA_4_0/source: nbt_server torture/local

tridge at samba.org tridge at samba.org
Mon Jun 6 05:47:53 GMT 2005


Author: tridge
Date: 2005-06-06 05:47:52 +0000 (Mon, 06 Jun 2005)
New Revision: 7321

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7321

Log:
add nbtd statistics serving over irpc


Modified:
   branches/SAMBA_4_0/source/nbt_server/nbt_server.c
   branches/SAMBA_4_0/source/nbt_server/nbt_server.h
   branches/SAMBA_4_0/source/torture/local/irpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/nbt_server/nbt_server.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/nbt_server.c	2005-06-06 05:47:14 UTC (rev 7320)
+++ branches/SAMBA_4_0/source/nbt_server/nbt_server.c	2005-06-06 05:47:52 UTC (rev 7321)
@@ -27,6 +27,25 @@
 
 
 /*
+  serve out the nbt statistics
+*/
+static NTSTATUS nbtd_information(struct irpc_message *msg, 
+				 struct nbtd_information *r)
+{
+	struct nbtd_server *server = talloc_get_type(msg->private, struct nbtd_server);
+
+	switch (r->in.level) {
+	case NBTD_INFO_STATISTICS:
+		r->out.info.stats = &server->stats;
+		break;
+	}
+
+	return NT_STATUS_OK;
+}
+
+
+
+/*
   startup the nbtd task
 */
 static void nbtd_task_init(struct task_server *task)
@@ -64,6 +83,14 @@
 		return;
 	}
 
+	/* setup monitoring */
+	status = IRPC_REGISTER(task->msg_ctx, irpc, NBTD_INFORMATION, 
+			       nbtd_information, nbtsrv);
+	if (!NT_STATUS_IS_OK(status)) {
+		task_terminate(task, "nbtd failed to setup monitoring");
+		return;
+	}
+
 	/* start the process of registering our names on all interfaces */
 	nbtd_register_names(nbtsrv);
 }

Modified: branches/SAMBA_4_0/source/nbt_server/nbt_server.h
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/nbt_server.h	2005-06-06 05:47:14 UTC (rev 7320)
+++ branches/SAMBA_4_0/source/nbt_server/nbt_server.h	2005-06-06 05:47:52 UTC (rev 7321)
@@ -22,6 +22,8 @@
 
 #include "libcli/nbt/libnbt.h"
 #include "libcli/dgram/libdgram.h"
+#include "librpc/gen_ndr/ndr_irpc.h"
+#include "lib/messaging/irpc.h"
 
 /* 
    a list of our registered names on each interface
@@ -70,6 +72,8 @@
 	struct nbtd_interface *wins_interface;
 
 	struct wins_server *winssrv;
+
+	struct nbtd_statistics stats;
 };
 
 

Modified: branches/SAMBA_4_0/source/torture/local/irpc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/irpc.c	2005-06-06 05:47:14 UTC (rev 7320)
+++ branches/SAMBA_4_0/source/torture/local/irpc.c	2005-06-06 05:47:52 UTC (rev 7321)
@@ -150,7 +150,7 @@
 	msg_ctx = messaging_init(mem_ctx, MSG_ID, ev);
 
 	/* register the server side function */
-	IRPC_REGISTER(msg_ctx, rpcecho, ECHO_ADDONE, irpc_AddOne);
+	IRPC_REGISTER(msg_ctx, rpcecho, ECHO_ADDONE, irpc_AddOne, NULL);
 
 	ret &= test_addone(mem_ctx, msg_ctx);
 	ret &= test_speed(mem_ctx, msg_ctx, ev);



More information about the samba-cvs mailing list