summaryrefslogtreecommitdiffstats
path: root/source4/nbt_server/packet.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-10 08:41:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:31 -0500
commitc7304b3ab8396ffd1eb54a09cc730ea975ad488c (patch)
tree67e9be611368de386cac4f3a798513c5fe9e9b9c /source4/nbt_server/packet.c
parent056096c30ba73cbc5304c99af5d5a08d89111aab (diff)
downloadsamba-c7304b3ab8396ffd1eb54a09cc730ea975ad488c.tar.gz
samba-c7304b3ab8396ffd1eb54a09cc730ea975ad488c.tar.xz
samba-c7304b3ab8396ffd1eb54a09cc730ea975ad488c.zip
r8285: generate some real stats in the nbt server for the irpc client code to look at
(This used to be commit 73643884a3c76de5a738a28054a168fdb008a9f8)
Diffstat (limited to 'source4/nbt_server/packet.c')
-rw-r--r--source4/nbt_server/packet.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c
index 6e14fef06c..c1e0c4411b 100644
--- a/source4/nbt_server/packet.c
+++ b/source4/nbt_server/packet.c
@@ -89,6 +89,9 @@ void nbtd_name_query_reply(struct nbt_name_socket *nbtsock,
{
struct nbt_name_packet *packet;
size_t num_addresses = str_list_length(addresses);
+ struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbtd_interface);
+ struct nbtd_server *nbtsrv = iface->nbtsrv;
int i;
if (num_addresses == 0) {
@@ -131,6 +134,7 @@ void nbtd_name_query_reply(struct nbt_name_socket *nbtsock,
DEBUG(7,("Sending name query reply for %s at %s to %s:%d\n",
nbt_name_string(packet, name), addresses[0], src_address, src_port));
+ nbtsrv->stats.total_sent++;
nbt_name_reply_send(nbtsock, src_address, src_port, packet);
failed:
@@ -147,6 +151,9 @@ void nbtd_negative_name_query_reply(struct nbt_name_socket *nbtsock,
{
struct nbt_name_packet *packet;
struct nbt_name *name = &request_packet->questions[0].name;
+ struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbtd_interface);
+ struct nbtd_server *nbtsrv = iface->nbtsrv;
packet = talloc_zero(nbtsock, struct nbt_name_packet);
if (packet == NULL) return;
@@ -171,6 +178,7 @@ void nbtd_negative_name_query_reply(struct nbt_name_socket *nbtsock,
DEBUG(7,("Sending negative name query reply for %s to %s:%d\n",
nbt_name_string(packet, name), src_address, src_port));
+ nbtsrv->stats.total_sent++;
nbt_name_reply_send(nbtsock, src_address, src_port, packet);
failed:
@@ -187,6 +195,9 @@ void nbtd_name_registration_reply(struct nbt_name_socket *nbtsock,
{
struct nbt_name_packet *packet;
struct nbt_name *name = &request_packet->questions[0].name;
+ struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbtd_interface);
+ struct nbtd_server *nbtsrv = iface->nbtsrv;
packet = talloc_zero(nbtsock, struct nbt_name_packet);
if (packet == NULL) return;
@@ -214,6 +225,7 @@ void nbtd_name_registration_reply(struct nbt_name_socket *nbtsock,
rcode==0?"positive":"negative",
nbt_name_string(packet, name), src_address, src_port));
+ nbtsrv->stats.total_sent++;
nbt_name_reply_send(nbtsock, src_address, src_port, packet);
failed:
@@ -231,6 +243,9 @@ void nbtd_name_release_reply(struct nbt_name_socket *nbtsock,
{
struct nbt_name_packet *packet;
struct nbt_name *name = &request_packet->questions[0].name;
+ struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbtd_interface);
+ struct nbtd_server *nbtsrv = iface->nbtsrv;
packet = talloc_zero(nbtsock, struct nbt_name_packet);
if (packet == NULL) return;
@@ -256,6 +271,7 @@ void nbtd_name_release_reply(struct nbt_name_socket *nbtsock,
rcode==0?"positive":"negative",
nbt_name_string(packet, name), src_address, src_port));
+ nbtsrv->stats.total_sent++;
nbt_name_reply_send(nbtsock, src_address, src_port, packet);
failed:
@@ -273,6 +289,9 @@ void nbtd_wack_reply(struct nbt_name_socket *nbtsock,
{
struct nbt_name_packet *packet;
struct nbt_name *name = &request_packet->questions[0].name;
+ struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbtd_interface);
+ struct nbtd_server *nbtsrv = iface->nbtsrv;
packet = talloc_zero(nbtsock, struct nbt_name_packet);
if (packet == NULL) return;
@@ -299,6 +318,7 @@ void nbtd_wack_reply(struct nbt_name_socket *nbtsock,
DEBUG(7,("Sending WACK reply for %s to %s:%d\n",
nbt_name_string(packet, name), src_address, src_port));
+ nbtsrv->stats.total_sent++;
nbt_name_reply_send(nbtsock, src_address, src_port, packet);
failed: