diff options
author | brian <brian@cvs.openbsd.org> | 1999-03-04 17:42:27 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-03-04 17:42:27 +0000 |
commit | 1f35dffc8d00683e57728680047bb4e57287250d (patch) | |
tree | 7e2179eee44c76f42d7e01638e169ee6f31ec3d3 /usr.sbin | |
parent | d2230d0c327a84c14104d20f9f9aa3f5e2e33163 (diff) |
Extend the ``set redial'' command to allow incremental
redial timeouts.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/bundle.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/command.c | 6 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/datalink.c | 143 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/datalink.h | 16 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/ppp.8 | 113 |
5 files changed, 201 insertions, 85 deletions
diff --git a/usr.sbin/ppp/ppp/bundle.c b/usr.sbin/ppp/ppp/bundle.c index f6d04a82da7..c79d7272d9b 100644 --- a/usr.sbin/ppp/ppp/bundle.c +++ b/usr.sbin/ppp/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.10 1999/03/01 00:45:14 brian Exp $ + * $Id: bundle.c,v 1.11 1999/03/04 17:42:25 brian Exp $ */ #include <sys/param.h> @@ -1139,9 +1139,9 @@ bundle_Open(struct bundle *bundle, const char *name, int mask, int force) if ((mask & dl->physical->type) && (dl->state == DATALINK_CLOSED || (force && dl->state == DATALINK_OPENING && - dl->dial_timer.state == TIMER_RUNNING))) { - if (force) - timer_Stop(&dl->dial_timer); + dl->dial.timer.state == TIMER_RUNNING))) { + if (force) /* Ignore redial timeout ? */ + timer_Stop(&dl->dial.timer); datalink_Up(dl, 1, 1); if (mask == PHYS_AUTO) /* Only one AUTO link at a time (see the AutoLoad timer) */ diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c index a3449ced960..4193536e549 100644 --- a/usr.sbin/ppp/ppp/command.c +++ b/usr.sbin/ppp/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.13 1999/03/03 23:01:09 brian Exp $ + * $Id: command.c,v 1.14 1999/03/04 17:42:25 brian Exp $ * */ #include <sys/param.h> @@ -141,7 +141,7 @@ #define NEG_DNS 52 const char Version[] = "2.11"; -const char VersionDate[] = "$Date: 1999/03/03 23:01:09 $"; +const char VersionDate[] = "$Date: 1999/03/04 17:42:25 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -1843,7 +1843,7 @@ static struct cmdtab const SetCommands[] = { {"recvpipe", NULL, SetVariable, LOCAL_AUTH, "RECVPIPE value", "set recvpipe value", (const void *)VAR_RECVPIPE}, {"redial", NULL, datalink_SetRedial, LOCAL_AUTH | LOCAL_CX, - "Redial timeout", "set redial value|random[.value|random] [attempts]"}, + "Redial timeout", "set redial secs[+inc[-incmax]][.next] [attempts]"}, {"sendpipe", NULL, SetVariable, LOCAL_AUTH, "SENDPIPE value", "set sendpipe value", (const void *)VAR_SENDPIPE}, {"server", "socket", SetServer, LOCAL_AUTH, diff --git a/usr.sbin/ppp/ppp/datalink.c b/usr.sbin/ppp/ppp/datalink.c index cbf0beae99a..dba15bb8a19 100644 --- a/usr.sbin/ppp/ppp/datalink.c +++ b/usr.sbin/ppp/ppp/datalink.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: datalink.c,v 1.15 1999/02/26 21:28:21 brian Exp $ + * $Id: datalink.c,v 1.16 1999/03/04 17:42:25 brian Exp $ */ #include <sys/param.h> @@ -81,7 +81,7 @@ datalink_OpenTimeout(void *v) { struct datalink *dl = (struct datalink *)v; - timer_Stop(&dl->dial_timer); + timer_Stop(&dl->dial.timer); if (dl->state == DATALINK_OPENING) log_Printf(LogPHASE, "%s: Redial timer expired.\n", dl->name); } @@ -91,18 +91,18 @@ datalink_StartDialTimer(struct datalink *dl, int Timeout) { int result = Timeout; - timer_Stop(&dl->dial_timer); + timer_Stop(&dl->dial.timer); if (Timeout) { if (Timeout > 0) - dl->dial_timer.load = Timeout * SECTICKS; + dl->dial.timer.load = Timeout * SECTICKS; else { result = (random() % DIAL_TIMEOUT) + 1; - dl->dial_timer.load = result * SECTICKS; + dl->dial.timer.load = result * SECTICKS; } - dl->dial_timer.func = datalink_OpenTimeout; - dl->dial_timer.name = "dial"; - dl->dial_timer.arg = dl; - timer_Start(&dl->dial_timer); + dl->dial.timer.func = datalink_OpenTimeout; + dl->dial.timer.name = "dial"; + dl->dial.timer.arg = dl; + timer_Start(&dl->dial.timer); if (dl->state == DATALINK_OPENING) log_Printf(LogPHASE, "%s: Enter pause (%d) for redialing.\n", dl->name, Timeout); @@ -131,13 +131,14 @@ datalink_HangupDone(struct datalink *dl) dl->cfg.phone.list[sizeof dl->cfg.phone.list - 1] = '\0'; dl->phone.alt = dl->phone.next = NULL; dl->reconnect_tries = dl->cfg.reconnect.max; - dl->dial_tries = dl->cfg.dial.max; + dl->dial.tries = dl->cfg.dial.max; + dl->dial.incs = 0; dl->script.run = 1; dl->script.packetmode = 1; if (!physical_SetMode(dl->physical, PHYS_BACKGROUND)) log_Printf(LogERROR, "Oops - can't change mode to BACKGROUND (gulp) !\n"); bundle_LinksRemoved(dl->bundle); - /* if dial.timeout is < 0 (random), don't override fsm.delay */ + /* if dial.timeout is < 0 (random), we don't override fsm.delay */ if (dl->cbcp.fsm.delay < dl->cfg.dial.timeout) dl->cbcp.fsm.delay = dl->cfg.dial.timeout; datalink_StartDialTimer(dl, dl->cbcp.fsm.delay); @@ -145,23 +146,25 @@ datalink_HangupDone(struct datalink *dl) datalink_NewState(dl, DATALINK_OPENING); } else if (dl->bundle->CleaningUp || (dl->physical->type == PHYS_DIRECT) || - ((!dl->dial_tries || (dl->dial_tries < 0 && !dl->reconnect_tries)) && + ((!dl->dial.tries || (dl->dial.tries < 0 && !dl->reconnect_tries)) && !(dl->physical->type & (PHYS_DDIAL|PHYS_DEDICATED)))) { datalink_NewState(dl, DATALINK_CLOSED); - dl->dial_tries = -1; + dl->dial.tries = -1; + dl->dial.incs = 0; dl->reconnect_tries = 0; bundle_LinkClosed(dl->bundle, dl); if (!dl->bundle->CleaningUp) - datalink_StartDialTimer(dl, dl->cfg.dial.timeout); + datalink_StartDialTimer(dl, datalink_GetDialTimeout(dl)); } else { datalink_NewState(dl, DATALINK_OPENING); - if (dl->dial_tries < 0) { + if (dl->dial.tries < 0) { datalink_StartDialTimer(dl, dl->cfg.reconnect.timeout); - dl->dial_tries = dl->cfg.dial.max; + dl->dial.tries = dl->cfg.dial.max; + dl->dial.incs = 0; dl->reconnect_tries--; } else { if (dl->phone.next == NULL) - datalink_StartDialTimer(dl, dl->cfg.dial.timeout); + datalink_StartDialTimer(dl, datalink_GetDialTimeout(dl)); else datalink_StartDialTimer(dl, dl->cfg.dial.next_timeout); } @@ -192,10 +195,11 @@ static void datalink_LoginDone(struct datalink *dl) { if (!dl->script.packetmode) { - dl->dial_tries = -1; + dl->dial.tries = -1; + dl->dial.incs = 0; datalink_NewState(dl, DATALINK_READY); } else if (modem_Raw(dl->physical, dl->bundle) < 0) { - dl->dial_tries = 0; + dl->dial.tries = 0; log_Printf(LogWARN, "datalink_LoginDone: Not connected.\n"); if (dl->script.run) { datalink_NewState(dl, DATALINK_HANGUP); @@ -209,7 +213,8 @@ datalink_LoginDone(struct datalink *dl) datalink_HangupDone(dl); } } else { - dl->dial_tries = -1; + dl->dial.tries = -1; + dl->dial.incs = 0; hdlc_Init(&dl->physical->hdlc, &dl->physical->link.lcp); async_Init(&dl->physical->async); @@ -248,9 +253,9 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, /* fall through */ case DATALINK_OPENING: - if (dl->dial_timer.state != TIMER_RUNNING) { - if (--dl->dial_tries < 0) - dl->dial_tries = 0; + if (dl->dial.timer.state != TIMER_RUNNING) { + if (--dl->dial.tries < 0) + dl->dial.tries = 0; if (modem_Open(dl->physical, dl->bundle) >= 0) { log_WritePrompts(dl, "%s: Entering terminal mode on %s\r\n" "Type `~?' for help\r\n", dl->name, @@ -262,7 +267,7 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, if (!(dl->physical->type & (PHYS_DDIAL|PHYS_DEDICATED)) && dl->cfg.dial.max) log_Printf(LogCHAT, "%s: Dial attempt %u of %d\n", - dl->name, dl->cfg.dial.max - dl->dial_tries, + dl->name, dl->cfg.dial.max - dl->dial.tries, dl->cfg.dial.max); } else datalink_LoginDone(dl); @@ -271,22 +276,24 @@ datalink_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, if (!(dl->physical->type & (PHYS_DDIAL|PHYS_DEDICATED)) && dl->cfg.dial.max) log_Printf(LogCHAT, "Failed to open modem (attempt %u of %d)\n", - dl->cfg.dial.max - dl->dial_tries, dl->cfg.dial.max); + dl->cfg.dial.max - dl->dial.tries, dl->cfg.dial.max); else log_Printf(LogCHAT, "Failed to open modem\n"); if (dl->bundle->CleaningUp || (!(dl->physical->type & (PHYS_DDIAL|PHYS_DEDICATED)) && - dl->cfg.dial.max && dl->dial_tries == 0)) { + dl->cfg.dial.max && dl->dial.tries == 0)) { datalink_NewState(dl, DATALINK_CLOSED); dl->reconnect_tries = 0; - dl->dial_tries = -1; + dl->dial.tries = -1; log_WritePrompts(dl, "Failed to open %s\n", dl->physical->name.full); bundle_LinkClosed(dl->bundle, dl); } if (!dl->bundle->CleaningUp) { - int timeout = datalink_StartDialTimer(dl, dl->cfg.dial.timeout); + int timeout; + + timeout = datalink_StartDialTimer(dl, datalink_GetDialTimeout(dl)); log_WritePrompts(dl, "Failed to open %s, pause %d seconds\n", dl->physical->name.full, timeout); } @@ -444,7 +451,7 @@ static void datalink_ComeDown(struct datalink *dl, int how) { if (how != CLOSE_NORMAL) { - dl->dial_tries = -1; + dl->dial.tries = -1; dl->reconnect_tries = 0; if (dl->state >= DATALINK_READY && how == CLOSE_LCP) dl->stayonline = 1; @@ -726,12 +733,14 @@ datalink_Create(const char *name, struct bundle *bundle, int type) dl->bundle = bundle; dl->next = NULL; - memset(&dl->dial_timer, '\0', sizeof dl->dial_timer); + memset(&dl->dial.timer, '\0', sizeof dl->dial.timer); - dl->dial_tries = 0; + dl->dial.tries = 0; dl->cfg.dial.max = 1; dl->cfg.dial.next_timeout = DIAL_NEXT_TIMEOUT; dl->cfg.dial.timeout = DIAL_TIMEOUT; + dl->cfg.dial.inc = 0; + dl->cfg.dial.maxinc = 10; dl->reconnect_tries = 0; dl->cfg.reconnect.max = 0; @@ -793,8 +802,8 @@ datalink_Clone(struct datalink *odl, const char *name) dl->phone.chosen = "N/A"; dl->bundle = odl->bundle; dl->next = NULL; - memset(&dl->dial_timer, '\0', sizeof dl->dial_timer); - dl->dial_tries = 0; + memset(&dl->dial.timer, '\0', sizeof dl->dial.timer); + dl->dial.tries = 0; dl->reconnect_tries = 0; dl->name = strdup(name); peerid_Init(&dl->peer); @@ -847,7 +856,7 @@ datalink_Destroy(struct datalink *dl) } } - timer_Stop(&dl->dial_timer); + timer_Stop(&dl->dial.timer); result = dl->next; modem_Destroy(dl->physical); free(dl->name); @@ -871,7 +880,7 @@ datalink_Up(struct datalink *dl, int runscripts, int packetmode) datalink_NewState(dl, DATALINK_OPENING); dl->reconnect_tries = dl->physical->type == PHYS_DIRECT ? 0 : dl->cfg.reconnect.max; - dl->dial_tries = dl->cfg.dial.max; + dl->dial.tries = dl->cfg.dial.max; dl->script.run = runscripts; dl->script.packetmode = packetmode; break; @@ -909,7 +918,7 @@ datalink_Close(struct datalink *dl, int how) datalink_AuthReInit(dl); fsm_Close(&dl->physical->link.lcp.fsm); if (how != CLOSE_NORMAL) { - dl->dial_tries = -1; + dl->dial.tries = -1; dl->reconnect_tries = 0; if (how == CLOSE_LCP) dl->stayonline = 1; @@ -1057,9 +1066,8 @@ datalink_SetReconnect(struct cmdargs const *arg) int datalink_SetRedial(struct cmdargs const *arg) { - int timeout; - int tries; - char *dot; + const char *sep, *osep; + int timeout, inc, maxinc, tries; if (arg->argc == arg->argn+1 || arg->argc == arg->argn+2) { if (strncasecmp(arg->argv[arg->argn], "random", 6) == 0 && @@ -1077,13 +1085,44 @@ datalink_SetRedial(struct cmdargs const *arg) } } - dot = strchr(arg->argv[arg->argn], '.'); - if (dot) { - if (strcasecmp(++dot, "random") == 0) { + sep = strchr(arg->argv[arg->argn], '+'); + if (sep) { + inc = atoi(++sep); + osep = sep; + if (inc >= 0) + arg->cx->cfg.dial.inc = inc; + else { + log_Printf(LogWARN, "Invalid timeout increment\n"); + return -1; + } + sep = strchr(sep, '-'); + if (sep) { + maxinc = atoi(++sep); + if (maxinc >= 0) + arg->cx->cfg.dial.maxinc = maxinc; + else { + log_Printf(LogWARN, "Invalid maximum timeout increments\n"); + return -1; + } + } else { + /* Default timeout increment */ + arg->cx->cfg.dial.maxinc = 10; + sep = osep; + } + } else { + /* Default timeout increment & max increment */ + arg->cx->cfg.dial.inc = 0; + arg->cx->cfg.dial.maxinc = 10; + sep = arg->argv[arg->argn]; + } + + sep = strchr(sep, '.'); + if (sep) { + if (strcasecmp(++sep, "random") == 0) { arg->cx->cfg.dial.next_timeout = -1; randinit(); } else { - timeout = atoi(dot); + timeout = atoi(sep); if (timeout >= 0) arg->cx->cfg.dial.next_timeout = timeout; else { @@ -1107,6 +1146,7 @@ datalink_SetRedial(struct cmdargs const *arg) } return 0; } + return -1; } @@ -1197,8 +1237,8 @@ iov2datalink(struct bundle *bundle, struct iovec *iov, int *niov, int maxiov, dl->bundle = bundle; dl->next = NULL; - memset(&dl->dial_timer, '\0', sizeof dl->dial_timer); - dl->dial_tries = 0; + memset(&dl->dial.timer, '\0', sizeof dl->dial.timer); + dl->dial.tries = 0; dl->reconnect_tries = 0; dl->parent = &bundle->fsm; dl->fsmp.LayerStart = datalink_LayerStart; @@ -1240,7 +1280,7 @@ datalink2iov(struct datalink *dl, struct iovec *iov, int *niov, int maxiov, int link_fd; if (dl) { - timer_Stop(&dl->dial_timer); + timer_Stop(&dl->dial.timer); /* The following is purely for the sake of paranoia */ cbcp_Down(&dl->cbcp); timer_Stop(&dl->pap.authtimer); @@ -1311,3 +1351,14 @@ datalink_SetMode(struct datalink *dl, int mode) datalink_Up(dl, 1, 1); return 1; } + +int +datalink_GetDialTimeout(struct datalink *dl) +{ + int result = dl->cfg.dial.timeout + dl->dial.incs * dl->cfg.dial.inc; + + if (dl->dial.incs < dl->cfg.dial.maxinc) + dl->dial.incs++; + + return result; +} diff --git a/usr.sbin/ppp/ppp/datalink.h b/usr.sbin/ppp/ppp/datalink.h index 5338ee922b2..8206275a045 100644 --- a/usr.sbin/ppp/ppp/datalink.h +++ b/usr.sbin/ppp/ppp/datalink.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: datalink.h,v 1.2 1999/02/06 03:22:35 brian Exp $ + * $Id: datalink.h,v 1.3 1999/03/04 17:42:25 brian Exp $ */ #define DATALINK_CLOSED (0) @@ -62,8 +62,6 @@ struct datalink { unsigned packetmode : 1; /* Go into packet mode after login ? */ } script; - struct pppTimer dial_timer; /* For timing between close & open */ - struct { struct { char dial[SCRIPT_LEN]; /* dial */ @@ -76,6 +74,8 @@ struct datalink { struct { int max; /* initially try again this number of times */ int next_timeout; /* Redial next timeout value */ + int inc; /* Increment timeout by `inc' each time read */ + int maxinc; /* Maximum number of increments */ int timeout; /* Redial timeout value (end of phone list) */ } dial; struct { @@ -89,13 +89,18 @@ struct datalink { struct { char list[SCRIPT_LEN]; /* copy of cfg.list for strsep() */ char *next; /* Next phone from the list */ - char *alt; /* Next phone from the list */ + char *alt; /* Alternate (after fail) phone from the list */ const char *chosen; /* Chosen phone number after DIAL */ } phone; struct cbcp cbcp; - int dial_tries; /* currently try again this number of times */ + struct { + struct pppTimer timer; /* For timing between close & open */ + int tries; /* currently try again this number of times */ + int incs; /* # times our timeout has been incremented */ + } dial; + unsigned reconnect_tries; /* currently try again this number of times */ char *name; /* Our name */ @@ -143,3 +148,4 @@ extern char *datalink_NextName(struct datalink *); extern int datalink_RemoveFromSet(struct datalink *, fd_set *, fd_set *, fd_set *); extern int datalink_SetMode(struct datalink *, int); +extern int datalink_GetDialTimeout(struct datalink *); diff --git a/usr.sbin/ppp/ppp/ppp.8 b/usr.sbin/ppp/ppp/ppp.8 index 20a111dcaeb..7f4625fecc0 100644 --- a/usr.sbin/ppp/ppp/ppp.8 +++ b/usr.sbin/ppp/ppp/ppp.8 @@ -1,4 +1,4 @@ -.\" $Id: ppp.8,v 1.24 1999/03/03 23:01:11 brian Exp $ +.\" $Id: ppp.8,v 1.25 1999/03/04 17:42:26 brian Exp $ .Dd 20 September 1995 .nr XX \w'\fC00' .Os FreeBSD @@ -835,42 +835,82 @@ to be down. If the connect fails, the default behaviour is to wait 30 seconds and then attempt to connect when another outgoing packet is detected. This behaviour can be changed with -.Bd -literal -offset indent -set redial seconds|random[.nseconds|random] [dial_attempts] -.Ed .Pp -.Sq Seconds +.Dl set redial Ar secs[+inc[-max]][.next] Op Ar attempts +.Pp +.Bl -tag -width XXXXXXXX -compact +.It Ar secs is the number of seconds to wait before attempting -to connect again. If the argument is -.Sq random , +to connect again. If the argument is the literal string +.Sq Li random , the delay period is a random value between 1 and 30 seconds inclusive. -.Sq Nseconds +.It Ar inc +is the number of seconds that +.Ar secs +should be incremented each time a new dial attempt is made. The timeout +reverts to +.Ar secs +only after a successful connection is established. The default value for +.Ar inc +is zero. +.It Ar maxinc +is the maximun number of times +.Nm +should increment +.Ar secs . +The default value for +.Ar maxinc +is 10. +.It Ar next is the number of seconds to wait before attempting to dial the next number in a list of numbers (see the .Dq set phone -command). The default is 3 seconds. Again, if the argument is -.Sq random , +command). The default is 3 seconds. Again, if the argument is the literal +string +.Sq Li random , the delay period is a random value between 1 and 30 seconds. -.Sq dial_attempts -is the number of times to try to connect for each outgoing packet -that is received. The previous value is unchanged if this parameter +.It Ar attempts +is the maximum number of times to try to connect for each outgoing packet +that triggers a dial. The previous value is unchanged if this parameter is omitted. If a value of zero is specified for -.Sq dial_attempts , +.Ar attempts , .Nm will keep trying until a connection is made. +.El +.Pp +So, for example; .Bd -literal -offset indent set redial 10.3 4 .Ed .Pp -will attempt to connect 4 times for each outgoing packet that is -detected with a 3 second delay between each number and a 10 second +will attempt to connect 4 times for each outgoing packet that causes +a dial attempt with a 3 second delay between each number and a 10 second delay after all numbers have been tried. If multiple phone numbers are specified, the total number of attempts is still 4 (it does not attempt each number 4 times). +.Pp +Alternatively, +.Pp +.Bd -literal -offset indent +set redial 10+10-5.3 20 +.Ed +.Pp +tells +.Nm +to attempt to connect 20 times. After the first attempt, +.Nm +pauses for 10 seconds. After the next attempt it pauses for 20 seconds +and so on until after the sixth attempt it pauses for 1 minute. The next +14 pauses will also have a duration of one minute. If +.Nm +connects, disconnects and fails to connect again, the timeout starts again +at 10 seconds. +.Pp Modifying the dial delay is very useful when running .Nm -in demand -dial mode on both ends of the link. If each end has the same timeout, +in +.Fl auto +mode on both ends of the link. If each end has the same timeout, both ends wind up calling each other at the same time if the link drops and both ends have packets queued. At some locations, the serial link may not be reliable, and carrier @@ -1566,7 +1606,10 @@ The following steps should be taken when connecting to your ISP: Describe your providers phone number(s) in the dial script using the .Dq set phone command. This command allows you to set multiple phone numbers for -dialing and redialing separated by either a pipe (|) or a colon (:) +dialing and redialing separated by either a pipe +.Pq Dq \&| +or a colon +.Pq Dq \&: : .Bd -literal -offset indent set phone "111[|222]...[:333[|444]...]... .Ed @@ -3873,25 +3916,41 @@ This sets the routing table RECVPIPE value. The optimum value is just over twice the MTU value. If .Ar value is unspecified or zero, the default kernel controlled value is used. -.It set redial Ar seconds[.nseconds] [attempts] +.It set redial Ar secs[+inc[-max]][.next] [attempts] .Nm can be instructed to attempt to redial .Ar attempts times. If more than one phone number is specified (see .Dq set phone above), a pause of -.Ar nseconds +.Ar next is taken before dialing each number. A pause of -.Ar seconds -is taken before starting at the first number again. A value of -.Ar random +.Ar secs +is taken before starting at the first number again. A literal value of +.Dq Li random may be used here in place of -.Ar seconds +.Ar secs and -.Ar nseconds , +.Ar next , causing a random delay of between 1 and 30 seconds. .Pp -Note, this delay will be effective, even after +If +.Ar inc +is specified, its value is added onto +.Ar secs +each time +.Nm +tries a new number. +.Ar secs +will only be incremented at most +.Ar maxinc +times. +.Ar maxinc +defaults to 10. +.Pp +Note, the +.Ar secs +delay will be effective, even after .Ar attempts has been exceeded, so an immediate manual dial may appear to have done nothing. If an immediate dial is required, a |