[jcifs] no name with type 0x00 with no scope for host
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Thu Feb 21 11:33:48 EST 2002
> -----Original Message-----
> From: Christopher R.Hertel [SMTP:crh at ubiqx.org]
> > In Ashish's case, he called:
> > getAllByAddress( String host )
> > which is just shorthand for:
> > getAllByAddress( getByName( host, 0x00, null ))
> > and if host is a dot quad IP getByName is a noop.
> Okay, that's where the problem is, and it goes back to my original
> message. You say above "in practice <00> is the only hexCode that works
> reliably"... but it's not since XP doesn't register it by default like the
> others do.
And we don't care because we know XP takes both an IP address and
*SMBSERVER as a called name.
> I see what is going on in the code above, and it's cool that it can be
> done, but it can also be misleading and problematic.
> In the getByName(), if the host is not a dot quad IP then you are stuck
> (particularly with XP) since you cannot know that an 0x00 name will be
> present. The lack of the 0x00 name doesn't mean that the host doesn't
> exist within the NBT network.
> If the host in getByName() is a dot quad (or a DNS name or something else
> we can resolve) then you'll have an IP address. You no longer need to
> consider the 0x00 suffix. It is no longer relevant to the query.
For the benifit of exceptional users the API is "open ended" in that it allows you to
get down to the metal but there are no polished RFC 1002 specific error messages
to teach you the NetBIOS protocol. You cannot use a DNS name with NbtAddress,
that's what the UniAddress class is for. And if you're getting down to the metal you
should know that the name lookup part may fail and be prepared to handle that.
> > The QUESTION_NAME in both messages is a "real name" and
> > therefore has a hexCode associated with it. It can be <20>, <1E>, whatever.
> > In practice MS hosts only reliably respond to <00> though. You can try this
> > with:
> > getAllByAddress( "ip", 0xXX, null );
> I understand what you are doing here, and why you picked the 0x00 suffix.
> The problem is that the 0x00 suffix is only *more* reliable than any
> other. Unfortunately, it is not completely reliable, as XP emphasises.
There is no evidence that even suggests XP does not respond to <00> node
> His later messages suggest otherwise.
His problem has nothing to do with jCIFS.
> b) Even if he's doing something wrong, my own 2cents is that a status
> query using an IP address that does not get a response should report
> "no status response from host <ip> was received" rather than "no name
> with type 0x00" was found".
What if there really isn't a 00 name? Saying "no status response from host <ip>
was received" sounds like something went wrong.
User: "Status response? What's that? I'm just trying to do a reverse lookup on
FOO<00> and get all it's siblings like nbtstat -a does ... but what's a status
response? Does that mean the machine is down?!
More information about the jcifs