summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1996-12-03 21:38:52 +0000
committernate <nate@FreeBSD.org>1996-12-03 21:38:52 +0000
commit8620fc8544ff62f29a19ab194cb21a092e314a97 (patch)
treebb44448442ea3de595c180ce0d9d0398f57509f7 /usr.sbin
parent1aa66460f8fa844a7fec1e9c9cf4bca3e5528b72 (diff)
downloadFreeBSD-src-8620fc8544ff62f29a19ab194cb21a092e314a97.zip
FreeBSD-src-8620fc8544ff62f29a19ab194cb21a092e314a97.tar.gz
Added my 'ddial' patches to user-PPP. The new mode tries it's darndest
to keep the link up, so it re-dials whenever it detects the link go down. This is useful for 'dedicated' links who use PPP. It's been used for over a year w/out problems at different sites.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/command.c6
-rw-r--r--usr.sbin/ppp/defs.h3
-rw-r--r--usr.sbin/ppp/ip.c6
-rw-r--r--usr.sbin/ppp/main.c23
-rw-r--r--usr.sbin/ppp/ppp.815
-rw-r--r--usr.sbin/ppp/ppp.8.m415
6 files changed, 52 insertions, 16 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index c413a46..870ef44 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.23 1996/10/12 16:20:28 jkh Exp $
+ * $Id: command.c,v 1.24 1996/10/13 15:05:14 sos Exp $
*
*/
#include <sys/types.h>
@@ -102,7 +102,9 @@ IsInteractive()
{
char *mes = NULL;
- if (mode & MODE_AUTO)
+ if (mode & MODE_DDIAL)
+ mes = "Working in dedicated dial mode.";
+ else if (mode & MODE_AUTO)
mes = "Working in auto mode.";
else if (mode & MODE_DIRECT)
mes = "Working in direct mode.";
diff --git a/usr.sbin/ppp/defs.h b/usr.sbin/ppp/defs.h
index c67971c..84989f5 100644
--- a/usr.sbin/ppp/defs.h
+++ b/usr.sbin/ppp/defs.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: defs.h,v 1.3 1995/09/02 17:20:51 amurai Exp $
+ * $Id: defs.h,v 1.4 1995/10/08 14:57:28 amurai Exp $
*
* TODO:
*/
@@ -59,6 +59,7 @@
#define MODE_AUTO 2 /* Auto calling mode */
#define MODE_DIRECT 4 /* Direct connection mode */
#define MODE_DEDICATED 8 /* Dedicated line mode */
+#define MODE_DDIAL 16 /* Dedicated dialing line mode */
#define EX_NORMAL 0
#define EX_START 1
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index c6732d3..1756b4d 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ip.c,v 1.8 1996/01/30 11:08:33 dfr Exp $
+ * $Id: ip.c,v 1.9 1996/05/11 20:48:25 phk Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@@ -53,7 +53,7 @@ static void IdleTimeout()
void
StartIdleTimer()
{
- if (!(mode & MODE_DEDICATED)) {
+ if (!(mode & (MODE_DEDICATED|MODE_DDIAL))) {
StopTimer(&IdleTimer);
IdleTimer.func = IdleTimeout;
IdleTimer.load = VarIdleTimeout * SECTICKS;
@@ -74,7 +74,7 @@ StopIdleTimer()
static void
RestartIdleTimer()
{
- if (!(mode & MODE_DEDICATED) && ipKeepAlive ) {
+ if (!(mode & (MODE_DEDICATED|MODE_DDIAL)) && ipKeepAlive ) {
StartTimer(&IdleTimer);
ipIdleSecs = 0;
}
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 0c9a5cf..af63085 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.21 1996/10/07 04:21:00 jkh Exp $
+ * $Id: main.c,v 1.22 1996/10/12 16:20:32 jkh Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -213,7 +213,8 @@ int signo;
void
Usage()
{
- fprintf(stderr, "Usage: ppp [-auto | -direct | -dedicated] [system]\n");
+ fprintf(stderr,
+ "Usage: ppp [-auto | -direct | -dedicated | -ddial ] [system]\n");
exit(EX_START);
}
@@ -232,6 +233,8 @@ ProcessArgs(int argc, char **argv)
mode |= MODE_DIRECT;
else if (strcmp(cp, "dedicated") == 0)
mode |= MODE_DEDICATED;
+ else if (strcmp(cp, "ddial") == 0)
+ mode |= MODE_DDIAL|MODE_AUTO;
else
Usage();
optc++;
@@ -303,9 +306,10 @@ char **argv;
printf("Interactive mode\n");
netfd = 0;
} else if (mode & MODE_AUTO) {
- printf("Automatic mode\n");
+ printf("Automatic Dialer mode\n");
if (dstsystem == NULL) {
- fprintf(stderr, "Destination system must be specified in auto mode.\n");
+ fprintf(stderr,
+ "Destination system must be specified in auto or ddial mode.\n");
exit(EX_START);
}
}
@@ -344,7 +348,7 @@ char **argv;
Cleanup(EX_START);
}
if ((mode & MODE_AUTO) && DefHisAddress.ipaddr.s_addr == INADDR_ANY) {
- fprintf(stderr, "Must specify dstaddr with auto mode.\n");
+ fprintf(stderr, "Must specify dstaddr with auto or ddial mode.\n");
Cleanup(EX_START);
}
}
@@ -389,7 +393,7 @@ char **argv;
snprintf(pid_filename, sizeof (pid_filename), "%s/PPP.%s",
_PATH_VARRUN, dstsystem);
unlink(pid_filename);
- sprintf(pid, "%d\n", getpid());
+ sprintf(pid, "%d\n", (int)getpid());
if ((fd = open(pid_filename, O_RDWR|O_CREAT, 0666)) != -1)
{
@@ -664,6 +668,13 @@ DoLoop()
for (;;) {
FD_ZERO(&rfds); FD_ZERO(&wfds); FD_ZERO(&efds);
+ /*
+ * If the link is down and we're in DDIAL mode, bring it back
+ * up.
+ */
+ if (mode & MODE_DDIAL && LcpFsm.state <= ST_CLOSED)
+ dial_up = TRUE;
+
/*
* If Ip packet for output is enqueued and require dial up,
* Just do it!
diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8
index 1b25f8b..8deb7e3 100644
--- a/usr.sbin/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp.8
@@ -1,5 +1,5 @@
.\" manual page [] for ppp 0.94 beta2 + alpha
-.\" $Id: ppp.8,v 1.18 1996/10/06 13:32:33 jkh Exp $
+.\" $Id: ppp.8,v 1.19 1996/10/31 19:55:05 joerg Exp $
.Dd 20 September 1995
.Os FreeBSD
.Dt PPP 8
@@ -9,7 +9,7 @@
Point to Point Protocol (aka iijppp)
.Sh SYNOPSIS
.Nm
-.Op Fl auto | Fl direct | Fl dedicated
+.Op Fl auto | ddial | dedicated | direct
.Op Ar system
.Sh DESCRIPTION
This is a user process
@@ -53,6 +53,13 @@ will act as a daemon and wait for a packet to be sent over the
link. When this happens, the daemon automatically dials and establishes the
connection.
+In almost the same manner ddial mode (dedicated dialing or demon dialing)
+also automatically dials and establishes the connection. However, it
+differs in that it will dial the remote site any time it detects the
+link is down, even if there are no packets to be sent. This mode is
+useful for full-time connections who worry less about line charges
+and more about being connected full time.
+
.It Supports server-side PPP connections.
Can act as server which accepts incoming
.Em PPP
@@ -280,6 +287,8 @@ remote peer.
To play with demand dialing, you must use the
.Fl auto
+or
+.Fl ddial
option. You must also specify the destination label in
.Pa /etc/ppp/ppp.conf
to use. It should contain the
@@ -293,6 +302,8 @@ command to define the remote peer's IP address. (refer to
When
.Fl auto
+or
+.Fl ddial
is specified,
.Nm
runs as a daemon but you can still configure or examine its
diff --git a/usr.sbin/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp.8.m4
index 1b25f8b..8deb7e3 100644
--- a/usr.sbin/ppp/ppp.8.m4
+++ b/usr.sbin/ppp/ppp.8.m4
@@ -1,5 +1,5 @@
.\" manual page [] for ppp 0.94 beta2 + alpha
-.\" $Id: ppp.8,v 1.18 1996/10/06 13:32:33 jkh Exp $
+.\" $Id: ppp.8,v 1.19 1996/10/31 19:55:05 joerg Exp $
.Dd 20 September 1995
.Os FreeBSD
.Dt PPP 8
@@ -9,7 +9,7 @@
Point to Point Protocol (aka iijppp)
.Sh SYNOPSIS
.Nm
-.Op Fl auto | Fl direct | Fl dedicated
+.Op Fl auto | ddial | dedicated | direct
.Op Ar system
.Sh DESCRIPTION
This is a user process
@@ -53,6 +53,13 @@ will act as a daemon and wait for a packet to be sent over the
link. When this happens, the daemon automatically dials and establishes the
connection.
+In almost the same manner ddial mode (dedicated dialing or demon dialing)
+also automatically dials and establishes the connection. However, it
+differs in that it will dial the remote site any time it detects the
+link is down, even if there are no packets to be sent. This mode is
+useful for full-time connections who worry less about line charges
+and more about being connected full time.
+
.It Supports server-side PPP connections.
Can act as server which accepts incoming
.Em PPP
@@ -280,6 +287,8 @@ remote peer.
To play with demand dialing, you must use the
.Fl auto
+or
+.Fl ddial
option. You must also specify the destination label in
.Pa /etc/ppp/ppp.conf
to use. It should contain the
@@ -293,6 +302,8 @@ command to define the remote peer's IP address. (refer to
When
.Fl auto
+or
+.Fl ddial
is specified,
.Nm
runs as a daemon but you can still configure or examine its
OpenPOWER on IntegriCloud