[jcifs] no name with type 0x00 with no scope for host
Michael B Allen
mballen at erols.com
Thu Feb 21 06:50:25 EST 2002
On Wed, 20 Feb 2002 11:44:05 -0600
Christopher R.Hertel <crh at ubiqx.org> wrote:
> By specifying that "no name with type 0x00" was found, it suggests that
> the query was specifically looking for a name with that suffix, and that
> it may have missed other names.
It *is* looking for a name with that suffix but I don't see why you think
it could miss the other names; they're all returned in the node status. If
you get a response to the node status at all, the name with that hexCode
(in this case <00>) is being advertised and the getAllByAddress call
is ultimately successfull. If you don't get a response it doesn't know
about <00> so we throw what I think is a very informative and accurate
You're thinking "get node status" when you need to be thinking "get all
the names at the host advertising this name".
Let's go one level down to see how jCIFS does the getAllByAddress
exactly. Theres not a lot of code behind this BTW so looking at the
source is the best way but here goes.
When you call:
getAllByAddress( NbtAddress addr )
addrs client.getNodeStatus( addr )
where client is a static instace of NameServiceClient and addrs is
the resulting array of NbtAddress' representing the names advertised
by the host at addr. Every NbtAddress has an IP and a Name object as
a member. Every Name object must have a String name, and int hexCode,
and a String scope but the scope can be null.
Now getNodeStatus builds a NODE_STATUS_RESPONSE message, encodes it in
a datagram packet and sends it to the IP associated with addr.
Here's the pertaintent part; IF you get a response, that name with
whatever hexCode is being advertised by the target (in practice <00>
is the only hexCode that works reliably), your getAllByAddress call is
successfull and the original addr object will be in the array of other
addrs. If however the host is NOT advertising a name with that hexCode,
you will not get a response and an UnknownHostException: no name with
type <hexCode> ... is thrown.
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.
> environment that lead me astray. I still think that the particular error
> message is misleading. If a "real" name and suffix are specified, then
> I'd want to see "name <name> with suffix <suffix> and scope <scope> was
> not found". If the wildcard name is used, then I would like to see "no
> status response from host <ip address>". Or something along those lines.
The NODE_STATUS_REQUEST message is a type of direct name query. This
physical layout of the message is exactly the same. The only thing that
distingushes a NAME_QUERY_REQUEST from a NODE_STATUS_REQUEST is one
single bit. 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
getAllByAddress( "ip", 0xXX, null );
> Of course, we still don't know what's going on in Ashish's case.
I thought we figured this out? He's running on the wrong interface. I
directed him to the laddr and baddr properties.
May The Source be with you.
More information about the jcifs