[jcifs] [SOLVED] problem with NbtAddress.getAllByAddress()
Christopher R.Hertel
crh at ubiqx.mn.org
Thu May 16 05:12:21 EST 2002
On Wed, May 15, 2002 at 11:26:04AM -0700, ashish wrote:
> yeah, many many thanks to Chris.
> it seems to work for every type of microsoft box "as of now" if we set all
> the flags to false.
> But can we still have exceptions. I mean are there any conditions in which
> setting all flags to false will not work but previous condition where B and
> RD flag are set would work..
The NBSTAT query (Node Status) is defined in the RFCs as having all flag
bits in the header turned off. Some of the Windows systems out there
ignore unimportant bits (RD, in particular) when processing the query.
That makes sense, but it's also not surprising that they would change the
behavior of their newer clients to be more picky. There is nothing
'wrong' with XP's behavior, it's just 'different'.
Things are a little more sticky with the regular name query (NB). Here's
how NB queries work:
1) Any broadcast query (defined by B bit being set) is:
- non-recursive
- Name Resolution only.
That means that 'B' queries are *only* answered from the local name
table, and only by nodes that will receive 'B' queries. A P node
should not ever respond to a query with the B bit set, and the query
should never be answered from the NBNS (WINS) database.
For some bizaare reason (a typo in the RFCs) B queries are typically
sent with RD on (ugly mistake, but the RD bit is ignored if B is set).
Note that B queries never result in a NEGATIVE NAME QUERY RESPONSE.
If the name is not registered, the query is simply dropped.
2) A unicast query (defined by B being set, IP destination is ignored) is
different.
- If RD is set, then the query is a name resoultion query, and should
be passed to the NBNS (WINS) system *if there is one* on the target
machine. If the name does not exist in either the local name table
or the NBNS database then the node will reply with a NEGATIVE NAME
QUERY RESPONSE.
- If RD is clear, then the query is a name verification query ("Are you
using this name?") and should *not* be passed to the NBNS. The
answer (POSITIVE or NEGATIVE) will come from the local name table
only.
That all makes some twisted sense if you think about it a while.
Basically, RD is supposed to mean "look further". The queries go
primarily to the host's local name table, and only go to the NBNS database
if RD is set.
You really don't want to know about the RA bit. ;)
Captain Pedantic -)-----
--
Samba Team -- http://www.samba.org/ -)----- Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/ -)----- ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/ -)----- crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/ -)----- crh at ubiqx.org
More information about the jcifs
mailing list