netapi32 and NetBIOS
Luke Kenneth Casson Leighton
lkcl at lkcl.net
Mon Dec 15 17:31:09 GMT 2003
i've just been alerted to the netbios work in wine (hooray!) as
part of an effort to get the network neighbourhood going (yippee!).
there is a problem, which i can help overcome.
the problem is this:
imagine that there is no TCP/IP stack in linux.
imagine that TCP/IP runs in two separate user-space services,
both of which are GPL'd: the TCP service is a fork-on-demand
one that binds to all interfaces, and the UDP service is even worse,
it's a single-process running a state machine.
let's pretend that neither of the processes understand anything
but Web services, and now you want to add SMTP, or worse, HTTPS.
you have to consider hard-coding and linking into a paired monolith
of programs, and you have a licensing and logistical nightmare that
is totally unacceptable for practical purposes.
this is the situation that is faced by wine, because samba, which
consists of two programs, smbd and nmbd, "controls" the NetBIOS
transport, from both a server _and_ (due to some bugs in Windows)
also a client perspective.
a flawed attempt to make it possible to cut-in to the NetBIOS
equivalent of Dynamic-DNS-plus-DHCP (the NBNS system on port 137)
was added in 2000 into nmbd, however from the Wine perspective
this is totally useless because the code to access the bypass
mechanism is GPL'd (tdb - trivial database).
happily there is a convenient way round the mess, because it
is possible to create the equivalent of a "Network Address
Translation" service, and working code along these lines,
which maintained a state machine of NetBIOS connections,
was created over three years ago.
nmbd needs to talk via this NAT service, so does nmblookup and,
once the code is all there, so does Wine's Network Neighbourhood
at present, all you have to do to get the Wine "Network
Neighbourhood" code to work is to disable samba, which is
going to be totally impractical for most people.
it is not _yet_ necessary for such a service to be created, but by
the time the NetBIOS code in wine is released, it will _become_
if anyone wants to sponsor me [pay money] to revive the experiments
i made in late 1999 / early 2000 in order to implement a NetBIOS "NAT"
service, please contact me.
expecting email to be received and understood is a bit like
picking up the telephone and immediately dialing without
checking for a dial-tone; speaking immediately without listening
for either an answer or ring-tone; hanging up immediately and
then expecting someone to call you (and to be able to call you).
every day, people send out email expecting it to be received
without being tampered with, read by other people, delayed or
simply - without prejudice but lots of incompetence - destroyed.
please therefore treat email more like you would a CB radio
to communicate across the world (via relaying stations):
ask and expect people to confirm receipt; send nothing that
you don't mind everyone in the world knowing about...
More information about the samba-technical