diff options
author | Joerg Wunsch <joerg@FreeBSD.org> | 2001-12-27 21:20:33 +0000 |
---|---|---|
committer | Joerg Wunsch <joerg@FreeBSD.org> | 2001-12-27 21:20:33 +0000 |
commit | e2aac1dd3116effe9ce12cab4c629717272372eb (patch) | |
tree | 50f23cc1feb7d0f68e0eba4ebb9c71061bc5cd2a /sbin/spppcontrol | |
parent | ea77971c6cd7b5351391df00fee584ea07eb88a6 (diff) | |
download | src-test2-e2aac1dd3116effe9ce12cab4c629717272372eb.tar.gz src-test2-e2aac1dd3116effe9ce12cab4c629717272372eb.zip |
Notes
Diffstat (limited to 'sbin/spppcontrol')
-rw-r--r-- | sbin/spppcontrol/spppcontrol.8 | 5 | ||||
-rw-r--r-- | sbin/spppcontrol/spppcontrol.c | 20 |
2 files changed, 23 insertions, 2 deletions
diff --git a/sbin/spppcontrol/spppcontrol.8 b/sbin/spppcontrol/spppcontrol.8 index 8db48bce6496..ca227c9cf4d6 100644 --- a/sbin/spppcontrol/spppcontrol.8 +++ b/sbin/spppcontrol/spppcontrol.8 @@ -164,6 +164,10 @@ through approximately 800 seconds.) This is the default, and will not be explicitly displayed in .Ql list mode. +.It Ar lcp-timeout Ns \&= Ns Em timeout-value +Allows to change the value of the LCP restart timer. Values are +specified in milliseconds. The value must be between 10 and 20000 ms, +defaulting to 3000 ms. .It Ar enable-vj Enable negotiation of Van Jacobsen header compression. (Enabled by default.) .It Ar disable-vj @@ -175,6 +179,7 @@ Disable negotiation of Van Jacobsen header compression. bppp0: phase=dead myauthproto=chap myauthname="uriah" hisauthproto=chap hisauthname="ifb-gw" norechallenge + lcp-timeout=3000 enable-vj .Ed .Pp diff --git a/sbin/spppcontrol/spppcontrol.c b/sbin/spppcontrol/spppcontrol.c index e1ddfffe8db9..111ac0d1994f 100644 --- a/sbin/spppcontrol/spppcontrol.c +++ b/sbin/spppcontrol/spppcontrol.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Joerg Wunsch + * Copyright (c) 1997, 2001 Joerg Wunsch * * All rights reserved. * @@ -65,6 +65,8 @@ main(int argc, char **argv) int s, c; int errs = 0, verbose = 0; size_t off; + long to; + char *endp; const char *ifname, *cp; struct ifreq ifr; struct spppreq spr; @@ -165,7 +167,20 @@ main(int argc, char **argv) spr.defs.hisauth.flags |= AUTHFLAG_NORECHALLENGE; else if (strcmp(argv[0], "rechallenge") == 0) spr.defs.hisauth.flags &= ~AUTHFLAG_NORECHALLENGE; - else if (strcmp(argv[0], "enable-vj") == 0) + else if (startswith("lcp-timeout=")) { + cp = argv[0] + off; + to = strtol(cp, &endp, 10); + if (*cp == '\0' || *endp != '\0' || + /* + * NB: 10 ms is the minimal possible value for + * hz=100. We assume no kernel has less clock + * frequency than that... + */ + to < 10 || to > 20000) + errx(EX_DATAERR, "bad lcp timeout value: %s", + cp); + spr.defs.lcp.timeout = to; + } else if (strcmp(argv[0], "enable-vj") == 0) spr.defs.enable_vj = 1; else if (strcmp(argv[0], "disable-vj") == 0) spr.defs.enable_vj = 0; @@ -211,6 +226,7 @@ print_vals(const char *ifname, struct spppreq *sp) AUTHNAMELEN, sp->defs.hisauth.name, authflags(sp->defs.hisauth.flags)); } + printf("\tlcp-timeout=%d ms\n", sp->defs.lcp.timeout); printf("\t%sable-vj\n", sp->defs.enable_vj? "en": "dis"); } |