From 412e4bd82000f2c58a2ac9010ee97fac68b0df82 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 6 Jun 2005 05:47:52 +0000 Subject: r7321: add nbtd statistics serving over irpc (This used to be commit 4c0ed7328b14969ea34790b0e80fa714c44ccc5f) --- source4/nbt_server/nbt_server.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source4/nbt_server/nbt_server.c') diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c index 2c76152160..6139b78810 100644 --- a/source4/nbt_server/nbt_server.c +++ b/source4/nbt_server/nbt_server.c @@ -26,6 +26,25 @@ #include "nbt_server/nbt_server.h" +/* + 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 */ @@ -64,6 +83,14 @@ static void nbtd_task_init(struct task_server *task) 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); } -- cgit