summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.h
Commit message (Collapse)AuthorAgeFilesLines
* Understand the Session-Timeout RADIUS attributebrian2002-05-071-0/+12
| | | | | | Store the Filter-Id attribute (we don't do anything with it yet) Submitted mostly by: andrew pavlov <and@kremenchug.net>
* Add a ``log'' command for logging specific information.brian2001-11-031-0/+1
| | | | | | | | | | | | | | Add an ``UPTIME'' variable to indicate the bundle uptime. It's now possible to put something like this in ppp.linkdown for a server setup: MYADDR: log Session closing: User USER, address HISADDR, up UPTIME Fixed some memory leakage with commands that expand words. Made some functions static. Fixed a diagnostic bug (iface add .... SIOCDIFADDR)
* o Add ipv6 support, abstracting most NCP addresses into opaquebrian2001-08-141-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | structures (well, they're treated as opaque). It's now possible to manage IPv6 interface addresses and routing table entries and to filter IPV6 traffic whether encapsulated or not. IPV6CP support is crude for now, and hasn't been tested against any other implementations. RADIUS and IPv6 are independent of eachother for now. ppp.linkup/ppp.linkdown aren't currently used by IPV6CP o Understand all protocols(5) in filter rules rather than only a select few. o Allow a mask specification for the ``delete'' command. It's now possible to specifically delete one of two conflicting routes. o When creating and deleting proxy arp entries, do it for all IPv4 interface addresses rather than doing it just for the ``current'' peer address. o When iface-alias isn't in effect, don't blow away manually (via ``iface add'') added interface addresses. o When listening on a tcp server (diagnostic) socket, bind so that a tcp46 socket is created -- allowing both IPv4 and IPv6 connections. o When displaying ICMP traffic, don't display the icmp type twice. When display traffic, display at least some information about unrecognised traffic. o Bump version Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
* Handle hardware-imposed MTU/MRU limitations. PPPoE will no longerbrian2001-06-181-2/+0
| | | | | | | | | | | | allow MRU/MTU negotiations to exceed 1492. Add an optional ``max'' specifier to ``set m[rt]u'', ie. set mtu max 1480 Bump the ppp version number. Sponsored by: Monzoon Networks AG and FreeBSD Services Limited
* When we change the interface MTU, run through the routing table and tweakbrian2001-04-051-2/+0
| | | | all route MTUs too.
* Add ``enable/disable tcpmssfixup'', defaulting to enabled.brian2000-11-281-3/+5
| | | | | Suggested by: julian Hijacked from: ru (ports/net/tcpmssd)
* 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.
* Allow a ``timeout secs'' filter option to let specific packet typesbrian2000-07-111-1/+1
| | | | | | | | | | | | 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.
* o Log the (payload/size) of all packet types, not just TCP packetsbrian2000-07-071-10/+11
| | | | | | | | | | | | | | | | | | | 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.
* Add ``set ifqueue'' to control the size of the outgoing packetbrian2000-06-111-0/+1
| | | | | | | queue. Doing ``set ifqueue 0'' and ``set urgent none'' will allow full use of luigi's WF2Q code. Requested by: luigi
* When running ppp -background, show comfort messages showingbrian2000-04-071-0/+1
| | | | | | | | 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.
* Add the ``resolv'' command for telling ppp how to deal with resolv.conf.brian2000-03-141-0/+1
| | | | | You can now ``resolv restore'' in ppp.linkdown ! Add DNS0 and DNS1 macros.
* Adjust whitespacebrian2000-03-141-1/+1
|
* Correct some typos introduced in the descriptor -> fdescriptor change.brian2000-03-141-1/+1
|
* To avoid namespace polution in NetBSD:brian2000-03-141-4/+4
| | | | ``struct descriptor'' -> ``struct fdescriptor''
* Handle the availability of TUNSIFHEAD. If it's there, use it.brian2000-01-231-0/+1
| | | | | 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-0/+1
|
* Cosmetic: Make struct mbuf more like kernel mbufs.brian1999-12-201-1/+0
|
* Rewrite the link descriptor transfer code in MP mode.brian1999-11-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix ``set proctitle'' by using setproctitle().brian1999-11-171-4/+1
|
* Add the -unit command line switch for specifying the tun device.brian1999-10-191-1/+1
| | | | | | 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.
* $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-3/+8
| | | | | | to ``set timeout''. This is useful for situations where your minimum call charge is (say) 5 minutes (like mine is)
* o Obsolete the undocumented ``set weight'' command.brian1999-08-051-16/+9
| | | | | | | | | | | | | | | | | | | | | | | 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).
* Introduce the ``keep-session'' option. Refer to the manbrian1999-06-021-8/+9
| | | | | | page for details. This allows MP over non-tty devices where the original ppp process must not exit (such as sshd-spawned ppp sessions).
* Remember if MYADDR or HISADDR is used in a filter add tweak allbrian1999-05-311-1/+3
| | | | filters any time either value changes.
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-11/+15
| | | | | | | | | | | | | | | | | | | details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland
* When using ``set device !someprogram'', when ``someprogram''brian1998-12-101-1/+2
| | | | | | | exits, it causes a select() exception. Handle these select() exceptions on link descriptors in pretty much the same way as loss of carrier rather than dropping out in confusion.
* Remove some redundant (#if 0'd) code.brian1998-10-291-8/+1
|
* Add ``set proctitle'' for changing argv[0]. All substitutionsbrian1998-10-271-1/+3
| | | | | | | are done in the same way as command execution. For example, ``set proctitle USER INTERFACE PROCESSID'' would be useful in a -direct profile for identifying who's connected.
* Shuffle the iface-alias option so that's in alphabeticalbrian1998-10-261-9/+9
| | | | order like the rest of the options.
* Add ``enable proxyall'' support. This adds proxy ARP entriesbrian1998-10-261-9/+10
| | | | | | | | | | for every machine on every class C or smaller subnet that we route to. Add ``set {send,recv}pipe'' for controlling our socket buffer sizes. Mention the IP number with the problem in a few error messages. All submitted by: Craig Leres <leres@ee.lbl.gov> Modified slightly by: me
* Loosen our restrictions on setting enddisc, mrru,brian1998-10-241-1/+2
| | | | | | | | shortseq, authname and authkey. o Auth{name,key} may additionally be set in PHASE_ESTABLISH. o The others may be set in PHASE_ESTABLISH as long as no links have yet reached DATALINK_LCP.
* Solve the ``first connection'' problem that occurs onbrian1998-10-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | demand-dial links with dynamic IP numbers where the program that causes the dial bind()s to an interface address that is subsequently changed after ppp negotiation. The problem is defeated by adding negotiated addresses to the tun interface as additional alias addresses and providing a set of ``iface'' commands for managing the interface. Libalias is also required (and what a name clash!) - it happily IP-aliases the address so that the source is that of the primary (negotiated) interface and un-IP-aliases it on the way back. An ``enable iface-alias'' is done implicitly by the -alias command line switch. If -alias isn't given, iface-aliasing is disabled by default and can't be enabled 'till an ``alias enable yes'' is done. ``alias enable no'' silently disables iface-alias. So, for dynamic-IP-type-connections, running ``ppp -alias -auto blah'' will work for the first connection, although existing bindings will not survive a disconnect/connect as the TCP peer will be trying to send to the old IP address - the packets won't route. It's now a lot easier to add IPXCP to ppp with minor updates to the new iface.[ch] (if anyone ever gets 'round to it). It's also now possible to manually add interface aliases with something like ``iface add 1.2.3.4/24 5.6.7.8''. This allows multi-homed ppp links :-)
* If we've got a full output buffer queue and cannot sendbrian1998-08-251-1/+9
| | | | | | | | anything for two mintues (see ``set choked'' and ``show bundle''), nuke the ip, mp and link level buffer queues. This should fix problems where ``ppp -auto'' seems to stop responding after failing to connect to the peer a few times.
* o Support callback types NONE, E.164, AUTH and CBCP.brian1998-08-071-1/+2
| | | | | | | | | | | | | | (see the new ``set callback'' and ``set cbcp'' commands) o Add a ``cbcp'' log level and mbuf type. o Don't dump core when \T is given in ``set login'' or ``set hangup''. o Allow ``*'' and blanks as placeholders in ppp.secret and allow a fifth field for specifying auth/cbcp dialback parameters. o Remove a few extraneous #includes o Define the default number of REQs (restart counter) in defs.h rather than hardcoding ``5'' all over the place. o Fix a few man page inconsistencies.
* Allow an optional ``!'' in the open, dial & call commands.brian1998-07-291-2/+2
| | | | | When used, the redial timer is ignored and the modem is opened immediately.
* Silence ``Network unreachable'' warnings when usingbrian1998-07-281-2/+2
| | | | | | | | | | | | | | | | | | ``add .... HISADDR''. The network will never be reachable at this point unless we're in -auto or reading the command from ppp.linkup. We can now run the following lines and get the expected results: set ifaddr 1.2.3.4/0 5.6.7.8/0 add default HISADDR where a route is added immediately in auto mode and the whole thing is delayed 'till the IP numbers have been agreed in other modes. Essentially, ppp.linkup is no longer required.
* Don't dlopen()/dlsym() libalias, use it in the same waybrian1998-06-271-1/+2
| | | | as the rest of the world uses libraries.
* Don't bring the modem offline or hangup when ``down lcp''brian1998-06-161-2/+2
| | | | is done. Instead, behave like ``close lcp''.
* o Maintain a link-type mask for open datalinks as well asbrian1998-06-121-2/+6
| | | | | | | | | | | for all datalinks in a bundle. Ppp now deals correctly with link types that are changed while open o When changing the type of the last AUTO link, only clear the interface if we're not in PHASE_NETWORK. This allows us to switch to -ddial mode while we have a connection without suddenly unexpectedly throttling ourselves by clearing the interface configuration. Problem area noted by: Aaron Jeremias Luz <aaron@csh.rit.edu>
* Put the correct pid in /var/run/tunX.pidbrian1998-06-061-1/+2
| | | | Suggested by: many
* o If there's a session leader left running for a descriptorbrian1998-05-291-2/+3
| | | | | | | | | | | that we're now closing, manually HUP that session leader so that the tty is fully released. o Always restart our carrier detect timer in the receiving process if it was running in the sending process (as we now *always* pass the descriptor). o Tweak argv when we go into pause() mode to keep our session so that ps can see what's going on (without checking for a `pause' state in `ps -l').
* o #define the name "tun" in defs.h against the future possibilitybrian1998-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | of supporting architectures with different device names. o Close /dev/tunX when destroying the bundle. o Don't forget to close the parent end of the pipe in the child process when exec'ing a program from a chat script. o If we close our controlling terminal, ditch the current session with it, allowing getty(8) (or whatever) to regain control. o After transferring our controlling terminal descriptor to another ppp instance, we now fork a new ppp to continue where we left off, transferring ownership of all uucp locks and the /var/run/tunX.pid file. Meanwhile the parent closes all file descriptors, defaults all signals and does a pause() to wait for a HUP after the transferred descriptor is finally closed. We don't run /bin/cat any more (again!). Suggested by: bde TODO: It seems clocal devices need their pause()d session leader to be given a manual HUP, as closing the last open descriptor doesn't do the job.
* o Move our prompt descriptor list outside of the bundle.brian1998-05-231-6/+2
| | | | | | | | | | | | | | | | | | | | It's now dealt with by the `server' object. This simplifies things as we only have one list of prompt descriptors and the log_ routines check prompt::logactive to determine whether it should be used for output. o Include the MP socket UpdateSet() result in bundle::UpdateSet(). o Don't select on the tun device unless we're in NETWORK phase or AUTO mode. o Stop the idle timer when we go to DEAD phase. We may have transferred a link and not had a chance to kill it. o Don't fail when trying to unlink our transferred datalink from our descriptor lists just before the transfer. o Add our link descriptor to the write set if we got a short write the last time (physical::out is set). o Log the connection source address when a connection is closed. o Remove descriptor::next field. Descriptor lists are not required any more.
* MFMP: Make ppp multilink capable.brian1998-05-211-0/+170
See the file README.changes, and re-read the man page.
OpenPOWER on IntegriCloud