SAMBA client for MagiCNet
-------------------------

This is the port of SMB client, the client that gives access to
SMB compatible (NetBIOS) servers such as several Unix systems,
Linux, windows(95/98/2k) and win-NT. Drives, folders, files and
printers 'exported' by the server can be accessed by the client.

The following should be considered short introduction to the SMB
world, for more info you should visit the SAMBA pages at
"http://www.samba.org" and pick your closest link.

Since I don't like command line programs for MagiC/MagiCNet this
client will shortly be converted to a device driver (possibly
with a shared lib) so that BNeT will be able to use such services
directly from our desktops. For now, try it as a beta, report any
problems, check the commands etc.

Installation:
-------------
The 'official' location of SAMBA programs is "u:\usr\local\samba"
or "u:\usr\local\samba\bin". I suggest the creation of a x:\usr
folder on your VFAT partition which will be linked to U:\ drive.

Inside this folder create a subfolder "local" and inside "local"
"samba". The "samba" folder should contain three more folders
"lib", "private" and "var". In the "lib" folder copy the file
smb.conf, optionaly your LMHOSTS file and create yet another
folder called "codepages".

If it all looks complicated, take a look at the original SAMBA
documentation, then you'll realize what complicated means :-)

Having prepared the above directory structure your VFAT drive
should have a tree like this.
 
 x:/usr
     /local
           /samba
                 smb_clnt.ttp
                 /lib
                     smb.conf
                     LMHOSTS    (optional, not needed for now)
                           /codepages
                 /private
                     smbpasswd  (optional)
                 /var

I'd also strongly suggest the creation of a x:\tmp folder and
in case you already have one, link it to U:\TMP

I'm using a utility from Daniel Augsburger called LINK2U.PRG which
does the job fine. Just copy it to your \GEMSYS\MAGIC\START folder
and prepare a text file called link2u.cnf in your $HOME folder 
defining the links. This is my own LINK2U.CNF:
---------------------------
# create links to drive u
#
sln i:\usr u:\usr
sln i:\tmp\ u:\tmp

# delete link to drive a
#
delu a
---------------------------

All the above is impotant if you wish to have your system ready for
SMB server and other SMB related tools that will be published in the
near (I hope) future. For the moment the SMB server is almost ready
and BNeT will be updated to be SAMBA compatible.

Usage:
------
Make sure you can ping from/to your server.

Run the client with wrong parameters (--help will do) to see the 
usage screen and get an idea of available options.

Now run SMB_CLNT.TTP with parameters <\\your_server><\shared_drive>
-N - U <username>. For example to connect to a win95/98/2K/NT PC 
with name "MY_PC" and drive C:\ shared as "DRIVE_C", pass the line:

smb_clnt.ttp "\\MY_PC\DRIVE_C -N -U guest"

Note: -N means don't ask for a password. If the remote server insists
on asking for password read the SMB docs for ways to overcome this or
contact me.

You should now see the smb: \> prompt. From now on the smb client
works like an ftp client.

Hint
----
If you have connected to your windows C:\ drive, it's a good idea to
change to another folder than root for playing with SAMBA. This can
save you filling your root partition with test files or even worse
delete importan files. It's a good practice to NOT share your C:\
drive, you can share any folders inside it or other drives, CDs etc.

You can use the following commands: (available also by typing 'help'
or '?' on the command prompt).

ls      <mask> list the contents of the current folder
dir     <mask> list the contents of the current folder
lcd     [folder] change/report the local current working folder
cd      [folder] change/report the remote folder
pwd     show current remote folder (same as 'cd' with no args)
get     <remote name> [local name] get a file
mget    <mask> get all the matching files
put     <local name> [remote name] put a file
rename  <src> <dest> rename some files
mask    <mask> mask all filenames against this
del     <mask> delete all matching files
rm      <mask> delete all matching files
mkdir   <folder> make a folder
md      <folder> make a folder
rmdir   <folder> remove a folder
rd      <folder> remove a folder
pq          enumerate the print queue
prompt      toggle prompting for filenames for mget and mput  
recurse     toggle folder recursion for mget and mput  
translate   toggle text translation for printing  
lowercase   toggle lowercasing of filenames for get 
print       <file name> print a file
printmode   <graphics or text> set the print mode
queue       show the print queue
qinfo       show print queue information
cancel      <jobid> cancel a print queue entry
quit        logoff the server
q           logoff the server
exit        logoff the server
help        [command] give help on a command
?           [command] give help on a command
    

Not tested or not working on MagiCNet:
--------------------------------------
more        <remote name> view a remote file with your pager
mput        <mask> put all matching files
tar         tar <c|x>[IXbgNa] current folder to/from <file name>
blocksize   blocksize <number> (default 20)
tarmode     <full|inc|reset|noreset> tar's behaviour towards archive bits
setmode     filename <setmode string> change modes of file
newer       <file> only mget files newer than the specified local file
archive     <level> n0=ignore archive bit
                    n1=only get archive files
                    n2=only get archive files and reset archive bit
                    n3=get all files and reset archive bit

Additional comments:
--------------------
If your remote 'server' is a win95/98 computer you can have a look at
'Net Watcher' and see your connection parameters, file(s) currently
in use etc.

You can run the client with the -L <hostname> parameter, this should
show you all the shares on the remote server.

For win NT 4 I just made a new user "Vassilis" with blank password
and the client worked fine. So I suggest this method although the
SAMBA docs have much more info and even registry modifications for
win NT connections.

You don't know the name of your PC? Go to the window$ Control Panel
(a stolen name ? ;-), open the Network icon, click the Identification
tab and read the Computer name field (if there is also a workgroup
name, take a note, we might need it later).

Two 'clients' should be installed, Client for Microsoft Networks and
File and Printer sharing for Microsoft Networks. TCP/IP-><hw_adapter>
that your ATARI connects to, should also be correctly installed.

Printing:
---------
You can connect to a remote shared printer with the -P option, eg.

smb_clnt.ttp "\\DELL_PC\HP520 -P -N -U guest"

Now for printer drivers available to our ATARIs, tell NVDI to print
to a file and then use the command "print <filename>" to print this
file to the remote printer. I have no idea about postscript or other
print methods, please contact me with suggestions.

Text files can be printed directly with or without CR/LF translation,
use the 'translate' command to toggle this on or off.

Speed:
------
On my TT with MagiC 6.x and MagiCNet 1.3.7b with RTL8012 pocket
ethernet adapter the speed connected to a 450 MHz Pentium with
win 98, is between 120 and 144 Kb/sec, not bad considering the way
SAMBA is written.

Problems?
---------
First check your server setup, TCP settings etc. Then increase the
debug level to 4 or 5 (run SMB_CLNT.TTP with your usual params plus
-d 5) and send me the info.

Version info:
-------------
For MagiCNet this is version 01.00 based on the original 1.9.18p3
(which is the one printed on the screen) but with a touch of newer
versions (2.xx and newer). It's not possible to compile the whole
project with Pure C (even with gnu C for MagiC) so I keep what is
working and update what is not.

Thanks:
-------
To Andrew Tridgell and the SAMBA team that made possible for others
to connect to the chaos called by some 'Micro$oft Networks'.

Copyright:
----------
(c) Andrew Tridgell 1994-1998
(c) The SAMBA team  1993-2001
(c) Vassilis Papathanassiou 2001

Status and disclaimer:
----------------------
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
