wvdial (main application) prints a helpful message if pppd dies too quickly.

A "connect" line in /etc/ppp/options also elicits a warning from wvdialconf.


git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@148 6619c942-59fa-0310-bf43-a07aaa81d9ac
This commit is contained in:
apenwarr 1999-08-02 18:20:52 +00:00
parent 6c0d79895a
commit af00468d19
5 changed files with 21 additions and 11 deletions

9
TODO
View File

@ -8,20 +8,13 @@ a message to wvdial-list-request@worldvisions.ca with the subject
WvDial
------
- "Command>" should be a prompt (Janis in London)
- start PPP when you get an IP address string
- 1ms-lag-mode for wvmodem
- try harder with max speed detection (some modems just don't work at the
max baud rate!)
- mention /etc/wvdial.conf, /dev/ttyS*, and pap-secrets file permissions
- allow passing of options on the command line: if it has an '=' sign,
assume it's a configuration setting.
- find pppd in PATH, don't assume /usr/sbin/pppd
- blank lines count as prompts (sometimes?)
- portability: #ifdef's around B57600 and higher?
- create a pidfile in /var/run/wvdial.pid
- don't open terminals that are already in use, even if they don't have
lockfiles? How can we determine that?
- include a sample wvdial.conf file.
- split the debian postinst script out, so that non-debian users get the
convenient setup prompts
- go to background automatically when starting pppd (watch out with the
@ -36,6 +29,4 @@ WvDial
WvDial - docs
------
- how to disable call waiting (insert *70, in the phone number)
- ask users to send /var/log/pppd if it doesn't work
- make sure /etc/ppp/options has no nasties (modem name, phone #, etc)
- split wvdial.1 man page into wvdial.1 and wvdial.conf.5

View File

@ -86,6 +86,7 @@ int main( int argc, char ** argv )
WvSyslog *syslog = NULL;
WvConf cfg( "/etc/wvdial.conf" );
WvStringList *sections = new WvStringList;
WvLog log( "WvDial", WvLog::Debug );
bool chat_mode = false;
@ -131,6 +132,13 @@ int main( int argc, char ** argv )
&& dialer.status() != WvDialer::Idle ) {
dialer.select( 100 );
dialer.execute();
if (dialer.weird_pppd_problem) {
dialer.weird_pppd_problem = false;
log(WvLog::Warning,
"pppd error! Look at files in /var/log for an "
"explanation.\n");
}
}
dialer.hangup();

View File

@ -27,10 +27,12 @@ void check_ppp_options()
continue;
// but baud rates and tty names are not!
// a 'connect' line is usually bad too.
if (isdigit(line[0])
|| !strncmp(line, "/dev", 4)
|| !strncmp(line, "tty", 3)
|| !strncmp(line, "cua", 3))
|| !strncmp(line, "cua", 3)
|| !strncmp(line, "connect", 7))
{
fprintf(stderr,
"\n*** WARNING! Line \"%s\"\n"

View File

@ -69,6 +69,7 @@ WvDialer::WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode = fa
auto_reconnect_delay = 0;
auto_reconnect_at = 0;
connected_at = 0;
weird_pppd_problem = false;
sect_list = _sect_list;
chat_mode = _chat_mode;
@ -299,6 +300,13 @@ void WvDialer::execute()
hangup();
delete( modem );
modem = NULL;
if( time( NULL ) - connected_at < 45 ) {
weird_pppd_problem = true;
} else {
weird_pppd_problem = false;
}
// check to see if we're supposed to redial automatically soon.
if( options.auto_reconnect && isok() ) {
@ -523,7 +531,7 @@ void WvDialer::async_dial()
return;
case 0: // CONNECT
if( options.stupid_mode == true ) {
log( "Carrier detected. Starting ppp.\n" );
log( "Carrier detected. Starting PPP immediately.\n" );
start_ppp();
} else {
log( "Carrier detected. Waiting for prompt.\n" );

View File

@ -72,6 +72,7 @@ public:
virtual bool isok() const;
int connect_attempts;
bool weird_pppd_problem;
int dial_stat;
char * connect_status() const;