r5118: added support for node status replies in nbtd. nmblookup -S now works against...
[samba.git] / source / nbt_server / query.c
index c962a691c637182a6f3a617fffb5bd840ccbb1fe..859a9c7f26bcd742efce860e12043a0bb16a3f33 100644 (file)
 #include "system/network.h"
 #include "nbt_server/nbt_server.h"
 
-/* check a condition on an incoming packet */
-#define NBT_ASSERT_PACKET(packet, src_address, test) do { \
-       if (!(test)) { \
-               nbt_bad_packet(packet, src_address, #test); \
-               return; \
-       } \
-} while (0)
-
-
 /*
   send a name query reply
 */
@@ -92,6 +83,13 @@ void nbt_request_query(struct nbt_name_socket *nbtsock,
        struct nbt_iface_name *iname;
        struct nbt_name *name;
 
+       /* see if its a node status query */
+       if (packet->qdcount == 1 &&
+           packet->questions[0].question_type == NBT_QTYPE_STATUS) {
+               nbt_query_status(nbtsock, packet, src_address, src_port);
+               return;
+       }
+
        /* if its a WINS query then direct to our WINS server */
        if ((packet->operation & NBT_FLAG_RECURSION_DESIRED) &&
            !(packet->operation & NBT_FLAG_BROADCAST)) {