(mm) A PPP dialer for Linux
Home | Software | Count
Software:
GWT
  GWTOAuthLogin
X/Motif
  ansi xterm
  grabc
  mdgclock
  miv
  mplaymidi
  mppp
  mxascii
  mcmap
  mxcmap
  mxconsole
  mxkill
  mxshowfont
  qtip
  xmastm
  yrolo
Web
  mhttpd
  web counter
  upload.pl
  TimeTrack.pl
  mod_auth_ldap
Games
  fltkmm
  iphonemm
Java
   cdcl
   cdclgwt
   jdgclock
Libraries
  libcalen
  libmcfg
  libsll
  libmsock
Misc
  bangla font
  dpr
  genmake
  hod
  smtp.pl
  vhtml
  phones_ldap
  showpic_ldap
  mbasecalc
  fluid_hack
  kdialppp
  strip2csv
  googlecode-upload
MS Windows
  mwinclip.pl
  mbasecalc
  mailsend
  wiv
mppp and xmppp Release 1.1b
ppp dialers for Linux
by
Muhammad A Muquit

Initial Release Jun-26-1997
Latest Release Mar-24-1998

Table of Contents

Note: I'm on broadband for quite a while. So I don't maintain or use this program anymore.
-- muquit@muquit.com, Jun-15-2003

Introduction
mppp and xmppp are two configurable ppp dialers for Linux. mppp is a character based ppp dialer and xmppp is a dialer written in X/ Motif. Either one or both can be compiled and used [not at the same time though :)]. mppp does not require anything special in order to compile. However, xmppp requires at least Motif 1.1 in order to compile. Statically linked versions of mppp and xmppp are supplied for your convenience. The programs talks to the modem device directly, therefore, no external scripts (e.g. chat) are needed. I wrote and tested them on Redhat Linux 4.1. But they should be portable to other Unices with POSIX termios. I wrote it because none of the ppp dialers worked the way I wanted. It works the way I like. I'm releasing it with the hope that it might be useful to you. Bug reports, suggestions are always welcome.

Changes
Please read this section periodically to see what have been changed or added.

  • An internal change, should not affect anything. (mar-22-1998).
  • Chnages in script file, in version 1.1a, an explicit CR (carriage return) was supplied after sending a tag. In this version, you must supply the CR or CRL if required (mar-22-1998).

Requirements

  • Your kernel must have support for ppp. You must have pppd 2.2 or higher. The default Redhat Linux is ready for ppp. If it works with Slackware, Debian etc. please let me know.
  • Familiarity with UNIX operating system. You must know how to use a text editor, copy files etc.
  • ANSI C compiler if you want to compile. (a statically built version is supplied for your convenience).
  • At least Motif 1.1, if you want to compile the Motif version. (a statically built version is supplied for your convenience).

Features

  • mppp is character based, that is no need for X to run.
  • xmppp is spiffy looking X/Motif ppp dialer.
  • mppp can be exited keeping ppp connection alive or can be killed after a specifed time.
  • xmppp can be exited keeping the ppp connection alive.
  • xmppp icons indicate the ppp status.
  • talks directly to the modem device, no need for chat script.
  • configuration file is a text file.
  • script file is a text file.
  • multiple numbers with varied baud rates can be specified.
  • maximum redial attempt for each number can be specified.
  • connection log is maintained.

Download
The both archives contain the source. The second one contains statically built motif binary (xmppp) as well.

  • Download souce:
    Source
    File: mppp1.1b.tar.gz
    Size: 80902 bytes
    MD5 Checksum: c00f54c12f57c2784721c4bba0769395
    Last updated: ?

    or
  • Download source+statically built Motif binary for Linux:
    Binary for Linux
    File: mppp1.1b_static.tar.gz
    Size: 1024205 bytes
    MD5 Checksum: e535b964e68acca04347b447afb6dec2
    Last updated: ?
After downloading, extract the distribution. At the shell prompt, type:
    $ tar -xvzf mppp1.1b.tar.gz

    or

    $ tar -xvzf mppp1.1b_static.tar.gz

    $ cd mppp1.1b

How to compile

If you want to compile with debug on, add -DDEBUG=1 in Makefile.no-moitf and Xmppp.tmp.

Compiling mppp
mppp is character based ppp dialer. Before compiling, have a look at the file Makefile.no-motif. Then, at the shell prompt, type:

    $ make clean
    $ make -f Makefile.no-motif
The name of the binary is mppp. copy it somewhere in your path.

Compiling xmppp
xmppp is X/Motif based ppp dialer. A statically linked version of xmppp is supplied. If you want to compile, your must have at least Motif 1.1. If you want to change anything, have a look at Xmppp.tmpl. Then, at the shell prompt, type:

    $ xmkmf
    $ make clean
    $ make    
The name of the binary is xmppp. copy it somewhere in your path.

