summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/modem.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct the return of DialModem()brian1997-05-291-11/+8
| | | | Suggested by: kfurge <kfurge@worldnet.att.net>
* De-couple ppp from libalias. If libalias isn't there, thebrian1997-05-261-1/+2
| | | | | | | | | alias commands simply won't work. Only root may specify the location of the alias lib (otherwise, it's hard-coded). Make logprintf silently fail if LogOpen hasn't been called. Suggested by: eivind
* Fix the reconnect option, and add an explanation to vars.hbrian1997-05-241-2/+2
|
* Mega update to sort out bad implementationsbrian1997-05-191-20/+9
| | | | | | | | | | | | | | | | | | of reconnect & -background. o Fix reconnect anomolies. o Make reconnect apply to failed LQR hangups (& mention in man page). o Make reconnect effective in -background mode. o Listen on socket in -background mode. o Try all phone numbers in -background mode. o Insist on system arg in -background mode. o Make a control-connection close command exit in -background mode. o Output status message to stdout on exit of parent in -background mode. o Don't notify parent of success too soon. o Describe termination EX_* code. o Miscelaneous diagnostic corrections. o Remove redundant connect_time from modem.c. o Don't repeatedly DownConnection().
* Don't attempt to ioctl(modem...) when modem isbrian1997-05-141-1/+9
| | | | closed. Just DownConnection().
* Add a ttyXX.if file in /var/run that points tobrian1997-05-101-9/+6
| | | | | | | the tunX.pid file. Change the ppp.tunX.pid name to tunX.pid Requested by: Daniel O Callaghan <danny@panda.hilink.com.au>
* Tidy up the code - bounds checking, returnbrian1997-05-101-12/+37
| | | | | | value checking etc. Submitted by: eivind
* Add a reconnect capability directing ppp to re-establishbrian1997-04-211-1/+2
| | | | | | | | | | | the connection after an unexpected loss of carrier: set reconnect timer ntries The man page warns against using this command when your timeout value is slightly more than the other sides :{} Suggested by: burton@bsampley.vip.best.com (Burton Sampley)
* Make -background option attempt each phone number at mostbrian1997-04-131-6/+1
| | | | | once. Make -background ignore redial. Output exit value to syslog with "PPP Terminated" message.
* Remove the syslog stuff, and allow various return valuesbrian1997-03-311-4/+9
| | | | | | | | | in uu_lock(). Add uu_lockerr() for turning the results of uu_lock into something printable. Remove bogus section in man page about race conditions allowing both processes to get the lock. Include libutil.h and use uu_lock() correctly where it should. Suggested by: ache@freebsd.org
* Detect failure open condition for direct mode nowache1997-03-101-3/+9
| | | | | Don't assume that modem descriptor must be >=3 in CloseModem, just assume it is any valid descriptor >=0
* Don't waste time scanning tun_in+10 descriptors, scan exactly whatache1997-03-101-10/+10
| | | | | | | we need now. Don't assume that file descriptor can't be 0 (many places) Protect FD_* macros from being used with negative descriptors Shorten MS EXT show help to fit 80 cols
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix many buffer overruns in the code. Specifically, disallow ExpandStringimp1997-01-101-4/+6
| | | | | | | | | | | | | to be used to expand things beyond the size of the buffer passed in. Also do a general cleanup of sprintf -> snprintf as well as strcpy and strncat safety. Also expand some buffers to allow for the largest possible data that might be used. This is a 2.2 candidate. However, it needs to be vetted on -current since little testing has been done on this due to my lack of PPP on this machine. Reviewed by: Jordan Hubbard, Peter Wemm, Guido van Rooij
* For /usr/sbin/ppp, you must choose between running ppp in the background orjkh1996-12-221-3/+13
| | | | | | | | | | | | | | | | | | | | | | connecting to a host immediately in the foreground. I would like to be able to run ppp from a script so that my script can be sure that it is connected to the 'net before it continues running: # Dial up the internet. ppp -background myprovider || exit 1 do-some-net-command # Hang up the modem. kill -HUP `cat /var/run/ppp.tun0.pid` Another problem is that the current ppp calls its process id file `/var/run/PPP.server', which may conflict if you have more than one IP tunnel interface available. Closes PR#1469 Submitted by: Gord Matzigkeit <gord@enci.ucalgary.ca>
* Make CRTSTS selection a runtime option. Closes PR#1392jkh1996-12-221-16/+18
| | | | Submitted by: Mike McGaughey <mmcg@heraclitus.cs.monash.edu.au>
* Here is a diff of /usr/src/usr.sbin/ppp against current. The diffsphk1996-05-111-8/+8
| | | | | | | | | | | | | | | | | | | add some logging functionality which I find very useful. 'set debug link' will record just link up/down and address assignments. 'set debug connect' will record the entire chat dialog 'set debug carrier' will record just chat lines including 'CARRIER' (so that I can be sure I'm getting a 28.8 line). There was a global change required to permit LogPrintf to take a bit mask instead of a bit position value (to permit logging some events on either of two flags, so that no change in 'set debug lcp' would result from the code supporting 'link'. Thus the diffs are rather long for such a small change. The man page is also touched. Oh, and there was a slight syntax problem in route.c Reviewed by: phk Submitted by: Tony Kimball <alk@Think.COM>
* Fix UnrawModem:ache1996-03-291-6/+6
| | | | | | restore initial (not second level) state not call it for DEV_SYNC issue input flush after restoring
* Directly clear parity area because cfmakeraw not do itache1996-03-281-1/+2
|
* After real problem is found (flush never occurse), re-enableache1996-03-271-1/+3
| | | | | software flow control, but re-enable it properly, idea taken from taylor 'cu'
* Fix typing bug cause flushing never occurse:ache1996-03-271-2/+2
| | | | TIOCFLUSH -> TCIOFLUSH
* Use cfmakeraw() instead of all those termios settingsache1996-03-271-24/+8
|
* Cleanup both raw & termianl modes termios flags settingsache1996-03-271-4/+11
|
* Disable ^S/^Q flow control!!!ache1996-03-271-3/+3
|
* Better fix for terminal modeache1996-03-131-13/+5
|
* 1) Open /dev/null for std* after setsid() to be shure that modem isache1996-03-091-1/+5
| | | | | | | | | *not* our controlling terminal (SIGHUP can coming in other case) 2) Add HUPCL for non-dedicated lines to be shure that modem properly resetted. 3) Correct usage string.
* Log phone as LOG_PHASE, it is valuable enough for multi-phone environment.ache1996-03-081-1/+2
| | | | | Add missing return when terminal mode can't be re-established due to modem not opened.
* 1) Add multi-phone dialing/redialing, several phones separated by ':'ache1996-03-081-9/+24
| | | | | | | | | | 2) Improve on-line help subsystem 3) Make 'term' mode works even carrier dropped (old code close line forever here) 4) Make 'term' mode 8bit clean. 5) Improve manual page 6) #ifdef DEBUG diagnostic about missing optional files. 7) Don't put interactive dialing info to logfile
* Some patches to ppp which improve stability. I have been running adfr1996-01-301-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ppp based on these patches for about 3 weeks with no downtime. The original submitters comments: Two features iijppp has over kernel ppp that I like are predictor1 compression and demand dialing. Here are a few bug fixes. I expanded the priority queueing scheme and discovered it was broken due to the assignment at ip.c line 300. All packets were being queued at the same priority. Fixing priority queueing broke predictor1 compression. Packets were compressed before being queued and predictor1 worked as long as the packets were popped off the queue in the same order they were pushed onto the queue. There were a few byte order problems in IP header tests also. There is a recursion problem in SendLqrReport(). LcpClose() is called when "Too many echo packets are lost" which winds up in SendLqrReport() again. I believe the original intention was to just stop the LQR timer with the call to StopLqr() but the side effects hurt. Submitted by: John Capo <jc@irbs.com>
* Final cleanup for now. -Wall is now silent. A couple of bogons found.phk1996-01-111-2/+1
|
* A random bunch of cleanup changes.phk1996-01-101-2/+6
|
* 1. Do not log the password itself to ppp.log ( Mr. Rich Murphey )amurai1995-09-021-0/+1
| | | | | | | | | 2. Add ability to execute shell commands and suspend back into invoking shell (Mr. J Wunsch) Reviewed by: amurai@spec.co.jp Submitted by: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Rich Murphey <rich@lamprey.utmb.edu>
* 1. Clean up log message.amurai1995-07-081-6/+6
| | | | | | | | 2. Optimize ModemQlen. 3. Sending ProtoReject for Unknow protocol (i.e. IPX) 4. Avoid select looping by reading tun under the high system load. 5. Adding Local version String for maintenance. 6. Just more speak rather silent ignore if you type invalid key words.
* Hang up the modem if the dial or login fails. This ensures that wedfr1995-06-301-1/+2
| | | | | will not hold the line open if the other end has a broken modem or server. This happens to me quite frequently with my ISP.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Fixing follows and John's fruent explnation than my English....amurai1995-04-161-6/+30
| | | | | | | | | | | | | | | | | | | | | The first problem I found was that descriptor 0 was being closed. This happens because the modem variable is set to 0 to indicate that it is not valid but there are not enough tests for the modem variable being 0. You can see where I have done this in the patch. Code in OpenModem() dups the modem descriptor if it is < 3. Once this happened the modem was always open and an incomming call would have getty and ppp reading the modem. Descriptor 1 is closed when the quit command was executed from a telnet connection. The next modem open returns descriptor 1 and this gets duped leaving the modem always open again. The modem was not being closed when the connection dropped or was closed from the other end. The UUCP lock was also not removed if the modem could not be opened. Reviewed by: Atsushi Murai <amurai@spec.co.jp> Submitted by: John Capo <jc@irbs.com>
* 1.Reducing cpu usage at off connection.amurai1995-03-111-3/+3
| | | | | | | | | 2.Implment Redail function as working correctly. 3.Clean up a code as I notice. 4.Now, RTT getting close to 50ms with ISDN/TA 38400bps !! Reviewed by: amurai@spec.co.jp Submitted by: amurai@spec.co.jp
* Fixing minor bug and allow help(Not for all command) and quitamurai1995-02-271-6/+9
| | | | | | | | but not close line connection by "quit all" command if not authorized. Reviewed by: amurai@spec.co.jp Submitted by: tony-o@iij.ad.jp amurai@spec.co.jp
* New user Process PPP based on iij-ppp0.94beta2.amurai1995-02-261-25/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Supporting SYNC SIO device (But need a device driver) - add "set speed sync" o Fixing bug for Predictor-1 function. o Add new parameter that re-sent interval for set timeout commands. o Improving RTT (Round Trip Time) and reducing processor time. - Previous Timer service was using polling, and now using SIGALRM ;-) - A 0.94beta2 will not work correctly.... -- Follows are additinal feature not including 0.94beta2 o Support Proxy ARP - add "enable/disable proxy" commands o Marging common routine in CHAP/PAP. o Enhancing LCP/IPCP log information. o Support local Authfication connection on port 300x and tty. - You can set up pair of your "hostname -s" and password in ppp.secret. if either ppp.secret file nor your hostname line don't exist, It will notify a message and working as same as previous version.(Backword compatibility) - If you did set up them, It's allow connection but nothing to do except help and passwd command. - add "passwd yourpasswd" commands o Support afilter - keep Alive filter that a packet can send/receiving according to ifilter/ofilter but doesn't count it as preventing idle timer expires. - Same syntax of other filters. o Fixing bugs reported by current user for previous one. Thanks !! Reviewed by: Atsushi Murai (amurai@spec.co.jp)
* (no commit message)amurai1995-01-311-0/+591
OpenPOWER on IntegriCloud