Commit Graph

333 Commits

Author SHA1 Message Date
Brian Somers f01e577b07 Only allow one arg to `delete' - the mask & gateway aren't necessary.
Delete AF_LINK routes as well as AF_INET.
Allow the word `default' as the arg to `delete' or in place of the
first two args (dest & netmask) to `add'.
Accept INTERFACE as the third arg to `add'.

  You can now say `add default interface' to create a default route
  through the tun interface.  It's reported that subsequent bind()s
  will bind to a broadcast address and not to the address currently
  assigned to the tun device - this is the first step towards
  supporting that first connection that was around from before the
  dynamic IP negotiation....
1997-12-07 04:09:15 +00:00
Brian Somers b6871831e5 Correct cftypes128 index. 1997-12-06 22:43:58 +00:00
Brian Somers 4bfaee9023 Understand ``sockaddr_dl''s where sdl_nlen != 0 1997-12-04 18:49:39 +00:00
Brian Somers 702026bc21 Remove duplicate REJECTED macro.
Remove extraneous pointers.
1997-12-04 18:49:35 +00:00
Brian Somers ea6610416a Initialize ccpstate when CCP comes down.
Remove extraneous pointers.
1997-12-04 18:49:32 +00:00
Brian Somers 0c9d3d050e Parenthesise the REJECTED macro. 1997-12-04 18:49:28 +00:00
Brian Somers 774326ed2e Identify rejected protocol types according to rfc1700. 1997-12-04 18:49:26 +00:00
Brian Somers 4bc84b8c11 Fix the CCP Type field value for DEFLATE.
(I *really* meant to do this  *before* committing the
deflate changes in the first place - oops).

Pppd is horribly broken in this respect - refer to the
ppp man page for details.  Ppp *WON'T* negotiate deflate
with pppd by default - you must ``enable'' and ``accept''
``pppd-deflate'' in your config.

While I'm in there, update the cftypes in ccp.c so that
we recognise some more protocols (we don't actually do
anything with them - just send a REJ).
1997-12-03 23:28:02 +00:00
Brian Somers 0053cc58a9 Abstract the CCP layer a level.
Add DEFLATE support.
1997-12-03 10:23:54 +00:00
Brian Somers fc85e494d0 Display connect time as 0 if we've never been
connected.
Pointed out by: Jeff Kletsky <Jeff@wagsky.com>
1997-11-26 02:16:10 +00:00
Brian Somers 132502aa4d Fix the help command (broken when I re-prototyped
all the commands).
1997-11-23 20:05:18 +00:00
Brian Somers 82ceff74d2 Up the version number to 1.5. 1997-11-22 13:47:02 +00:00
Brian Somers 9cb1d89ee2 Understand how to derive the names of interfaces
when they aren't ordered.  This is probably vital
for laptop support ;-I
1997-11-22 13:46:02 +00:00
Brian Somers b6e82f33ef Fix prototypes.
Remove extraneous decls.
Add ``const'' to several places.
Allow ``make NOALIAS=1'' to remove IP aliasing.
Merge with OpenBSD - only the Makefiles vary.

We can now survive a compile with
  -Wall -Wbad-function-cast -Wcast-align -Wcast-qual
  -Winline -Wmissing-declarations -Wmissing-prototypes
  -Wnested-externs -Wpointer-arith -Wredundant-decls
  -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts
(although the Makefile just contains -Wall).
1997-11-22 03:37:54 +00:00
Brian Somers f9e4a0ca7d Allow zero args to "cvs log". 1997-11-18 19:38:27 +00:00
Brian Somers 082798e7bd Fix interactive mode so that it doesn't require a passwd (again!). 1997-11-18 18:17:25 +00:00
Brian Somers 9a0b991f97 Add throughput logging (disabled by default).
Use "enable throughput" to see modem & IPCP throughput.
Removed an extraneous prompt()
1997-11-18 14:52:08 +00:00
Brian Somers 841cf58dbc Remove the outq error in "show modem". 1997-11-18 08:49:03 +00:00
Brian Somers b264e1d275 DropClient() when read() returns 0 (as it did before). 1997-11-18 07:33:23 +00:00
Brian Somers 3b7eb4fb00 Add and use a DropClient() function for closing the diagnostic port.
Call DropClient() from Cleanup() too.
1997-11-18 00:19:34 +00:00
Brian Somers 39f94eddcd Don't SetLabel() 'till we've done the SelectSystem(). This
avoids the situation where we specify label ``x'' on the command
line, and label ``x'' has a ``load y'' command embedded in it.
When the line comes up, we want to use ``x'' from ppp.linkup,
not ``y''.
1997-11-17 01:13:41 +00:00
Brian Somers c7d4711f9e Add id strings to tun.[ch].
Don't try to open ppp.secret if we're never going to use it.
1997-11-17 00:42:41 +00:00
Brian Somers 6a6b4bbb08 Abstract data read from and written to the tun device,
allowing for a possible header on the front of all packets.
In OpenBSD, there's a structure containing the address
family here.
If we're building under OpenBSD, set up the ``flags'' part
of struct tuninfo (not there under FreeBSD) so that we config
the interface as POINTOPOINT.
Prefix prototypes with ``extern'' in os.c for consistency.

These changes are cosmetic under FreeBSD, but allow ppp to
build & work under OpenBSD (bar the srandomdev() stuff,
the inclusing of <net/if_var.h> and some Makefile symantecs).
1997-11-16 22:15:11 +00:00
Brian Somers 5d5e507005 Interpret AF_LINK sockaddrs correctly in show/delete route.
Print out inteface names rather than numbers, and use the
same "find out the names" code in SetIfAddr().  This means
that the nasty ioctl(,SIOCGIFCONF,)/realloc loop is now
buried :-)
1997-11-15 02:15:56 +00:00
Brian Somers b351d6b7c3 uucplock is in section 3 not section 8 ! 1997-11-14 20:07:39 +00:00
Brian Somers 9e836af5d9 Update the cftypes arrays according to rfc1700.
Log IPCP reqests as IPCP.
1997-11-14 15:39:15 +00:00
Brian Somers a23e75e150 Allow blank lines in config entries (they aren't terminators). 1997-11-14 15:38:07 +00:00
Brian Somers 9fecb4e63f Use seteuid() instead of setreuid().
The setreuid() page says seteuid is better !
1997-11-13 17:31:52 +00:00
Brian Somers 4562be7470 Don't run if ppp.conf is writable. 1997-11-13 15:35:06 +00:00
Brian Somers 815624cfab Log a warning when a -direct invocation is denied. 1997-11-13 14:44:06 +00:00
Brian Somers d9181b0512 Fix command logging (broken with the "allow" command). 1997-11-13 14:43:20 +00:00
Brian Somers 04da22ce2d Null commit: The last commit made some warning messages clearer. 1997-11-13 12:10:50 +00:00
Brian Somers e445012341 Don't delete interface routes when we do an LcpDown.
They'll get deleted in Cleanup().
1997-11-13 12:09:57 +00:00
Brian Somers a272e47d50 Understand networks in the filter rules. We don't
insist on x.x.x.0/24 - x.x.x.x/24 is ok too.
1997-11-12 21:04:21 +00:00
Brian Somers 710e9c2970 Log whether or not IP packets are bloked due to
a filter.
1997-11-12 19:48:45 +00:00
Brian Somers c40e02e7f3 Return correct value from "set loopback".
Output "set ?filter deny host|port" rules correctly
with show ?filter.
Submitted by:	Dave Bodenstab <imdave@mcs.net>
1997-11-12 18:47:30 +00:00
Brian Somers 6143f398f8 Don't attempt to dial if "dial label" has specified
a restricted label.
1997-11-12 16:34:51 +00:00
Brian Somers 6c5a1dc652 Pass a missing arg to LogPrintf(). 1997-11-12 15:50:38 +00:00
Brian Somers adbec73e00 Don't warn that we're waiting for the command to complete if
we've put it in the background (!bg).
1997-11-12 02:10:05 +00:00
Brian Somers a9c503af9d Don't moan about unexpected config req's when in ST_STOPPING. 1997-11-11 23:23:11 +00:00
Brian Somers 12ef29a81a Finish the security improvements:
o Add "allow" command:
      "allow users a b c" gives access to users a, b and c.
      "allow modes auto"  gives those users access to auto mode only.
      "allow users *" and  "allow modes *" are accepted.
      No users and all modes are allowed by default.
    UID 0 can do anything.
  o Set the current label with the "load" and "dial" commands
    so that the call to ppp.linkdown makes sense.
  o Up the verison number.
  o Don't OR MODE_AUTO for -background and -ddial.
  o Don't OR MODE_INTER when we get a diagnostic connection.
  o Allow up to 40 args per line (was 20).
  o "set ifaddr" only changes the interface in AUTO mode (with other
    modes, it happens after IPCP negotiation).
  o Sort command descriptions in the man page.
  o Support -dedicated mode where we just talk ppp forever (no login etc).
1997-11-11 22:58:14 +00:00
Brian Somers 3d8ad715f4 Fix typo that causes CHAP RESPONSEs to *always*
be damned M$ responses if you've got DES.
1997-11-11 13:08:12 +00:00
Brian Somers 3aa7aa46a3 Flush the output stream when doing local logging. 1997-11-11 12:26:34 +00:00
Brian Somers bdbc7471d7 Don't Cleanup() in background mode when
we get a "close", the LcpClose() will
eventually do it when we get to PHASE_DEAD.
1997-11-09 23:40:21 +00:00
Brian Somers 116e558a8f Initialize VarAltPhone.
PR:		4993
1997-11-09 22:56:15 +00:00
Brian Somers 8ea8442c9a Don't create a diagnostic socket by default.
Allow a password spec on the "set server" command line.
Use SIGUSR2 to close the diagnostic socket.
Some man page corrections.
1997-11-09 22:07:29 +00:00
Brian Somers d025849c64 Don't ask for a password if it's specified as empty. 1997-11-09 18:51:23 +00:00
Brian Somers da2a8b4d42 Add the "!include" syntax.
Return 0 from "show" commands.
1997-11-09 17:51:27 +00:00
Brian Somers 86e0293468 Increase chat script sizes to 512
Requested by: Michael Reifenberger <root@totum.plaut.de>
1997-11-09 14:18:55 +00:00
Brian Somers 50454ee744 Remove the use of $HOME/.ppp.* 1997-11-09 13:18:51 +00:00