pppd for MagiCNet
-----------------
This is pppd and chat intergrated into a single program with a 
simple GEM interface. This is not the best possible solution but
should be enough to get us online.

Installation:
-------------
Unpack the archive in any folder. Copy the ppp folder from the new
MagiCNet distribution into your U:\etc\ folder and modify its files
for your needs.

The tree needed is:

u:\etc
     \ppp
        options
        chat_script
        chap-secrets    (if chap authentication is required)
        pap-secrets     (if pap authentication is required)
          \opts
            default.opt (a copy of the options file)
            local.opt   (... other options files)
           
If you use a scrip to login to your ISP, filling usrename and 
password entries in chat-script with your account details should
be OK. On all other cases you should inform me on success or 
failure (setting 'debug' in options will help a lot !).

Short explanation of options and chat-scrip settings
----------------------------------------------------
options sample
----------------------------------------------------
debug
/dev/MODEM1
115200
0.0.0.0: 
noauth
-vj
noipdefault
defaultroute
connect "u:/usr/etc/chat -f u:/etc/ppp/chat-script"
----------------------------------------------------
 
  debug
  
  Will turn debug mode on. pppd opens a log file in your u:\tmp
  folder (and it's a good idea to have a tmp folder linked to
  your U:\ drive, several other unix programs might need this
  and fail without warning if it doesn't exist).
  
  /dev/<serial port> eg /dev/modem2
  
  The serial port that will be used for the connection. Please 
  note that there are no ttys in MagiC.
  
  speed (eg. 38400, 115200 etc)
  
  Will set the baud rate for this port. If a default setting is
  used (eg through the SERIAL.CPX), just remove this line and
  pppd will use whatever the current speed for this port is.
  
  local IP:remote IP
  
  For most cases this should be 0.0.0.0 unless you have a static
  IP or make local intranet connections. Can be removed if 
  noipdefault is used.
  
  noauth
  
  Used to set pppd to NOT ask the remote system to authenticate
  itself, most ISPs refuse it and this can cause problems and
  finaly result in connection timeout.
  
  -vj
  
  Is used to suppress Van Jacobson compression. MagiCNet's new
  SLIP.MIF implements it better so this option can be used, for
  the moment leave it off (ie use -vj).
  
  noipdefault
  
  pppd will not try to assign a default IP address for this port
  (eg by reading your HOSTNAME), your ISP will provide a dynamic
  IP address.
  
  defaultroute
  
  pppd will add a default route to the routing table using the
  IP address that your ISP has given you. If you already have
  a default route through any other interface, pppd will replace
  it for the time of the connection and then restore it.
  
  connect "/usr/etc/chat -f u:/etc/ppp/chat-script"
  
  What this line says is: connect using the chat program and chat
  will use the file (-f) u:/etc/ppp/chat-script. Since chat is
  intergrated into pppd (to avoid fork() and other nasty calls ;-),
  this line decides if a modem call will be done or not. 
  
  The path to the chat program is NOT needed, it's here only for
  compatibility or in case someone already has such a file from
  MiNT's pppd. Thus using connect "chat -f <path to a file>" will
  normally work.
  
chat-script sample
----------------------------------------------------
""
ATZ
OK
ATDT0123456789
ABORT "BUSY"
ABORT "NO CARRIER"
CONNECT
""
sername:
<username>
ssword:
<password>
----------------------------------------------------

  Chat also uses a 'conversational' method to talk to the modem,
  for every string sent, a reply is expected.
  
  ""
  
 - Send an empty string (useful :-)
  
  ATZ or other modem init AT string
  
 - Reset or initialize the modem.
 
  OK
  
 - We expect OK as the reply, if not, modem is not on or some other
   error has happened. pppd will terminate.
   
  ATDT01234567
  
 - Dial this number.
 
  ABORT "BUSY"
  ABORT "NO CARRIER"
  ...... (other ABORT reasons)
  CONNECT
  
 - Abort on above error conditions, continue in case CONNECT is 
   received from the modem.
   
 We're online now. If you use a script (as I do with my ISP) 
 continue the file by providing the script details.
 
  ""
  sername:
  
  Wait for this part of the word "Username:", as practice has shown,
  it's better to wait for parts of a word than for the whole word.
  
  loginname
  
  Reply with your login name.
  
  ssword:
  
  Wait for "Password:"
  
  passwd
  
  Reply with your password.
  
 Fill any other strings your ISP might require to completely log you
 in the network, for example mine still permits slip connections, so
 it asks for PPP, SLIP or Aborting the connection, in that case the
 expected string is "Selection: " and the reply "1", "2" or "3".
 Your existing setup can help in this case or, (first time user ??!)
 a terminal program will tell you exactly the menu your ISP uses.
 
 PAP and CHAP
 ------------
 If your ISP uses no menu then pap or chap negotiation will start.
 For this to have any chance to succeed, your chap or pap-secrets
 file should be correctly filled with your username and password.
 
 # Secrets for authentication using PAP
 # client	server	secret			IP addresses
   papval     *     "our secret"
   
 The example above gives my loginname, accepts any server for 
 authentication and then proves that it knows the password
 (put your password inside quotes if it contains any strange
 characters, spaces etc).
 
 Note:
 -----
 This version of pppd will complain with the message:
 "Warning - secret file u:/etc/ppp/pap-secrets has world and/or 
 group access"
 Well, ignore it, although true, since we don't have such things
 (user/grpoup permitions) on MagiC :-)
 
 The .OPT scheme
 ---------------
 pppd_GEM will try to read files with the extention ".opt" from the
 folder "u:\etc\ppp\opts\" for users that connect to different ISPs
 or wish to use local connections without renaming options and
 script files. For example one can copy the options file that is
 used more often as default.opt and any subsequent files as name.opt
 (eg OTENet.opt, MyLocalPC.opt, MSCHAP.opt etc). Selection is done
 from the GEM popup. In case no such folder or files exist, pppd_GEM
 will proceed normally reading the u:\etc\ppp\options file.
 
 
 Well, that's it. I'm using this pppd version from May 2001 for
 my internet connections and it works fine. That means I need
 your feedback if something goes wrong.
 
 Limitations
 -----------
 syslog is a simplified version of the unix version(s), in fact it
 acts as a debug file called pppd and located in u:\tmp and it is
 reset every time pppd.prg is started.
 
 Signals are not supported (but you can always kill the program from
 u:\proc or from MagiC's Program Manager).
 
 Same as above, Disconnect puts pppd in Terminating phase, hangs up
 the modem and quits the program.
 
 Hanging up is currently done with the "drop DTR" method, ie no
 disconnect script is readen. Will be fixed in  the future.
 
 Version
 -------
 It closely follows pppd v 2.3.11 except where MagiC or Pure C put
 their own limitations.
 
 