summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.c
Commit message (Collapse)AuthorAgeFilesLines
* Support radius accounting, and add a packet count to throughputbrian2000-08-281-0/+1
| | | | | | | | | statistics as a side effect. Submitted by: Marcin Cieslak <saper@system.pl> with some tweaks to RAD_ACCT_SESSION_ID and RAD_ACCT_MULTI_SESSION_ID generation by me.
* Make -DNOSUID (or -DPPP_NOSUID) possible to build ppp without SUIDbrian2000-08-181-0/+5
| | | | capabilities.
* setproctitle() doesn't need to be called with root privs, so movebrian2000-08-161-2/+1
| | | | it from id.c into defs.c
* Maintain input and output throughput averages and choose the highestbrian2000-08-151-6/+9
| | | | | | | | | | | | | | of the two when calculating the MP throughput average for the ``set autoload'' implementation. This makes more sense as all links I know of are full-duplex. This also means that people may need to adjust their autoload settings as 100% bandwidth is now the theoretical maximum rather than 200% (but of course, halfing the current settings is probably not the correct answer either!). This involves a ppp version bump as we need to pass an extra throughput array through the MP local domain socket.
* Calculate the average link throughput using a counter based on thebrian2000-08-151-4/+4
| | | | | | | | cumulative total of all active links rather than basing it on the total of PROTO_MP traffic. This fixes a problem whereby Cisco routers send PROTO_IP packets only when there's only one link (hmm, what a good idea!).
* Allow a ``timeout secs'' filter option to let specific packet typesbrian2000-07-111-14/+23
| | | | | | | | | | | | effect the idle timer in different ways. Submitted by: Stefan Esser <se@freebsd.org> With adjustments by me to document the option in the man page and to give the same semantics for outgoing traffic as incoming. I made the style more consistent in ip.c - this should really have been done as a separate commit.
* Fix -auto breakage introduced with the last commit.brian2000-07-111-1/+1
|
* o Log the (payload/size) of all packet types, not just TCP packetsbrian2000-07-071-11/+14
| | | | | | | | | | | | | | | | | | | o If the new ``filter-decapsulation'' is enabled, delve into UDP packets that contain 0xff 0x03 as the first two bytes, and if we recognise it as PROTO_IP, decapsulate it for the purpose of filter checking. If we recognise it as PROTO_<anything else> mention this for logging purposes only. This change is aimed at people running PPPoUDP where the UDP traffic is being sent over another PPP link. It's desireable to have the top level link connected all the time, but to have the bottom level link capable of decapsulating the traffic and comparing the payload against the filters, thus allowing ``set filter dial ...'' to work in tunnelled environments. The caveat here is that the top ppp cannot employ any compression layers without making the data unreadable for the bottom ppp. ``disable deflate pred1 vj'' and ``deny deflate pred1 vj'' is suggested.
* Fix a printf-style arg cast (again)brian2000-06-231-1/+2
|
* Fix a printf-style format errorbrian2000-06-181-1/+1
|
* Add ``set ifqueue'' to control the size of the outgoing packetbrian2000-06-111-2/+7
| | | | | | | queue. Doing ``set ifqueue 0'' and ``set urgent none'' will allow full use of luigi's WF2Q code. Requested by: luigi
* Use mp_CheckAutoloadTimer() rather than mp_StopAutoloadTimer()brian2000-05-311-2/+2
| | | | | | | when opening or closing an auto link due to the autoload setting. Spotted by: David Hedley <david@inty.co.uk>
* When we do a ``dial'' or ``open'' from DATALINK_READY, go tobrian2000-05-261-5/+4
| | | | | | | | | | DATALINK_CARRIER and turn off scripting. This should fix instances where ``term'' is used followed by ~. and then ``dial''/``open'' (it currently just sits there looking at you). Reported by: Tim Vanderhoek <vanderh@ecf.utoronto.ca>
* When running ppp -background, show comfort messages showingbrian2000-04-071-10/+18
| | | | | | | | when we're redialing/reconnecting. While we're here, log redial, reconnect and phone number announcements to LogCHAT, and reduce some other logging to LogDEBUG.
* I didn't get this right the last time....brian2000-04-061-13/+20
| | | | | | | | | | | | | When an NCP reaches TLF, *ONLY* datalink_Close() links that are in DATALINK_OPEN. When the last link reaches TLD, DOWN all NCPs (as we used to in the links TLF (which was the wrong place anyway)), as the NCPs aren't now going to datalink_Close() us unexpectedly, we get to continue doing what we were told to do in the first place. The result: When we lose a link, the IPCP layer goes down and we actually call the stuff in ppp.linkdown !
* Correct the parent notification diagnostic emitted from the childbrian2000-03-221-1/+2
| | | | process in -background mode (it should report failure if appropriate).
* If a links LCP FSM has reached TLF and it's the last link,brian2000-03-221-12/+5
| | | | | | | | | | | | | don't bother to re-initialise the NCPs. Instead wait for bundle_LinkClosed() to be called - IFF it actually is called. By initialising the NCPs at this point, ppp was recursing back into the fsm_Down() routing for the link, and losing track of the reason that the link was being brought down. The end result was that ``set reconnect'' would never do anything. Patiently pointed out by: ru
* Add the ``resolv'' command for telling ppp how to deal with resolv.conf.brian2000-03-141-4/+13
| | | | | You can now ``resolv restore'' in ppp.linkdown ! Add DNS0 and DNS1 macros.
* Fix some printf-style argument bugsbrian2000-03-141-7/+9
|
* Correct some typos introduced in the descriptor -> fdescriptor change.brian2000-03-141-8/+8
|
* To avoid namespace polution in NetBSD:brian2000-03-141-12/+12
| | | | ``struct descriptor'' -> ``struct fdescriptor''
* Handle the availability of TUNSIFHEAD. If it's there, use it.brian2000-01-231-13/+52
| | | | | For the moment this is just overhead, but it'll be used for INET6 support later.
* Use TUNSIFPID when we change our PID (if it exists).brian2000-01-211-1/+10
|
* Correct usages of getuid() and geteuid()brian1999-12-301-1/+1
| | | | Pointed out by: billf
* Add a bunch of `const's and fix a typo.brian1999-12-271-1/+1
| | | | Submitted by: Rich Neswold <rneswold@MCS.Net>
* Don't bother fork()ing after closing a ctty if ppp is about tobrian1999-12-231-0/+10
| | | | terminate anyway.
* Cosmetic: Make struct mbuf more like kernel mbufs.brian1999-12-201-24/+25
|
* Change the way we transfer links (again). The previousbrian1999-11-301-28/+83
| | | | | | | | | | | | | | | method avoided all race conditions, but suffered from sometimes running out of buffer space if enough clients were piled up at the same time. Now, the client pushes the link descriptor, one end of a socketpair() and the ppp version via sendmsg() at the server. The server replies with a pid. The client then transfers any link lock with uu_lock_txfr() and writev()s the actual link contents. The socketpair is now the only place we need to have large socket buffers and the bind()ed socket can keep the default 4k buffer while still handling around 90 racing clients.
* Make -foreground a proper option (allowing ``allow mode foreground'',brian1999-11-281-2/+3
| | | | ``set mode foreground'' etc.
* Rewrite the link descriptor transfer code in MP mode.brian1999-11-251-81/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, ppp attempted to bind() to a local domain tcp socket based on the peer authname & enddisc. If it succeeded, it listen()ed and became MP server. If it failed, it connect()ed and became MP client. The server then select()ed on the descriptor, accept()ed it and wrote its pid to it then read the link data & link file descriptor, and finally sent an ack (``!''). The client would read() the server pid, transfer the link lock to that pid, send the link data & descriptor and read the ack. It would then close the descriptor and clean up. There was a race between the bind() and listen() where someone could attempt to connect() and fail. This change removes the race. Now ppp makes the RCVBUF big enough on a socket descriptor and attempts to bind() to a local domain *udp* socket (same name as before). If it succeeds, it becomes MP server. If it fails, it sets the SNDBUF and connect()s, becoming MP client. The server select()s on the descriptor and recvmsg()s the message, insisting on at least two descriptors (plus the link data). It uses the second descriptor to write() its pid then read()s an ack (``!''). The client creates a socketpair() and sendmsg()s the link data, link descriptor and one of the socketpair descriptors. It then read()s the server pid from the other socketpair descriptor, transfers any locks and write()s an ack. Now, there can be no race, and a connect() failure indicates a stale socket file. This also fixes MP ppp over ethernet, where the struct msghdr was being misconstructed when transferring the control socket descriptor. Also, if we fail to send the link, don't hang around in a ``session owner'' state, just do the setsid() and fork() if it's required to disown a tty. UDP idea suggested by: Chris Bennet from Mindspring at FreeBSDCon
* Don't setuid() 'till we've called ID0setproctitle()brian1999-11-231-1/+1
|
* Fix ``set proctitle'' by using setproctitle().brian1999-11-171-7/+7
|
* Use modfind() to check if a kld is already loaded.brian1999-11-161-11/+7
| | | | Submitted mostly by: green
* Support PPPoEbrian1999-11-061-35/+81
| | | | | Help (lots) from: julian, archie Facilities from: ahebert@pubnix.net
* Add the -unit command line switch for specifying the tun device.brian1999-10-191-6/+16
| | | | | | Warn about -alias being depricated (but still allow it). Don't moan twice about failing to open any tun device. Fix a diagnostic and add the -quiet switch to the usage message.
* When we get the last NCP TLD, close all datalinks with CLOSE_STAYDOWNbrian1999-10-151-1/+1
| | | | rather than CLOSE_NORMAL.
* Bring links down gently when their throughput isn't enough forbrian1999-10-051-1/+1
| | | | | the ``set autoload'' value. Don't just ``down'' the link. Don't get stuck in ``ready'' the first time we ``close'' a link.
* Do a kldload() if we get ENXIO trying to open /dev/tun0brian1999-09-221-0/+29
| | | | Originally submitted by: green
* Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.brian1999-09-211-3/+0
| | | | | | | The original report was due to a mis-installation of the NetBS header files :-/ Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>
* NetBSD has moved ``extern int errno;'' to signal.h :-/brian1999-09-201-0/+3
| | | | Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>
* o Split the two IPCP queues into three - one for FSM databrian1999-09-041-1/+3
| | | | | | | | | | | | (LCP/CCP/IPCP), one for urgent IP traffic and one for everything else. o Add the ``set urgent'' command for adjusting the list of urgent port numbers. The default urgent ports are 21, 22, 23, 513, 514, 543 and 544 (Ports 80 and 81 have been removed from the default priority list). o Increase the buffered packet threshold from 20 to 30. o Report the number of packets in the IP output queue and the list of urgent ports under ``show ipcp''.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* o Add the -foreground switch. This switch behaves like -background exceptbrian1999-08-191-2/+2
| | | | | | | | | that ppp stays in the foreground. o Add the -quiet switch to quieten ppps startup o Add the -nat flag and discourage the use of the -alias flag. Both do the same thing. o Correct some nat usage strings. o Change the internal ``alias'' command to ``nat''.
* Implement a minimum idle time value as an optional second argumentbrian1999-08-171-11/+38
| | | | | | to ``set timeout''. This is useful for situations where your minimum call charge is (say) 5 minutes (like mine is)
* Change printf formats %q[du] -> %ll[du]brian1999-08-091-3/+3
|
* Add ISDN support via isdnd & i4b. This requires versionbrian1999-08-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 0.81.1 of the i4b code - namely support of the I4B_VR_REQ ioctl via the i4brbchX device. Ppp controls the phone number, but idle timers and SYNC/RAW decisions are still made by isdnd (in isdnd.rc). This involves a new datalink state machine phase. The ``wait for carrier'' phase happens after dialing but before logging in. The whole dial state should really be abstracted so that each device type can deal with it in its own way (thinking about PPPoE) - but that'll have to wait. The ``set cd'' symantics remain the same for tty devices, but we now delay until we either get CD or timeout waiting (at which time we drop the link if we require CD). For i4b devices we always insist on carrier. Thanks to hm@ for his help, and especially for pointing out that I *don't* need to re-implement isdnd (that was a huge waste of time !) :-]
* o Obsolete the undocumented ``set weight'' command.brian1999-08-051-187/+157
| | | | | | | | | | | | | | | | | | | | | | | o If we're using RADIUS and the RADIUS mtu is less than our peers mru/mrru, reduce our mtu to this value for NetBSD too. o Make struct throughput's sample period dynamic and tweak the ppp version number to reflect the extra stuff being passed through the local domain socket as a result (MP mode). o Measure the current throughput based on the number of samples actually taken rather than on the full sample period. o Keep the throughput statisics persistent while being passed to another ppp invocation through the local domain socket. o When showing throughput statistics after the timer has stopped, use the stopped time for overall calculations, not the current time. Also show the stopped time and how long the current throughput has been sampled for. o Use time() consistently in throughput.c o Tighten up the ``show bundle'' output. o Introduce the ``set bandwidth'' command. o Rewrite the ``set autoload'' command. It now takes three arguments and works based on a rolling bundle throughput average compared against the theoretical bundle bandwidth over a given period (read: it's now functional).
* o Overhaul filtering, adding facilities to jump over rules and tobrian1999-07-271-1/+10
| | | | | | | | | negate the sense of rules. o Remove the redundant (and undocumented) ``host'' and ``port'' words (README.changes updated). o Don't permit (and ignore) garbage instead of the protocol. Mostly submitted by: Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
* Disable TUNSLMODE when we first open the tun device.brian1999-06-221-2/+10
| | | | Submitted by: Ian West <ian@niw.com.au>
* Introduce the ``keep-session'' option. Refer to the manbrian1999-06-021-2/+5
| | | | | | page for details. This allows MP over non-tty devices where the original ppp process must not exit (such as sshd-spawned ppp sessions).
OpenPOWER on IntegriCloud