diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-06 05:47:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:41 -0500 |
commit | 412e4bd82000f2c58a2ac9010ee97fac68b0df82 (patch) | |
tree | b438eb2ace9eef34f1c11d28711b048d503b06ea /source4/nbt_server | |
parent | 0093e1b62cf02d1c3bdc3f18c8c4cc3d0abbf776 (diff) | |
download | samba-412e4bd82000f2c58a2ac9010ee97fac68b0df82.tar.gz samba-412e4bd82000f2c58a2ac9010ee97fac68b0df82.tar.bz2 samba-412e4bd82000f2c58a2ac9010ee97fac68b0df82.zip |
r7321: add nbtd statistics serving over irpc
(This used to be commit 4c0ed7328b14969ea34790b0e80fa714c44ccc5f)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/nbt_server.c | 27 | ||||
-rw-r--r-- | source4/nbt_server/nbt_server.h | 4 |
2 files changed, 31 insertions, 0 deletions
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 @@ -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 @@ 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); } diff --git a/source4/nbt_server/nbt_server.h b/source4/nbt_server/nbt_server.h index e2b8584f5a..b9ed265b88 100644 --- a/source4/nbt_server/nbt_server.h +++ b/source4/nbt_server/nbt_server.h @@ -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_server { struct nbtd_interface *wins_interface; struct wins_server *winssrv; + + struct nbtd_statistics stats; }; |