[jcifs] NetBIOS Name Table

Michael B. Allen miallen at eskimo.com
Tue Feb 4 08:05:14 EST 2003

On Mon, 3 Feb 2003 18:09:22 +0100
andrea.lanza at frameweb.it wrote:

> This question is related with the last thread ( : NetBIOS adapter status
> request )
> If I would get all the netbios name table from a remote pc, wich method
> should I use ?
> I see that FirstCalledName represent the Netbios Name of the computer ( or
> perhaps the first registered, that's the same (I guess...) )
> I try to use the NextCalledName and I got
> *SMBSERVER        the first time
> <NetbiosName>     the second call
> null              following calls.

The firstCalledName and nextCalledName functions are use internally
to the jcifs.smb package and generally should not be used. When jCIFS
connects to another machine we have to know the "CalledName". There are
many situations where we don't know what that is however (e.g. just given
an IP). So there are a bunch of names we can try like the ip address
as a string, the catch-all name '*SMBSERVER', the first label of the DNS
name, etc. So firstCalledName/nextCalledName runs through all of these
names. That's all. Don't bother with those methods. I should document
them just to prevent such confusion.

> Is there a way to reproduce the NBTSTAT information and being able to konw
> all the name registered with that adapter and their functions
> (workstation name, server, messenger, domain name, users logged on,....) ?

Yes. Use the NbtAddress.getAllByAddress method. The hexcode will tell
you what the type of name is. You'll see there's a link in the NbtAddress
api documentation to a page from MS explaining what the hexcodes mean.


A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 

More information about the jcifs mailing list