Appropriate fallback resorces are used at compile time. That means, the xmppp program will have a nice look without the app-defaults file. However if you insist on changing the resources, please look the file Xmppp.ad. Copy this file to /usr/lib/X11/app-defaults or (to your home direcoty) as Xmppp. If you change any resource, make sure that you do it right, otherwise xmppp will not look right. Even a empty resources file screw things up. I suggest not to install application resources file.

If you get error message about undefined constants B57600, B115200, B230400, and B460800, you have an old kernel. Remove the flag -DHIGH_SPEED=1 from Makefile.no-motif and Xmppp.tmpl.

Synopsis

    mppp [options]
    xmppp [options]

    Where, the options include:
        -config config_file     specifies the config file
        -h                      shows this help
        -verbose                verbose mode on
        -V                      shows Version
        -quit minutes           exits keeping ppp connection open (only for
                                mppp).  If the value of minutes is 0, then 
                                the ppp connection will stay up until it 
                                is disconnected manually. If a value is 
                                specified then the pppd will be killed 
                                after the time is elapsed.      
    
    For xmppp, all standard X toolkit command line options are available.

How to use
Before using mppp or xmppp, you must setup the configuration file. mppp or xmppp can locate the configuration file in several ways. First, it looks for a environment variable called MPPP. This variable indicates the full path of the configuration file. If the variable does not exist, it looks for a file called mppp.cfg in the directory .mpppdir at the user's home directory. If you su and invoke the program, it will look for the file mppp.cfg at the directory .mpppdir at root's home, not yours. However, the location of the config file can be specified at command line with the flag -config. The command line takes precedence over everything. The easiest way to setup the configuration file as follows. From inside the mppp source directory, type the following comamnds at the shell prompt:

    $ mkdir $HOME/.mpppdir
    $ cp ./dotmpppdir/* $HOME/.mpppdir
    $ cd $HOME/.mpppdir
    $ /bin/ls -l
Now you must edit the file mppp.cfg and fccc.scr using your favorite text editor. The file fccc.scr is the script file which holds the send-expect string sequence for establishing ppp connection. You can change the name/path of this file by editing mppp.cfg file.

Configuration file
A sample configuration file is shown below. Please read the comments in the file and edit as necessary. If you followed the steps above, the file will be at the directory .mpppdir at your home directory. The name of this file is mppp.cfg. You like to keep it somewhere else, and change the name, you must run the programs with -config newname.cfg. You also have to edit the file specified by the directive Script.


#########################################################################
# Config file for mppp and xmppp 1.1b
# This file contains all necessary information in order to make a ppp
# connection to a ISP or to a PPP server running on a host.
#
# URL: http://www.fccc.edu/users/muquit
# email: ma_muquit@fccc.edu
# May-03-1997 (a vacation hack)
#########################################################################
#
# Version       Current mppp version. This must be present
#
MpppVersion     1.1b

#
# PPPcommand    full path of pppd                      
#
PPPCommand      /usr/sbin/pppd

#
#PPPdargs       pppd arguments. ALL in one line, no line break is allowed!
#
pppdargs        asyncmap 0 lock -detach defaultroute crtscts

#
# MpppLogfile   The file keeps the connection records  
#
#MpppLogfile     /users/muquit/.mpppdir/mppp.log
MpppLogfile      mppp.log

#
#MpppLockfile   The dotlock file to prevent multiple   
#               invocation of mppp.                    
MpppLockfile    mppp.lck

#
# Location      A smal description of your PPP server   #
#
Location        Fox Chase Cancer Center PPP server

#
# MaxRedial     Maximum Number of attemts to dial a specific number if the
#               Number is busy or dialing fails for some reason.
MaxRedial       3

#
# MaxLoop       Loop throught the list of numbers this many times
#
MaxLoop         5

#
# Numbers       The phone numbers. The syntax is Number1:baud|Number2:baud..
#               If the first number is busy after MaxRedial, the second
#               number is tried MaxRedial time and so on.
#
Numbers    1111111:57600|2222222:38400|3333333:38400|4444444:38400

#
# Script        The name of the file which holds the  send-expect sequence.
#               If the filename does not start with /, the file must be
#               located at $HOME/.mppdir directory
#
#Script          /users/muquit/.mpppdir/fccc.scr
Script          fccc.scr


#
# Device        The name of the modem device           
#
Device          /dev/modem

#
#InitString     Modem Init string                      
#
InitString      AT&F1M0

#
#InitOKResponse   Expected ok response from modem sending   
#                 the InitString                         
#
InitOKResponse    OK

#
# DialString    Modem Dialing string                   
#
DialString      ATX4DT

#
# DialOKResponse  Expect OK response from modem after connecting
#
DialOKResponse   CONNECT

And the following is the script file specified by the directive Script

######################################################################
# a Script file for mppp 
# ma_muquit@fccc.edu, May-31-1997
#
# The format of this file is send expect sequence, one in each line.
#
#Connect to your ppp  server using minicom or some other dialing software
#and keep a note  of the prompts and the string you responded with. You can
#use a full  or a partial string in the sequence. Try to avoid confusing
#specification. This is what I need to make a ppp connection, it may very
#significantly for you.
#
# Three characters are considered special, they are: ^cr, ^crlf and ^lf. 
# ^cr   indicates Carriage Return (\r)
# ^crlf indicates Carriage Return-Line Feed (\r\n)
# ^lf   indicates Line Feed (\n)
#
# NOTE: ^ is the literal ^ character, not a control character, that is
#       you'll type it as Shift+6 (Press shift and 6 key)
#
#       DO NOT add ^cr or ^crlf or ^lf after any expect-send line. If you
#       need any of those, add each one on a separate line.
#  
######################################################################
send   ^cr
send   ^cr
expect  Userid:
send   <Your login>

expect ssword
send   <Your password>
send    ^cr

expect >
send   ppp
send   ^cr

If you use this program to connect to your ISP, you might consider sending me the script file you use. It would be helpful to others who subscribe to the same ISP and do not know how to write the script file. Do not forget to remove your password before sending it to me.

How it works
If mppp is invoked without any arguments for reading the configuration file at command line, it will try to read the configuration file from the default location. The default location is determined in two ways. First, it looks for a environment variable called MPPP. The environment variable MPPP specifies the full path of the configuration file. If the environment variable MPPP does not exist, the program will look for a file called mppp.cfg at the directory .mppdir at the user's home directory. The environment variable and the hardcoded default can be overwritten by the flag -config. Example:

    mppp -config /some/path/abcd.cfg
    or
    xmppp -config /some/path/abcd.cfg
xmppp locates the configuration file exactly the same way, only difference with mppp is that xmppp reads the file when the Connect button is clicked.

It is possible to run mppp from cron. You might need to do this if you need to connect somewhere at certatin time in order to download a file for example. Here is how you can do this:

    mppp -quit 30 > /dev/null 2>&1
mppp will disconnect after 30 minutes.

Screen shots
A sample mppp session is shown below.


    $ mppp

    Attempt (1/3), Loop (1/5), ph # 1111111, baud 57600

    Initializing Modem ...initialized
    Dialing 1111111, Speed 57600 ... -done-
    Initiating send-expect sequence ... -done-
    Negotiating ppp handshake...
    -done-
    
    --- Press Enter to close connection ---

    Connected! (Number 1111111) (Baud 57600)
    Sun Mar 22 15:21:02 1998 -> 00:00:37


xmppp_off.jpg
Figure 1: xmppp main window.
When the Connect button is clicked, the configuration file is read and loaded. If there's any error reading the file, the program will exit. (This behavior will change in the next release.) Then the program goes through the sequence of initialization of modem, dialing and making ppp handshake with the other side. During this process the label of the Connect button changes to Cancel, that is dialing can be aborted by clicking on the Cancel button. There are four indicator at the right side of the Connect button. They indicate the state of dialing process.

The red indicator changes color from red to yellow to green as the state of connection progresses. The first red indicator changes to yellow as the modem initialization starts. It becomes green after the initialization succeeds. The second indicator goes to yellow as the dialing starts and becomes green as the connection is established with the ppp server. The third indicator becomes yellow as the send-expect sequence starts and becomes green as the send-expect sequences finishes by starting the ppp at the other side. The fourth indicator goes yellow as the pppd starts at the local machine and goes green as handshakes succeeds with the other side.

xmppp_on.jpg
Figure 2: xmppp, After ppp connection is established

If the Hangup button is clicked, the pppd daemon gets killed and modem device gets closed and initialized back to its original state. A log of the connection is written to the file specified by MpppLog directive in the config file.

on icon on icon
Figure 3: xmppp icons before and after connection respectively

The default icon is shown on the left and the icon changes like the one on the right after the ppp connection is established. After the connection, the icon name acts as a timer (hr:min:sec) which shows the elapsed time. If you use fvwm95 or some other kind of window manager which do not display icons, then the icons won't be much useful to you. I use CDE, so I can tell right away if ppp is up or down just by looking at the icon.

Frequently asked questions

  1. After writing the message "Initiating send-expect sequence ...", the program just waits for ever. What's going on?
1. After writing the message "Initiating send- expect sequence ...", the program just waits for ever. What's going on?

Answer: First of all, find out if your ISP is using PAP/CHAP for authentication. If so, you can skip the answer. This program can be used with PAP/CHAP, I'll put the instruction here as soon as get some time.

Check the script file. It must be wrong. What happening is: the program was expecting to read a specific string, but it never arrived. To solve this problem, Connect to your ppp server using minicom or some other dialing software and keep a note of the prompts and the string you responded with. Use this information to write the script file.

Todo

  • Better documentation.
  • Rigorous error checking in code.
  • Allow editing configuration file in xmppp.
  • Allow entering password interactively.
  • and many more.

back Page updated: Sun Mar 31 01:59:56 2013 GMT   Copyright © 2013 muquit@muquit.com.