[jcifs] querying a wins server for a list of workgroups
Christopher R. Hertel
crh at ubiqx.mn.org
Fri Jul 27 01:36:08 EST 2001
On Thu, Jul 26, 2001 at 12:06:42AM -0400, Ian Charnas wrote:
> However, now I try to look up smb:// (to get a list of workgroups) .... but
> jcifs doesn't ask the wins server this time.
Correct. A Windows client might send a query to the WINS server, but the
WINS server will always return a Netgative Name Query Response when
queried for a unique 0x1D name. This is a kludge, but it's Microsoft's
kludge, not ours.
jCIFS takes a short-cut (I assume) by not sending 0x1D queries to the WINS
server at all. That simply speeds things up.
> Instead, jcifs sends a netbios NameQueryRequest to the broadcast address to
> find a master browser, and then it asks the master browser for a list of
> workgroups. Well, the master browser only knows of the workgroups within
> its network segment. There are a *lot* of segments on this network.
> The WINS server knows about all the workgroups in all the segments, so why
> isn't jcifs asking the wins server for this information? Am I doing
> something wrong? Is there a way to get jcifs to ask the wins server for a
> list of workgroups?
The WINS server doesn't keep a list of 0x1D names, so it doesn't know
about all of the workgroups in the segment. When a Master Browser
registers itself, the WINS server politely send back a Postive
Registration Response. Then, while the client isn't looking, it scrapes
the registration into the bit bucket and denys any knowledge of the
existance of 0x1D unique names. That's how Microsoft gets a Master
Browser on each subnet. (There are other side effects...nodes in P-mode
cannot find the browse list at all!)
If the workgroups are actually NT Domains, then the WINS server does have
a list because the Domain Controllers will register their 0x1B names. In
this case, though, the 0x1B names represent the Domain Master Browser
function of the PDC. DMBs will correlate browse lists for you, so (once
again) you don't need to query the WINS server.
If you don't have PDCs for all of your workgroups, you can do something
unique with Samba. Unlike Windows, Samba can run as a DMB even if there
is no PDC for the workgroup. Samba has a few other tricks for
distributing browse lists. Read the docs.
Hope that helps.
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
More information about the jcifs