wvdial-1.61/0000755000175000017500000000000011512320272012660 5ustar thierrythierrywvdial-1.61/configure0000755000175000017500000000054711077703077014613 0ustar thierrythierry#!/bin/sh PACKAGE_NAME=wvdial PACKAGE_VERSION=1.61 sed -e "s/@PACKAGE_NAME@/$PACKAGE_NAME/g" \ -e "s/@PACKAGE_TARNAME@/$PACKAGE_NAME/g" \ -e "s/@PACKAGE_STRING@/$PACKAGE_NAME $PACKAGE_VERSION/g" \ -e "s/@PACKAGE_VERSION@/$PACKAGE_VERSION/g" \ Makefile.in > Makefile sed -e "s/@PACKAGE_VERSION@/$PACKAGE_VERSION/g" version.h.in > version.h wvdial-1.61/CHANGES0000644000175000017500000002663511077630125013676 0ustar thierrythierry Changes to WvDial since the initial release: 1.51 (2002 03 04) ---- - Synchronize with libwvstreams v3.69 - WvDialConf actually works with this release - Applied some patches from Andrew W. Nosenko that fix a couple of typos, and which makes sure that the wvdialconf man page gets installed. - Applied some patches from RedHat to make sure that WvDial and WvStreams compile clean on 64 bit architectures. Also did some cleanup to make sure that the goofy GCC that RedHat ships doesn't complain on some bits of WvDial. - Applied patches from SuSE to ensure that WvDial compiles cleanly using GCC 3.1, as well, adapt a patch to make sure that wvdialconf creates the wvdial.conf file mode 660. Also applied their multi-phone number patch (so it will dial several phone numbers in order if you ask it nicely), as well as their check to make sure inherited sections actually exist. - Applied a mega patch from SuSE that added better ISDN support, added USB modem support, added a "--no-syslog" option, inactivity timeouts, interactive passwords (WvDial will now prompt you for passwords if you ask it to), Connection checking once you're online (which can probably be adapted to run your copy of retchmail (or if you are still using fetchmail.. I guess you could run that as well) once you are online. It also reputedly works better with DialD. - Applied patch from Dushyanth Harinath to implement the "Dial Attempts" option, which will now cause WvDial to stop trying to dial after the number in this option is exceeded. - It should be mentioned somewhere that all of these nifty new features are pretty much completely untested. So please bang at them, look at them, and please send the bug reports to wvdial-list@lists.nit.ca. That's where all of the cool wvdial hackers hang out ;) 1.50 (2002 01 28) ---- - Added handling of Configuration Files in other places than /etc/wvdial.conf - Added support for Lucent WinModem devices (/dev/ttyLT) - Added support for command line options (you can now do cool things like: wvdial password=currentSecureIDNumber HeadOffice - Changed so that WvStreams is now not included in the base distribution so you need WvStreams installed as a separate package in order for WvDial to do anything intelligent. 1.42 (Sometime ago) ---- - There were some changes - not sure what they were anymore, but there were some changes between 1.41 and 1.42 1.41 (1999 01 06) ---- - Some internal changes to wvstreams for compatibility with non-gcc compilers. Nothing much that will interest most people, but anyone hacking on wvdial should hack on this version. 1.40 (1999 08 02) ---- - Lots of changes to the underlying wvstreams library and API; you probably won't notice, but it's much cleaner/faster/better now. - '%' is now a valid prompt character. - The wvdial/MENUS file documents login menu types that we currently do/don't support. Patches to fix any of the unsupported ones are (VERY!) welcome, but try to make sure you don't break any supported ones while you're at it. - After wvdial guesses at a login menu, it now reverts to default_reply. That means if menu guessing doesn't quite work the first time, you have a chance to recover and send 'ppp' instead. - Michael K. Johnson from Red Hat fixed a bug with baud rate detection: we weren't actually checking if the kernel allowed us to set the new rate, so wvdialconf choose the wrong one sometimes. - mkj also added support for a "--chat" option to wvdial: this will allow you to use wvdial as a drop-in replacement for the "chat" program, because wvdial will talk on stdin/stdout and log messages to syslog. Try something like this: pppd connect 'wvdial --chat' /dev/ttyS2 115200 Thanks, Michael! - If you have the liblockdev library installed, we use that instead of our own routines to create lock files in /var/lock. Among other things, that makes /dev/modem symlinks safe! (But _everybody_ has to use liblockdev on your system if you really want it to be useful.) - "New PPPD = yes" is now the default, because nearly everyone has the new pppd nowadays. You can still turn it off if you want. 1.30 and 1.31 (never released) ------------- - These were pre-release versions distributed to Patrick Patterson (author of kwvdial) and Red Hat, respectively, to help them integrate their packages with wvdial. 1.20 (1998 11 07) ---- - Auto Reconnect is on by default. It was supposed to be before. Oops. Changed some of the delays, too. - WvDial is now smarter with short menus that arrive at the same time as their prompts. Previously, the prompt would get lost, and so the prompt wouldn't get answered even if wvdial successfully found the option. - We can now read menus such as "Press P for PPP, R for shell" correctly. - Now using the latest WvStreams library, with several bugfixes and cleanups. - New autodependency mechanism is MUCH faster. 1.10 (1998 09 23) ---- - The '$' character is now a valid prompt character. (So the bash$ prompt can work!) - WvDial keeps track of how many times it has tried to connect during the current session. It also auto-redials if your ISP hangs up on you, and has an exponential backoff timer (delay doubles each time) if it simply can't connect for some reason. - wvdialconf was setting Init, not Init1 in /etc/wvdial.conf. Unfortunately, there is no such option, so people wanting to change the ATZ were getting confused. 1.01 (1998 09 10) ---- - "Remote Name" option now defaults to '*' instead of 'wvdial' -- this should help people using CHAP. - People with 7e1 connections (ie. certain Compuserve dial-ins) should now be able to connect, because WvDial ignores the incoming parity bit. - WvDial no longer re-initializes the modem on exit. 1.00 did sometimes, for a rather silly reason. - Because of another silly error (capitalization of the word 'Modem') WvDial 1.00 was printing the "-->" arrow for _all_ lines, not just informational messages. - There was an obscure bug that caused crashing with certain very specific prompt styles. 1.00 (1998 08 25) ---- - There really wasn't much wrong with it! This version is 0.41 with patches for a few build problems, the latest WvStreams library, and up-to-date documentation. 0.41 (1998 05 16) ---- - Now works better with pppd 2.3.x: you don't need "noauth" in /etc/ppp/options. Set the option "New PPPD = yes" in wvdial.conf. - Cleaned up some compile problems with the egcs compiler. - Longer delay between TERMinating and KILLing pppd. 0.40 (1998 04 19) ---- - WvDial now aborts a connection sequence if it sees that the modem has dropped carrier. You can disable this with the "Carrier Check" config file option. - Boolean (on/off) options in wvdial.conf can now be set to 1/0, on/off, yes/no, and true/false. - Much cleaner prompt detection code. Now wvdial can understand any of the following menu formats: 1. Start PPP (1) Start PPP [1] Start PPP Press (1) for PPP whack 1 - PPP If you press "1", you get PPP. - An all-new "stupid mode" disables prompt responses entirely and just runs pppd immediately when you connect, using PAP. This is for (you guessed it) "stupid" ISP's that give a login: prompt but don't let you actually log in, but work fine anyway if you just use PAP. Just set "Stupid Mode = yes" in wvdial.conf. - Up to 9 different init strings, via the config options Init1 through Init9. - Change your dial prefix and dial command separately from the phone number, possibly even in a separate [Dialer] section of wvdial.conf. WvDial now dials the modem like this: "Dial Command" "Dial Prefix" "Phone" Where by default, "Dial Command" is ATDT and "Dial Prefix" is blank. - Didn't update the manpages, again. 0.31 (1998 03 15) ---- - WvDial would segfault for some people if pppd died. Thanks to and for pointing this out. The problem was caused by referring to WvDialer::modem after it had been deleted after a disconnect. - Debian package no longer redirects pon/poff to pon.wvdial/poff.wvdial; it was too dangerous and done incorrectly. Also changed postinst to only create wvdial.conf at the "configuration" phase of installation. - Included a fix from to search for ISP "welcome" messages and avoid the 5-second "don't know what to do" delay. The implementation of this may change later. - WvDial now isn't quite as eager to respond to login prompts; it waits 100ms first. That way, if a server prints several login prompts in a row, wvdial won't try to answer all of them. 0.30 (1998 03 07) ---- - We now use the modem's carrier detect to notice when, during login, the connection has dropped. - login and password prompt override, with the "Login Prompt" and "Password Prompt" options. - Some fixes to prompt detection: "sign*on" is detected, and "~" doesn't count as a prompt string. We don't do blank-line prompts yet since they're still a bit suspicious. - Added --help and --version command-line options. - We now warn when you specify a non-existent wvdial.conf section on the command line. - Some minor changes to the output display. 0.25 (1998 02 14) ---- - wvdial now has a mailing list! Send a message (subject: subscribe) to wvdial-list-request@worldvisions.ca if you want to get in on all the latest action. All new releases will be announced here. - Added support for pppd 2.3.x, by editing pap-secrets instead of using the "deprecated" +ua option. This unfortunately means that you will need to run wvdial as root at least the first time after you set/change your password in /etc/wvdial.conf. (The +ua option was removed from pppd for security reasons, and most people agree that setting a PPP password is an "administrative" task to be done by root.) - You can now supply an arbitrary number of config file sections on the wvdial command line and wvdial will take options out of them in order. For example: "wvdial uwaterloo quiet" might take the phone number from the [Dialer uwaterloo] section, the init string from the [Dialer Quiet] section, and the rest of the information from the [Dialer Defaults] section. - Removed various unneeded files from the source tree. Some of it was Linux-specific, and getting compiled for no reason. WvDial should _hopefully_ build with very few changes on other systems, now. - "&c0" init string problem fixed -- "CLOCAL" mode should have been enabled in wvmodem.cc. 0.20 (1997 12 21) ---- - Debian package now uses debhelper instead of debmake. - Much-improved WvLog class produces cleaner and more readable screen output. (And provides room to grow into nice features like syslog.) - Simplified WvDialer class by using the new WvLog stuff, fixing several bugs in the process. - Much better prompt detection / response, now officially tested at least once. - Slightly better ppp negotiation string detection. It's still stupid, but it works. - Thanks to Stephen P. Molnar for noticing some horrible bugs in the config file parser, which may now be fixed. - The return code of pppd is now reported correctly. 0.12 (1997 12 18) ---- - Quick change to search /dev/ttyI* (ISDN) as well as /dev/ttyS*. This MAY be all that's necessary to support ISDN... but we're probably not so lucky. Let us know! 0.11 ---- - Tiny fix to rules.mk in the source code archive so that non-Debian (actually, non-bash2) users can compile WvDial. wvdial-1.61/wvmodemscan.cc0000644000175000017500000003616311260441600015522 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Intelligent serial port scanner: try to find a port (or ports) * with a working modem, guess a basic startup init string, and find * the maximum baud rate. */ #include "wvmodemscan.h" #include "wvmodem.h" #include "strutils.h" #include #include #include #include #include WvString isdn_init; bool default_asyncmap = false; // startup at atz atq0 atv1 ate1 ats0 carrier dtr fastdial // baudstep reinit done static const char *commands[WvModemScan::NUM_STAGES] = { NULL, "Q0 V1 E1", "Z", "S0=0", "&C1", "&D2", "+FCLASS=0", NULL, NULL, "", NULL }; static int baudcheck[6] = { 2400, 9600, 115200, 0 }; static int default_baud = baudcheck[0]; static int isdn_speed = 115200; WvModemScan::WvModemScan(WvStringParm devname, bool is_modem_link) : debug(devname, WvLog::Debug) { stage = Startup; memset(status, 0, sizeof(status)); if (devname[0] == '/') file = devname; else file = WvString("/dev/%s", devname); use_modem_link = is_modem_link; baud = default_baud; modem = NULL; tries = 0; broken = false; } WvModemScan::~WvModemScan() { if (isok() && isdone()) debug(WvLog::Info, "Speed %s; init \"%s\"\n", maxbaud(), initstr()); WVRELEASE(modem); } bool WvModemScan::use_default_asyncmap() const { return default_asyncmap; } bool WvModemScan::isok() const { return !broken; } WvString WvModemScan::initstr() const { char s[200]; if (isdn_init) return (isdn_init); strcpy(s, "AT"); for (int i = 0; i < NUM_STAGES; i++) { if (status[i] != Worked && status[i] != Test) continue; if (!commands[i] || !commands[i][0]) continue; if ((commands[i][0]=='Z' || commands[i][0]=='I') && status[i] != Test) continue; strcat(s, commands[i]); strcat(s, " "); } return WvString(trim_string(s)); } void WvModemScan::execute() { if (isdone() || !isok()) return; switch ((Stage)stage) { case Startup: assert(!modem); modem = new WvModem(file, baud); modem->die_fast = true; if (!modem->isok()) { if (modem->geterr() && modem->geterr() != EIO && modem->geterr() != ENOENT && modem->geterr() != ENODEV) { debug(WvLog::Info, "%s\n", modem->errstr()); } broken = true; } else stage++; break; case AT: case ATZ: case ATS0: case Carrier: case DTR: case FCLASS: case Reinit: assert(modem); status[stage] = Test; if (!strncmp(file, "/dev/ircomm", 11)) { while (baudcheck[tries+1] <= 9600 && baudcheck[tries+1] != 0) tries++; if (baudcheck[tries] > 19200 || baudcheck[tries] == 0) { broken = true; debug("failed at 9600 and 19200 baud.\n"); return; } baud = modem->speed(baudcheck[tries]); } if (!doresult(WvString("%s\r", initstr()), stage==ATZ ? 3000 : 500) || ((stage <= AT || stage == Reinit) && status[stage]==Fail)) { int old_baud = baud; tries++; //modem->drain(); //modem->speed(baud*2); //baud = modem->speed(baud); if (baudcheck[tries] == 0) { broken = true; debug("and failed too at %s, giving up.\n", WvString(isdn_speed)); // Go back to default_baud: modem->speed(default_baud); baud = modem->getspeed(); } else if (strncmp(file, "/dev/ircomm", 11)) debug("failed with %s baud, next try: %s baud\n", old_baud, baud = modem->speed(baudcheck[tries])); //baud = modem->speed(baud*2)); #if 0 if (tries >= 4) { if (baud == default_baud) { debug("nothing at %s baud,\n", WvString(default_baud)); // Ok, then let's try ISDN speed for ISDN TAs: modem->speed(isdn_speed); baud = modem->getspeed(); tries = 0; } else { // Ok, we tried default_baud and ISDN speed, give up: broken = true; debug("nor at %s.\n", WvString(isdn_speed)); // Go back to default_baud: modem->speed(default_baud); baud = modem->getspeed(); } } #endif // else try again shortly } else { tries = 0; stage++; } break; case GetIdent: assert(modem); status[stage] = Test; debug("Modem Identifier: "); if (!doresult(WvString("ATI\r"), 500) || (status[stage]==Fail)) { tries++; if (tries >= 3) debug("nothing.\n"); // else try again shortly } else { if (is_isdn()) debug("Looks like an ISDN modem.\n"); if (!strncmp(identifier, "Hagenuk", 7)) { status[stage] = Test; if (doresult(WvString("ATI1\r"), 500)) if (!strncmp(identifier, "Speed Dragon", 12) || !strncmp(identifier, "Power Dragon", 12)) { isdn_init = "ATB8"; modem_name = WvString("Hagenuk %s", identifier); } status[stage] = Worked; } else if (!strncmp(identifier, "346900", 6)) { status[stage] = Test; if (doresult(WvString("ATI3\r"), 500)) if (!strncmp(identifier, "3Com U.S. Robotics ISDN",23)) { isdn_init = "AT*PPP=1"; modem_name = identifier; } status[stage] = Worked; } else if (!strncmp(identifier, "SP ISDN", 7)) { status[stage] = Test; if (doresult(WvString("ATI4\r"), 500)) if (!strncmp(identifier, "Sportster ISDN TA", 17)) { isdn_init = "ATB3"; modem_name = identifier; } status[stage] = Worked; } else if (!strncmp(identifier, "\"Version", 8)) { status[stage] = Test; if (doresult(WvString("ATI6\r"), 500)) modem_name = identifier; status[stage] = Worked; } else if (!strncmp(identifier, "644", 3)) { status[stage] = Test; if (doresult(WvString("ATI6\r"), 500)) if (!strncmp(identifier, "ELSA MicroLink ISDN", 19)) { isdn_init = "AT$IBP=HDLCP"; modem_name = identifier; default_asyncmap = true; } status[stage] = Worked; } else if (!strncmp(identifier, "643", 3)) { status[stage] = Test; if (doresult(WvString("ATI6\r"), 500)) if (!strncmp(identifier, "MicroLink ISDN/TLV.34", 21)) { isdn_init = "AT\\N10%P1"; modem_name = identifier; } status[stage] = Worked; } else if (!strncmp(identifier, "ISDN TA", 6)) { status[stage] = Test; if (doresult(WvString("ATI5\r"), 500)) if (strstr(identifier, ";ASU")) { isdn_init = "ATB40"; modem_name = "ASUSCOM ISDNLink TA"; } status[stage] = Worked; } else if (!strncmp(identifier, "128000", 6)) { status[stage] = Test; if (doresult(WvString("ATI3\r"), 500)) if (!strncmp(identifier, "Lasat Speed", 11)) { isdn_init = "AT\\P1&B2X3"; modem_name = identifier; } status[stage] = Worked; } else if (!strncmp(identifier, "28642", 5) // Elite 2864I || !strncmp(identifier, "1281", 4) // Omni TA128 USA || !strncmp(identifier, "1282", 4) // Omni TA128 DSS1 || !strncmp(identifier, "1283", 4) // Omni TA128 1TR6 || !strncmp(identifier, "1291", 4) // Omni.Net USA || !strncmp(identifier, "1292", 4) // Omni.Net DSS1 || !strncmp(identifier, "1293", 4) // Omni.Net 1TR6 ) { status[stage] = Test; if (doresult(WvString("ATI1\r"), 500)) if (!strncmp(identifier, "Elite 2864I", 11) || !strncmp(identifier, "ZyXEL omni", 10)) { isdn_init = "AT&O2B40"; if (strncmp(identifier, "ZyXEL", 5)) modem_name = WvString("ZyXEL %s", identifier); else modem_name = identifier; } status[stage] = Worked; } tries = 0; stage++; } case BaudStep: assert(modem); modem->drain(); modem->speed(baud*2); // if we try 2*baud three times without success, or setting 2*baud // results in a lower setting than 1*baud, we have reached the // top speed of the modem or the serial port, respectively. if (tries >= 3 || modem->getspeed() <= baud) { // using the absolute maximum baud rate confuses many slower modems // in obscure ways; step down one. baud = modem->speed(baud); debug("Max speed is %s; that should be safe.\n", baud); stage++; status[stage] = Worked; break; } debug("Speed %s: ", modem->getspeed()); if (!doresult("AT\r", 500) || status[stage] == Fail) { tries++; } else // got a response { baud = modem->getspeed(); tries = 0; // next time through we try a faster speed } break; case Done: case NUM_STAGES: assert(0); break; // should never happen } if (stage == Done) // we just incremented stage number to Done { WVRELEASE(modem); } } bool WvModemScan::doresult(WvStringParm _s, int msec) { char buf[1024], *cptr; size_t len; WvString s(_s); modem->drain(); usleep(50 * 1000); // delay a bit after emptying the buffer modem->write(s); debug("%s -- ", trim_string(s.edit())); len = coagulate(buf, sizeof(buf), msec); if (!len) { // debug("(no answer yet)\n"); return false; } buf[len] = 0; cptr = trim_string(buf); while (strchr(cptr, '\r')) { cptr = trim_string(strchr(cptr, '\r')); if (stage == GetIdent && status[stage] == Test) { char *p = strpbrk(cptr, "\n\r"); if (p) *p=0; identifier = cptr; status[stage] = Worked; debug("%s\n", identifier); return true; } } while (strchr(cptr, '\n')) cptr = trim_string(strchr(cptr, '\n')); debug("%s\n", cptr); if (!strncmp(cptr, "OK", 2)) status[stage] = Worked; else status[stage] = Fail; return true; } size_t WvModemScan::coagulate(char *buf, size_t size, int msec) { size_t len = 0, amt; char *cptr = buf; assert(modem); if (!modem->isok()) { broken = true; return 0; } while (modem->select(msec, true, false)) { amt = modem->read(cptr, size-1); cptr[amt] = 0; len += amt; size -= amt; cptr += amt; if (strstr(buf, "OK") || strstr(buf, "ERROR")) break; } return len; } const char *WvModemScan::is_isdn() const { if (isdn_init) return isdn_init; if (!identifier) return NULL; if (identifier == "3C882") // 3Com Impact IQ return identifier; if (identifier == "346800") // USR ISDN TA return identifier; #if 0 // this isn't nearly unique enough... if (identifier == "960") // Motorola BitSurfr return identifier; #endif return NULL; } static int fileselect(const struct dirent *e) { return !strncmp(e->d_name, "ttyS", 4) // serial || !strncmp(e->d_name, "ttyLT", 5) // Lucent WinModem || !strncmp(e->d_name, "ttyACM", 6) // USB acm Modems || !strncmp(e->d_name, "ttyUSB", 6) // Modems on USB RS232 || !strncmp(e->d_name, "ircomm", 6) // Handys over IrDA || !strncmp(e->d_name, "ttySL", 5); // SmartLink WinModem // (no internal ISDN support) || !strncmp(e->d_name, "ttyI", 4); } #if defined(__GLIBC__) && __GLIBC_PREREQ(2, 10) static int filesort(const dirent **e1, const dirent **e2) #else static int filesort(const void *_e1, const void *_e2) #endif { #if !(defined(__GLIBC__) && __GLIBC_PREREQ(2, 10)) dirent const * const *e1 = (dirent const * const *)_e1; dirent const * const *e2 = (dirent const * const *)_e2; #endif const char *p1, *p2; int diff; for (p1=(*e1)->d_name, p2=(*e2)->d_name; *p1 || *p2; p1++, p2++) { if (!isdigit(*p1) || !isdigit(*p2)) { // Scan i (ircomm*) after t (tty*): if (*p1 == 'i' && *p2 == 't') return(1); // Scan A (ttyACM*) after S (ttyS*): if (*p1 == 'A' && *p2 == 'S') return(1); if (*p1 == 'S' && *p2 == 'A') return(-1); diff = *p1 - *p2; if (diff) return diff; } else // both are digits { return atoi(p1) - atoi(p2); } } return 0; } WvModemScanList::WvModemScanList(WvStringParm _exception) : log("Modem Port Scan", WvLog::Debug) { struct dirent **namelist; struct stat mouse, modem; int num, count, mousestat, modemstat; WvString exception; thisline = -1; printed = false; mousestat = stat("/dev/mouse", &mouse); modemstat = stat("/dev/modem", &modem); num = scandir("/dev", &namelist, fileselect, filesort); if (num < 0) return; // there shouldn't be a /dev/ if (!!_exception) exception = strrchr(_exception, '/') + 1; for (count = 0; count < num; count++) { // never search the device assigned to /dev/mouse; most mouse-using // programs neglect to lock the device, so we could mess up the // mouse response! (We are careful to put things back when done, // but X seems to still get confused.) Anyway the mouse is seldom // a modem. if (mousestat==0 && mouse.st_ino == (ino_t)namelist[count]->d_ino) { log("\nIgnoring %s because /dev/mouse is a link to it.\n", namelist[count]->d_name); continue; } if (!!exception && !strcmp(exception, namelist[count]->d_name)) { log("\nIgnoring %s because I've been told to ignore it.\n", namelist[count]->d_name); continue; } // bump /dev/modem to the top of the list, if it exists // and also use /dev/modem as the device name which will be used later // so PCMCIA can change it where it has detected a serial port and // wvdial will follow without the need for another wvdialconf call. if (modemstat==0 && modem.st_ino == (ino_t)namelist[count]->d_ino) { log("\nScanning %s first, /dev/modem is a link to it.\n", namelist[count]->d_name); prepend(new WvModemScan(WvString("%s", namelist[count]->d_name), true), true); } else append(new WvModemScan(WvString("%s", namelist[count]->d_name), false), true); } while (--num >= 0) free(namelist[num]); free(namelist); } // we used to try to scan all ports simultaneously; unfortunately, this // caused problems when people had "noncritical" IRQ conflicts (ie. two // serial ports with the same IRQ, but they work as long as only one port // is used at a time). Also, the log messages looked really confused. // // So now we do the scanning sequentially, which is slower. The port // being scanned is at the head of the list. If the probe fails, we // unlink the element. If it succeeds, we have found a modem -- so, // isdone() knows we are done when the _first_ element is done. // void WvModemScanList::execute() { assert (!isdone()); WvModemScanList::Iter i(*this); for (i.rewind(); i.next(); ) if (!i().isdone()) break; if (!i.cur()) return; WvModemScan &s(*i); if (!s.isok()) { if (!printed) { WvStringParm f = s.filename(); const char *cptr = strrchr(f, '/'); if (cptr) cptr++; else cptr = f; if (!strncmp(cptr, "tty", 3)) cptr += 3; ++thisline %= 8; if (!thisline) log("\n"); log("%-4s ", cptr); } i.unlink(); printed = false; } else { s.execute(); if (s.isok()) printed = true; } if (isdone()) log("\n"); } bool WvModemScanList::isdone() { WvModemScanList::Iter i(*this); for (i.rewind(); i.next(); ) if (!i().isdone()) return false; return true; } wvdial-1.61/wvrules.mk0000644000175000017500000001566211077706451014747 0ustar thierrythierry# wvrules.mk # # Copyright (C) 1998-2007 by Avery Pennarun # and contributors. # Use, distribute, modify, and redistribute freely. (But if you're nice, # you'll send all your changes back to me.) # # This is a complicated-looking set of Makefile rules that should make your # own Makefiles simpler, by providing for several useful features (like # autodependencies and a 'clean' target) without any extra effort. # # It will only work with GNU make. # # we need a default rule, since the 'includes' below can cause trouble .PHONY: default all default: all all: CC CXX # if WVSTREAMS_SRC is set assume everything else is set. # For packages that use WvStreams use WVSTREAMS_SRC=. for distribution. ifneq ($(WVSTREAMS),) WVSTREAMS_SRC=$(WVSTREAMS) WVSTREAMS_LIB=$(WVSTREAMS) WVSTREAMS_INC=$(WVSTREAMS)/include WVSTREAMS_BIN=$(WVSTREAMS) endif export WVSTREAMS WVSTREAMS_SRC WVSTREAMS_LIB WVSTREAMS_INC WVSTREAMS_BIN SHELL=/bin/bash include $(WVSTREAMS_SRC)/config.defaults.mk -include $(WVSTREAMS_SRC)/config.mk -include $(WVSTREAMS_SRC)/config.overrides.mk -include $(WVSTREAMS_SRC)/local.mk ifeq (${EXEEXT},.exe) _WIN32=_WIN32 XPATH += $(WVSTREAMS)/win32 $(WVSTREAMS)/win32/cominclude AR=i586-mingw32msvc-ar LIBS += -lssl -lcrypto -lz -lole32 -lrpcrt4 -lwsock32 -lgdi32 -limagehlp \ -lxplc-cxx -lxplc -lstdc++ else CFLAGS += -fPIC CXXFLAGS += -fPIC endif include $(WVSTREAMS_SRC)/wvrules-$(COMPILER_STANDARD).mk ifeq (${WVTESTRUN},) WVTESTRUN=$(WVSTREAMS_BIN)/wvtestrunner.pl endif # macros that expand to the object files in the given directories objects=$(sort $(foreach type,c cc,$(call objects_$(type),$1))) objects_c=$(filter-out $(WV_EXCLUDES), \ $(patsubst %.c,%.o,$(wildcard $(addsuffix /*.c,$1)))) objects_cc=$(filter-out $(WV_EXCLUDES), \ $(patsubst %.cc,%.o,$(wildcard $(addsuffix /*.cc,$1)))) tests_cc=$(filter-out $(WV_EXCLUDES), \ $(patsubst %.cc,%,$(wildcard $(addsuffix /*.cc,$1)))) # default "test" rule does nothing... .PHONY: test runtests test: runtests: %/test: $(MAKE) -C $(dir $@) test INCFLAGS=$(addprefix -I,$(WVSTREAMS_INC) $(XPATH)) CPPFLAGS+=$(INCFLAGS) \ -D_BSD_SOURCE -D_GNU_SOURCE $(OSDEFINE) \ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ -DUNSTABLE ifeq ($(VERBOSE),1) COMPILE_MSG := LINK_MSG := DEPEND_MSG := SYMLINK_MSG := else COMPILE_MSG = @echo compiling $@...; LINK_MSG = @echo linking $@...; #DEPEND_MSG = @echo " depending $@..."; DEPEND_MSG := @ SYMLINK_MSG := @ endif # any rule that depends on FORCE will always run .PHONY: FORCE FORCE: ifeq ($(LN_S),) LN_S := ln -s endif ifeq ($(LN),) LN := ln endif # Create symbolic links # usage: $(wvlns,source,dest) wvlns=$(SYMLINK_MSG)$(LN_S) -f $1 $2 # Create hard links # usage: $(wvln,source,dest) wvln=$(SYMLINK_MSG)$(LN) -f $1 $2 # usage: $(wvcc,outfile,infile,stem,extra_cflags,mode) # eg: $(wvcc,foo.o,foo.cc,foo,-fPIC,-c) define wvcc ./CC $(if $5,$5,-c) $3 $($1-CFLAGS) $($1-CPPFLAGS) $4 endef define wvcxx ./CXX $(if $5,$5,-c) $3 $($1-CXXFLAGS) $($1-CPPFLAGS) $4 endef %.so: SONAME=$@$(if $(SO_VERSION),.$(SO_VERSION)) wvsoname=$(if $($1-SONAME),$($1-SONAME),$(if $(SONAME),$(SONAME),$1)) ifdef _WIN32 define wvlink_so @echo "Skipping $@ on win32 (can't build shared libraries)" endef else define wvlink_so $(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -Wl,-z,defs -Wl,-soname,$(call wvsoname,$1) -shared -o $1 $(filter %.o %.a %.so,$2) $($1-LIBS) $(LIBS) $(XX_LIBS) $(if $(filter-out $(call wvsoname,$1),$1),$(call wvlns,$1,$(call wvsoname,$1))) endef endif ../%.so:; @echo "Shared library $@ does not exist!"; exit 1 ../%.a:; @echo "Library $@ does not exist!"; exit 1 ../%.o:; @echo "Object $@ does not exist!"; exit 1 /%.a:; @echo "Library $@ does not exist!"; exit 1 %.o: %.c; $(call wvcc ,$@,$<,$*) %.fpic.o: %.c; $(call wvcc ,$@,$<,$*,-fPIC) %.o: %.cc; $(call wvcxx,$@,$<,$*) %.fpic.o: %.cc; $(call wvcxx,$@,$<,$*,-fPIC) %.o: %.cpp; $(call wvcxx,$@,$<,$*) %.fpic.o:%.cpp; $(call wvcxx,$@,$<,$*,-fPIC) %.s: %.c; $(call wvcc ,$@,$<,$*,,-S) %.s: %.cc; $(call wvcxx,$@,$<,$*,,-S) %.s: %.cpp; $(call wvcxx,$@,$<,$*,,-S) %.E: %.c; $(call wvcc,$@,$<,$*,,-E) %.E: %.cc; $(call wvcxx,$@,$<,$*,,-E) %.E: %.cpp; $(call wvcxx,$@,$<,$*,,-E) %.moc: %.h; moc -o $@ $< %: %.o; $(call wvlink,$@,$^) %.t: %.t.o; $(call wvlink,$@,$(call reverse,$(filter %.o,$^)) $(filter-out %.o,$^) $(LIBWVTEST)) %.a %.libs:; $(call wvlink_ar,$@,$^) %.so:; $(call wvlink_so,$@,$^) # Force objects to be built before final binaries $(addsuffix .o,$(basename $(wildcard *.c) $(wildcard *.cc) $(wildcard *.cpp))): %.gz: FORCE % @rm -f $@ gzip -f $* @ls -l $@ # # We automatically generate header dependencies for .c and .cc files. The # dependencies are stored in the file ".filename.d", and we include them # automatically here if they exist. # -include $(shell find . -name '.*.d') /dev/null # # A macro for compiling subdirectories listed in the SUBDIRS variable. # Tries to make the target ($@) in each subdir, unless the target is called # "subdirs" in which case it makes "all" in each subdir. # define subdirs_func +@OLDDIR="$$(pwd)"; set -e; \ for d in __fx__ $2; do \ if [ "$$d" = "__fx__" ]; then continue; fi; \ cd "$$d"; \ echo ; \ echo "--> Making $1 in $$(pwd)..."; \ $(MAKE) --no-print-directory $1 || exit 1; \ cd "$$OLDDIR"; \ done @echo @echo "--> Back in $$(pwd)..." endef subdirs = $(call subdirs_func,$(subst subdirs,all,$(if $1,$1,$@)),$(if $2,$2,$(SUBDIRS))) define shell_reverse revlist="" ; \ for word in $(1) ; do \ revlist="$${word} $${revlist}"; \ done ; \ echo "$${revlist}" endef reverse = $(shell $(call shell_reverse,$(1))) clean_subdirs = $(call subdirs,clean,$(call reverse,$(SUBDIRS)),keep) %: %/Makefile FORCE @cd "$@"; echo; echo "--> Making all in $$(pwd)..."; \ $(MAKE) --no-print-directory all subdirs: ${SUBDIRS} # # Auto-clean rule. Feel free to append to this in your own directory, by # defining your own "clean" and/or "distclean" rules. # .PHONY: clean _wvclean clean: _wvclean _wvclean: @echo '--> Cleaning $(shell pwd)...' @rm -f *~ *.tmp *.o *.a *.so *.so.* *.libs *.dll *.lib *.moc *.d .*.d .depend \ .\#* .tcl_paths pkgIndex.tcl gmon.out core build-stamp \ CC CXX \ wvtestmain @rm -f $(patsubst %.t.cc,%.t,$(wildcard *.t.cc) $(wildcard t/*.t.cc)) \ t/*.o t/*~ t/.*.d t/.\#* @rm -f valgrind.log.pid* @rm -f semantic.cache tags @rm -rf debian/tmp dist-hook: PKGDIR=$(WVPACKAGE_TARNAME)-$(WVPACKAGE_VERSION) dist: dist-hook @echo '--> Making dist in ../build/$(PKGDIR)...' @test -d ../build || mkdir ../build @rsync -a --delete --force '$(shell pwd)/' '../build/$(PKGDIR)' cd ../build/$(PKGDIR) && git clean -d -f -x cd ../build/$(PKGDIR) && git log > ChangeLog @find '../build/$(PKGDIR)' -name .git -type d -print0 | xargs -0 rm -rf -- @find '../build/$(PKGDIR)' -name .gitignore -type f -print0 | xargs -0 rm -f -- @rm -f '../build/$(PKGDIR).tar.gz' @cd ../build; tar -zcf '$(PKGDIR).tar.gz' '$(PKGDIR)' @echo '--> Created tarball in ../build/$(PKGDIR).tar.gz.' wvdial-1.61/wvdialconf.10000644000175000017500000000246411077625616015124 0ustar thierrythierry.TH WVDIALCONF 1 "December 2005"" WvDial" .\" .SH NAME wvdialconf \- build a configuration file for .BR wvdial (1) .\" .SH SYNOPSIS .B wvdialconf .I /etc/wvdial.conf .\" .SH DESCRIPTION .B wvdialconf detects your modem, its maximum baud rate, and a good initialization string and generates or updates the .BR wvdial (1) configuration file based on this information. .PP .B wvdialconf is completely non-interactive. You still need to edit .I /etc/wvdial.conf to specify the phone number, login name, and password of your internet account in order for .BR wvdial (1) to work. .PP It is safe to run .B wvdialconf if a configuration file already exists. In that case, only the .IR Modem , .IR Baud , .IR Init , and .I Init2 options are changed in the .I "[Dialer Defaults]" section, and only if autodetection is successful. .\" .SH BUGS We're willing to entertain the possibility. Let us know if you have any problems by sending an e-mail to .BR . .PP .\" .SH DIAGNOSTICS An exit status of 0 means that a modem was detected and the configuration file was updated successfully. .PP Any other value means that something went wrong and the configuration file was unchanged. .\" .SH AUTHORS Dave Coombs and Avery Pennarun for Net Integration Technologies. .\" .SH SEE ALSO .BR wvdial (1), .BR wvdial.conf (5). wvdial-1.61/wvdialer.h0000644000175000017500000001116611260440437014661 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Definition of the WvDialer smart-dialer class. * */ #ifndef __DIALER_H #define __DIALER_H #include #include "strutils.h" #include "wvconfemu.h" #include "wvlog.h" #include "wvmodem.h" #include "wvpapchap.h" #include "wvdialbrain.h" #include "wvpipe.h" #include "wvstreamclone.h" #include "wvdialmon.h" #define INBUF_SIZE 1024 #define DEFAULT_BAUD 57600U extern const char wvdial_help_text[]; extern const char wvdial_version_text[]; struct OptInfo /************/ { const char * name; WvString * str_member; int * int_member; const char * str_default; int int_default; }; class WvConf; class WvDialer : public WvStreamClone /***********************************/ { public: WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode = false ); virtual ~WvDialer(); bool dial(); void hangup(); void execute(); bool check_attempts_exceeded(int connect_attempts); void pppd_watch( int w ); int ask_password(); enum Status { Idle, ModemError, OtherError, Online, Dial, PreDial1, PreDial2, WaitDial, WaitAnything, WaitPrompt, AutoReconnectDelay }; Status status() const { return stat; } time_t auto_reconnect_time() const { return (auto_reconnect_at - time(NULL)); } virtual void pre_select(SelectInfo &si); virtual bool post_select(SelectInfo &si); virtual bool isok() const; int connect_attempts; int dial_stat; char *connect_status() const; bool init_modem(); void del_modem(); WvModemBase *take_modem(); void give_modem(WvModemBase *_modem); friend class WvDialBrain; struct { WvString modem; int baud; WvString init1; WvString init2; WvString init3; WvString init4; WvString init5; WvString init6; WvString init7; WvString init8; WvString init9; WvString phnum; WvString phnum1; WvString phnum2; WvString phnum3; WvString phnum4; WvString dial_prefix; WvString areacode; WvString dial_cmd; WvString login; WvString login_prompt; WvString password; WvString pass_prompt; WvString where_pppd; WvString pppd_option; WvString force_addr; WvString remote; WvString default_reply; WvString country; WvString provider; WvString product; WvString homepage; WvString dialmessage1; WvString dialmessage2; WvString dnstest1, dnstest2; int carrier_check; int stupid_mode; int new_pppd; int auto_reconnect; int abort_on_busy; int abort_on_no_dialtone; int dial_attempts; int compuserve; int tonline; int auto_dns; int check_dns; int check_dfr; int idle_seconds; int isdn; int ask_password; int dial_timeout; } options; WvDialMon pppd_mon; // class to analyse messages of pppd private: WvDialBrain *brain; WvConf &cfg; WvStringList *sect_list; WvModemBase *modem; bool chat_mode; bool been_online; time_t connected_at; time_t auto_reconnect_delay; time_t auto_reconnect_at; WvPipe *ppp_pipe; int phnum_count; int phnum_max; WvLog log; WvLog err; WvLog modemrx; Status stat; time_t last_rx; time_t last_execute; int prompt_tries; WvString prompt_response; void load_options(); void async_dial(); void async_waitprompt(); void start_ppp(); // The following members are for the wait_for_modem() function. int wait_for_modem( const char *strs[], int timeout, bool neednewline, bool verbose = true); int async_wait_for_modem( const char * strs[], bool neednewline, bool verbose = true); char buffer[ INBUF_SIZE + 1 ]; off_t offset; void reset_offset(); // Called from WvDialBrain::guess_menu() bool is_pending() { return( modem->select( 1000 ) ); } // These are used to read the messages of pppd int pppd_msgfd[2]; // two fd of the pipe WvFDStream *pppd_log; // to read messages of pppd // These are used to pipe the password to pppd int pppd_passwdfd[2]; // two fd of the pipe }; #endif // __DIALER_H wvdial-1.61/papchaptest.cc0000644000175000017500000000123611077625616015525 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Little test program for WvPapChap. */ #include "wvpapchap.h" int main( int argc, char * argv[] ) /*********************************/ { if( argc != 4 ) { printf( "Usage: papchaptest username remote password\n" ); return( -1 ); } WvPapChap papchap; papchap.put_secret( argv[1], argv[3], argv[2] ); if( papchap.isok_pap() ) printf( "PAP successful.\n" ); else printf( "PAP failed.\n" ); if( papchap.isok_chap() ) printf( "CHAP successful.\n" ); else printf( "CHAP failed.\n" ); return( 0 ); } wvdial-1.61/wstrong-problem0000644000175000017500000000760211077625616015771 0ustar thierrythierry From Ave: I think wvdial should try 'users' as a response once, then give up and rever to 'ppp'. If "Default Reply" is set in the config file, it should override any wvdial braininess. From worldvisions@worldvisions.ca Thu Mar 25 11:55:08 1999 Received: from worldvisions by insight.worldvisions.ca with local (Exim 2.05 #1 (Debian)) id 10QDPQ-0007c0-00; Thu, 25 Mar 1999 11:55:08 -0500 Received: from localhost [127.0.0.1] (apenwarr) by insight.worldvisions.ca with esmtp (Exim 2.05 #1 (Debian)) id 10QDPQ-0007bu-00; Thu, 25 Mar 1999 11:55:08 -0500 Received: from www1.bond.net by fetchmail-4.6.4 POP3 for (single-drop); Thu, 25 Mar 1999 11:55:08 EST Received: from ccshst09.cs.uoguelph.ca (ccshst09.cs.uoguelph.ca [131.104.96.18]) by www1.bond.net (8.9.3/8.9.3) with ESMTP id LAA14001 for ; Thu, 25 Mar 1999 11:46:29 -0500 (EST) Received: from ccshst01 (ccshst01.cs.uoguelph.ca [131.104.96.14]) by ccshst09.cs.uoguelph.ca (8.8.6/8.8.6) with SMTP id LAA18089 for ; Thu, 25 Mar 1999 11:51:28 -0500 (EST) Date: Thu, 25 Mar 1999 11:51:28 -0500 (EST) From: wfs X-Sender: wstrong@ccshst01 To: Avery Pennarun Subject: Re: adding a third propmt In-Reply-To: <19990324230103.D17057@worldvisions.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-UIDL: c7c66cc952a281b12245ba5bbb05f203 Sender: Status: RO Content-Length: 2377 Lines: 90 On Wed, 24 Mar 1999, Avery Pennarun wrote: > > Could you send an exact copy of your wvdial output so I can see why it's > choosing the wrong prompt response? > > wvdial 2>&1 | tee wvdial.out > > Sure, I've included it below. Thanks for the quick response, I was shocked. Like I said, wvdial is excellent. I've never seen an app, either under *nix or Windows that was able to not only locate the modem, but figure out the proper init and control strings. Is wvdial standard with any linux distributions? If not, it should be, and with Slak (but that's a rather biased opinion). Thank you again for getting back to me so quickly. It would be great if I could use an app developed so close to home. Walter --------------------------- wvdial.out --> WvDial: Internet dialer version 1.20 --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 OK --> Modem initialized. --> Sending: ATDT 763-0250 --> Waiting for carrier. ATDT 763-0250 CONNECT 115200 --> Carrier detected. Waiting for prompt. Annex Command Line Interpreter * Copyright 1991 Xylogics, Inc. Checking authorization, Please wait... Annex username: --> Looks like a login prompt. --> Sending: wstrong wstrong Annex password: --> Looks like a password prompt. --> Sending: (password) Permission granted *-*-* 96070201 [1b][H[1b][2J Terminal Server Access to the University of Guelph HSNetwork. *-*-* annex03:33: DOSMaslo Users: Type services to display a list of campus IT services WinMaslo Users: Type ppp to complete connection annex03:33: --> Found a good menu option: "users". --> Hmm... a prompt. Sending "users". users CLI: Command not found. annex03:33: --> Hmm... a prompt. Sending "users". users CLI: Command not found. annex03:33: --> Hmm... a prompt. Sending "users". users CLI: Command not found. annex03:33: --> Don't know what to do! Starting pppd and hoping for the best. --> Starting pppd at Thu Mar 25 11:40:28 1999 --> PPP daemon has died! (exit code = 0) --> Disconnecting at Thu Mar 25 11:40:32 1999 --> Auto Reconnect will be attempted in 5 seconds --> Initializing modem. --> Sending: ATZ OK ATZ --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 OK &C1 &D2 S11=55 +FCLASS=0 --> Modem initialized. -------------------------------------------- wvdial-1.61/ppp.provider0000644000175000017500000000003611077625616015252 0ustar thierrythierrynoauth name wvdial usepeerdns wvdial-1.61/wvrules-posix.mk0000644000175000017500000000477411077701753016111 0ustar thierrythierryifdef _WIN32 LIBWVSTATIC=$(WVSTREAMS_LIB)/libwvstatic.a LIBWVBASE=$(LIBWVSTATIC) LIBWVUTILS=$(LIBWVSTATIC) LIBWVSTREAMS=$(LIBWVSTATIC) LIBUNICONF=$(LIBWVSTATIC) LIBWVDBUS=$(LIBWVSTATIC) $(LIBS_DBUS) LIBWVQT=$(LIBWVSTATIC) LIBWVTEST=$(WVSTREAMS_LIB)/libwvtest.a $(LIBWVUTILS) else LIBWVSTATIC=$(WVSTREAMS_LIB)/libwvstatic.a LIBWVBASE=$(WVSTREAMS_LIB)/libwvbase.so LIBWVUTILS=$(WVSTREAMS_LIB)/libwvutils.so $(LIBWVBASE) LIBWVSTREAMS=$(WVSTREAMS_LIB)/libwvstreams.so $(LIBWVUTILS) LIBUNICONF=$(WVSTREAMS_LIB)/libuniconf.so $(LIBWVSTREAMS) ifneq ("$(with_dbus)", "no") LIBWVDBUS=$(WVSTREAMS_LIB)/libwvdbus.so $(LIBWVSTREAMS) endif ifneq ("$(with_qt)", "no") LIBWVQT=$(WVSTREAMS_LIB)/libwvqt.so $(LIBWVSTREAMS) endif LIBWVTEST=$(WVSTREAMS_LIB)/libwvtest.a $(LIBWVUTILS) endif # # Initial C compilation flags # INCFLAGS=$(addprefix -I,$(WVSTREAMS_INC) $(XPATH)) CPPFLAGS += $(CPPOPTS) CFLAGS += $(COPTS) CXXFLAGS += $(CXXOPTS) LDFLAGS += $(LDOPTS) -L$(WVSTREAMS_LIB) # Default compiler we use for linking WVLINK_CC = $(CXX) ifneq ("$(enable_optimization)", "no") CXXFLAGS+=-O2 CFLAGS+=-O2 endif ifneq ("$(enable_warnings)", "no") CXXFLAGS+=-Wall -Woverloaded-virtual CFLAGS+=-Wall endif DEBUG:=$(filter-out no 0,$(enable_debug)) ifdef DEBUG CPPFLAGS += -ggdb -DDEBUG=1 $(patsubst %,-DDEBUG_%,$(DEBUG)) LDFLAGS += -ggdb else CPPFLAGS += -DDEBUG=0 LDFLAGS += endif define wvlink_ar $(LINK_MSG)set -e; rm -f $1 $(patsubst %.a,%.libs,$1); \ echo $2 $($1-EXTRA) >$(patsubst %.a,%.libs,$1); \ $(AR) q $1 $(filter %.o,$2 $($1-EXTRA)); \ for d in "" $(filter %.libs,$2 $($1-EXTRA)); do \ if [ "$$d" == "" ]; then \ continue; \ fi; \ cd $$(dirname "$$d"); \ for c in $$(cat $$(basename "$$d")); do \ if echo $$c | grep -q "\.list$$"; then \ for i in $$(cat $$c); do \ $(AR) q $(shell pwd)/$1 $$i; \ done; \ else \ $(AR) q $(shell pwd)/$1 $$c; \ fi; \ done; \ cd $(shell pwd); \ done; \ for l in "" $(filter %.list,$2 $($1-EXTRA)); do \ if [ "$$l" == "" ]; then \ continue; \ fi; \ for i in $$(cat $$l); do \ $(AR) q $1 $$(dirname "$$l")/$$i; \ done; \ done; \ $(AR) s $1 endef CC: FORCE @CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ $(WVSTREAMS_SRC)/gen-cc CC c CXX: FORCE @CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ $(WVSTREAMS_SRC)/gen-cc CXX cc wvlink=$(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -o $1 $(filter %.o %.a %.so, $2) $($1-LIBS) $(XX_LIBS) $(LDLIBS) $(PRELIBS) $(LIBS) wvdial-1.61/ppp.provider-pipe0000644000175000017500000000011311077625616016201 0ustar thierrythierrynoauth name wvdial plugin passwordfd.so defaultroute replacedefaultroute wvdial-1.61/TODO0000644000175000017500000000232311077625616013370 0ustar thierrythierry Volunteers welcome! Contact us at: http://groups.google.com/group/wvstreams-devel. WvDial ------ - 1ms-lag-mode for wvmodem - adjust the number of seconds before "hoping for the best" - sometimes the login prompt takes a long time to answer. - 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. - DONE version 1.5 (01/2002) - find pppd in PATH, don't assume /usr/sbin/pppd - blank lines count as prompts (sometimes?) - create a pidfile in /var/run/wvdial.pid - 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 lockfile!) - create config file 0600!! - if pppd dies "too quickly", suggest to the user that /var/log/ppp.log, daemon.log, etc may contain the answers to the problem. - '@' is a prompt string :) (MSN) - try simply "AT" (3 retries) after finding max baud rate, rather than going directly to retry the full init string. WvDial - docs ------ - how to disable call waiting (insert *70, in the phone number) - split wvdial.1 man page into wvdial.1 and wvdial.conf.5 wvdial-1.61/gen-cc0000755000175000017500000000066411077701246013762 0ustar thierrythierry#!/bin/sh -e OUTFILE=$1 EXT=$2 echo "* Generating $OUTFILE" >&2 TEMPFILE=gencc-$$.tmp cat >$TEMPFILE <<-EOF #!/bin/sh set -e MODE=\$1 BASE=\$2 DIR=\$(dirname \$BASE) DEPFILE=\$(dirname \$BASE)/.\$(basename \$BASE .o).d shift shift $CC \$MODE -o \$BASE.o \$BASE.$EXT \\ -MMD -MF \$DEPFILE -MP -MQ \$BASE.o \\ $CPPFLAGS \\ $CFLAGS \\ "\$@" EOF chmod a+x $TEMPFILE mv $TEMPFILE $OUTFILE wvdial-1.61/wvdialconf.cc0000644000175000017500000000732111077636065015346 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2005 Net Integration Technologies, Inc. * * WvDial configuration utility. Generates a basic wvdial.conf file. */ #include "uniconfroot.h" #include "wvargs.h" #include "wvfile.h" #include "wvmodemscan.h" #include "wvstrutils.h" #include "version.h" #include void check_ppp_options() { WvFile file("/etc/ppp/options", O_RDONLY); char *line; while ((line = file.getline()) != NULL) { line = trim_string(line); // comments and blank lines are ignored if (line[0] == '#' || !line[0]) continue; // IP addresses are allowed if (strchr(line, '.') || strchr(line, ':')) 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, "connect", 7)) { wvcon->print("\n*** WARNING! Line \"%s\"\n" " in /etc/ppp/options may conflict with wvdial!\n\n", line); } } } int main(int argc, char **argv) { #if DEBUG free(malloc(1)); // for electric fence #endif WvString conffilename("/etc/wvdial.conf"); WvArgs args; args.set_version("WvDialConf " WVDIAL_VER_STRING "\n" "Copyright (c) 1997-2005 Net Integration Technologies, " "Inc."); args.set_help_header("Create or update a WvDial configuration file"); args.set_help_footer("You must specify the FILENAME of the configuration " "file to generate."); args.add_optional_arg("FILENAME", false); WvStringList remaining_args; args.process(argc, argv, &remaining_args); if (!remaining_args.isempty()) conffilename = remaining_args.popstr(); wvcon->print("Editing `%s'.\n\n", conffilename); wvcon->print("Scanning your serial ports for a modem.\n\n"); WvModemScanList l; while (!l.isdone()) l.execute(); if (l.count() < 1) { wvcon->print("\n\n" "Sorry, no modem was detected! " "Is it in use by another program?\n" "Did you configure it properly with setserial?\n\n" "Please read the FAQ at http://alumnit.ca/wiki/?WvDial\n"); return 1; } WvModemScanList::Iter i(l); i.rewind(); i.next(); WvModemScan &m = *i; WvString fn = m.filename(), init = m.initstr(); wvcon->print("\nFound %s on %s", m.is_isdn() ? "an ISDN TA" : strncmp("/dev/ttyACM",fn,11) ? "a modem" : "an USB modem", fn.cstr()); if (m.use_modem_link) { wvcon->print(", using link /dev/modem in config.\n"); fn = "/dev/modem"; } else { wvcon->print(".\n"); } UniConfRoot root(WvString("ini:%s", conffilename), 0660); UniConf cfg(root["Dialer Defaults"]); cfg.xset("Modem", fn); cfg.xsetint("Baud", m.maxbaud()); cfg.xset("Init1", (m.is_isdn() ? "AT&F" : "ATZ")); cfg.xset("Init2", init); cfg.xset("ISDN", (m.use_default_asyncmap() ? "1" : "0")); cfg.xset("Modem Name", (m.modem_name ? m.modem_name.cstr() : "")); cfg.xset("Modem Type", (m.is_isdn() ? "ISDN Terminal Adapter" : (strncmp("/dev/ttyACM",fn,11) ? "Analog Modem" : "USB Modem"))); if (m.modem_name) wvcon->print("Config for %s written to %s.\n", m.modem_name, conffilename); else wvcon->print("Modem configuration written to %s.\n", conffilename); // insert some entries to let people know what they need to edit if (!cfg.xget("Phone")) cfg.xset("; Phone", ""); if (!cfg.xget("Username")) cfg.xset("; Username", ""); if (!cfg.xget("Password")) cfg.xset("; Password", ""); check_ppp_options(); cfg.commit(); return 0; } wvdial-1.61/wvdialbrain.h0000644000175000017500000000356011077625616015357 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Definition of the brains behind the WvDialer class. * */ #ifndef __WVDIALBRAIN_H #define __WVDIALBRAIN_H #include #include "strutils.h" #include "wvlog.h" #include "wvpipe.h" #include "wvstreamclone.h" class WvDialer; enum BrainTokenType /*****************/ { TOK_WORD = 0, TOK_NUMBER, TOK_PUNCT }; struct BrainToken /***************/ { BrainTokenType type; char * tok_str; char tok_char; BrainToken * next; }; class WvDialBrain /***************/ { public: WvDialBrain( WvDialer * a_dialer ); ~WvDialBrain(); void reset(); const char * check_prompt( const char * buffer ); const char * guess_menu( char * buf ); int saw_first_compuserve_prompt; private: WvDialer * dialer; int sent_login; int prompt_tries; WvString prompt_response; // These functions are called from check_prompt().... bool is_prompt( const char * c, const char * promptstring = NULL, bool dots_wild = false ); bool is_login_prompt( const char * buf ); bool is_compuserve_prompt( const char * buf ); bool is_password_prompt( const char * buf ); bool is_welcome_msg( const char * buf ); // Menu-string tokenizer.... BrainToken * tokenize( char * left, char * right ); BrainToken * tokenize( char * str ); void token_list_done( BrainToken * token_list ); // Called from guess_menu.... void guess_menu_guts( BrainToken * token_list ); void set_prompt_response( char * str ); }; inline BrainToken * WvDialBrain::tokenize( char * str ) /*****************************************************/ { if( str == NULL ) return( NULL ); return( tokenize( str, str+strlen( str ) - 1 ) ); } #endif // __WVDIALBRAIN_H wvdial-1.61/MENUS0000644000175000017500000000242411077625616013514 0ustar thierrythierry CONNECT 115200/PPP 64000/NONE Bethel College Terminal Server Please select one of the following: 1) Log in to menno 2) Start PPP session 3) Hangup and exit Enter Number: Press ( 1 ) for PPP Press 3 ) for PPP 4 ) for PPP Yonko 5 ) for PPP Yonko 6) for PPP Press 7 for PPP, 2 for chickens, or 3 8, for PPP; 2, for something else. (Don't answer me) I like food (but ignore this ppp) Choice> (9) is a PPP option but (2) is not. (2) is not, but (10) is a PPP option Enter hostname (e.g. shell3.ba) with no password, or your SLIP/PPP login: options are: P FOR PPP, R FOR SHELL ENTER USERID ACCOUNT. ===> [11] (that's CTRL-Q) La Groupe Videotron Ltee., Services PC 1 PPP 9 T h e U S I T M a i n M e n u 1. Start a Dialup Session 4. Start a Ppp Session 2. Resume a Dialup Session 5. Start a CSlip Session 3. Start a Slip Session Your Choice ? For dialup-IP, type "PPP" or "SLIP" now. If you can't log in type "trouble". Which service, please? Doesn't work: ------------ prompts that are followed immediately by CRLF, then wait on a blank line. Enter your username or type 'new' if new user: Login ID: (mitel-kanata) ENTER USERID ACCOUNT. ===> [11] wvdial-1.61/pppmon.cc0000644000175000017500000000420611260441413014503 0ustar thierrythierry // not finished // author: arvin@suse.de #include #include #include #include #include #include #include "wvdialmon.h" #include "wvfork.h" #include "wvfdstream.h" WvStream *pppd_log = NULL; // to read messages of pppd WvDialMon pppd_mon; int main( int argc, char ** argv ) { int argc_ppp = 0; const char * argv_ppp[ argc+10 ]; argv_ppp[argc_ppp++] = "/usr/sbin/pppd"; for( int i = 1; i < argc; i++ ) argv_ppp[argc_ppp++] = argv[i]; // open a pipe to access the messages of pppd int pppd_msgfd[2]; if( pipe( pppd_msgfd ) == -1 ) { fprintf( stderr, "pipe failed: %s\n", strerror(errno) ); exit( EXIT_FAILURE ); } char buffer[20]; sprintf( buffer, "%d", pppd_msgfd[1] ); argv_ppp[argc_ppp++] = "logfd"; argv_ppp[argc_ppp++] = buffer; pppd_log = new WvFDStream( pppd_msgfd[0] ); pppd_mon.setconnectmsg( "Connected..." ); /* for( int i = 0; i < argc_ppp; i++ ) printf( "%s\n", argv_ppp[i] ); */ // fork and exec pppd pid_t pid = wvfork(); if( pid == (pid_t) 0 ) { // we are the child argv_ppp[argc_ppp] = NULL; execv( argv_ppp[0], (char* const*)argv_ppp ); fprintf( stderr, "exec failed: %s\n", strerror(errno) ); exit( EXIT_FAILURE ); } if( pid < (pid_t) 0 ) { // the fork failed fprintf( stderr, "error: can't fork child process\n" ); exit( EXIT_FAILURE ); } /* ppp_pipe = new WvPipe( argv_ppp[0], argv_ppp, false, false, false ); */ // install signals for( ;; ) { // see if pppd is still alive // now watch for messages and output to stdout if( pppd_log != NULL && pppd_log->isok() ) { char *line; do { line = pppd_log->blocking_getline( 100 ); if( line != NULL ) { char *buffer1 = pppd_mon.analyse_line( line ); if( buffer1 != NULL && buffer1[0] != '\0' ) { char buffer2[ strlen( buffer1 ) + 10 ]; sprintf( buffer2, "pppd: %s", buffer1 ); fprintf( stdout, "%s", buffer2 ); } } } while( line != NULL ); } } exit( EXIT_SUCCESS ); } wvdial-1.61/wvdialmon.h0000644000175000017500000000405011077625616015050 0ustar thierrythierry // copyright: (C) 2000 by SuSE GmbH // author: arvin@suse.de // WvStreamsified by Patrick Patterson #ifndef __WVDIALMON_H #define __WVDIALMON_H #include #include #include #include #include #include #include "wvbuf.h" #include "wvstring.h" #include "wvlog.h" #include "strutils.h" class WvDialMon { public: WvDialMon (); ~WvDialMon (); // void setexec( const WvString name ) { executename = name; }; void setconnectmsg( WvStringParm name ) { connectmsg = name; }; void setdnstests (WvString, WvString); void setcheckdns (int flag) { do_check_dns = flag; } void setcheckdfr (int flag) { do_check_dfr = flag; } void reset(); // the returned buffer is only valid until the next call char* analyse_line( const char *line ); const int auth_failed(); private: // name of program to execute after successful connection // WvString executename; // // message to display after connection has been setup WvString connectmsg; // time to wait before launch of executename // int usleep_time; // // regex to match `status = ' regex_t rx_status; // regex to match quoted (not empty) text regex_t rx_quote; WvLog log; WvLog err; WvString buffer; int get_quotedtext(char *dest, const char *line); // flag int _auth_failed; // check defaultroute stuff // int do_check_dfr; int check_dfr(); int kernel_version; FILE *route_fd; char route_buffer[512]; int route_dev_col, route_dest_col, route_gw_col; int route_flags_col, route_mask_col; int route_num_cols; int open_route_table (); void close_route_table (); int read_route_table (struct rtentry *rt); int defaultroute_exists (struct rtentry *rt); // check DNS stuff // int do_check_dns; int check_dns(); WvString dnstest1, dnstest2; int check_dns_name( const char *name ); regex_t rx_namesrv; }; #endif // __WVDIALMON_H wvdial-1.61/COPYING.LIB0000644000175000017500000006126111077625616014346 0ustar thierrythierry GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! wvdial-1.61/wvdialbrain.cc0000644000175000017500000004663611077625616015530 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * The brains behind the WvDialer class. This handles prompt-detection, * menu-guessing, and related tasks. * */ #include "wvdialbrain.h" #include "wvdialer.h" #include #include #include static char rbrackets[] = ".-:'\">)]}"; static char lbrackets[] = ".-:'\"<([{"; static char brackets[] = ".-:'\"<>()[]{}"; static char menu_bad_words[] = "press push hit enter type key"; //************************************************** // WvDialBrain Public Functions //************************************************** WvDialBrain::WvDialBrain( WvDialer * a_dialer ) /*********************************************/ : dialer( a_dialer ) { saw_first_compuserve_prompt = 0; reset(); } WvDialBrain::~WvDialBrain() /*************************/ { } void WvDialBrain::reset() /***********************/ { sent_login = 0; prompt_tries = 0; prompt_response = ""; } const char * WvDialBrain::guess_menu( char * buf ) /************************************************/ // Searches buf for signs of intelligence, and tries to guess how to // start PPP on the remote side. Good for terminal servers with menus, // prompts, and (hopefully) whatever else. // Assumes buf is lowercase already, and has all its nulls turned into // whitespace. { char * cptr = NULL; char * line; char * nextline; BrainToken * tok; while( strstr( buf, "ppp" ) != NULL ) { cptr = strstr( buf, "ppp" ); // pick out the beginning of the line containing "ppp" for( line=cptr; line >= buf && !isnewline( *line ); line-- ) ; line++; // too far! // find the beginning of the next line in the buffer, or the // end of the buffer... so we know where to stop our searches. for( nextline = line; *nextline && !isnewline( *nextline ); nextline++ ) ; buf = nextline; // now 'continue' will check the next line // Now tokenize the line and perform an IntelliSearch (tm) tok = tokenize( line, nextline ); if( tok ) { guess_menu_guts( tok ); // may call set_prompt_response() token_list_done( tok ); } } if( cptr ) return( cptr + 4 ); // return pointer directly AFTER "ppp". else return( NULL ); } const char * WvDialBrain::check_prompt( const char * buffer ) /***********************************************************/ { WvString tprompt; // If we've been here too many times, or too long ago, just give up and // start pppd. if( prompt_tries >= 5 || time( NULL ) - dialer->last_rx >= 10 ) { dialer->log( WvLog::Notice, "Don't know what to do! " "Starting pppd and hoping for the best.\n" ); dialer->start_ppp(); } else if( dialer->options.compuserve && is_compuserve_prompt( buffer )) { // We have a login prompt, so send a suitable response. const char * send_this = "CIS"; dialer->log( "Looks like a Compuserve host name prompt.\n" "Sending: %s\n", send_this ); saw_first_compuserve_prompt++; saw_first_compuserve_prompt++; dialer->reset_offset(); prompt_tries++; return( send_this ); } else if( dialer->options.compuserve && !saw_first_compuserve_prompt && is_login_prompt ( buffer )) { // We have a login prompt, so send a suitable response. const char * send_this = "cisv1"; dialer->log( "Looks like a Compuserve New login prompt.\n" "Sending: %s\n", send_this ); dialer->reset_offset(); prompt_tries++; saw_first_compuserve_prompt++; return( send_this ); } else if( is_login_prompt( buffer ) ) { // We have a login prompt, so send a suitable response. WvString login = dialer->options.login; if (dialer->options.compuserve && strstr (dialer->options.login, "/noint") == 0) { login = WvString("%s%s", login, "/noint/go:pppconnect"); } dialer->log( "Looks like a login prompt.\n" "Sending: %s\n", login ); dialer->reset_offset(); prompt_tries++; return( login ); } else if( is_password_prompt( buffer ) ) { const char *passwd = 0; if (dialer->options.compuserve && saw_first_compuserve_prompt == 1) { passwd = "classic"; dialer->log( "Looks like a Compuserve classic password prompt.\nSending: classic\n" ); saw_first_compuserve_prompt++; } else { // We have a password prompt, so send a suitable resonse. dialer->log( "Looks like a password prompt.\nSending: (password)\n" ); } dialer->reset_offset(); prompt_tries++; sent_login = 1; // yes, we've sent a password: // assume we've sent username too. if (!passwd) passwd = dialer->options.password; return( passwd ); } else if( is_welcome_msg( buffer ) ) { dialer->log( "Looks like a welcome message.\n" ); dialer->start_ppp(); } else if( is_prompt( buffer ) ) { // We have some other prompt. if( dialer->is_pending() ) { return( NULL ); // figure it out next time } if( !prompt_response[0] ) prompt_response = dialer->options.default_reply; // wild guess dialer->log( "Hmm... a prompt. Sending \"%s\".\n", prompt_response ); dialer->reset_offset(); prompt_tries++; // only use our prompt guess the first time. // if it fails, go back to the default reply. tprompt = prompt_response; prompt_response = ""; return( tprompt ); } else { // not a prompt at all! if( dialer->is_pending() ) return( NULL ); // figure it out next time } // If we get here, then we aren't at a prompt. return( NULL ); } //************************************************** // WvDialBrain Private Functions //************************************************** bool WvDialBrain::is_prompt( const char * c, const char * promptstring, bool dots_wild ) /***************************************************/ // Searches the buffer 'c' for a prompt. If no promptstring is given, we // return true for ANY prompt. If a prompt string is given, then we are // looking for a SPECIFIC prompt that contains that string. { const char * cptr; static const char * prompt_punct = ")>}]:.|-?$%=\x11"; // if no promptstring was given, the search is simple: it is a // prompt if the last line ends in punctuation and no newline. if( !promptstring ) { for( cptr = c + strlen( c ) - 1; cptr >= c; cptr-- ) { if( isnewline( *cptr ) ) { if ( !prompt_response[0] ) return( false ); // last line was empty: not a prompt else continue; // we have a guess, so use it anyway, IF the // last non-blank line was a prompt. } if( strchr( prompt_punct, *cptr ) ) return( true ); // first non-whitespace was punctuation! good. if ( !isspace( *cptr ) ) return( false ); // not punctuation or whitespace at end } return( false ); } // seek backwards from the end of the buffer to the beginning of // the last line, or the beginning of the buffer, whichever comes first. // Then skip leading whitespace so that when we are done, (c) points at // the first non-white character on the line. for( cptr = c + strlen( c ) - 1; cptr >= c; cptr-- ) { if( isnewline( *cptr ) ) break; } c = cptr > c ? cptr : c; while( isspace( *c ) ) c++; // find the promptstring in the buffer. if( dots_wild == false ) { // a bit of an obscure case, but: find the _last_ occurrence on the // prompt line, not the first. c = strstr( c, promptstring ); if( !c ) return( false ); else while( strstr( c+1, promptstring ) ) c = strstr( c+1, promptstring ); } else { // dots are wild, like in regular expressions const char * p = c; unsigned int char_count = 0; while( *p != '\0' && char_count != strlen( promptstring ) ) { char tmp = promptstring[ char_count ]; if( tmp == '.' || *p == tmp ) { if( char_count == 0 ) { // If we match the beginning of the promptstring, // set c to point at it. c = p; } char_count++; } else { // Start over, since a letter did not match and was not a dot. char_count = 0; } p++; } // If we hit the end of the promptstring, and char_count does not // equal its length, then it was not there. if( char_count != strlen( promptstring ) ) return( false ); } // now make sure everything after "promptstring" is whitespace // and there is at least one punctuation mark. bool foundpunct = false; for( c += strlen( promptstring ); *c; c++ ) { if( strchr( prompt_punct, *c ) ) foundpunct = true; else if( !isspace( *c ) ) return false; // non-whitespace or punctuation: not a prompt } return( foundpunct ); // found a prompt if the string was followed by punct } bool WvDialBrain::is_login_prompt( const char * buf ) /***************************************************/ { return( is_prompt( buf, "login" ) || is_prompt( buf, "name" ) || is_prompt( buf, "user" ) || is_prompt( buf, "id" ) || is_prompt( buf, "userid" ) || is_prompt( buf, "user.id", true ) || is_prompt( buf, "signon" ) || is_prompt( buf, "sign.on", true ) || is_prompt( buf, "usuario", false ) || ( dialer->options.login_prompt[0] && is_prompt( buf, dialer->options.login_prompt ) ) ); } bool WvDialBrain::is_compuserve_prompt( const char * buf ) /***************************************************/ { return( is_prompt( buf, "host name" )); } bool WvDialBrain::is_password_prompt( const char * buf ) /******************************************************/ { return( is_prompt( buf, "password" ) || ( dialer->options.pass_prompt[0] && is_prompt( buf, dialer->options.pass_prompt ) ) ); } bool WvDialBrain::is_welcome_msg( const char * buf ) /**************************************************/ // Thanks to dsb for this one, 3/10/98. { return( sent_login && ( strstr( buf, "mtu" ) || strstr( buf, "ip address is" ) ) ); } BrainToken * WvDialBrain::tokenize( char * left, char * right ) /*************************************************************/ { BrainToken * token_list = NULL; BrainToken * new_token = NULL; BrainToken * prev_token = NULL; char * p; if( left == NULL || right == NULL || right <= left ) return( NULL ); p = left; while( p <= right ) { // If *p is a null or a new-line, we are done. if( *p == '\0' || isnewline( *p ) ) break; // Skip whitespace in the string. if( isspace( *p ) ) { p++; continue; } // If it's a letter, we've got the beginning of a word. if( isalpha( *p ) ) { char * end = p+1; new_token = new BrainToken; new_token->type = TOK_WORD; new_token->next = NULL; if( token_list == NULL ) token_list = new_token; else prev_token->next = new_token; while( end <= right && isalpha( *end ) ) end++; new_token->tok_str = new char[ end - p + 1 ]; strncpy( new_token->tok_str, p, end - p ); new_token->tok_str[ end-p ] = '\0'; p = end; // skip to the end of the word for next time prev_token = new_token; continue; } // If it's a digit, we've got the beginning of a number. if( isdigit( *p ) ) { char * end = p+1; new_token = new BrainToken; new_token->type = TOK_NUMBER; new_token->next = NULL; if( token_list == NULL ) token_list = new_token; else prev_token->next = new_token; while( end <= right && isdigit( *end ) ) end++; new_token->tok_str = new char[ end - p + 1 ]; strncpy( new_token->tok_str, p, end - p ); new_token->tok_str[ end-p ] = '\0'; p = end; // skip to the end of the number for next time prev_token = new_token; continue; } // If it's useful punctuation (brackets and such), grab it. if( strchr( brackets, *p ) ) { new_token = new BrainToken; new_token->type = TOK_PUNCT; new_token->next = NULL; if( token_list == NULL ) token_list = new_token; else prev_token->next = new_token; new_token->tok_char = *p; p++; prev_token = new_token; continue; } // If it's anything else, ignore it. p++; } return( token_list ); } void WvDialBrain::token_list_done( BrainToken * token_list ) /**********************************************************/ { BrainToken * next_token; while( token_list != NULL ) { next_token = token_list->next; if( token_list->type == TOK_WORD || token_list->type == TOK_NUMBER ) delete token_list->tok_str; delete token_list; token_list = next_token; } } void WvDialBrain::guess_menu_guts( BrainToken * token_list ) /**********************************************************/ // There are some cases which may occur in a valid menu line. // Number 1 is of the form "P for PPP" // Number 2 is of the form "1 - start PPP" // Number 3 is of the form "(1) start PPP" // Number 4 has the form "1 blah blah PPP". The first non-whitespace character // is a number, followed by more whitespace. We have to be paranoid here // to avoid seeing phone numbers and such. // We check for these cases in order. // // Okay, fine. This function now uses goto for no good reason. So shoot me. // At least it doesn't randomly return from the middle of the function before // trying all the cases... { BrainToken * lmarker = NULL; BrainToken * rmarker = NULL; BrainToken * tok; char * prompt_resp = NULL; int index; /////////////// FIRST CASE // This should be generalized later, but for now we'll look for "FOR PPP", // and then examine the thing in front of THAT. If it's not punctuation, // we'll use it as a prompt response. If it IS punctuation, but is NOT // a bracket, we'll take the thing before THAT even, and use it as a prompt // response. for( tok = token_list; tok != NULL; tok = tok->next ) { bool failed = false; if( tok->type == TOK_PUNCT ) continue; // Only looking at words and numbers now. BrainToken * tok2 = tok->next; for( ; tok2 != NULL; tok2 = tok2->next ) { if( tok2->type != TOK_PUNCT ) break; // Only looking at punctuation after the word we're investigating. if( strchr( brackets, tok2->tok_char ) ) { failed = true; break; } } if( failed ) continue; if( !tok2 || !tok2->next ) break; // Now tok is the potential response, and tok2 is the next word or // number, as long as there were no brackets in between. // So now we can look for "for ppp". if( !strcmp( tok2->tok_str, "for" ) && !strcmp( tok2->next->tok_str, "ppp" ) ) { set_prompt_response( tok->tok_str ); return; } } /////////////// SECOND CASE // Find the first right-bracket on the line, and evaluate everything // before it. Things that are allowed are numbers, and words other // than "press" etc. for( tok = token_list; tok != NULL; tok = tok->next ) if( tok->type == TOK_PUNCT ) if( strchr( rbrackets, tok->tok_char ) ) { rmarker = tok; // leftmost right-bracket on this line. break; } if( rmarker == NULL ) goto three; // no right-bracket on this line. // Make sure "ppp" comes _AFTER_ the rmarker... So that we don't respond // to "I like food (ppp is fun too)" or similar things. for( tok = rmarker->next; tok != NULL; tok = tok->next ) if( tok->type == TOK_WORD && strcmp( tok->tok_str, "ppp" ) == 0 ) break; if( tok == NULL ) // We did not find "ppp" after the rmarker goto three; for( tok = token_list; tok != rmarker; tok = tok->next ) { // If we find punctuation in here, then Case Two is WRONG. // Also, handles things like "Press 5" or "Type ppp" correctly. // If there's more than one valid "thing", use the last one. if( tok->type == TOK_PUNCT ) { prompt_resp = NULL; break; } if( tok->type == TOK_NUMBER ) prompt_resp = tok->tok_str; if( tok->type == TOK_WORD ) if( strstr( menu_bad_words, tok->tok_str ) == NULL ) prompt_resp = tok->tok_str; } if( prompt_resp != NULL ) { // Case Two was successful! set_prompt_response( prompt_resp ); return; } three: /////////////// THIRD CASE // Find the first (and recursively innermost) matching pair of brackets. // For example: "This ('a', by the way) is what you type to start ppp." // will parse out simply the letter a. // // Start by finding the RIGHTmost right-bracket which immediately // follows the LEFTmost right-bracket (ie - no words in between). // In the above example, it is the first apostrophe. // // Nov 6/98: Ummmmm, does the above paragraph make sense? bool ready_to_break = false; rmarker = NULL; for( tok = token_list; tok != NULL; tok = tok->next ) { if( tok->type == TOK_PUNCT ) { if( strchr( lbrackets, tok->tok_char ) ) { lmarker = tok; ready_to_break = true; } } else { if( ready_to_break ) break; } } if( lmarker == NULL ) goto four; // no left-bracket on this line. // Now find the matching bit of punctuation in the remainder. // Watch for useful words as we do it... index = strchr( lbrackets, lmarker->tok_char ) - lbrackets; for( tok = lmarker->next; tok != NULL; tok = tok->next ) { if( tok->type == TOK_PUNCT ) { if( tok->tok_char == rbrackets[ index ] ) { rmarker = tok; break; } } else if( tok->type == TOK_WORD ) { if( strstr( menu_bad_words, tok->tok_str ) == NULL ) prompt_resp = tok->tok_str; } else // tok->type == TOK_NUMBER prompt_resp = tok->tok_str; } if( rmarker == NULL ) goto four; // no corresponding right-bracket on this line. // Make sure "ppp" comes _AFTER_ the rmarker... So that we don't respond // to "I like food (ppp is fun too)" or similar things. for( tok = rmarker->next; tok != NULL; tok = tok->next ) if( tok->type == TOK_WORD && strcmp( tok->tok_str, "ppp" ) == 0 ) break; if( tok == NULL ) // We did not find "ppp" after the rmarker goto four; if( prompt_resp != NULL ) { // Case Three was successful set_prompt_response( prompt_resp ); return; } four: /////////////// FOURTH CASE // This is a catch-all for punctuationless menus of the form: // 1 PPP // 2 Quit // Let's just assume the command is a single-digit number. This should // avoid accidentally parsing phone numbers or IP addresses. lmarker = token_list; if ( lmarker->type == TOK_NUMBER && lmarker->tok_str[0] && !lmarker->tok_str[1] ) { for ( tok = token_list; tok != NULL; tok = tok->next ) if (tok->type == TOK_WORD && strcmp( tok->tok_str, "ppp" ) == 0 ) break; if ( tok ) { set_prompt_response( lmarker->tok_str ); // Case Four worked! return; } } // Apparently this was not a valid menu option. Oh well. return; } void WvDialBrain::set_prompt_response( char * str ) /*************************************************/ { WvString n; if( strcmp( str, prompt_response ) ) { n.setsize( strlen( str ) + 1 ); strcpy( n.edit(), str ); n.edit()[ strlen( str ) ] = '\0'; dialer->log( "Found a good menu option: \"%s\".\n", n ); prompt_response = n; } } wvdial-1.61/wvpapchap.h0000644000175000017500000000204711260441664015036 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Re-write of wvpapsecrets.h. This one supports CHAP as well, and is also * much safer. */ #ifndef __WVPAPCHAP_H #define __WVPAPCHAP_H #include "wvconfemu.h" #include "wvlinklist.h" #include "wvstring.h" #define PAP_SECRETS "/etc/ppp/pap-secrets" #define CHAP_SECRETS "/etc/ppp/chap-secrets" #define REMOTE_SECRET "wvdial" class WvPapChap /*************/ { public: WvPapChap() : pap_success( true ), chap_success( true ) {} ~WvPapChap() {} void put_secret( WvString _username, WvString _password, WvString _remote ); bool isok_pap() const { return( pap_success ); } bool isok_chap() const { return( chap_success ); } private: WvStringList contents; bool pap_success; bool chap_success; bool load_file( const char * filename ); bool write_file( const char * filename ); void do_secret( const char * username, const char * password, const char * remote ); }; #endif // __WVPAPCHAP_H wvdial-1.61/README0000644000175000017500000002452511077625616013570 0ustar thierrythierry Welcome to WvDial ================= It's amazing! It's your wildest dream come true! Dialup networking for Linux that doesn't require chat scripts! Okay, so maybe you're not as excited as I am, but we hope this will brighten up your week. WvDial attempts to make the previously rather complicated configuration of Linux dial-up networking as simple as phone number - username - password. But first there is something we should tell you: The GNU Library General Public License ====================================== WvDial was originally written by Dave Coombs and Avery Pennarun of Net Integration Technologies, and is released to the public under the terms of GNU's LGPL, or Library General Public License. This is not quite the same as the General Public License (GPL) that most Linux software uses. The LGPL is actually *less* restrictive -- you can use LGPL software inside your own programs, and you are *not* required to place your program under the GPL or LGPL. That means companies or individuals can, if they want, take all the code in WvDial and use it in a product without giving anyone their own source code. But there's a catch, of course -- basically, you have to make the source code to WvDial itself available to users, and if you *change* the WvDial code in any way, you must also release the changes under the terms of the LGPL. That means you have to give out the source code to your changes. That also means that we or anyone can build a product based on the modified WvDial, and although the source code to WvDial must be provided, the rest of the system does not have to be (L)GPL'd. We think that this is a fair way to share this software, because it guarantees that everyone can fix bugs and when anyone does, everyone can get the patch. But still, people can build small Linux systems based on WvDial without having to give out the source code to their *entire* main program. Naturally none of that is legally binding. The nice people at GNU have prepared the legalese already and you can find their license verbatim in the file COPYING.LIB or, if you installed the Debian package, /usr/doc/copyright/LGPL. Please read it carefully before distributing (or worse, not distributing) modified copies of WvDial, because the rules aren't quite as simple as I've made them sound. Compiling and Installing WvDial =============================== If you are not using our pre-compiled Debian package, you will need to compile WvDial yourself. This is not too difficult as long as you have a few things installed on your Linux system: - pppd 2.2.0f or 2.3.5, with the pppd program preferably at /usr/sbin/pppd. - gcc 2.7.2 or higher, with g++. - GNU make; you may need version 3.75 or higher, I'm not sure. - WvStreams; version 4.4 or higher. Almost any halfway modern Linux system should have all of these. The last is available from http://alumnit.ca/wiki/index.php?page=DownloadReleases Building WvDial is a simple matter. First, check the Makefile to see if everything looks okay to you. By default, wvdial and wvdialconf will install in /usr/local/bin with their man pages in /usr/local/man/man1. That's probably right for most systems. To build and install WvDial, then: make make install Assuming you don't have any compile errors (and really, you shouldn't, right?) you now have an installed WvDial system. Configuring for the First Time ============================== Again Debian users have a nice soft fuzzy warm cushion to land on: when installing the WvDial package, Debian's "dpkg" automatically runs wvdialconf and asks all the right questions to get you going. If you compiled manually, you have to go through a little bit more trouble -- but don't worry, not that much. The first thing to do is have wvdialconf detect your modem and create your initial configuration. 'su' to root and type the following: wvdialconf /etc/wvdial.conf If all goes well, your modem will be detected and its configuration stored in /etc/wvdial.conf. If it doesn't work, all is not lost but you will have to build the configuration completely by yourself. Read the wvdial(1) man page ("man wvdial") for more information about that. In any case, if your modem is not detected or the detection sequence confuses you in some way, let us know by sending us a message -- this is supposed to be a stable release, but everybody knows that doesn't really mean anything. Things could still go wrong, and we really want to know if they do. Remember, if we don't know there's a problem, we can't fix it. On my computer the modem detection sequence looks like this: Scanning your serial ports for a modem. modemscan: Ignoring ttyS0 because /dev/mouse is a link to it. ttyS1<*1>: AT -- AT -- AT -- nothing. ttyS2<*1>: AT -- OK ttyS2<*1>: ATZ -- OK ttyS2<*1>: ATQ0 -- OK ttyS2<*1>: ATQ0 V1 -- OK ttyS2<*1>: ATQ0 V1 E1 -- OK [more init string testing] ttyS2<*1>: Speed 2400: AT -- OK ttyS2<*1>: Speed 4800: AT -- OK [more baud rate testing] ttyS2<*1>: Speed 230400: AT -- AT ttyS2<*1>: Max speed is 115200; using 57600 to be safe. ttyS2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 -- OK Found 1 available modem; using /dev/ttyS2. ttyS2: Speed 57600; init "ATQ0 V1 E1 S0=0 &C1 &D2 S11=55" wvdialconf will scan all your /dev/ttyS* serial ports *except* the /dev/mouse port (if you have a /dev/mouse link) because sometimes probing the mouse port can cause mouse problems. In any case, try not to move your mouse while wvdialconf is probing and you should be safe. After wvdialconf runs successfully (ie., you receive a message like the one above) it writes your configuration to /etc/wvdial.conf, the filename you gave it on the command line. My auto-generated wvdial.conf file looks like this: [Dialer Defaults] Modem = /dev/ttyS2 Baud = 57600 Init = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 ; Phone = ; Username = ; Password = After [Dialer Defaults], the first four lines have been autodetected for your system, so don't worry if they look a little different. The next three lines are commented out. You need to edit the file to fill in the information about your Internet provider. Here's a sample completed wvdial.conf file: [Dialer Defaults] Modem = /dev/ttyS2 Baud = 57600 Init = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 Phone = 555-4242 Username = apenwarr Password = my-password This contains all the information needed to dial my favourite non-existent Internet provider. If you use more than one modem, dial-in account, Internet provider, init string, or anything, you can use additional "override" sections in wvdial.conf to support this. See the wvdial(1) man page for more information. (Type "man wvdial") Testing it for the First Time ============================= Now you've compiled, installed, and configured WvDial. Doesn't that make you mad at all the darn Debian users who didn't have to do any of this stuff? Well, now you've caught up with them. Sooner or later, everyone has to try dialing for the first time. To do this, type wvdial (surprise!). Unlike other ppp dialers you might have used, the wvdial program runs in the foreground and never exits until you disconnect or have some kind of fatal error. You can also quit (and disconnect the phone, and clean up politely) by pressing CTRL-C. I think this is more user-friendly, myself. Of course if you want it to work like pppd you can always do it in the usual way: wvdial >/var/log/wvdial.log 2>&1 & It is interesting to note that almost all of WvDial's functionality is found in a C++ class called WvDialer. That means it's easy for a programmer to take WvDial and put in whatever kind of user interface he wants. The "wvdial" program serves as a simple example. So with WvDial, if someone (say) wanted to write an X-Windows dialup button bar, they could simply link in the C++ class and not have to worry about messy interactions with self-backgrounding pppd scripts and other gruesome stuff. Anyway, if you have any gripes about the way this works, let us know. The more stuff you complain about, the more likely we are to do something about it. Assuming it Worked... ===================== If you ran wvdial and it connected to and logged into your Internet provider, you're in business. If it said anything strange or confusing along the way, e-mail us anyway -- it could be the sign of a nasty problem hiding somewhere. Nah, it Didn't Work After All ============================= Because WvDial has a pretty nasty bunch of heuristics included for dialing modems, finding login/password prompts, guessing at menu options and command prompts, and so on, it has been known to screw up on occasion. If WvDial doesn't quite work for you, it's probably our fault, not yours! It's difficult for us to guess typical login sequences for various ISP's, and it's completely impossible for us to guess them all. If WvDial doesn't seem to like your ISP, I've got some good news and some bad news for you. The bad news about WvDial versus 'chat' scripts: if your chat script doesn't work, you can always fix it without doing any programming. WvDial uses built-in intelligence, but if its intelligence fails, you're out of luck. And now the good news: Let us know about the problem and we'll do our best to help. If we can do it, we want WvDial to work with nearly every ISP around, without any special configuration. The most useful thing you can do for us is create a complete transcript of your wvdial session: wvdial 2>&1 | tee wvdial.out Then send the wvdial.out file to us along with your comments. Similarly, if the problem is during the modem detection phase (ALL modems should be detected successfully in a working wvdialconf!) you can get a transcript like this: wvdialconf /dev/null 2>&1 | tee wvdialconf.out And send us wvdialconf.out. Concluding Notes ================ WvDial has support for switching easily between multiple Internet accounts: read the wvdial(1) man page for more information. For that matter, it would do you well to read the wvdial(1) and wvdialconf(1) man pages anyway. (Oh, and don't forget about wvdial.conf(5) too!) Even though this is supposed to be a stable release, there may still be bugs in this thing. Tell us about them, every last one. For up-to-date contact information, see the WvDial web page at: http://alumnit.ca/wiki/index.php?page=WvDial ...have fun with it! Remember: It's only big and scary looking if you look too closely. wvdial-1.61/Makefile.in0000644000175000017500000000346511077703205014744 0ustar thierrythierryWVPACKAGE_NAME=@PACKAGE_NAME@ WVPACKAGE_STRING=@PACKAGE_STRING@ WVPACKAGE_TARNAME=@PACKAGE_TARNAME@ WVPACKAGE_VERSION=@PACKAGE_VERSION@ prefix=/usr/local WVSTREAMS_INC= WVSTREAMS_LIB= WVSTREAMS_BIN=$(prefix)/bin WVSTREAMS_SRC=. PC_CFLAGS=$(shell pkg-config --cflags libwvstreams) ifeq ($(PC_CFLAGS),) $(error WvStreams does not appear to be installed) endif CPPFLAGS+=$(PC_CFLAGS) PC_LIBS=$(shell pkg-config --libs libwvstreams) ifeq ($(PC_LIBS),) $(error WvStreams does not appear to be installed) endif LIBS+=$(PC_LIBS) BINDIR=${prefix}/bin MANDIR=${prefix}/share/man PPPDIR=/etc/ppp/peers include wvrules.mk default: all papchaptest all: wvdial.a wvdial wvdialconf pppmon wvdial.a: wvdialer.o wvmodemscan.o wvpapchap.o wvdialbrain.o \ wvdialmon.o wvdial wvdialconf papchaptest pppmon: \ LDFLAGS+=-luniconf -lwvstreams -lwvutils -lwvbase wvdial wvdialconf papchaptest pppmon: wvdial.a install-bin: all [ -d ${BINDIR} ] || install -d ${BINDIR} [ -d ${PPPDIR} ] || install -d ${PPPDIR} install -m 0755 wvdial wvdialconf ${BINDIR} cp ppp.provider ${PPPDIR}/wvdial cp ppp.provider-pipe ${PPPDIR}/wvdial-pipe install-man: [ -d ${MANDIR}/man1 ] || install -d ${MANDIR}/man1 [ -d ${MANDIR}/man5 ] || install -d ${MANDIR}/man5 install -m 0644 wvdial.1 wvdialconf.1 ${MANDIR}/man1 install -m 0644 wvdial.conf.5 ${MANDIR}/man5 install: install-bin install-man uninstall-bin: rm -f ${BINDIR}/wvdial ${BINDIR}/wvdialconf rm -f ${PPPDIR}/wvdial rm -f ${PPPDIR}/wvdial-pipe uninstall-man: rm -f ${MANDIR}/man1/wvdial.1 ${MANDIR}/man1/wvdialconf.1 rm -f ${MANDIR}/man5/wvdial.conf.5 uninstall: uninstall-bin uninstall-man clean: rm -f wvdial wvdialconf wvdialmon papchaptest pppmon distclean: rm -f version.h Makefile .PHONY: clean all install-bin install-man install uninstall-bin uninstall-man \ uninstall wvdial-1.61/ChangeLog0000644000175000017500000023722111260442314014443 0ustar thierrythierrycommit 6d6d7ff6df3caa8da0bf5ce6ff646a2d08199284 Author: William Lachance Date: Tue Sep 29 13:30:03 2009 -0400 Make a bunch of static character stuff const The fact that it wasn't const was (mostly) harmless, but it never hurts to be careful. Plus, the huge stream of error messages was annoying. commit 8417e178b528919e96a5c8ff06c5f27d60e746fe Author: Andrey Vihrov Date: Tue Sep 29 13:08:04 2009 -0400 Fix compilation of wvmodemscan with glibc 2.10 commit c98e15ea7309255ba6533dd9aea6c0a85642e440 Author: Peter McCurdy Date: Wed May 6 11:49:30 2009 +0800 Properly retry sending the init string to the modem. As reported by Sergey Ostashenko, if the modem times out when sending it the init string the first time, we resend if the modem doesn't respond. If the modem responds the second time, we should accept it and move on, instead of ignoring it. Signed-off-by: William Lachance commit 089d50df13068ca645fef368275e4e0d5bfd4ec9 Author: William Lachance Date: Wed Oct 22 17:24:03 2008 -0300 Also recurse into subdirectories when deleting stuff commit 184538ec18e3dcb5c185419b2b1f19c762f5780d Author: William Lachance Date: Wed Oct 22 17:07:31 2008 -0300 Remove the config.mk/config.mk.in, and just generate the makefile Much harder to screw things up this way, and it's way simpler to boot. commit 57ce2b60a112a8e97955322ff2192e0526bc3c16 Author: William Lachance Date: Wed Oct 22 16:55:08 2008 -0300 Oops, gen-cc isn't generated, it's required. commit 8ed5ffd4724d5767bd5c08d3c2170d2587abdec0 Author: William Lachance Date: Wed Oct 22 16:52:47 2008 -0300 Update .gitignore commit e179f0293b824f461eb3f3119cef61e01f5fa864 Author: William Lachance Date: Wed Oct 22 16:52:33 2008 -0300 Update distclean target commit 6a82423394ae796043f44921e04b87e21d2146b4 Author: William Lachance Date: Wed Oct 22 16:50:58 2008 -0300 Eugh, need to incorporate a few more artifacts from wvstreams' build system A bit of a rat's nest of makefile rules, but I guess as long as it works... commit 22a538006b60aca7dde7fe0e174cd1894b2d2998 Author: William Lachance Date: Wed Oct 22 16:34:01 2008 -0300 Update debian packaging. commit d31f5bc2a2fdabb5844fb733d13d5571db07f8af Author: William Lachance Date: Wed Oct 22 16:29:00 2008 -0300 dist now generates a primitive changelog commit 86c5f8f96eff57276ace672b34ac2142afda1eec Author: William Lachance Date: Wed Oct 22 16:11:26 2008 -0300 Add a very simple configure script (written in shell) This allows us to make wvdial distributables easily. commit b4691b2d5afda10f1b5fc96250c50df2bf514c26 Author: William Lachance Date: Wed Oct 22 11:46:43 2008 -0300 Remove obsolete references to WvStreams mailing list commit 268035c679629ac9d40185bbc5f4e6bb0de2d4be Author: Steve Marple Date: Wed Oct 22 10:59:37 2008 -0300 Include patch from Fedora that allows you to customize the dial timeout. commit 82596460e27ee2c816f707b93ec3d4f3e2097e48 Author: William Lachance Date: Wed Oct 22 10:51:40 2008 -0300 Changes and additions to build correctly out of a git repository commit c566f26a1fc87dcc1a196a18b859b1cff761d6d7 Author: apenwarr Date: Tue Oct 9 04:54:00 2007 +0000 Merged in everything from the dbus-win32 branch using this command: svn merge svn+ssh://svn.alumnit.ca/svn/branches/{death_to_wvcallback@11813,dbus-win32@11815} The dbus-win32 branch is now obsolete. This branch is now the basis for what we hope will be WvStreams 5. git-svn-id: file:///home/apenwarr/alumnit-svn/public/branches/death_to_wvcallback@11816 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 24238323bb5ef5a4e01e533d9f60be3aff0b3f54 Author: wlach Date: Fri Jul 20 16:29:13 2007 +0000 Updated debian packaging stuff for WvDial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@11654 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2c7991ad57da21636425ec3e63d8d19a0e3d03e6 Author: wlach Date: Thu Jul 19 20:17:49 2007 +0000 Merge in inversion changes from 'wvstreams_inversion_2': pre_select now returns void. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@11646 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b560dc58e4b05839dea5e734e6f935b539d415f8 Author: wlach Date: Wed Jul 18 18:29:16 2007 +0000 Documentation updates for wvdial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@11641 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 90c92430cdca75f6a8bc4fa9e6adc4331192a734 Author: pphaneuf Date: Mon Mar 19 09:41:05 2007 +0000 Remove the support for building from NITI's tree, fix building from Subversion in the alumnit tree. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@11571 6619c942-59fa-0310-bf43-a07aaa81d9ac commit de09d69e88fc03c8226bee087ff78d458a500f9f Author: wlach Date: Wed Dec 13 03:54:41 2006 +0000 Merged revisions 10677-11457 via svnmerge from /trunk git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11462 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 8146b2fb9c1ef86b2961d81bfc4a5b9022cf4cb7 Author: sfllaw Date: Thu May 25 13:54:37 2006 +0000 Postinst should make the log world-readable. git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11223 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 513d5614f27a632b71ee525160a4564e6eb55fea Author: sfllaw Date: Thu May 25 12:49:41 2006 +0000 Don't let the Debian configuration silently abort, just because something isn't in /etc/wvdial.conf. git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11222 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 83fc3257a6668c2512e583822ad3236bae534c8e Author: sfllaw Date: Thu May 25 12:46:18 2006 +0000 Make wvdialconf log things to /var/log/wvdialconf.log, instead of writing to console in the Debian postinst. git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11221 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 3af376f11339dd4f6df7c92ced750f71b82c4412 Author: sfllaw Date: Thu May 25 12:43:22 2006 +0000 We don't actually need to include WvConfEmu headers any more. git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11220 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 0b63524e4227bdb593f0507fdb7d54ea5058db92 Author: sfllaw Date: Sat Mar 4 00:49:45 2006 +0000 WvDial changes for 1.56. git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11027 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 9ce53bea07ad9d3c3295dfb5672df5ebc7b3acec Author: sfllaw Date: Wed Feb 22 18:06:17 2006 +0000 WvDialConf should actually write out its configuration file. I've also rewritten it so it no longer uses WvConfEmu. git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@11011 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b6b261f3347defc437d8d5e7d0e86a0198975854 Author: sfllaw Date: Thu Jan 5 21:02:42 2006 +0000 Merged revisions 10837-10911 via svnmerge from /branches/wvstreams_4_2 git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@10912 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 83faccb273769ff49daa47558dd0f391f055bc4e Author: sfllaw Date: Tue Dec 6 22:14:41 2005 +0000 Merged revisions 10758-10831 via svnmerge from /branches/wvstreams_4_2 git-svn-id: file:///home/apenwarr/alumnit-svn/public/releases/freesw@10832 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 8f1bc770fcc7f945393fc86f9f690d58214250af Author: pphaneuf Date: Tue Jul 5 21:02:55 2005 +0000 Merged revisions 10143-10145 via svnmerge from /branches/carambola BUGZID:13451 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@10146 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a2efe43eb15ad97b0b053310fc565f4a7193d5ef Author: pphaneuf Date: Tue Jul 5 02:49:45 2005 +0000 Merged revisions 9923-10128 via svnmerge from /branches/carambola git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@10139 6619c942-59fa-0310-bf43-a07aaa81d9ac commit eb4d73a13dc7a4ff76fca1355d37c2ffdf4726a9 Author: pmccurdy Date: Sat Jun 25 06:25:34 2005 +0000 head: Finish merging the Subversion-related Makefile changes. Any other branches will just have to fix them in Subversion. This is probably the last CVS commit ever; so long, CVS repository, it's been fun. BUGZID:5749 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@10087 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 76591bf9a877bba52ea543f27b788594300a009a Author: sfllaw Date: Wed May 11 19:59:52 2005 +0000 HEAD: Update WvDial's build system to work with pkg-config. BUGZID: 7558 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@9803 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 42da9a31308bc0ce3789570192b1310e0d90dfb5 Author: sfllaw Date: Wed May 11 19:59:23 2005 +0000 HEAD: Update WvDial's Debian packages to match the ones in Debian right now. With some minor alterations. BUGZID: 7559 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@9802 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 73ebe2f075da71d629de85531f7d30cdaa243fd8 Author: pphaneuf Date: Wed Sep 1 17:40:54 2004 +0000 Using getline() with a non-zero timeout is fundamentally evil, but when you need it, you do need it. What to do? Enter Guilt-Oriented Orthodontic Programming (also known as GOOP). Renamed getline() to blocking_getline(), and put a short inline getline() that does not have the timeout parameter at all and calls blocking_getline() with a zero timeout. This way, you can still specify a non-zero timeout if you need to, but you'll be guilt-ridden by the obviously evil function you'll be using. Also, it's more easily greppable, so we can find offenders quicker and fix them. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6933 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 1345cb65435d15247a172f6f749dc13d1dff2526 Author: apm Date: Thu Aug 26 17:21:35 2004 +0000 head: standardize log messages so that they start with uppercase letter. (tedious!) BUGZID:7004 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6883 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 005e65f0c009c229308b4cf3eba53e57bcea0266 Author: pphaneuf Date: Tue Aug 17 00:53:45 2004 +0000 Changed RELEASE to WVRELEASE and DELETE to WVDELETE. Why? Because Avery said so, that's why! BUGZID:6603 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6591 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a25c210c5f7f4334ee6855a6cde6b600c8ac7b78 Author: pphaneuf Date: Mon Aug 16 21:27:18 2004 +0000 Removed the mixing of WvConfEmu and WvConf in WvDial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6585 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e1b24c32f4ab45cfaeb2406bf4d53eb8c2913c00 Author: pphaneuf Date: Thu Aug 5 18:45:40 2004 +0000 Backing out my previous changes, they have too many subleties and cornercases. BUGZID:6101 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6227 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 8d4f1f985f46f9828f7f5adc3e30be6a4ad8652e Author: pphaneuf Date: Mon Aug 2 22:02:01 2004 +0000 Removed usage of uses_continue_select and replaced them with explicit uses of WvCont. BUGZID:6101 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6155 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 21e9aaff09157e28b0bcd436ada5fef5bf048758 Author: ppatters Date: Thu Jul 29 17:24:44 2004 +0000 HEAD: Ssoya now depends on OpenSLP actually being built first. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6062 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b5474e118a58797fce1797c0890ab96406d1a2fe Author: sfllaw Date: Tue Jul 27 21:39:43 2004 +0000 HEAD: Update .cvsignore files for files generated by snapshot.sh git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@6017 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c214932aa8d0e424230f7d832f57c082837564ac Author: pphaneuf Date: Sat Jun 12 00:08:33 2004 +0000 Fixed a bunch of foo->release() into the safer RELEASE(foo); git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@5007 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 64a5d7187c7459f7bf2766bc18836e919ed57cf8 Author: pmccurdy Date: Thu Jun 10 23:19:43 2004 +0000 head: compile fix to wvdial, the ?: operator didn't like dealing with a WvString and a char*. Probably a gcc2.95 issue. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@4997 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 45736af152769aa8c2d90edce06d5501da8d3ad1 Author: ppatters Date: Thu Jun 10 21:34:13 2004 +0000 HEAD: Make WvMapi/WvTnef and the Evolution Connector compile again after Pierre's futzing. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@4993 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 38f1cef5396f1591e9fefd8beafeea3d4ee6cef9 Author: ppatters Date: Thu Jun 10 20:45:28 2004 +0000 HEAD: Fix up a few places where pphaneuf's changes wrt xplc_ptr hadn't propagated (HINT: type make in src/weaver :). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@4989 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 19740a9ce53436035f2c067bcb47e1e52da0f55e Author: pphaneuf Date: Wed Jun 9 21:16:23 2004 +0000 Converted our codebase to use release() instead of delete. Left the "XPLC delete detector" enabled. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@4951 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 6cb751b92261ff32904966514946d2b799cdeacc Author: pphaneuf Date: Mon Apr 19 18:01:31 2004 +0000 Merged from r3_80. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@4434 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 64e5363d4aa5f1bf20329d92ee8b0f55c9a4e810 Author: ppatters Date: Mon Mar 1 21:28:32 2004 +0000 HEAD: More UPS Scanner cleanups... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@3997 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 980f04b5a309f0280427804ceab3aee049f9aa54 Author: ppatters Date: Mon Feb 16 21:43:29 2004 +0000 HEAD: UPS Detection now sort of works... more testing is required, but this at least helps BUGZID:1398 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@3930 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2acae9b5529c26e54164eb3fc6e875222205bf33 Author: apenwarr Date: Mon Jan 19 23:22:06 2004 +0000 HEAD: merged everything from wvstreams_unittest. If you were working in wvstreams_unittest, please switch to HEAD from now on! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@3674 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4861a6dee299d49b094c175145d01bc3c67f1cb3 Author: apenwarr Date: Thu Nov 20 02:09:57 2003 +0000 HEAD: merged *all* recent changes from r3_75. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@3165 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c8dfa94625694af14abab4cf20948675f11ecf7a Author: pphaneuf Date: Wed Nov 12 22:31:09 2003 +0000 Removed all USE_WVCONFEMU references, along with a double-delete of "freeswan" in weaver.cc. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@3111 6619c942-59fa-0310-bf43-a07aaa81d9ac commit bb33d2071fe4f65c6fa2677c7b486ae1d2917f6b Author: ppatters Date: Thu Nov 6 00:52:43 2003 +0000 HEAD: Added apcupsd (UPS Daemon to shut the Net Integrator down nicely on a power failure) support. Starts work on fixing BUGZID: 1398. While I was there, made the code to handle template files for wvffilter the same across most services. Also cleaned up some random spacing in a variety of places. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@3055 6619c942-59fa-0310-bf43-a07aaa81d9ac commit d0ddab71cdbbec6b046763612eed3055cf8c58e5 Author: pphaneuf Date: Wed Oct 22 22:23:10 2003 +0000 Screw WvConfEmu::isclean. I hate it and it's stupid, so I removed it from the two places that used it (not in weaver code anyway). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2983 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 97fd28593bd109f0b6b0974a2ee3241598a1d2c7 Author: apenwarr Date: Wed Oct 15 06:12:40 2003 +0000 HEAD: merged netguide_reversion branch, and therefore all recent r3_74 changes. It seems unstable when I tried it, but I think it was also unstable before I started. And maybe 3.74 is unstable too. Hmm. Anyway, now that it's merged, we can begin to think about testing and fixing stuff. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2952 6619c942-59fa-0310-bf43-a07aaa81d9ac commit fbf843a705d39af036dbce0af39206d17811c9cf Author: pphaneuf Date: Fri Oct 10 23:24:26 2003 +0000 More WvConfEmu hacking... Did I run this without the USE_WVCONFEMU flag? Of course not! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2930 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 8a232f5fdd088a907d87af93770b5bdff205e4c3 Author: pphaneuf Date: Wed Oct 8 01:05:45 2003 +0000 Yet some more WvConfEmu hacking... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2902 6619c942-59fa-0310-bf43-a07aaa81d9ac commit d10c896e5706633a2a5fe9ce7c14a6cf3c56b790 Author: pphaneuf Date: Wed Oct 1 20:26:59 2003 +0000 Began converting weaver to WvConfEmu. This is turned on by compiling with a USE_WVCONFEMU preprocessor symbol, so don't worry, I'm not actually breaking everything... :-) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2880 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 04523a85a7c2acf68cf2db2355f00ba8825be8db Author: apenwarr Date: Wed Sep 10 03:42:20 2003 +0000 The great Makefile re-merger: now wvstreams and the rest of niti use the same wvrules.mk. The wvstreams one is still unnecessarily messy, but I'm too lazy to fix it right now. Big new bonus feature: you can now do things like "make t/whatever.t" and it'll work, because the compile rule no longer assumes you're compiling something in the current directory. Other big bonus feature: there's only one way to enable/disable optimizations now. Darn it. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2771 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e0e147bd1430776f80f54b1171266259c0eb8f9d Author: pphaneuf Date: Wed Aug 27 14:36:55 2003 +0000 Merging fastforward, polly, wvdial and wvprint from r3_74. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2728 6619c942-59fa-0310-bf43-a07aaa81d9ac commit fd40b143e80cb79d44f1f84e1bbffefabbbfdaab Author: jim Date: Fri Apr 25 18:05:49 2003 +0000 HEAD: src/wvdial: * debian/rules: install pon and poff git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2370 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 22da18a533cb68c0b7964eddfb456efb834d4e57 Author: jim Date: Wed Apr 23 13:58:02 2003 +0000 HEAD: src/wvdial: * Makefile: rework the install targets, i.e. make install now installs everything that is wanted. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2355 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 3120ebf4d33269985a3359953b2c3c322f21ac41 Author: pphaneuf Date: Mon Apr 14 19:53:28 2003 +0000 Fixed massive breakage in jim's Makefile mangling. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2270 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 116318e67e2a7dbc7b821b6bcee9c152bcedce28 Author: jim Date: Mon Apr 14 15:55:20 2003 +0000 HEAD: niti/src/wvdial Fix some debian packaging issues. I will upload a new wvdial on the weekend on hppa so we any PIC issues. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2269 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e7c670788d24f258be91b9188110e73ddffb38c5 Author: jim Date: Thu Apr 10 17:45:26 2003 +0000 HEAD: Remove extra whitespace in Makefile and add myself to the uploaders list. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2239 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 5a508367f3c704c027630888cdcdb9987af3c381 Author: drheld Date: Tue Apr 8 23:03:00 2003 +0000 HEAD: *MERGE* r3_73=>HEAD. Should maybe possibly even work. ;) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2224 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 64bc64686d769ea011d06254b26200548bd9d57b Author: ppatters Date: Fri Mar 14 17:27:28 2003 +0000 HEAD: Debian Packaging "Fixes" to fix some lintian buglets, and start wvstreams into it's mega packaging split (since we now have hooks into a TON of stuff :) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2086 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ac6947715cc3bdb2639a8a3b2994f68c44632e94 Author: ilguiz Date: Mon Mar 3 08:57:34 2003 +0000 HEAD: change compiler to the one that fits Qt library when configuring --with-qt git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2020 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a068d3412a4998a57a3ee9eac98acce4f986a898 Author: ppatters Date: Wed Feb 12 04:45:50 2003 +0000 HEAD: Huge number of files touched while updating the copyright notice on all of the open source files. Also, while I was there, cleaned up the option entry on the polly binary, fixed some random spacing in Retchmail, and made the Makefiles for unithingy not suck so much. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1876 6619c942-59fa-0310-bf43-a07aaa81d9ac commit bcfbb520f5b0ab4b90a693fcae6c67b98bf48ac9 Author: apenwarr Date: Sat Feb 1 10:15:12 2003 +0000 The Great Class Renaming. "UniConf*" mostly becomes "Uni*Gen", "Wv*Buffer*" usually becomes "Wv*Buf*", and a few nonstandard renamings are thrown in for good measure. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1836 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 45c9f39900cc178d95686dfc26af941827e57d5d Author: apenwarr Date: Sat Feb 1 06:05:04 2003 +0000 Removed silly /file and \file tags from the tops of files. Removed silly html tags from comments. Removed spurious "inline" keywords where inline is implicit. All praise sed! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1829 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 81685c81feda19b32500ee062eccd0d078330a54 Author: mag Date: Wed Jan 29 22:26:34 2003 +0000 Some random tweaks to WvLinkList. DeclareWvList# macros are now just a typedef, like in Table/Dict. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1820 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e0d6f9122c8c43f3ecc15e68fb8a5edaef688db7 Author: apenwarr Date: Mon Jan 13 08:22:07 2003 +0000 Merging unifix into the main branch. And now the REAL fun begins... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1707 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 84ce36eb85481ea5179fc4bbe1a1776798d033ef Author: jbrown Date: Fri Nov 1 02:12:05 2002 +0000 Split WvStream file-descriptor related code off into WvFDStream subclass. Removed obsolete WvSplitStream. Added wvin, wvout, wverr console streams. Fixed up all users of any of the above features and fixed any obvious existing bugs that were uncovered by the refactoring. This all seems to work fine (Weaver runs okay)... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1304 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 927129b5c94d28d03a8a0830d6d171aacc2fbbfd Author: ppatters Date: Mon Oct 7 22:18:28 2002 +0000 Fix the Makefiles so that the "tar straight out of the tree and distribute" stuff works... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1152 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 74e3490302c9dc0d7aa79c9c6e36266305f9744e Author: ppatters Date: Mon Sep 30 18:04:09 2002 +0000 Continue moving distribution files into the main tree... this was wvdial git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@1102 6619c942-59fa-0310-bf43-a07aaa81d9ac commit f237af63633a4502d4d484125a39182a381f6c4c Author: ppatters Date: Fri Aug 2 21:31:56 2002 +0000 Fix a bug in wvdialconf that tried setting the mode to 660 decimal, instead of octal. How the HELL did this EVER work??? git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@845 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 5b11f552c4f57cdc06dbb804ea1de29803835218 Author: pphaneuf Date: Wed Jul 31 23:08:04 2002 +0000 WARNING: big WvStreamClone change in here (and fixing of all things it broke). WvStreamClone changed to take a WvStream* instead of a WvStream**, so you can just give it a NULL instead of pointing to a WvStream* of yours, then set WvStreamClone::cloned. WvStreamClone changed from not owning the cloned stream to owning it (it WILL delete it in its destructor!). If you don't want it to delete the cloned stream, set WvStreamClone::cloned to NULL before deleting the WvStreamClone. So in summary, you don't have to keep a redundant WvStream* anymore, you don't have to (and SHOULDN'T!) delete the cloned stream, so you can just go and do crazy things like WvStream* mystream = new WvCompressStream(new WvSSLStream(listener->accept())); and then just delete mystream without any remorse (it's just like shell pipes!). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@844 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 26460f5547074c64f20373be2756a7507318ea42 Author: ppatters Date: Mon Jul 29 21:34:39 2002 +0000 Add SmartLink modem support to WvModemScan git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@836 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c0a2884d58b1dbc01236f54b5707446c87f81b02 Author: apenwarr Date: Fri Jun 14 20:20:15 2002 +0000 Merged changes from 3.70 into the main branch. Again. It really needed it! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@785 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 0d855925b8b21d8eaecb6eef6726945e729ae8b7 Author: apenwarr Date: Thu May 16 21:32:21 2002 +0000 Merged changes from r3_70 into the main branch. Whew, we've been busy. Look Mom, no conflicts! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@721 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a5706d3c59ed198f4cd4a93760d298268c7296d9 Author: dcoombs Date: Thu Apr 25 15:08:51 2002 +0000 In a desperate effort to break as much stuff as humanly possible, I've WvStringParm-ified the rest of weaver (there were a few files apenwarr missed) and removed every extraneous call to WvString::unique(). It all still compiles, and weaver seems to run on peanut. I haven't tried anything more complicated than that, though. Let the fireworks begin. :) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@690 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b7329fa72f31b425754fee92070836b784460d77 Author: apenwarr Date: Thu Apr 25 05:06:40 2002 +0000 Removed the ancient iterator auto-typecast operator from wvlink.h (and thus WvList, WvHashTable, and WvDirIter) because I think I only added it in the first place to be confusing. One day I'll get rid of operator()() too... see how you like that. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@689 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 84d32e51a5b32b8b768ac37286899c36daa464a2 Author: apenwarr Date: Thu Apr 25 04:49:54 2002 +0000 Changed WvString semi-incompatibly to supposedly eliminate any imaginable need for explicit unique(). Yes, that's right, the Single Most Horrible Thing about WvString has been eliminated. :) Expect crashes. DEATH TO ALL WHO STAND IN MY WAY! (I didn't actually take _out_ the unique() calls, though. Feel free to delete any you see - they're all unneeded now.) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@687 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 498c7566439fdd39d4af828d2b547dec2a6393e7 Author: andrew Date: Wed Apr 24 20:44:22 2002 +0000 Made wvfork() even safer. Also minor changes to WvPrintService. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@682 6619c942-59fa-0310-bf43-a07aaa81d9ac commit dc4ac9647e86d546ca909bdc008aa1719e852295 Author: apenwarr Date: Sat Apr 20 02:29:20 2002 +0000 I have returned to the main branch and am wreaking havoc: got rid of extra messages from dhparm in auto-scanner.sh. Supplied default values for [HTTPD]Admin Email and Admin Team in the httpd.conf template. Fixed the Makefile so it builds again under the autobuilder again (I hope). Downgraded the severity (annoyingness) of some netguide messages. Fixed a bunchload of electric-fence crash bugs and some memory leaks. Reformatted some, but certainly not all, ArbitrarySpacing. Made wvapache shut up when it's disabled. Defined [HTTPD]AliasImp when webmail is turned off, but I think I did that wrong. Made WvNIS not do things when disabled, and made it call 'domainname' at the right times. Made WvDialConf sane again (the SuSE people may be helpful, but they don't know C++ :)) Ha, so who's Random Bugfix Man now? git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@656 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ce8c4a250c9d821ebafc1b05549e29d90eff726c Author: ppatters Date: Mon Apr 15 18:16:44 2002 +0000 Update Retchmail Changelog and fix a couple of silly Debian pickinesses, Update to WvDial Changelog, fix in wvdialer.cc for unecessary cast in start_ppp WvPipe Call, updates to versions for new releases of WvDial, WvStreams, and Retchmail. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@623 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 5aadbceacb30ed21b0a87b6b710b4509a82a87a5 Author: socrates Date: Thu Apr 4 17:07:47 2002 +0000 Changed call for WvPipe to fit new WvPipe Signature git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@574 6619c942-59fa-0310-bf43-a07aaa81d9ac commit d1901f9d8593e725bf71645fee905ed3b891c352 Author: ppatters Date: Mon Apr 1 20:06:30 2002 +0000 All OSS projects now build into Debian packages... also incorporated command line fix for WvDial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@566 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a4ead040a768cdb93eae2abc55b069933ff32bfc Author: ppatters Date: Mon Mar 18 21:37:39 2002 +0000 Makefile cleanup for WvDial git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@546 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4ddcc9b6532f70d4ede83fd503411d9967b07e50 Author: ppatters Date: Tue Mar 12 20:23:00 2002 +0000 WvDial Cleanups to (finally) get the command line option=value stuff working... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@540 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b80bc9ad22125d99ee367de4953cb66c50e5ee6e Author: ppatters Date: Sun Mar 10 18:43:24 2002 +0000 Well, at long last, I finally got a chance to try WvDial on a box that had a modem - and guess what? It was completely broken. This is now no longer the case. As far as I can tell(tested with 2 ISP's), WvDial now is back in working order. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@535 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e52834dd510b26115aaf0d9ea1e636cc93dfc7d9 Author: ppatters Date: Thu Mar 7 21:53:56 2002 +0000 More WvDial cleanup following the SuSE patch - I think that's the last of the sprintf'd buffers, and goofy output routines... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@530 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2f201e902994e5b1c86a0ab588644e831fb9ddc3 Author: ppatters Date: Tue Mar 5 23:37:07 2002 +0000 Cleanups of WvDial code after yesterday's big merge - mainly formatting, and "WvStreamsifying" of wvdialmon. Also added a check so that WvDial gives some usefull information if you try and compile it without WvStreams present... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@523 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 120a72d7cd7cbef8df193195c1305b2bfa4c5f20 Author: ppatters Date: Mon Mar 4 22:54:25 2002 +0000 Documentation Cleanup from the SuSE patch... this should be the last of it... at this point, like apenwarr said, we might want to give some thought to calling this version 1.6 git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@520 6619c942-59fa-0310-bf43-a07aaa81d9ac commit bea9eb11f6c76ab41f12d01949d5e54f751f6621 Author: ppatters Date: Mon Mar 4 22:39:14 2002 +0000 Monster SuSE patch merge... this should break WvDial REAL good... (actually probably not too badly.. but we'll see). Adds a raft of new stuff - ability to have WvDial prompt for password on the command line, ISDN goodies, USB (??) Modem support, and all sorts of other coolness... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@519 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 58d35c60ccf6ca9a787864c6c462bec34be87656 Author: ppatters Date: Mon Mar 4 21:10:49 2002 +0000 Added more SuSE patches - this time to make sure inherited wvdial.conf sections are present, and also add in a REALLY ugly patch that adds multi phone number support. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@518 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 959820a78cf25796905f7b424287a58521377f8a Author: ppatters Date: Mon Mar 4 20:21:05 2002 +0000 Added support for "No Answer" from patch from "Andrew W. Nosenko" . git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@517 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a1f6a42318d1d145672b43c4ade46cc6050a53aa Author: ppatters Date: Mon Mar 4 18:58:56 2002 +0000 Incorporate a patch from Dushyanth Harinath that implements a "Dial Attempts" option in wvdial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@516 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 29b3b56ea3e0defb0ab1e8f624cd2813b824d796 Author: ppatters Date: Mon Mar 4 17:31:05 2002 +0000 Fix Makefiles for FF,WvTFTP and WvDial so that they don't link against libwvcrypto git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@515 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c62afbe6fe1336516967dfe9532c4a7535414a6a Author: ppatters Date: Mon Mar 4 17:27:24 2002 +0000 Have WvDial now try and use the remote ends suggested DNS Settings (should cut down on the number of "It looks like it works, but Netscape can't find anything" emails). Updated Debian Changelog, and made wvdialconf create wvdial.conf mode 660 (instead of 666, which some people consider a security hole). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@514 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 79aec6fcfd3b4eb1764f23d99c19b362a730dfa4 Author: apenwarr Date: Sat Mar 2 04:33:08 2002 +0000 A bunch of highly incompatible wvstreams hacks: renamed select_setup/test_set to pre_select/post_select. Simplified force_select implementation and added undo_force_select. Added read_requires_writable and write_requires_readable pointers to WvStream, to make it _much_ easier to copy from one stream to another without using the outbuf. Split getfd() into getrfd() and getwfd(), even in basic wvstream, to simply implementation of WvSplitStream. Made select-for-write do the right thing when outbuf is in use (I think!). Got rid of auto_select, replacing it instead with two different variants of select(), one of which does what the old auto_select() does. Changed WvStream callbacks to use WvCallback (finally!), which means stream callbacks don't have to be static anymore. All of this will surely introduce some bugs, but at first glance, Weaver and various streams test programs seem to still work. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@507 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 3c3bfcfe5824516dc4583b5c299f4a138390769b Author: apenwarr Date: Tue Feb 19 21:14:57 2002 +0000 Merged recent r3_65 changes into the main branch. I guess we haven't done this for a while! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@455 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ae801455a621ff11d5cd322d2a79d2a67f7500c8 Author: ppatters Date: Wed Jan 30 01:07:23 2002 +0000 Updated WvDial version to 1.5, remove some legacy @worldvisions.ca references, and make wvcrash compile on non-Debian boxen git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@416 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 20acc4124d44730661af365cd86b076becb620eb Author: ppatters Date: Mon Jan 28 18:59:55 2002 +0000 - Debianize FastForward (as WvFastForward) - Change the Date from sometime in 1997 to now in retchmail's changelog - Patch WvDial to recognise Lucent Winmodems, Handle Config files in places other than /etc/wvdial.conf, and accept configuration options on the command line git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@413 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 5274f3f5974ee26a3108c0c02db0c2ed0d87c2e7 Author: ppatters Date: Mon Jan 21 18:23:59 2002 +0000 Changes for WvDial to make it build outside of Weaver tree - see previous entry for retchmail for details git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@400 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a57fea9f7f9219b91d04519a5e890c18520d7824 Author: ppatters Date: Fri Jan 18 16:10:41 2002 +0000 Makefile changes to hopefully get things to package nicely for the opensource release - if you get Make errors, make sure that src/wvrules.mk exists and is a symlink to ./wvrules.mk git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@395 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 3f82fb988bd215a389e9b7d5b4758bbdfd472a76 Author: apenwarr Date: Wed Jan 2 02:42:32 2002 +0000 Updated copyrights to 2002. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@382 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 27129e36f21aab916692083e134d1c81915af2de Author: apenwarr Date: Tue Jan 1 06:39:47 2002 +0000 A bunch of Makefile changes to make the whole source tree build again. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@377 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 917984b3c58da5dee09d691e8962c68ac98a87f8 Author: apenwarr Date: Tue Jan 1 05:44:00 2002 +0000 Changed other makefiles to handle rename of rules.mk to wvrules.mk. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@376 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ef45d0a0c1eb5ce3c4d7508d5dc16355adaa0e9e Author: apenwarr Date: Fri Dec 14 10:10:29 2001 +0000 Merged recent changes from r3_6 into the main branch. I guess it's been a while... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@364 6619c942-59fa-0310-bf43-a07aaa81d9ac commit fcf4bd6964fda76746bb6526f4da16f2c603cc67 Author: apenwarr Date: Sat Dec 8 22:26:49 2001 +0000 Fixed some header files for portability. Always use comments rather than bare words after '#endif' if you're going to use anything at all. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@359 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 70c5bc137a7a90acb7e50338f44899f3404e2cca Author: apenwarr Date: Wed Nov 28 22:12:29 2001 +0000 Decided to add an assertion to verify that WvStream::execute() ended up being called whenever callback() was called. An astonishing number of classes were forgetting to do that, which is technically okay... but might not always be. Anyway, fixed them all (I think). If you get my new wvstream_execute_called assertion, please fix the broken class :) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@348 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 7db49c8f6db1a3308298e77cea2aa2be3f2d054d Author: dcoombs Date: Wed Nov 14 17:34:26 2001 +0000 wvpapchap fix in main branch too git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@339 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 184ea646aae9b2f2c2de8b6f870e8ca14c8dd207 Author: apenwarr Date: Mon Nov 12 21:24:08 2001 +0000 It was getting far to easy to build weaver. Rearranged the way .a files are generated, so now we have a central libwvstreams.a rather than linking configfile, ipstreams, etc separately. I haven't moved the directory structure around yet, but I will... Also added the beginnings of a WvDaemon class, but it's not used anywhere yet. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@332 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 3031736ad421f3a3f07d5826f85983cb72d61711 Author: dcoombs Date: Thu Oct 25 15:17:21 2001 +0000 wrote backslash_escape() in strutils.cc, which takes a string, puts a backslash in front of every !isalnum() character, and returns a new string. Using it when writing the chap-secrets and pap-secrets files. Also took this opportunity to make wvpapchap.cc slightly more modern. (I apparently didn't know about ThingList::zap() when I wrote it...) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@307 6619c942-59fa-0310-bf43-a07aaa81d9ac commit bd055873b3ec182fdf12a030b77496bfd2b36f3f Author: apenwarr Date: Mon Oct 22 13:25:56 2001 +0000 Added "abort on busy" and "abort on no dialtone" wvdial patch from Kenn Humborg . git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@298 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2ed0339184939197bf2c80f1019637b20bf60c1a Author: apenwarr Date: Thu Aug 16 21:23:02 2001 +0000 Merged recent changes from r3_5 into main branch. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@274 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c27b4b2f2f840bc6215904a8e44ec62f199720de Author: apenwarr Date: Fri Jun 29 10:46:56 2001 +0000 Finished porting pppoe and wvdial to the new netguide stuff, and started testing. wvdial seems to work on insight, but it looks like the modem on my weaver is broken -- it uses the old pctel_daa and is sharing the modem IRQ with eth0. Any activity on eth0 confuses the modem and causes NO DIALTONE or NO CARRIER! Also, I found out that with pctel_amr, apparently having /dev/ttyS15 open at all (even if not dialing or online) causes thousands of interrupts per second, which probably slows the CPU down a lot. So we'll have to change wvdialguide to only create the wvdialer object when absolutely necessary... Not checking in the failover stuff right now, since there's _really_ no way to test if that works, and Ozzy might want a "stable" version while I'm on holidays, and there's an off chance that Dave can fix any bugs in the current stuff, whereas if I put in the failover/doublevision stuff it would be hopeless. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@258 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c28ef16764491792f07d232c59eba7e92878dc5d Author: apenwarr Date: Fri Jun 22 04:53:26 2001 +0000 Fixed a raft of netguide bugs. Split the "killall" section of weaver.sh into killstuff.sh, which makes killing daemons easier when you core dump a test version of the weaver binary. Changed various WvLog source names to make the log viewer look nicer. Made the log viewer highlight any line that _starts_ with the selected string, so now you can pick "tunnel vision" and all the specific tunnels also get highlighted, or "wvdial" and "wvdial modem" and "wvdial modem #2" get highlighted too. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@256 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 1a690f425a8f67941785c256e1911ec46f5d6670 Author: apenwarr Date: Tue Jun 5 06:14:02 2001 +0000 Updated copyright notices on C++ files. Gee, I put that one off for almost as long as I put off doing my taxes :) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@247 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 09a64ae345c7a882e80b28f7e3dc4bd4f4e10855 Author: apenwarr Date: Fri May 11 19:57:37 2001 +0000 Preparing to release wvdial 1.42. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@240 6619c942-59fa-0310-bf43-a07aaa81d9ac commit f85dfdf06f020f06ad4549043a70cf1cc0b7581a Author: apenwarr Date: Sun Feb 11 23:10:43 2001 +0000 Fixed doublev randomness to make it more even. Changed apache settings to make Ozzy's benchmarks happier. Changed backup status emails to be a little more friendly. Accidentally left the 'weaver' binary statically linked. Changed status web page to support multi-modems again. Fixed idle detection for multi-modems, basically, but not quite. Made wvdial modem initialization try 3 times before giving up. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@232 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 1c73e0312b38b24a0c01f7d9fbf966273a5c85c3 Author: dcoombs Date: Sun Jul 30 20:10:56 2000 +0000 Fixed the hits-enter-sometimes bug that was happening on the LCD panel. Stupid uninitialized variables. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@225 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 25da2acceacf140f6a8aeac508e360fb0b9b505c Author: apenwarr Date: Sun Jun 25 05:10:28 2000 +0000 Fixed the Init1/Init bug that Dave introduced (I think). DHCP server gets enabled automatically, if the user doesn't choose. Improved the "nameserver ping probe" to use hardping() instead of softping(), removing the need to fiddle with the routing table and/or use ARP. weaverlogin.c's init process unloads the cloop module now, which allows us to properly umount /. Starting/stopping samba doesn't start/stop appletalk, and vice versa. Domain name setting on "create first user" screen has a default value now, rather than blank. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@224 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ed488a451ce83de557c9fb860e706913695696a0 Author: dcoombs Date: Sat Jun 24 20:19:09 2000 +0000 Fixed small bug in WvDial, where it thought a blank line was a prompt if it had a guess. Now it thinks a blank line is a prompt if it has a guess and the most recent non-blank line really WAS a prompt. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@223 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 059c4e2debd9ada43508fa99f690656904018a11 Author: dcoombs Date: Sat Jun 24 20:11:05 2000 +0000 Made [Dialer]Init1 vs Init consistent with itself. Always sets Init1, but WvDial accepts both now anyway. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@222 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4f55eb45da8fb8278158a50cd2c2434af0ad3333 Author: apenwarr Date: Fri Jun 23 23:03:44 2000 +0000 Weaver turns on most services automatically ("Trusted hosts only") after a zap. Dhcpd refuses to create entries for 0.0.0.0 interfaces. Fix for wvdial bug relating to garbage characters and 0x80->0x00. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@221 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 25d4bbed925f58e3b319c35f07beb4d56091b1bb Author: apenwarr Date: Wed Jun 21 07:50:00 2000 +0000 Took out some baud rate weirdness in WvModemScan. Since the speed-detection bug was fixed, there's no need to be "safe" by stepping down one, and therefore there's no need to force ISDN to 115200, which fixes 9600 baud modems that identify themselves as "960" (the same as a known ISDN modem). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@219 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4dd65a120190088963678bc2c8e83b34f7bc5579 Author: apenwarr Date: Sun Apr 2 11:31:10 2000 +0000 Modem dialer control stuff is back. I'm not quite sure I like the way it looks, though... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@201 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 0484a7c3bfaaa5eebc4be5ffa37c9c418c1d4f2f Author: apenwarr Date: Sun Apr 2 09:22:10 2000 +0000 WvDial now uses continue_select() instead of sleep() or usleep(). No crashes... yet :) Also, it seems wvdial's code for reading its config file entries into a set of wvstrings was messed up. It needed to call unique() on each string... if the dialer config entries changed after creating the WvDialer object, wacky things would happen. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@200 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c0355a8605ffbe8af3b0a636f94a083831d37183 Author: apenwarr Date: Sun Apr 2 08:12:55 2000 +0000 "Advanced" localnet page seems to do interfaces and routing properly now. _That_ was certainly a lot of work. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@199 6619c942-59fa-0310-bf43-a07aaa81d9ac commit aba4097d9e7e33a3472d0d1e5642745f167afe01 Author: apenwarr Date: Wed Mar 15 20:44:55 2000 +0000 Updated copyright notices to "1997-2000" and "Net Integration Technologies, Inc." It still says "Worldvisions Weaver software", though, because that's really what it is. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@185 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 5adaa2811ee0ab22ef8a0ec62803e366ab839100 Author: apenwarr Date: Wed Mar 15 20:41:23 2000 +0000 Split WvFile out of wvstream.h into its own file, with dramatically more widespread consequences than I was expecting. I think I fixed all the missing headers now though. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@184 6619c942-59fa-0310-bf43-a07aaa81d9ac commit f517b10969f11df24d159142bdf94ae3f9fa9753 Author: apenwarr Date: Sun Feb 27 22:14:28 2000 +0000 WebConfig produces output based on aml... not well integrated yet (at ALL!) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@179 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4e6dcf093fb1e4afdbd484c4b08c41a9a6b548a7 Author: apenwarr Date: Sun Nov 28 19:39:36 1999 +0000 wvdial now reads .wvdialrc when it starts, in addition to /etc/wvdial.conf. The user config file overrides the system-wide one. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@174 6619c942-59fa-0310-bf43-a07aaa81d9ac commit fbc1820d254829a94bc4a265a93e6d905c4f1af1 Author: apenwarr Date: Thu Nov 25 21:48:04 1999 +0000 Weaver 2.20c changes, from a while ago. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@173 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 265f6322ce4c57c5151fee358d3f20c43a331534 Author: apenwarr Date: Fri Nov 19 05:14:46 1999 +0000 A better fix to the previous wvdial problem. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@172 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 6d8e0d04e1cf47c441566c17d7f2f3151c27190a Author: apenwarr Date: Fri Nov 19 05:00:29 1999 +0000 Wvdial patch to work with "CONNECT...PPP" lines, thanks to a report by Renaud Guerin. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@171 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b6fa357eb49ea0ba6ec8c4e9d32ac24fb16c76ec Author: apenwarr Date: Fri Oct 15 01:09:20 1999 +0000 Updated version number to 2.20. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@162 6619c942-59fa-0310-bf43-a07aaa81d9ac commit c24847b3bae5513944de699ea70474566e17e4aa Author: apenwarr Date: Sun Sep 19 03:07:55 1999 +0000 Another wvdial tweak from mkj. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@159 6619c942-59fa-0310-bf43-a07aaa81d9ac commit fb2f97817ffcad3e8eb5f52c991677e990f8bb4b Author: apenwarr Date: Mon Sep 13 21:48:57 1999 +0000 cfg.get() split into cfg.get(string) and cfg.getint(int) for portability (especially to glibc2.1). Same with set(). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@155 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 80b4cf8e0c4d93530ebe69f55cb66d4f4919dccf Author: dcoombs Date: Mon Sep 13 20:07:35 1999 +0000 Support for the USR ISDN TA... (id 346800) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@154 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2740a9a4949ee8aec9a5518a9acb031f340fa5da Author: apenwarr Date: Thu Aug 12 04:51:52 1999 +0000 WvDialconf creates wvdial.ini 0600. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@152 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 522345b83359ce5a938a6cb44bf3fe9493b9f8f0 Author: apenwarr Date: Sat Aug 7 17:06:16 1999 +0000 Area Code support from Michael K. Johnson. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@151 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 247e71e926445d771476c56d673aa7105e94aca9 Author: apenwarr Date: Mon Aug 2 18:30:47 1999 +0000 WvSyslog allows you to override which WvLog debug levels are LOG_DEBUG; now the wvdial application uses this feature. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@149 6619c942-59fa-0310-bf43-a07aaa81d9ac commit af00468d1942b3434f0978f3db718d022769ecce Author: apenwarr Date: Mon Aug 2 18:20:52 1999 +0000 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 commit 6c0d79895a0a318c1db3340328d9a635d918e96a Author: apenwarr Date: Mon Aug 2 18:01:49 1999 +0000 Updated wvdial version to 1.40. Added optional support for the liblockdev library to WvLockFile, and made rules.mk able to merge .a files together (for now, so that liblockdev.a could be linked automatically, but later, so we can easily build a libwvstreams.a from all the various libraries). More virtual function fixes in WvModem. wvdialconf now checks /etc/ppp/options for common errors, and sends people to the FAQ, then to wvdial-list@worldvisions.ca rather than asking people to personally report problems to wvdial@worldvisions.ca git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@147 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 8ac1529e0ed98d5591db6fa0ddc092cf68da4b1c Author: apenwarr Date: Mon Aug 2 15:47:10 1999 +0000 Moved some wvmodembase virtual functions from a .h file into a .cc file. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@146 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 7c7cde499a4ce7abacdbaabeba2d9a869e88c906 Author: apenwarr Date: Sun Aug 1 16:00:38 1999 +0000 Patch from Michael K. Johnson to add the "--chat" option to wvdial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@145 6619c942-59fa-0310-bf43-a07aaa81d9ac commit d3d575487860688872fce37cb8f28e4485e8f1d4 Author: apenwarr Date: Thu Jul 29 00:20:15 1999 +0000 *** empty log message *** git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@143 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ae79bad97c83dc32fecd46c4c190b3dcd7360b21 Author: apenwarr Date: Wed Jul 21 01:26:54 1999 +0000 Correction to Michael's previous patch. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@142 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4c126a0acbecc1756b22119184a0e9773d26d3b3 Author: apenwarr Date: Wed Jul 21 01:20:29 1999 +0000 Patch from Michale K. Johnson to fix a bug with baud rate detection in wvdialconf; we also now detect modems on /dev/modem. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@141 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e83d4c03987aff817273d901c24eb74e55500504 Author: apenwarr Date: Mon Jun 21 04:15:11 1999 +0000 WvDial should now revert to default_reply after using its "intelligent" guess once. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@117 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 63381d2f60c5396e2510e8e2ff4fb9d7095a0304 Author: apenwarr Date: Sun Jun 20 17:18:36 1999 +0000 *** empty log message *** git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@112 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4cfbb5e33900ac8f8a7bee52ffe47dc796e710dc Author: apenwarr Date: Sun Jun 6 17:08:49 1999 +0000 Tweaked version numbers and SNMP webconfig display. WvDial's pap-secrets writer now uses \\ for \, so that pppd accepts it properly. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@109 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 9ced3783360de3063e4b42400c921aa68928b421 Author: apenwarr Date: Sat Apr 10 05:16:15 1999 +0000 Oops. Fixed a bug that I just introduced in rules.mk. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@100 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 7830da56818f7288115e7f04f3cdba05cfd4c076 Author: apenwarr Date: Thu Mar 25 19:52:57 1999 +0000 Kernel 2.2.4. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@97 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 0cf1ab0ee785d34cb6858c83bc1859808d90ce10 Author: apenwarr Date: Wed Mar 24 05:30:49 1999 +0000 DEATH TO BUGS! Lots of bugs! I think! git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@95 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 97bcc9abd586eca35f3efaa5a35ade48c3b60192 Author: apenwarr Date: Wed Mar 24 03:41:42 1999 +0000 Updated all the copyright notices to include 1999. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@94 6619c942-59fa-0310-bf43-a07aaa81d9ac commit d806b4f1906ebf947364862a26f18aa3e94c66d0 Author: apenwarr Date: Sun Mar 21 21:36:19 1999 +0000 Fixed various netguide bugs. Dialer should now not disconnect every time a dialerconfig option is changed in webconfig. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@92 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2e3e652355d505feb4a7bb5dca79fee3824d05d7 Author: dcoombs Date: Tue Feb 23 15:49:29 1999 +0000 Added a broken menu to WvDial's MENUS file. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@82 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4db844de52915d73270c92684ba34ef61d5f07b2 Author: apenwarr Date: Sat Feb 13 21:01:36 1999 +0000 Added /sbin/hwclock. Added O_TRUNC on most file create calls (oops... that should have been done LONG ago!) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@75 6619c942-59fa-0310-bf43-a07aaa81d9ac commit bf0ae486cb9e8d18468da6d5eece841e5091b06f Author: apenwarr Date: Mon Jan 25 22:44:10 1999 +0000 hdparm spins down the hard drive after 5 minutes... we'll see if that's useful. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@74 6619c942-59fa-0310-bf43-a07aaa81d9ac commit cd189604663fb439bbe71a9cfc274b5ccb01f450 Author: apenwarr Date: Sat Jan 23 18:54:48 1999 +0000 *** empty log message *** git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@73 6619c942-59fa-0310-bf43-a07aaa81d9ac commit edf2a85ecc20bc2b3eac9ecff63eeb55d64392e0 Author: apenwarr Date: Fri Dec 11 12:07:31 1998 +0000 Initial attempt at Double Vision. LD_PRELOAD the libdoublev.so.0 library and it will cause outgoing TCP connections to alternate between the list of addresses in /tmp/doublev.conf. Set the DV_DEBUG environment variable to get debug output. Also fixed some ugly demand dialer bugs and fiddled with the firewall settings. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@71 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4fd21f3c20fe593a302f7763babed9e6a1285252 Author: apenwarr Date: Fri Dec 11 10:02:02 1998 +0000 Double Vision network setup is in place... now we just need to make sure things bind to the right addresses. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@70 6619c942-59fa-0310-bf43-a07aaa81d9ac commit b0edaed2b8c8074c4784601a13775a88368e6082 Author: apenwarr Date: Fri Dec 11 05:51:18 1998 +0000 General cleanup of the demand dialer stuff. Added a bunch of short functions to the WvWeaver class to make it more manageable. (net_online(), net_dynamic(), dialer_configured(), etc). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@69 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 566d2c8239f263ab9955cad61217e385029613d6 Author: dcoombs Date: Thu Dec 10 20:15:26 1998 +0000 The beginnins of transparent proxy support in Fast Forward... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@67 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 6ea0c87b1520575f6c0d62cb27fe7bdfa426b05a Author: apenwarr Date: Fri Dec 4 10:05:00 1998 +0000 Demand dialing "works". Well, it could use some fixing, but it does dial :) webconfig/lcdconfig/rcmd still horribly broken. Idle timer is shot. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@62 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a498e49aabc4dd9c56eb0d50398343325ada7385 Author: apenwarr Date: Fri Dec 4 08:36:03 1998 +0000 Well, it's not getting any prettier... Commented out huge portions of webconfig/lcdconfig/rcmd code because it no longer works with the way I'm doing demand dialing. Of course, demand dialing doesn't work either, but that's next :) All the pieces are in place, I think. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@61 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 3fb8787eaf0a16ccd6ccca93b7bfe5e6ec12e18e Author: apenwarr Date: Mon Nov 30 15:54:43 1998 +0000 De-accelerifated the delay loops in the LCD stuff by reading from an I/O port instead of just using NOP. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@58 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a37bff22546251a6c80a8821e5a0bbff36e40b4f Author: apenwarr Date: Sat Nov 21 07:24:20 1998 +0000 Updated TODO and wvdial/MENUS. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@56 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 8ac9aee4787422421ba6364f4e60b75f15e5e8f1 Author: dcoombs Date: Wed Nov 18 19:43:39 1998 +0000 fixed a bug in papchap. WvString related... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@51 6619c942-59fa-0310-bf43-a07aaa81d9ac commit ed8ba0740b2d23f874ef07e79e4fe69639033779 Author: apenwarr Date: Tue Nov 17 02:19:35 1998 +0000 Made (I think) my last major change to WvString and fixed lots of code to go with it. Also found some bugs related to previous changes, and fixed those. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@48 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 6e9a453d0a45726b0c9b94b95af17b6a828dabc9 Author: apenwarr Date: Sun Nov 15 03:36:15 1998 +0000 Changed WvStream::select_setup() and test_set() calls to use a new SelectInfo struct, instead of the few parameters we were passing them before. This should make things easier (and reduces the source code size still further :)) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@47 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 608d35392aeafe55c97070cc22264ff77d4b9180 Author: dcoombs Date: Sun Nov 15 02:48:43 1998 +0000 Percent '%' is now a prompt character. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@46 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 5c0dbb55148affc33b0139b33e2550e3fc3b8d46 Author: apenwarr Date: Sat Nov 14 22:55:08 1998 +0000 Stage 3: operator(char*)() in WvString now returns a const char * instead. To get an editable string, use WvString::edit(). This means we can finally reimplement the way WvString works, without breaking anything (I hope). git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@45 6619c942-59fa-0310-bf43-a07aaa81d9ac commit cc05e087c55a50e9f4eaa3c338313699b4824f3f Author: apenwarr Date: Sat Nov 14 22:14:19 1998 +0000 Phase 2: changed WvLinkList::Iter and WvHashTable::Iter to give references to their objects, not pointers, and to provide operator(_type&) and operator() functions. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@44 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a463b1723ad6d0d47424ceaa0c7fda242857dff4 Author: apenwarr Date: Sat Nov 14 21:13:08 1998 +0000 Phase 1 of the Massive WvString Changes: the .str member has been renamed and should no longer be referred to directly. Typecast (often automatically) to (char *) instead. Also, the auto-typecast to int has been removed -- it was used in exactly one place :) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@43 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 7741f2dcd11b021a0e0295fede4f992eb1527f71 Author: apenwarr Date: Fri Nov 13 17:38:51 1998 +0000 Renamed tmp_html.cc to html.tmp.cc, because I'm pedantic :) git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@41 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 386d8373ba29124cbbb53be20f2d479fa6649bcd Author: apenwarr Date: Wed Nov 11 20:10:42 1998 +0000 Rewrote configfile stuff yesterday, with associated massive changes. It seems to work, but there may still be some bugs lurking... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@40 6619c942-59fa-0310-bf43-a07aaa81d9ac commit de877c7e7ad65c0a7185f209094615f85dddf7f4 Author: dcoombs Date: Fri Nov 6 17:33:15 1998 +0000 WvDial handles almost everything in MENUS. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@39 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 35dc3aeed939640746881ef8b7ddf6d4d84530ac Author: dcoombs Date: Fri Nov 6 17:12:11 1998 +0000 WvDial handles Golden Triangle properly. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@38 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 2bf8f8c51fe496a5553a7934a019d7f40178b312 Author: dcoombs Date: Fri Nov 6 16:10:15 1998 +0000 added Golden Triangle's menu to WvDial's MENUS file. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@37 6619c942-59fa-0310-bf43-a07aaa81d9ac commit e93e38f619a105f22e3c36a5d495aac8f6c7d66c Author: dcoombs Date: Fri Nov 6 15:59:43 1998 +0000 Teeny fix to wvdialbrain... guess_menu always returned NULL. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@36 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a5adbcf20cb8881d2ee4c7b1fcbed052a84f040b Author: apenwarr Date: Fri Nov 6 12:10:15 1998 +0000 Slight fix to WvDialBrain so that it won't do stupid things (like clear the buffer) when the entire menu, including prompt, arrives in one giant chunk. Also, blank lines count as prompts _if_ a menu has been parsed. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@35 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 450fc1f28a82d80594e5f4d5cbd6711d06fe1331 Author: apenwarr Date: Thu Nov 5 15:57:53 1998 +0000 Checked in some of my incomplete udp2test.cc changes. Need to work on some other stuff before I finish that... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@32 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 4041701ecd5b4fe13057c6052b4fd5644b767961 Author: apenwarr Date: Wed Oct 28 20:02:00 1998 +0000 Fixed a crash bug with wvmodemscan, if the identifier string was unavailable. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@28 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a28ba02fc0043d5c7e32137b467b06d9b37b5ffa Author: apenwarr Date: Mon Oct 26 00:27:08 1998 +0000 Changed WvModemScan.cc to avoid egcs warnings. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@27 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 9f19b7e91a319c5d15823d4a3ee696ff549636e5 Author: dcoombs Date: Sun Oct 25 22:25:30 1998 +0000 bitsurfr returns 960 for ati0, not 940. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@26 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 885c9c4b5dc516e5e92237ec9a400d0ca1ae1caa Author: dcoombs Date: Sun Oct 25 22:12:12 1998 +0000 Weaver now writes the ISDN identifier to the config file. This will help with supporting the BitSurfr... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@25 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 00ceede9fb229573e987444ee09a348139baef50 Author: apenwarr Date: Fri Oct 23 00:19:29 1998 +0000 Started looking at the WvNetMap code. I just realized that the IPtoHWDict is useless, and HWtoIPDict is needlessly complicated. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@24 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a299dde02c31f48aebe95ee74011e950dd8df07a Author: apenwarr Date: Tue Oct 20 19:14:32 1998 +0000 Added to wvdial/TODO. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@16 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 56ab18e91e17385c9ec02c47dcb4b42acc02e790 Author: apenwarr Date: Fri Oct 16 17:16:50 1998 +0000 Changed WvDial's auto reconnect delays. 30 seconds is too long for the first retry... git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@14 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 734178aeebcda3018c046d8caa3610a738a7a898 Author: dcoombs Date: Mon Oct 5 14:22:27 1998 +0000 Turned Auto Reconnect on by default in WvDial. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@13 6619c942-59fa-0310-bf43-a07aaa81d9ac commit 34e301f10c63e03f00fe6e7f822c67185c379c21 Author: apenwarr Date: Sat Oct 3 06:55:03 1998 +0000 WvStream::Callback functions now all return void -- no one ever used the return values anyway. A new virtual function, WvStream::execute(), is used if no callback is defined. That way, derived classes can simply override execute() instead of fiddling with static member functions and other uglies. git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@7 6619c942-59fa-0310-bf43-a07aaa81d9ac commit a0eaaa2d642f64f2fa61e25fd1d17fe23ece6eb6 Author: apenwarr Date: Sat Oct 3 02:04:39 1998 +0000 Initial revision git-svn-id: file:///home/apenwarr/alumnit-svn/public/trunk@2 6619c942-59fa-0310-bf43-a07aaa81d9ac wvdial-1.61/wvdial.conf.50000644000175000017500000001467711077630173015211 0ustar thierrythierry.TH WVDIAL.CONF 5 "December 2005" "WvDial" .\" .SH NAME wvdial.conf \- wvdial configuration file .\" .SH DESCRIPTION When .B wvdial starts, it first loads its configuration from .IR /etc/wvdial.conf , which contains basic information about the modem port, speed, and init string, along with information about your Internet Service Provider (ISP), such as the phone number, your username, and your password. .sp The configuration file .I /etc/wvdial.conf is in Windows "ini" file format, with .B sections named in square brackets and a number of .B variable = value pairs within each section. .PP Here is a sample configuration file: .PP .RS [Dialer Defaults] .br Modem = /dev/ttyS2 .br Baud = 57600 .br Init = ATZ .br Init2 = AT S11=50 .br Phone = 555-4242 .br Username = apenwarr .br Password = my-password .sp [Dialer phone2] .br Phone = 555-4243 .sp [Dialer shh] .br Init3 = ATM0 .sp [Dialer pulse] .br Dial Command = ATDP .RE .PP The sample configuration file above contains all of the options necessary to run the two sample command lines given above. Here is a complete list of settings that .B wvdial understands: .TP .I Modem The location of the device that .B wvdial should use as your modem. The default is .BR /dev/modem . .TP .I Baud The speed at which .B wvdial will communicate with your modem. The default is 57600 baud. .TP .I "Init1 ... Init9" .B wvdial can use up to nine initialization strings to set up your modem. Before dialing, these strings are sent to the modem in numerical order. These are particularly useful when specifying multiple sections. See above for an example that uses Init3 to turn the modem's speaker off. The default is "ATZ" for Init1. .TP .I Phone The phone number you want .B wvdial to dial. You can add up to 4 other phone numbers that .B wvdial will dial in order, by adding: .TP .I Phone1 .TP .I Phone2 .TP .I Phone3 .TP .I Phone4 .TP .I Dial Prefix .B wvdial will insert this string after the dial command and before the phone number. For example, to disable call waiting (in North America, anyway) set this to "*70,". .TP .I Dial Command .B wvdial will use this string to tell the modem to dial. The default is "ATDT". .TP .I Login You must set this to the username you use at your ISP. .TP .I Login Prompt If your ISP has an unusual login procedure that .B wvdial is unable to figure out, you can use this option to specify a login prompt. When this prompt is received from your ISP, .B wvdial will send the .B Login string. .TP .I Password You must set this to the password you use at your ISP. .TP .I Ask Password By setting this option .B wvdial will prompt for your password on every dialin. Thus you don't have to save your password in .IR /etc/wvdial.conf . (Option added by SuSE.) .TP .I Password Prompt If your ISP has an unusual login procedure that .B wvdial is unable to figure out, you can use this option to specify a password prompt. When this prompt is received from you ISP, .B wvdial will send the .B Password string. .TP .I PPPD Path If your system has pppd somewhere other than .BR "/usr/sbin/pppd" , you will need to set this option. .TP .I Auto DNS Try to get the Domain Nameserver (DNS) from the provider. This option is "on" by default. (Option added by SuSE.) .TP .I Check DNS Check the Domain Nameserver (DNS) after the connection has been set up. This option is "on" by default. (Option added by SuSE.) .TP .I DNS Test1 First DNS lookup for DNS check. (Option added by SuSE.) .TP .I DNS Test2 Second DNS lookup for DNS check. (Option added by SuSE.) .TP .I Check Def Route Check the default route after the connection has been set up. This option is "on" by default. (Option added by SuSE.) .TP .I Force Address This option only applies if you have a static IP address at your ISP, and even then you probably don't need it. Some ISP's don't send the IP address as part of the PPP negotiation. This option forces pppd to use the address you give it. .TP .I Remote Name If your ISP uses PAP or CHAP authentication, you might need to change this to your ISP's authentication name. In most cases, however, it's safe to use the default value, "*". .TP .I Carrier Check .B wvdial checks your modem during the connection process to ensure that it is actually online. If you have a weird modem that insists its carrier line is always down, you can disable the carrier check by setting this option to "no". .TP .I Stupid Mode When .B wvdial is in Stupid Mode, it does not attempt to interpret any prompts from the terminal server. It starts pppd immediately after the modem connects. Apparently there are ISP's that actually give you a login prompt, but work only if you start PPP, rather than logging in. Go figure. Stupid Mode is (naturally) disabled by default. .TP .I New PPPD You need this option if you have pppd version 2.3.0 or newer, to make wvdial create the file .BR /etc/ppp/peers/wvdial . This option is enabled by default, thus if you have older pppd you need to set it to `no' (or upgrade pppd). .TP .I Default Reply When .B wvdial detects a prompt, and it hasn't seen any clues that indicate what it should send as a response to the prompt, it defaults to sending "ppp". Sometimes this is inadequate. Use this option to override .BR wvdial 's default prompt response. .TP .I Auto Reconnect If enabled, .B wvdial will attempt to automatically reestablish a connection if you are randomly disconnected by the other side. This option is "on" by default. .TP .I Idle Seconds Set the hangup timeout in seconds. If there is inactivity for the given time the connection is shut down. A hangup timeout of 0 disables this feature. .TP .I Abort on Busy If enabled, .B wvdial will not retry the connection if the modem says that the line is busy. This option is "off" by default. .TP .I Abort on No Dialtone If enabled, .B wvdial will not retry the connection if the modem says that there is no dialtone. This option is "on" by default. .TP .I Dial Attempts If value is set, .B wvdial will quit after that many tries .If set to 0, .B wvdial will happily keep dialling forever. .TP .I Dial Timeout The maximum time in seconds that .B wvdial will wait for a connection to be made. Default value is 60 seconds. .PP The .BR wvdialconf (1) program can be used to detect your modem and fill in the Modem, Baud, and Init/Init2 options automatically. .\" .SH AUTHORS Dave Coombs and Avery Pennarun for Net Integration Technologies Inc. Great contributions have been made by many people, including SuSE and RedHat. Thanks guys! .\" .SH "SEE ALSO" .BR wvdial (1), .BR wvdialconf (1), .BR pppd (8). wvdial-1.61/pon.wvdial.10000644000175000017500000000042611077625616015045 0ustar thierrythierry.TH PON.WVDIAL 1 "December 2005" "WvDial" .\" .SH NAME pon.wvdial - A pon replacement. .br poff.wvdial - A poff replacement. .\" .SH DESCRIPTION .B pon.wvdial .br .TR .B poff.wvdial .br .RS Replacement scripts for pon and poff. .RE \." .SH SEE ALSO .BR wvdial (1), .BR pon (1), wvdial-1.61/wvdial.10000644000175000017500000001206111077625616014250 0ustar thierrythierry.TH WVDIAL 1 "December 2005" "WvDial" .\" .SH NAME wvdial \- PPP dialer with built-in intelligence. .\" .SH SYNOPSIS .B wvdial [ .I OPTIONS ] [ .I SECTION ] ... .\" .SH DESCRIPTION .B wvdial is an intelligent PPP dialer, which means that it dials a modem and starts PPP in order to connect to the Internet. It is something like the .BR chat (8) program, except that it uses heuristics to guess how to dial and log into your server rather than forcing you to write a login script. .PP When .B wvdial starts, it first loads its configuration from .IR /etc/wvdial.conf and .IR ~/.wvdialrc which contains basic information about the modem port, speed, and init string, along with information about your Internet Service Provider (ISP), such as the phone number, your username, and your password. .PP Then it initializes your modem and dials the server and waits for a connection (a CONNECT string from the modem). It understands and responds to typical connection problems (like BUSY and NO DIALTONE). .PP Any time after connecting, .B wvdial will start PPP if it sees a PPP sequence from the server. Otherwise, it tries to convince the server to start PPP by doing the following: .IP \(bu 4 responding to any login/password prompts it sees; .IP \(bu interpreting \(lqchoose one of the following\(rq-style menus; .IP \(bu eventually, sending the word \(lqppp\(rq (a common terminal server command). .PP If all of this fails, .B wvdial just runs .BR pppd (8) and hopes for the best. It will bring up the connection, and then wait patiently for you to drop the link by pressing CTRL\-C. .\" .SH OPTIONS Several options are recognized by .BR wvdial . .TP .B \-c, \-\-chat Run wvdial as a chat replacement from within pppd, instead of the more normal method of having wvdial negotiate the connection and then call pppd. .TP .B \-C, \-\-config=CONFIGFILE Run wvdial with CONFIGFILE as the configuration file, instead of .IR /etc/wvdial.conf . This is mainly useful only if you want to have per-user configurations, or you want to avoid having dial-up information (usernames, passwords, calling card numbers, etc.) in a system wide configuration file. .TP .B \-n, \-\-no\-syslog Don't output debug information to the syslog daemon (only useful together with \-\-chat). .PP .B wvdial is normally run without command line options, in which case it reads its configuration from the .I "[Dialer Defaults]" section of .IR /etc/wvdial.conf . (The configuration file is described in more detail in .BR wvdial.conf (5) manual page.) .PP One or more .IR SECTION s of .I /etc/wvdial.conf may be specified on the command line. Settings in these sections will override settings in .IR "[Dialer Defaults]" . .PP For example, the command: .RS .B wvdial phone2 .RE will read default options from the .I "[Dialer Defaults]" section, then override any or all of the options with those found in the .I "[Dialer phone2]" section. .PP If more than one section is specified, they are processed in the order they are given. Each section will override all the sections that came before it. .PP For example, the command: .RS .B wvdial phone2 pulse shh .RE will read default options from the .I "[Dialer Defaults]" section, then override any or all of the options with those found in the .I "[Dialer phone2]" section, followed by the .I "[Dialer pulse]" section, and lastly the .I "[Dialer shh]" section. .PP Using this method, it is possible to easily configure .B wvdial to switch between different internet providers, modem init strings, account names, and so on without specifying the same configuration information over and over. .\" .SH BUGS \(lqIntelligent\(rq programs are frustrating when they don't work right. This version of .B wvdial has only minimal support for disabling or overriding its \(lqintelligence\(rq, with the \(lqStupid Mode\(rq, \(lqLogin Prompt\(rq, and \(lqPassword Prompt\(rq options. So, in general if you have a nice ISP, it will probably work, and if you have a weird ISP, it might not. .PP Still, it's not much good if it doesn't work for you, right? Don't be fooled by the fact that .B wvdial finally made it to version 1.00; it could well contain many bugs and misfeatures. Let us know if you have problems by sending e-mail to .BR . .PP You may encounter some error messages if you don't have write access to .B /etc/ppp/pap\-secrets and .BR /etc/ppp/chap\-secrets . Unfortunately, there's really no nice way around this yet. .SH FILES .TP /etc/wvdial.conf Configuration file which contains modem, dialing, and login information. See .BR wvdial.conf (5). .TP /dev/ttyS* Serial port devices. .TP /etc/ppp/peers/wvdial Required for correct authentication in pppd version 2.3.0 or newer. .TP /etc/ppp/{pap,chap}\-secrets Contains a list of usernames and passwords used by pppd for authentication. .B wvdial maintains this list automatically. .\" .SH AUTHORS Dave Coombs and Avery Pennarun for Net Integration Technologies. We would also like to thank SuSE and RedHat for adding a number of various cool features to .BR wvdial . Thanks guys! .\" .SH SEE ALSO .BR wvdial.conf (5), .BR wvdialconf (1), .BR pppd (8), .BR chat (8). wvdial-1.61/FAQ0000644000175000017500000000017611077625616013236 0ustar thierrythierry wvdial stays in foreground -- you really are connected don't forget to set up /etc/resolv.conf setserial /etc/ppp/options wvdial-1.61/config.defaults.mk0000644000175000017500000000125211077701700016271 0ustar thierrythierryCOMPILER_STANDARD=posix EXEEXT= INSTALL=/usr/bin/install -c INSTALL_DATA=${INSTALL} -m 644 INSTALL_PROGRAM=${INSTALL} INSTALL_SCRIPT=${INSTALL} LN_S=ln -s LN=ln MOC=/usr/bin/moc LIBS_DBUS=-ldbus-1 LIBS_QT=-lqt-mt LIBS_PAM=-lpam LIBS_TCL= prefix=/usr/local datadir=${prefix}/share includedir=${prefix}/include infodir=${prefix}/share/info localstatedir=${prefix}/var mandir=${prefix}/share/man sharedstatedir=${prefix}/com sysconfdir=${prefix}/etc exec_prefix=${prefix} bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib libexecdir=${exec_prefix}/libexec sbindir=${exec_prefix}/sbin enable_debug=yes enable_optimization=no enable_resolver_fork= enable_warnings= enable_testgui= wvdial-1.61/version.h.in0000644000175000017500000000015711077675071015146 0ustar thierrythierry#ifndef __VERSION_H #define __VERSION_H #define WVDIAL_VER_STRING "@PACKAGE_VERSION@" #endif // __VERSION_H wvdial-1.61/wvdial.cc0000644000175000017500000001402411077630376014475 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2005 Net Integration Technologies, Inc. * * Standalone WvDial program, for testing the WvDialer class. * * Created: Sept 30 1997 D. Coombs */ #include "wvargs.h" #include "wvdialer.h" #include "version.h" #include "wvlog.h" #include "wvlogrcv.h" #include "wvlogfile.h" #include "wvsyslog.h" #include "wvcrash.h" #include #include #include volatile bool want_to_die = false; // use no prefix string for app "Modem", and an arrow for everything else. // This makes the output of the wvdial application look nicer. class WvDialLogger : public WvLogConsole /**************************************/ { public: WvDialLogger() : WvLogConsole(dup(2)) // log to stderr (fd 2) { } protected: virtual void _make_prefix(time_t now); }; void WvDialLogger::_make_prefix(time_t now) /*******************************/ { WvString name = last_source; if(name == "WvDial Modem") { prefix = ""; prelen = 0; } else { prefix = "--> "; prelen = 4; } } static void signalhandler(int sig) /***********************************/ { fprintf(stderr, "Caught signal %d: Attempting to exit gracefully...\n", sig); want_to_die = true; signal(sig, SIG_DFL); } bool haveconfig = false; static bool config_cb(WvStringParm value, void *userdata) { WvConf *cfg = reinterpret_cast(userdata); if (!access(value, F_OK)) { cfg->load_file(value); haveconfig = true; return true; } fprintf(stderr, "Cannot read `%s'\n", value.cstr()); return false; } int main(int argc, char **argv) /********************************/ { #if DEBUG free( malloc( 1 ) ); // for electric fence #endif WvDialLogger rc; WvSyslog *syslog = NULL; WvLogFile *filelog = NULL; UniConfRoot uniconf("temp:"); WvConf cfg(uniconf); WvStringList sections; WvStringList cmdlineopts; WvLog log( "WvDial", WvLog::Debug ); WvString homedir = getenv("HOME"); bool chat_mode = false; bool write_syslog = true; signal(SIGTERM, signalhandler); signal(SIGINT, signalhandler); signal(SIGHUP, signalhandler); WvArgs args; args.set_version("WvDial " WVDIAL_VER_STRING "\n" "Copyright (c) 1997-2005 Net Integration Technologies, " "Inc."); args.set_help_header("An intelligent PPP dialer."); args.set_help_footer("Optional SECTION arguments refer to sections in " "configuration file (usually)\n" "/etc/wvdial.conf, $HOME/.wvdialrc or the file " "specified by --config.\n" "Specified sections are all read, with later ones " "overriding previous ones.\n" "Any options not in the listed sections are taken " "from [Dialer Defaults].\n" "\n" "Also, optional OPTION=value parameters allow you " "to override options within\n" "the configuration files.\n"); args.add_option('C', "config", "use configfile instead of /etc/wvdial.conf", "configfile", WvArgs::ArgCallback(&config_cb), &cfg); args.add_set_bool_option('c', "chat", "used when running wvdial from pppd", chat_mode); args.add_reset_bool_option('n', "no-syslog", "don't send output to SYSLOG", chat_mode); args.add_optional_arg("SECTION", true); args.add_optional_arg("OPTION=value", true); WvStringList remaining_args; args.process(argc, argv, &remaining_args); { WvStringList::Iter i(remaining_args); for (i.rewind(); i.next(); ) { if (strchr(i(), '=' )) cmdlineopts.append(new WvString(i()),true); else sections.append(new WvString("Dialer %s", i()), true); } } if (sections.isempty()) sections.append(new WvString("Dialer Defaults"), true); if( !haveconfig) { // Load the system file first... WvString stdconfig("/etc/wvdial.conf"); if (!access(stdconfig, F_OK)) cfg.load_file(stdconfig); // Then the user specific one... if (homedir) { WvString rcfile("%s/.wvdialrc", homedir); if (!access(rcfile, F_OK)) cfg.load_file(rcfile); } } // Inject all of the command line options on into the cfg file in a new // section called Command-Line if there are command line options. if (!cmdlineopts.isempty()) { WvStringList::Iter i(cmdlineopts); for (i.rewind();i.next();) { char *name = i().edit(); char *value = strchr(name,'='); // Value should never be null since it can't get into the list // if it doesn't have an = in i() // *value = 0; value++; name = trim_string(name); value = trim_string(value); cfg.set("Command-Line", name, value); } sections.prepend(new WvString("Command-Line"), true); } if(!cfg.isok()) { return 1; } if (chat_mode) { if (write_syslog) { WvString buf("wvdial[%s]", getpid()); syslog = new WvSyslog( buf, false, WvLog::Debug2, WvLog::Debug2 ); } else { // Direct logging to /dev/null as otherwise WvLog hasn't any // receivers and thus will use WvLogConsole to log to stderr. // That can disturb the communication with the modem on // stdin/stdout. - Fixes a bug reported by SUSE on 04/05/04 filelog = new WvLogFile( "/dev/null", WvLog::Debug2 ); } } WvDialer dialer(cfg, §ions, chat_mode); if (!chat_mode) if (dialer.isok() && dialer.options.ask_password) dialer.ask_password(); if (dialer.dial() == false) return 1; while (!want_to_die && dialer.isok() && dialer.status() != WvDialer::Idle) { dialer.select(100); dialer.callback(); } int retval; if (want_to_die) { // Probably dieing from a user signal retval = 2; } if ((dialer.status() != WvDialer::Idle) || !dialer.isok()) { retval = 1; } else { retval = 0; } dialer.hangup(); WVRELEASE(filelog); delete syslog; return(retval); } wvdial-1.61/wvdialer.cc0000644000175000017500000011125211260440453015012 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Implementation of the WvDialer smart-dialer class. * */ #include "wvdialer.h" #include "version.h" #include #include #include #include #include #include #include #include #include #include #include // N_() is defined here just for internationalization. #define N_(String) String static const char * init_responses[] = { "ok", "error", NULL }; static const char * dial_responses[] = { "connect", "no carrier", "no dialtone", "no dial tone", "busy", "error", "voice", "fclass", "no answer", NULL }; static const char * prompt_strings[] = { "}!}", "!}!", NULL }; static int messagetail_pid = 0; //************************************************** // WvDialer Public Functions //************************************************** WvDialer::WvDialer( WvConf &_cfg, WvStringList *_sect_list, bool _chat_mode ) /***************************************************************************/ : WvStreamClone( 0 ), cfg(_cfg), log( "WvDial", WvLog::Debug ), err( log.split( WvLog::Error ) ), modemrx( "WvDial Modem", WvLog::Debug ) { ppp_pipe = NULL; pppd_log = NULL; been_online = false; stat = Idle; offset = 0; prompt_tries = 0; last_rx = last_execute = 0; prompt_response = ""; auto_reconnect_delay = 0; auto_reconnect_at = 0; connected_at = 0; phnum_count = 0; phnum_max = 0; // tell wvstreams we need our own subtask uses_continue_select = true; brain = NULL; modem = NULL; sect_list = _sect_list; chat_mode = _chat_mode; log("WvDial: Internet dialer version " WVDIAL_VER_STRING "\n"); // Ensure all sections in sect_list actually exist, warning if not. WvStringList::Iter iter(*sect_list); for(iter.rewind(); iter.next();) { if(cfg[*iter] == NULL) { err(WvLog::Warning, "Warning: section [%s] does not exist in wvdial.conf.\n", *iter); } } // Ensure all inherited sections exist, warning if not. WvConfigSectionList::Iter iter2 (cfg); for (iter2.rewind(); iter2.next();) { WvConfigSection & sect2 = *iter2; WvConfigEntry * entry = sect2["Inherits"]; if (entry) { WvString inherits = entry->value; if (cfg[inherits] == NULL) err( WvLog::Warning, "Warning: inherited section [%s] does not exist in wvdial.conf\n", inherits); } } // Activate the brain and read configuration. brain = new WvDialBrain(this); // init_modem() reads the config options. It MUST run here! if(!init_modem()) { // init_modem() printed an error stat = ModemError; return; } if (options.provider.len()) { log( WvLog::Notice, "Dialing %s %s.\n", options.provider, options.product); } if (options.homepage.len()) { log(WvLog::Notice, "Homepage of %s: %s\n", options.provider.len() ? options.provider.cstr() : "this provider", options.homepage); } if(options.auto_reconnect && options.idle_seconds > 0) { err(WvLog::Notice, "Idle Seconds = %s, disabling automatic reconnect.\n", options.idle_seconds); options.auto_reconnect = false; } pppd_mon.setdnstests(options.dnstest1, options.dnstest2); pppd_mon.setcheckdns(options.check_dns); pppd_mon.setcheckdfr(options.check_dfr); } WvDialer::~WvDialer() /*******************/ { terminate_continue_select(); WVRELEASE(ppp_pipe); WVRELEASE(pppd_log); delete brain; } bool WvDialer::dial() /*******************/ // Returns false on error, or true to go asynchronous while dialing. { if(stat == Online) return(true); if(stat != Idle) { // error message has already been printed elsewhere return(false); } if (!options.phnum) { err( "Configuration does not specify a valid phone number.\n" ); stat = OtherError; } if (!options.login) { err( "Configuration does not specify a valid login name.\n" ); stat = OtherError; } if (!options.password) { err( "Configuration does not specify a valid password.\n" ); stat = OtherError; } if( stat != Idle ) return( false ); phnum_max = 0; if(options.phnum1.len()) { phnum_max++; if(options.phnum2.len()) { phnum_max++; if(options.phnum3.len()) { phnum_max++; if(options.phnum4.len()) phnum_max++; } } } // we need to re-init the modem if we were online before. if(been_online && !init_modem()) stat = ModemError; else { stat = Dial; connect_attempts = 1; dial_stat = 0; brain->reset(); } return(true); } void WvDialer::hangup() /*********************/ { WVRELEASE(ppp_pipe); if( !chat_mode ) pppd_watch( 250 ); if( stat != Idle ) { time_t now; time( &now ); log( "Disconnecting at %s", ctime( &now ) ); del_modem(); stat = Idle; } if (messagetail_pid > 0) { kill(messagetail_pid, 15); messagetail_pid = 0; } } void WvDialer::pre_select( SelectInfo& si ) /*******************************************/ { if( isok() && stat != Online && stat != Idle && time( NULL ) - last_execute > 1 ) { // Pretend we have "data ready," so execute() gets called. // select() already returns true whenever the modem is readable, // but when we are doing a timeout (eg. PreDial1/2) for example, // we need to execute() even if no modem data is incoming. si.msec_timeout = 0; } else { WvStreamClone::pre_select( si ); } } bool WvDialer::post_select( SelectInfo& si ) { if( isok() && stat != Online && stat != Idle && time( NULL ) - last_execute > 1 ) { // Pretend we have "data ready," so execute() gets called. // select() already returns true whenever the modem is readable, // but when we are doing a timeout (eg. PreDial1/2) for example, // we need to execute() even if no modem data is incoming. return true; } else { return WvStreamClone::post_select( si ); } } bool WvDialer::isok() const /*************************/ { bool b = ( !modem || modem->isok() ) && stat != ModemError && stat != OtherError; /* if (!b) err("Returning not ok!!\n" ); */ return( b ); } char *WvDialer::connect_status() const /*************************************/ { static char msg[ 160 ]; switch( stat ) { case PreDial2: case PreDial1: case Dial: case WaitDial: if( dial_stat == 1 ) strcpy( msg, N_("Last attempt timed out. Trying again.") ); else if( dial_stat == 2 ) strcpy( msg, N_("Modem did not connect last attempt. Trying again.") ); else if( dial_stat == 3 ) strcpy( msg, N_("No dial tone last attempt. Trying again.") ); else if( dial_stat == 4 ) strcpy( msg, N_("Busy signal on last attempt. Trying again.") ); else if( dial_stat == 5 ) strcpy( msg, N_("Voice answer on last attempt. Trying again.") ); else if( dial_stat == 6 ) strcpy( msg, N_("Fax answer on last attempt. Trying again.") ); else if( dial_stat == 7 ) strcpy( msg, N_("No answer on last attempt. Trying again.") ); else return( NULL ); break; case WaitAnything: strcpy( msg, N_("Waiting for a response from Internet Provider.") ); break; case WaitPrompt: strcpy( msg, N_("Waiting for a prompt from Internet Provider.") ); break; case AutoReconnectDelay: sprintf( msg, "Next attempt in 00:%02ld:%02ld.", ( auto_reconnect_at - time( NULL ) ) / 60, ( auto_reconnect_at - time( NULL ) ) % 60 ); break; default: return( NULL ); } return( msg ); } void WvDialer::pppd_watch( int ms ) /*********************************/ { // see if pppd has a message, analyse it and output to log if( pppd_log != NULL && pppd_log->isok() ) { char *line; while ( (line = pppd_log->blocking_getline( ms )) ) { WvString buffer1(pppd_mon.analyse_line( line )); if (!!buffer1) { log("pppd: %s\n", buffer1); } } } } void WvDialer::execute() /**********************/ { WvStreamClone::execute(); // the modem object might not exist, if we just disconnected and are // redialing. if( !modem && !init_modem() ) return; last_execute = time( NULL ); if( !chat_mode ) pppd_watch( 100 ); switch( stat ) { case Dial: case WaitDial: case PreDial1: case PreDial2: async_dial(); break; case WaitAnything: // we allow some time after connection for silly servers/modems. if( modem->select( 500, true, false ) ) { // if any data comes in at all, switch to impatient mode. stat = WaitPrompt; last_rx = time( NULL ); } else if( time( NULL ) - last_rx >= 30 ) { // timed out - do what WaitPrompt would do on a timeout. stat = WaitPrompt; } else { // We prod the server with a CR character every once in a while. // FIXME: Does this cause problems with login prompts? modem->write( "\r", 1 ); } break; case WaitPrompt: async_waitprompt(); break; case Online: assert( !chat_mode ); // If already online, we only need to make sure pppd is still there. if( ppp_pipe && ppp_pipe->child_exited() ) { int pppd_exit_status = ppp_pipe->exit_status(); if( ppp_pipe->child_killed() ) { log( WvLog::Error, "PPP was killed! (signal = %s)\n", ppp_pipe->exit_status() ); } // we must delete the WvModem object so it can be recreated // later; starting pppd seems to screw up the file descriptor. hangup(); del_modem(); time_t call_duration = time( NULL ) - connected_at; if( pppd_mon.auth_failed() ) { log("Authentication error.\n" "We failed to authenticate ourselves to the peer.\n" "Maybe bad account or password?\n" ); } else { WvString msg = ""; switch (pppd_exit_status) { case 2: msg = "pppd options error"; break; case 3: msg = "No root priv error"; break; case 4: msg = "No ppp module error"; break; case 10: msg = "PPP negotiation failed"; break; case 11: msg = "Peer didn't authenticatie itself"; break; case 12: msg = "Link idle: Idle Seconds reached."; break; case 13: msg = "Connect time limit reached."; break; case 14: msg = "Callback negotiated, call should come back."; break; case 15: msg = "Lack of LCP echo responses"; break; case 17: msg = "Loopback detected"; break; case 19: msg = "Authentication error.\n" "We failed to authenticate ourselves to the peer.\n" "Maybe bad account or password?"; break; } if (msg.len()) { // Note: exit code = %s is parsed by kinternet: log("The PPP daemon has died: %s (exit code = %s)\n", msg, pppd_exit_status); log("man pppd explains pppd error codes in more detail.\n"); err(WvLog::Notice, "I guess that's it for now, exiting\n"); if (pppd_exit_status == 12 && options.auto_reconnect) err(WvLog::Notice, "Idle parameter is passed to pppd\n" "If you don't want an idle timeout per default,\n" "comment out the idle parameter in /etc/ppp/options\n"); if (pppd_exit_status == 15) { log("Provider is overloaded(often the case) or line problem.\n"); } options.auto_reconnect = false; } msg = ""; switch (pppd_exit_status) { case 1: msg = "Fatal pppd error"; break; case 5: msg = "pppd received a signal"; break; case 6: msg = "Serial port lock failed"; break; case 7: msg = "Serial port open failed"; break; case 8: msg = "Connect script failed"; break; case 9: msg = "Pty program error"; break; case 16: msg = "A modem hung up the phone"; break; case 18: msg = "The init script failed"; break; } if (msg.len()) { log("The PPP daemon has died: %s (exit code = %s)\n", msg, pppd_exit_status); log("man pppd explains pppd error codes in more detail.\n"); log(WvLog::Notice, "Try again and look into /var/log/messages " "and the wvdial and pppd man pages for more information.\n"); } else log(WvLog::Notice, "The PPP daemon has died. (exit code = %s)\n", pppd_exit_status); } // check to see if we're supposed to redial automatically soon. if( options.auto_reconnect && isok() ) { if( call_duration >= 45 ) // Connection was more than 45 seconds, so reset the // "exponential backup timer". auto_reconnect_delay = 0; // exponentially back up... auto_reconnect_delay *= 2; if( auto_reconnect_delay == 0 ) auto_reconnect_delay = 5; // start at 5 seconds if( auto_reconnect_delay > 600 ) auto_reconnect_delay = 600; // no longer than 10 minutes auto_reconnect_at = time( NULL ) + auto_reconnect_delay; stat = AutoReconnectDelay; log( WvLog::Notice, "Auto Reconnect will be attempted in %s " "seconds\n", auto_reconnect_at - time( NULL ) ); } } break; case AutoReconnectDelay: // If enough time has passed after ISP disconnected us that we should // redial, do it... // We can only get into this state if the Auto Reconnect option is // enabled, so there's no point in checking the option here. if( time( NULL ) >= auto_reconnect_at ) { stat = Idle; dial(); } break; case Idle: case ModemError: case OtherError: default: drain(); break; } } //************************************************** // WvDialer Private Functions //************************************************** void WvDialer::load_options() /***************************/ { OptInfo opts[] = { // string options: { "Modem", &options.modem, NULL, "/dev/modem", 0 }, { "Init1", &options.init1, NULL, "ATZ", 0 }, { "Init2", &options.init2, NULL, "", 0 }, { "Init3", &options.init3, NULL, "", 0 }, { "Init4", &options.init4, NULL, "", 0 }, { "Init5", &options.init5, NULL, "", 0 }, { "Init6", &options.init6, NULL, "", 0 }, { "Init7", &options.init7, NULL, "", 0 }, { "Init8", &options.init8, NULL, "", 0 }, { "Init9", &options.init9, NULL, "", 0 }, { "Phone", &options.phnum, NULL, "", 0 }, { "Phone1", &options.phnum1, NULL, "", 0 }, { "Phone2", &options.phnum2, NULL, "", 0 }, { "Phone3", &options.phnum3, NULL, "", 0 }, { "Phone4", &options.phnum4, NULL, "", 0 }, { "Dial Prefix", &options.dial_prefix, NULL, "", 0 }, { "Area Code", &options.areacode, NULL, "", 0 }, { "Dial Command", &options.dial_cmd, NULL, "ATDT", 0 }, { "Username", &options.login, NULL, "", 0 }, { "Login Prompt", &options.login_prompt, NULL, "", 0 }, { "Password", &options.password, NULL, "", 0 }, { "Password Prompt", &options.pass_prompt, NULL, "", 0 }, { "PPPD Path", &options.where_pppd, NULL, "/usr/sbin/pppd", 0 }, { "PPPD Option", &options.pppd_option, NULL, "", 0 }, { "Force Address", &options.force_addr, NULL, "", 0 }, { "Remote Name", &options.remote, NULL, "*", 0 }, { "Default Reply", &options.default_reply,NULL, "ppp", 0 }, { "Country", &options.country, NULL, "", 0 }, { "Provider", &options.provider, NULL, "", 0 }, { "Product", &options.product, NULL, "", 0 }, { "Homepage", &options.homepage, NULL, "", 0 }, { "DialMessage1", &options.dialmessage1, NULL, "", 0 }, { "DialMessage2", &options.dialmessage2, NULL, "", 0 }, { "DNS Test1", &options.dnstest1, NULL, "www.suse.de", 0 }, { "DNS Test2", &options.dnstest2, NULL, "www.suse.com", 0 }, // int/bool options { "Baud", NULL, &options.baud, "", DEFAULT_BAUD }, { "Carrier Check", NULL, &options.carrier_check, "", true }, { "Stupid Mode", NULL, &options.stupid_mode, "", false }, { "New PPPD", NULL, &options.new_pppd, "", true }, { "Auto Reconnect", NULL, &options.auto_reconnect,"", true }, { "Dial Attempts", NULL, &options.dial_attempts, "", 0 }, { "Abort on Busy", NULL, &options.abort_on_busy, "", false }, { "Abort on No Dialtone", NULL, &options.abort_on_no_dialtone, "", true }, { "Compuserve", NULL, &options.compuserve, "", false }, { "Tonline", NULL, &options.tonline, "", false }, { "Auto DNS", NULL, &options.auto_dns, "", true }, { "Check DNS", NULL, &options.check_dns, "", true }, { "Check Def Route", NULL, &options.check_dfr, "", true }, { "Idle Seconds", NULL, &options.idle_seconds, "", 0 }, { "ISDN", NULL, &options.isdn, "", false }, { "Ask Password", NULL, &options.ask_password, "", false }, { "Dial Timeout", NULL, &options.dial_timeout, "", 60 }, { NULL, NULL, NULL, "", 0 } }; const char * d = "Dialer Defaults"; for( int i=0; opts[i].name != NULL; i++ ) { if( opts[i].str_member == NULL ) { // it's an int/bool option. *( opts[i].int_member ) = cfg.fuzzy_getint( *sect_list, opts[i].name, cfg.getint( d, opts[i].name, opts[i].int_default ) ); } else { // it's a string option. *( opts[i].str_member ) = cfg.fuzzy_get( *sect_list, opts[i].name, cfg.get( d, opts[i].name, opts[i].str_default ) ); } } // Support Init, as well as Init1, to make old WvDial people happy. const char * newopt = cfg.fuzzy_get( *sect_list, "Init", cfg.get( d, "Init", NULL ) ); if( newopt ) options.init1 = newopt; } bool WvDialer::init_modem() /*************************/ { int received, count; load_options(); if (!options.modem) { err( "Configuration does not specify a valid modem device.\n" ); stat = ModemError; return( false ); // if we get this error, we already have a problem. } for (count = 0; count < 3; count++) { // the buffer is empty. offset = 0; del_modem(); // Open the modem... if( chat_mode ) { int flags = fcntl( STDIN_FILENO, F_GETFL ); if( ( flags & O_ACCMODE ) == O_RDWR ) { cloned = modem = new WvModemBase( STDIN_FILENO ); } else { // The following is needed for diald. // Stdin is not opened for read/write. ::close( STDIN_FILENO ); if( getenv( "MODEM" ) == NULL ) { err( "stdin not read/write and $MODEM not set\n" ); exit( 1 ); } // Try to open device $MODEM. flags &= !O_ACCMODE; flags |= O_RDWR; int tty = ::open( getenv( "MODEM" ), flags ); if( tty == -1 ) { err( "can't open %s: %m\n", getenv( "MODEM" ) ); exit( 1 ); } cloned = modem = new WvModemBase( tty ); } } else { cloned = modem = new WvModem( options.modem, options.baud ); } if( !modem->isok() ) { err( "Cannot open %s: %s\n", options.modem, modem->errstr() ); continue; } log( "Initializing modem.\n" ); // make modem happy modem->print( "\r\r\r\r\r" ); while( modem->select( 100, true, false ) ) modem->drain(); // Send up to nine init strings, in order. int init_count; for( init_count=1; init_count<=9; init_count++ ) { WvString *this_str; switch( init_count ) { case 1: this_str = &options.init1; break; case 2: this_str = &options.init2; break; case 3: this_str = &options.init3; break; case 4: this_str = &options.init4; break; case 5: this_str = &options.init5; break; case 6: this_str = &options.init6; break; case 7: this_str = &options.init7; break; case 8: this_str = &options.init8; break; case 9: default: this_str = &options.init9; break; } if( !! *this_str ) { modem->print( "%s\r", *this_str ); log( "Sending: %s\n", *this_str ); received = wait_for_modem( init_responses, 5000, true ); switch( received ) { case -1: modem->print( "ATQ0\r" ); log( "Sending: ATQ0\n" ); received = wait_for_modem( init_responses, 500, true ); modem->print( "%s\r", *this_str ); log( "Re-Sending: %s\n", *this_str ); received = wait_for_modem( init_responses, 5000, true ); switch( received ) { case -1: err( "Modem not responding.\n" ); return( false ); case 1: err( "Bad init string.\n" ); return( false ); } break; case 1: err( "Bad init string.\n" ); goto end_outer; } } } // Everything worked fine. log( "Modem initialized.\n" ); return( true ); // allows us to exit the internal loop end_outer: continue; } // we tried 3 times and it didn't work. return( false ); } void WvDialer::del_modem() { assert(cloned == modem); if (modem) { modem->hangup(); WVRELEASE(modem); cloned = NULL; } } WvModemBase *WvDialer::take_modem() { WvModemBase *_modem; if (!modem) init_modem(); _modem = modem; cloned = modem = NULL; return _modem; } void WvDialer::give_modem(WvModemBase *_modem) { del_modem(); cloned = modem = _modem; } void WvDialer::async_dial() /*************************/ { int received; if( stat == PreDial2 ) { // Wait for three seconds and then go to PreDial1. continue_select(3000); stat = PreDial1; return; } if( stat == PreDial1 ) { // Hit enter a few times. for( int i=0; i<3; i++ ) { modem->write( "\r", 1 ); continue_select(500); if (!isok() || !modem) break; } stat = Dial; return; } if( stat == Dial ) { // Construct the dial string. We use the dial command, prefix, // area code, and phone number as specified in the config file. WvString *this_str; switch( phnum_count ) { case 0: this_str = &options.phnum; break; case 1: this_str = &options.phnum1; break; case 2: this_str = &options.phnum2; break; case 3: this_str = &options.phnum3; break; case 4: default: this_str = &options.phnum4; break; } WvString s( "%s%s%s%s%s\r", options.dial_cmd, options.dial_prefix, !options.dial_prefix ? "" : ",", options.areacode, *this_str ); modem->print( s ); log( "Sending: %s\n", s ); log( "Waiting for carrier.\n" ); stat = WaitDial; } received = async_wait_for_modem( dial_responses, true ); switch( received ) { case -1: // nothing -- return control. if( time( NULL ) - last_rx >= options.dial_timeout ) { log( WvLog::Warning, "Timed out while dialing. Trying again.\n" ); stat = PreDial1; connect_attempts++; dial_stat = 1; //if Attempts in wvdial.conf is 0..dont do anything if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } } return; case 0: // CONNECT /* if( chat_mode ) { if( options.ask_password ) { err( "Error: dial on demand does not work with option Ask Password = 1\n" ); exit( 1 ); } if( getuid() != 0 ) { err( "Hint: if authentication does not work, start wvdial.dod once as user root\n" ); } WvPapChap papchap; papchap.put_secret( options.login, options.password, options.remote ); if( getuid() == 0 ) { if( papchap.isok_pap() == false ) { err("Warning: Could not modify %s: %s\n",PAP_SECRETS, strerror(errno)); } if( papchap.isok_chap() == false ) { err("Warning: Could not modify %s: %s\n",CHAP_SECRETS, strerror(errno)); } } } */ if( options.stupid_mode == true || options.tonline == true ) { if( chat_mode ) { log( "Carrier detected. Chatmode finished.\n" ); exit( 0 ); } else { log( "Carrier detected. Starting PPP immediately.\n" ); start_ppp(); } } else { log( "Carrier detected. Waiting for prompt.\n" ); stat = WaitAnything; } return; case 1: // NO CARRIER log( WvLog::Warning, "No Carrier! Trying again.\n" ); stat = PreDial1; connect_attempts++; dial_stat = 2; continue_select(2000); //if Attempts in wvdial.conf is 0..dont do anything if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } return; case 2: // NO DIALTONE case 3: // NO DIAL TONE if( options.abort_on_no_dialtone == true ) { err( "No dial tone.\n" ); stat = ModemError; } else { log( "No dial tone. Trying again in 5 seconds.\n" ); stat = PreDial2; connect_attempts++; dial_stat = 3; //if Attempts in wvdial.conf is 0..dont do anything if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } } return; case 4: // BUSY if( options.abort_on_busy == true ) { err( "The line is busy.\n" ); stat = ModemError; } else { if( phnum_count++ == phnum_max ) phnum_count = 0; if( phnum_count == 0 ) log( WvLog::Warning, "The line is busy. Trying again.\n" ); else log( WvLog::Warning, "The line is busy. Trying other number.\n"); stat = PreDial1; connect_attempts++; dial_stat = 4; continue_select(2000); } return; case 5: // ERROR err( "Invalid dial command.\n" ); stat = ModemError; //if Attempts in wvdial.conf is 0..dont do anything if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } return; case 6: // VOICE log( "Voice line detected. Trying again.\n" ); connect_attempts++; dial_stat = 5; stat = PreDial2; //if Attempts in wvdial.conf is 0..dont do anything if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } return; case 7: // FCLASS log( "Fax line detected. Trying again.\n" ); connect_attempts++; dial_stat = 6; stat = PreDial2; if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } return; case 8: // NO ANSWER log( WvLog::Warning, "No Answer. Trying again.\n" ); stat = PreDial1; connect_attempts++; dial_stat = 7; if(options.dial_attempts != 0) { if(check_attempts_exceeded(connect_attempts)) { hangup(); } } continue_select(2000); return; default: err( "Unknown dial response string.\n" ); stat = ModemError; return; } } bool WvDialer::check_attempts_exceeded(int no_of_attempts) /********************************************************/ { if(no_of_attempts > options.dial_attempts) { log( WvLog::Warning, "Maximum Attempts Exceeded..Aborting!!\n" ); return true; } else { return false; } } static int set_echo( int desc, int value ) /****************************************/ { struct termios settings; if( isatty( desc ) != 1 ) return 0; if( tcgetattr (desc, &settings) < 0 ) { perror ("error in tcgetattr"); return 0; } if( value ) settings.c_lflag |= ECHO; else settings.c_lflag &= ~ECHO; if( tcsetattr (desc, TCSANOW, &settings) < 0 ) { perror ("error in tcgetattr"); return 0; } return 1; } int WvDialer::ask_password() /**************************/ { char tmp[60]; log("Please enter password (or empty password to stop):\n" ); // fflush( stdout ); // kinternet needs this - WvLog should do it // automagically // set_echo( STDOUT_FILENO, 0 ); fgets( tmp, 50, stdin ); set_echo( STDOUT_FILENO, 1 ); if( tmp[ strlen(tmp)-1 ] == '\n' ) tmp[ strlen(tmp)-1 ] = '\0'; options.password = tmp; return 1; } void WvDialer::start_ppp() /************************/ { if( chat_mode ) exit(0); // pppd is already started... WvString addr_colon( "%s:", options.force_addr ); WvString speed( options.baud ); WvString idle_seconds( options.idle_seconds ); const char *dev_str = (const char *)options.modem; if (!(strncmp(options.modem, "/dev/", 5))) dev_str += 5; // open a pipe to access the messages of pppd if( pipe( pppd_msgfd ) == -1 ) { err("pipe failed: %s\n", strerror(errno) ); exit( EXIT_FAILURE ); } pppd_log = new WvFDStream( pppd_msgfd[0] ); WvString buffer1("%s", pppd_msgfd[1] ); // open a pipe to pass password to pppd WvString buffer2; if (!options.password) { if( pipe( pppd_passwdfd ) == -1 ) { err("pipe failed: %s\n", strerror(errno) ); exit( EXIT_FAILURE ); } ::write( pppd_passwdfd[1], (const char *) options.password, options.password.len() ); ::close( pppd_passwdfd[1] ); buffer2.append("%s", pppd_passwdfd[0] ); } char const *argv_raw[] = { options.where_pppd, speed, "modem", "crtscts", "defaultroute", "usehostname", "-detach", "user", options.login, (!!options.force_addr) ? (const char *)addr_colon : "noipdefault", options.new_pppd ? "call" : NULL, options.new_pppd ? "wvdial" : NULL, options.new_pppd && options.auto_dns ? "usepeerdns" : NULL, options.new_pppd && options.isdn ? "default-asyncmap" : NULL, options.new_pppd && (!!options.pppd_option) ? (const char *) options.pppd_option : NULL, options.new_pppd && options.idle_seconds >= 0 ? "idle" : NULL, options.new_pppd && options.idle_seconds >= 0 ? (const char *)idle_seconds : NULL, "logfd", buffer1, // !!buffer2 ? "passwordfd" : NULL, !!buffer2 ? (const char *)buffer2 : NULL, NULL }; /* Filter out NULL holes in the raw argv list: */ char * argv[sizeof(argv_raw)]; int argv_index = 0; for (unsigned int i = 0; i < sizeof(argv_raw)/sizeof(char *); i++) { if (argv_raw[i]) argv[argv_index++] = (char *)argv_raw[i]; } argv[argv_index] = NULL; if( access( options.where_pppd, X_OK ) != 0 ) { err( "Unable to run %s.\n", options.where_pppd ); err( "Check permissions, or specify a \"PPPD Path\" option " "in wvdial.conf.\n" ); return; } if (options.dialmessage1.len() || options.dialmessage2.len()) { log( WvLog::Notice, "\ ==========================================================================\n"); log( WvLog::Notice, "> %s\n", options.dialmessage1); if (options.dialmessage2.len()) log( WvLog::Notice, "> %s\n", options.dialmessage2); log( WvLog::Notice, "\ ==========================================================================\n"); if (options.homepage.len()) log( WvLog::Notice, "Homepage of %s: %s\n", options.provider.len() ? (const char *)options.provider : "this provider", options.homepage); } time_t now; time( &now ); log( WvLog::Notice, "Starting pppd at %s", ctime( &now ) ); // PP - Put this back in, since we're not using passwordfd unless we're // SuSE... how did this work without this? WvPapChap papchap; papchap.put_secret( options.login, options.password, options.remote ); if( papchap.isok_pap() == false ) { err( "Warning: Could not modify %s: %s\n" "--> PAP (Password Authentication Protocol) may be flaky.\n", PAP_SECRETS, strerror( errno ) ); } if( papchap.isok_chap() == false ) { err( "Warning: Could not modify %s: %s\n" "--> CHAP (Challenge Handshake) may be flaky.\n", CHAP_SECRETS, strerror( errno ) ); } ppp_pipe = new WvPipe( argv[0], argv, false, false, false, modem, modem, modem ); log( WvLog::Notice, "Pid of pppd: %s\n", ppp_pipe->getpid() ); stat = Online; been_online = true; connected_at = time( NULL ); } void WvDialer::async_waitprompt() /*******************************/ { int received; const char *prompt_response; if( options.carrier_check == true ) { if( !modem || !modem->carrier() ) { err( "Connected, but carrier signal lost! Retrying...\n" ); stat = PreDial2; return; } } received = async_wait_for_modem( prompt_strings, false, true ); if( received >= 0 ) { // We have a PPP sequence! log( "PPP negotiation detected.\n" ); start_ppp(); } else if( received == -1 ) { // some milliseconds must have passed without receiving anything, // or async_wait_for_modem() would not have returned yet. // check to see if we are at a prompt. // Note: the buffer has been lowered by strlwr() already. prompt_response = brain->check_prompt( buffer ); if( prompt_response != NULL ) modem->print( "%s\r", prompt_response ); } } static void strip_parity( char * buf, size_t size ) /*************************************************/ // clear the parity bit on incoming data (to allow 7e1 connections) { while( size-- > 0 ) { *buf = *buf & 0x7f; buf++; } } int WvDialer::wait_for_modem( const char * strs[], int timeout, bool neednewline, bool verbose ) /***********************************************/ { off_t onset; char * soff; int result = -1; int len; const char *ppp_marker = NULL; while( modem->select( timeout, true, false ) ) { last_rx = time( NULL ); onset = offset; offset += modem->read( buffer + offset, INBUF_SIZE - offset ); // make sure we do not split lines TOO arbitrarily, or the // logs will look bad. while( offset < INBUF_SIZE && modem->select( 100, true, false ) ) offset += modem->read( buffer + offset, INBUF_SIZE - offset ); // Make sure there is a NULL on the end of the buffer. buffer[ offset ] = '\0'; // Now turn all the NULLs in the middle of the buffer to spaces, for // easier parsing. replace_char( buffer + onset, '\0', ' ', offset - onset ); strip_parity( buffer + onset, offset - onset ); replace_char( buffer + onset, '\0', ' ', offset - onset ); if( verbose ) modemrx.write( buffer + onset, offset - onset ); strlwr( buffer + onset ); // Now we can search using strstr. for( result = 0; strs[ result ] != NULL; result++ ) { len = strlen( strs[ result ] ); soff = strstr( buffer, strs[ result ] ); if( soff && ( !neednewline || strchr( soff, '\n' ) || strchr( soff, '\r' ) ) ) { memmove( buffer, soff + len, offset - (int)( soff+len - buffer ) ); offset -= (int)( soff+len - buffer ); break; } } if( strs[ result ] == NULL ) result = -1; // Search the buffer for a valid menu option... // If guess_menu returns an offset, we zap everything before it in // the buffer. This prevents finding the same menu option twice. ppp_marker = brain->guess_menu( buffer ); if (strs != dial_responses) { if( ppp_marker != NULL ) memset( buffer, ' ', ppp_marker-buffer ); } // Looks like we didn't find anything. Is the buffer full yet? if( offset == INBUF_SIZE ) { // yes, move the second half to the first half for next time. memmove( buffer, buffer + INBUF_SIZE/2, INBUF_SIZE - INBUF_SIZE/2 ); offset = INBUF_SIZE/2; } if( result != -1 ) break; } buffer[ offset ] = 0; return( result ); // -1 == timeout } int WvDialer::async_wait_for_modem( const char * strs[], bool neednl, bool verbose ) /****************************************************************************/ { return( wait_for_modem( strs, 10, neednl, verbose ) ); } void WvDialer::reset_offset() /***************************/ { offset = 0; buffer[0] = '\0'; } wvdial-1.61/wvmodemscan.h0000644000175000017500000000416611077625616015403 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Intelligent serial port scanner: try to find a port (or ports) * with a working modem, guess a basic startup init string, and find * the maximum baud rate. */ #ifndef __WVMODEMSCAN_H #define __WVMODEMSCAN_H #include "wvlinklist.h" #include "wvlog.h" class WvModem; class WvModemScan { public: enum Stage { Startup=0, AT, ATZ, ATS0, Carrier, DTR, FCLASS, GetIdent, BaudStep, Reinit, Done, NUM_STAGES }; private: int stage; enum Status { Fail = -1, Unknown = 0, Worked = 1, Test }; Status status[NUM_STAGES]; WvLog debug; WvString file; WvString identifier; int baud, tries; WvModem *modem; bool broken; bool doresult(WvStringParm s, int msec); size_t coagulate(char *buf, size_t size, int msec); public: WvModemScan(WvStringParm devname, bool is_modem_link); ~WvModemScan(); WvString modem_name; bool use_modem_link; // check probe status bool isdone() const { return stage == Done; } bool isok() const; // is this an isdn modem? Returns modem identifier if so. const char *is_isdn() const; bool use_default_asyncmap() const; // continue the probe where we left off void execute(); // after a probe finishes (isdone()==true) these functions return // the final status info for the device. WvStringParm filename() const { return file; } int maxbaud() const { return baud; } WvString initstr() const; }; // Declare a WvModemScanList, which searches for all available modems. // After an instance of the class has been created, run execute() // again and again until isdone()==true; then the contents of the list // is a set of all available modems, in the form of WvModemScan objects. DeclareWvList2(WvModemScanListBase, WvModemScan); class WvModemScanList : public WvModemScanListBase { WvLog log; int thisline; bool printed; public: WvModemScanList(WvStringParm _exception = WvString::null); void execute(); bool isdone(); }; #endif // __WVMODEMSCAN_H wvdial-1.61/wvpapchap.cc0000644000175000017500000001001511260441676015171 0ustar thierrythierry/* * Worldvisions Weaver Software: * Copyright (C) 1997-2003 Net Integration Technologies, Inc. * * Re-write of wvpapsecrets.cc. This one supports CHAP as well, and is also * much safer. */ #include "wvpapchap.h" #include "wvfile.h" #include "strutils.h" #include #include #include /////////////////////////////////////////////////////////// // WvPapChap public functions /////////////////////////////////////////////////////////// void WvPapChap::put_secret( WvString username, WvString password, WvString remote ) /*******************************************/ { assert( remote[0] ); // PAP secrets: contents.zap(); load_file( PAP_SECRETS ); do_secret( username, password, remote ); if( write_file( PAP_SECRETS ) == false ) pap_success = false; // CHAP secrets: contents.zap(); load_file( CHAP_SECRETS ); do_secret( username, password, remote ); if( write_file( CHAP_SECRETS ) == false ) chap_success = false; } /////////////////////////////////////////////////////////// // WvPapChap private functions /////////////////////////////////////////////////////////// bool WvPapChap::load_file( const char * filename ) /******************************************/ // Loads filename into the "contents" string list, one line per entry. { char * from_file; WvString * tmp; WvFile file( filename, O_RDONLY ); if( file.isok() == false ) return( false ); from_file = file.getline(); while( from_file ) { tmp = new WvString( from_file ); contents.append( tmp, true ); from_file = file.getline(); } file.close(); return( true ); } bool WvPapChap::write_file( const char * filename ) /*******************************************/ // Writes the "contents" list to the file, one entry per line. { WvFile file( filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR ); if( file.isok() == false ) return( false ); WvStringList::Iter iter( contents ); for( iter.rewind(); iter.next(); ) file.print( "%s\n", *iter ); file.close(); return( true ); } void WvPapChap::do_secret( const char * _username, const char * _password, const char * _remote ) /***********************************************/ // Goes through the "contents" list, looking for lines that have the same // username. If they do, and the remote value is either "*" or remote, // the secret is removed. Otherwise, it is left in place. At the end of the // list, the secret "username remote password" is added. // remote defaults to "wvdial". { WvStringList::Iter iter( contents ); WvString username; WvString password; WvString remote; if( !_username || !_password ) return; // we need to backslash-escape all punctuation, so that pppd reads it // correctly. username = backslash_escape( _username ); password = backslash_escape( _password ); remote = _remote; if( !remote ) remote = "*"; for( iter.rewind(); iter.next(); ) { // Is this line a comment? if( iter()[0] == '#' ) continue; // Is the line blank? const char * p = iter(); do p++; while( *p != '\0' && isspace( *p ) ); p--; if( *p == '\0' ) continue; // p points at the first non-whitespace char. const char * q = p; do q++; while( *q != '\0' && !isspace( *q ) ); q--; if( *q == '\0' ) { // illegal line, so get rid of it. iter.unlink(); iter.rewind(); continue; } if( strncmp( username, p, q-p ) != 0 ) // different username, so let it stay. continue; p=q; do p++; while( *p != '\0' && isspace( *p ) ); // p now points to the beginning of the "remote" section. if( strncmp( p, remote, strlen( remote ) ) == 0 || *p == '*' ) { // conflicting secret, so get rid of it. iter.unlink(); iter.rewind(); continue; } // This secret line should be fine. } contents.append( new WvString( "%s\t%s\t%s", username, remote, password ), true ); } wvdial-1.61/wvdialmon.cc0000644000175000017500000002612511077625616015215 0ustar thierrythierry// copyright: (C) 2000 by SuSE GmbH // author: arvin@suse.de // WvStreamsified by Patrick Patterson (ppatters@nit.ca) #include #include #include #include #include #include #include #include #include #include #include #include #include #include "wvdialmon.h" WvDialMon::WvDialMon() : log( "WvDial", WvLog::Debug ), err( log.split( WvLog::Error ) ), buffer("") { // executename = WvString( "" ); connectmsg = WvString( "Connected... Press Ctrl-C to disconnect\n" ); // usleep_time = 1000; do_check_dfr = 0; do_check_dns = 0; route_fd = (FILE *) 0; buffer.setsize(100); regcomp( &rx_status, "status *= *", REG_EXTENDED ); regcomp( &rx_quote, "\\\"[^\\\"]+\\\"", REG_EXTENDED ); regcomp( &rx_namesrv, "nameserver *[0-9]+.[0-9]+.[0-9]+.[0-9]+", REG_EXTENDED ); reset(); } WvDialMon::~WvDialMon() { regfree( &rx_status ); regfree( &rx_quote ); regfree( &rx_namesrv ); } void WvDialMon::setdnstests (WvString dnstest1, WvString dnstest2) { WvDialMon::dnstest1 = dnstest1; WvDialMon::dnstest2 = dnstest2; } void WvDialMon::reset() { _auth_failed = 0; } const int WvDialMon::auth_failed() { return _auth_failed; } int WvDialMon::get_quotedtext(char *dest, const char *line) { regmatch_t rm[1]; if( regexec( &rx_quote, line, 1, &rm[0], 0 ) == REG_NOMATCH ) { err("***** no quoted text found in `%s' *****\n", line ); return 0; } int s = rm[0].rm_so, e = rm[0].rm_eo; strncpy (dest, &line[s], e-s); dest[e-s] = '\0'; return 1; } char *WvDialMon::analyse_line(const char *line) { regmatch_t rm[1]; if (line == NULL ) return NULL; // PAP stuff // if (strstr(line, "AuthReq") != NULL) log("Authentication (PAP) started\n"); if (strstr(line, "AuthAck") != NULL) log("Authentication (PAP) successful\n"); if (strstr(line, "AuthNak") != NULL) { log("Authentication (PAP) failed"); char buf[strlen(line)]; if( get_quotedtext( buf, line ) ) log(" (Message: %s )\n", buf); _auth_failed = 1; } // CHAP stuff // if (strstr(line, "CHAP Challenge") != NULL) log("Authentication (CHAP) started\n"); if (strstr(line, "CHAP Success") != NULL) log("Authentication (CHAP) successful\n"); if (strstr(line, "CHAP Failure") != NULL) { log("Authentication (CHAP) failed"); char buf[strlen(line)]; if( get_quotedtext( buf, line ) ) log(" (Message: %s )\n", buf); _auth_failed = 1; } // IP stuff // if (!strncmp(line, "local IP address", 17) || !strncmp(line, "remote IP address", 17) || !strncmp(line, "primary DNS address", 20) || !strncmp(line, "secondary DNS address", 20) ) { log("%s\n",line); } // Script stuff // if (strncmp(line, "Script", 6) == 0) { if (strstr(line, "/etc/ppp/ip-up") != NULL && strstr(line, "finished") != NULL) { if( regexec( &rx_status, line, 1, &rm[0], 0 ) == 0 ) { const char *p = &line[ rm[0].rm_eo ]; // err("***** status is `%s' *****\n", p2 ); if (strcmp( p, "0x0") == 0) { log("Script /etc/ppp/ip-up run successful\n"); if( do_check_dfr ) { if( check_dfr() ) log( "Default route Ok.\n" ); else log( "Default route failure.\n" ); } if( do_check_dns ) { if( check_dns() ) log( "Nameserver (DNS) Ok.\n" ); else log( "Nameserver (DNS) failure, the connection may not work.\n" ); } log( "%s\n", connectmsg ); // execute whatever the user wants to // // if( executename.len() > 0 ) { // // fflush(stdout); // fflush(stderr); // // pid_t pid = fork(); // // if( pid == (pid_t) 0 ) { // we are the child // // int devnullr = open("/dev/null",O_RDONLY,0); // dup2(devnullr, fileno(stdin)); // close(devnullr); // // int devnullw = open("/dev/null",O_WRONLY,0); // dup2(devnullw, fileno(stdout)); // dup2(devnullw, fileno(stderr)); // close(devnullw); // fflush(stdout); // fflush(stderr); // // for( int tty = 3; tty < 256; tty++ ) // close(tty); // // usleep( usleep_time ); // // // executename = Netscape -remote "reload()", macht probleme // // wenn mehrere netscapes auf dem xserver laufen (dann // // empfängt zufällig einer die message) // // const char *new_argv[4]; // new_argv[0] = "sh"; // new_argv[1] = "-c"; // new_argv[2] = executename; // new_argv[3] = NULL; // // execv( "/bin/sh", (char *const *) new_argv ); // // fprintf( stderr, "exec failed: %s\n", strerror(errno) ); // } // // if( pid < (pid_t) 0 ) // the fork failed // fprintf( stderr, "error: can't fork child process\n" ); // else // output( "Started `", executename, "' successfully\n" ); // // } } else { log("Script /etc/ppp/ip-up failed (return value: %s )\n", p); } } else { // fprintf( stderr, "***** no status found *****\n" ); } } if (strstr(line, "/etc/ppp/ip-down") != NULL && strstr(line, "started") != NULL) log("Script /etc/ppp/ip-down started\n"); } // TermReq stuff // if (strstr(line, "LCP TermReq") != NULL) { log("Terminate Request"); char buf[strlen(line)]; if( get_quotedtext( buf, line ) ) log(" (Message: %s )\n", buf); } // connect time stuff // if (strncmp(line, "Connect time", 12) == 0) log("%s\n",line); // interface stuff // if (strncmp(line, "Using interface", 15) == 0) log("%s\n", line); // terminate stuff // if( strncmp(line,"Terminating", 11 ) == 0 ) log("%s\n",line); return buffer.edit(); } /********* taken from pppd ************/ #define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p)) #define SET_SA_FAMILY(addr, family) \ memset ((char *) &(addr), '\0', sizeof(addr)); \ addr.sa_family = (family); #define SIN_ADDR(x) (((struct sockaddr_in *) (&(x)))->sin_addr.s_addr) #define ROUTE_MAX_COLS 12 /******************************************************************** * * close_route_table - close the interface to the route table */ void WvDialMon::close_route_table () { if (route_fd != (FILE *) 0) { fclose (route_fd); route_fd = (FILE *) 0; } } /******************************************************************** * * open_route_table - open the interface to the route table */ static char route_delims[] = " \t\n"; int WvDialMon::open_route_table () { char path[] = "/proc/net/route"; close_route_table(); route_fd = fopen (path, "r"); if (route_fd == NULL) { log( "can't read %s\n", path ); return 0; } route_dev_col = 0; /* default to usual columns */ route_dest_col = 1; route_gw_col = 2; route_flags_col = 3; route_mask_col = 7; route_num_cols = 8; /* parse header line */ if (fgets(route_buffer, sizeof(route_buffer), route_fd) != 0) { char *p = route_buffer, *q; int col; for (col = 0; col < ROUTE_MAX_COLS; ++col) { int used = 1; if ((q = strtok(p, route_delims)) == 0) break; if (strcasecmp(q, "iface") == 0) route_dev_col = col; else if (strcasecmp(q, "destination") == 0) route_dest_col = col; else if (strcasecmp(q, "gateway") == 0) route_gw_col = col; else if (strcasecmp(q, "flags") == 0) route_flags_col = col; else if (strcasecmp(q, "mask") == 0) route_mask_col = col; else used = 0; if (used && col >= route_num_cols) route_num_cols = col + 1; p = NULL; } } return 1; } /******************************************************************** * * read_route_table - read the next entry from the route table */ int WvDialMon::read_route_table(struct rtentry *rt) { char *cols[ROUTE_MAX_COLS], *p; int col; memset (rt, '\0', sizeof (struct rtentry)); if (fgets (route_buffer, sizeof (route_buffer), route_fd) == (char *) 0) return 0; p = route_buffer; for (col = 0; col < route_num_cols; ++col) { cols[col] = strtok(p, route_delims); if (cols[col] == NULL) return 0; /* didn't get enough columns */ p = NULL; } SET_SA_FAMILY (rt->rt_dst, AF_INET); SET_SA_FAMILY (rt->rt_gateway, AF_INET); SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16); SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16); SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16); rt->rt_flags = (short) strtoul(cols[route_flags_col], NULL, 16); rt->rt_dev = cols[route_dev_col]; return 1; } /******************************************************************** * * defaultroute_exists - determine if there is a default route */ int WvDialMon::defaultroute_exists (struct rtentry *rt) { int result = 0; if (!open_route_table()) return 0; while (read_route_table(rt) != 0) { if ((rt->rt_flags & RTF_UP) == 0) continue; if (kernel_version > KVERSION(2,1,0) && SIN_ADDR(rt->rt_genmask) != 0) continue; if (SIN_ADDR(rt->rt_dst) == 0L) { result = 1; break; } } close_route_table(); return result; } int WvDialMon::check_dfr() { struct rtentry def_rt; if( !defaultroute_exists( &def_rt ) ) return 0; // FIXME: check if the gateway is set correct // return 1; } int WvDialMon::check_dns_name( const char *name ) { struct hostent *hp; hp = gethostbyname( name ); if( hp == NULL ) { log( "warning, can't find address for `%s`\n", name ); return 0; } // err("***** official name for `%s' is `%s' *****\n", name, hp->h_name ); // return 1; } int WvDialMon::check_dns() { char name[] = "/etc/resolv.conf"; FILE *fin = fopen( name, "r" ); if( fin == NULL ) { log( "warning, can't read `%s`\n", name ); return 0; } const int size = 100; char line[size]; regmatch_t rm[1]; int found_namesrv = 0; while( fgets( line, size, fin ) != NULL ) { if( line[0] == '\n' || line[0] == '#' ) continue; if( line[ strlen(line)-1 ] == '\n' ) line[ strlen(line)-1 ] = '\0'; if( regexec( &rx_namesrv, line, 1, &rm[0], 0 ) == 0 ) { found_namesrv = 1; break; } } fclose( fin ); if( !found_namesrv ) { log( "warning, no nameserver found `%s`\n",name); return 0; } if (!check_dns_name ((const char* ) dnstest1) || !check_dns_name ((const char* ) dnstest2)) { log( "warning, address lookup does not work\n" ); return 0; } return 1; }