Help w/fd_ops for SMB
Luke Kenneth Casson Leighton
lkcl at lkcl.net
Tue Dec 16 09:51:19 GMT 2003
> Polling is not really needed for normal files anyway. Feel free to
> submit what you have, it's still useful to have the code, even if it
> needs to be moved somewhere else later on.
[fyi on samba-technical, a patch has been submitted to wine
that implements a netbios name and node status query, _and_
a full reimplementation of NetServerEnum and NetShareEnum
has been submitted.]
> And I think most of the
> name lookup etc. can be done in user space, it's only the file I/O
> itself that has to be in the kernel IMO.
no, you definitely don't want to go down that road, trust me.
it's completely unnecessary.
what you _do_ need is to have a proxy daemon that performs
the NetBIOS equivalent of Network Address Translation.
this proxy daemon needs to be used by wine, nmbd and nmblookup
(and no, there's no significant performance penalty for doing so).
the proxy daemon can bind to port 137 and can accept incoming
connections on either a unix domain socket or a high port number
or a shared memory interface.
the simplest version of the proxy daemon is to receive
pre-formatted port 137 requests, look in the packets, modify
the packet id (2 bytes) to a unique (to the daemon) outgoing
number, and using the incoming connection filedescriptor +
the original packet id in a state table.
there you have the basis of the Network Address Translation .
AT A LATER DATE, due consideration can be given to rewriting
the proxy daemon so that it has the "full" original IBM NetBIOS
3.0 API later, at which point adding things like IPX/SPX can
please trust me on this one: you do NOT want netbios in the linux
kernel, it's totally unnecessary. much more benefit can be
achieved, not least portability, by solving the issue in userspace.
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