diff options
author | Brian Somers <brian@FreeBSD.org> | 1998-04-11 21:50:47 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1998-04-11 21:50:47 +0000 |
commit | c08717df31e851310c715a1eb7fd7aab051a3b88 (patch) | |
tree | 20e55008073ab4322a86ef0bc4172506ec9ef22e /usr.sbin | |
parent | 99294c8bfa6799d9182a673cc1732f265cb71d38 (diff) | |
download | src-test2-c08717df31e851310c715a1eb7fd7aab051a3b88.tar.gz src-test2-c08717df31e851310c715a1eb7fd7aab051a3b88.zip |
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/bundle.c | 25 | ||||
-rw-r--r-- | usr.sbin/ppp/bundle.h | 3 | ||||
-rw-r--r-- | usr.sbin/ppp/command.c | 39 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp.8 | 12 |
4 files changed, 37 insertions, 42 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 4b5f7c27bed8..5e46aa2964f8 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/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.1.2.43 1998/04/07 23:45:41 brian Exp $ + * $Id: bundle.c,v 1.1.2.44 1998/04/10 13:19:01 brian Exp $ */ #include <sys/types.h> @@ -850,6 +850,29 @@ bundle_ShowLinks(struct cmdargs const *arg) return 0; } +int +bundle_ShowStatus(struct cmdargs const *arg) +{ + int remaining; + + prompt_Printf(arg->prompt, "Phase %s\n", bundle_PhaseName(arg->bundle)); + prompt_Printf(arg->prompt, " Interface: %s\n", arg->bundle->dev); + + prompt_Printf(arg->prompt, "\nDefaults:\n"); + prompt_Printf(arg->prompt, " Auth name: %s\n", arg->bundle->cfg.auth.name); + prompt_Printf(arg->prompt, " Idle Timer: "); + if (arg->bundle->cfg.idle_timeout) { + prompt_Printf(arg->prompt, "%ds", arg->bundle->cfg.idle_timeout); + remaining = bundle_RemainingIdleTime(arg->bundle); + if (remaining != -1) + prompt_Printf(arg->prompt, " (%ds remaining)", remaining); + prompt_Printf(arg->prompt, "\n"); + } else + prompt_Printf(arg->prompt, "disabled\n"); + + return 0; +} + static void bundle_IdleTimeout(void *v) { diff --git a/usr.sbin/ppp/bundle.h b/usr.sbin/ppp/bundle.h index 0972e51cb587..4a806c462d69 100644 --- a/usr.sbin/ppp/bundle.h +++ b/usr.sbin/ppp/bundle.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.h,v 1.1.2.26 1998/04/05 22:48:02 brian Exp $ + * $Id: bundle.h,v 1.1.2.27 1998/04/10 13:19:01 brian Exp $ */ #define PHASE_DEAD 0 /* Link is dead */ @@ -103,6 +103,7 @@ extern void bundle_LinkClosed(struct bundle *, struct datalink *); extern int bundle_FillQueues(struct bundle *); extern int bundle_ShowLinks(struct cmdargs const *); +extern int bundle_ShowStatus(struct cmdargs const *); extern void bundle_StartIdleTimer(struct bundle *); extern void bundle_SetIdleTimer(struct bundle *, int); extern void bundle_StopIdleTimer(struct bundle *); diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 4a8d727d4252..924df5251722 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.131.2.57 1998/04/10 13:19:03 brian Exp $ + * $Id: command.c,v 1.131.2.58 1998/04/10 23:51:27 brian Exp $ * */ #include <sys/types.h> @@ -81,8 +81,6 @@ #include "chap.h" #include "datalink.h" -static const char *HIDDEN = "********"; - static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); static int QuitCommand(struct cmdargs const *); @@ -432,23 +430,6 @@ ShowEscape(struct cmdargs const *arg) } static int -ShowTimeout(struct cmdargs const *arg) -{ - int remaining; - - prompt_Printf(arg->prompt, "Idle Timer: "); - if (arg->bundle->cfg.idle_timeout) { - prompt_Printf(arg->prompt, "%ds\n", arg->bundle->cfg.idle_timeout); - remaining = bundle_RemainingIdleTime(arg->bundle); - if (remaining != -1) - prompt_Printf(arg->prompt, "Remaining: %ds\n", remaining); - } else - prompt_Printf(arg->prompt, "disabled\n"); - - return 0; -} - -static int ShowTimerList(struct cmdargs const *arg) { ShowTimers(0, arg->prompt); @@ -478,18 +459,10 @@ ShowStopped(struct cmdargs const *arg) } static int -ShowAuthKey(struct cmdargs const *arg) -{ - prompt_Printf(arg->prompt, "AuthName = %s\n", arg->bundle->cfg.auth.name); - prompt_Printf(arg->prompt, "AuthKey = %s\n", HIDDEN); - return 0; -} - -static int ShowVersion(struct cmdargs const *arg) { static char VarVersion[] = "PPP Version 2.0-beta"; - static char VarLocalVersion[] = "$Date: 1998/04/10 13:19:03 $"; + static char VarLocalVersion[] = "$Date: 1998/04/10 23:51:27 $"; prompt_Printf(arg->prompt, "%s - %s \n", VarVersion, VarLocalVersion); return 0; @@ -526,8 +499,8 @@ ShowMSExt(struct cmdargs const *arg) #endif static struct cmdtab const ShowCommands[] = { - {"auth", NULL, ShowAuthKey, LOCAL_AUTH, - "Show auth details", "show auth"}, + {"bundle", NULL, bundle_ShowStatus, LOCAL_AUTH, + "Show bundle details", "show bundle"}, {"ccp", NULL, ccp_ReportStatus, LOCAL_AUTH | LOCAL_CX_OPT, "Show CCP status", "show cpp"}, {"compress", NULL, ReportCompress, LOCAL_AUTH, @@ -560,8 +533,6 @@ static struct cmdtab const ShowCommands[] = { "Show routing table", "show route"}, {"stopped", NULL, ShowStopped, LOCAL_AUTH | LOCAL_CX, "Show STOPPED timeout", "show stopped"}, - {"timeout", NULL, ShowTimeout, LOCAL_AUTH, - "Show Idle timeout", "show timeout"}, {"timers", NULL, ShowTimerList, LOCAL_AUTH, "Show alarm timers", "show timers"}, {"version", NULL, ShowVersion, LOCAL_NO_AUTH | LOCAL_AUTH, @@ -706,7 +677,7 @@ RunCommand(struct bundle *bundle, int argc, char const *const *argv, if (n < sizeof buf - 1 && f) buf[n++] = ' '; if (arghidden(argc, argv, f)) - strncpy(buf+n, HIDDEN, sizeof buf - n - 1); + strncpy(buf+n, "********", sizeof buf - n - 1); else strncpy(buf+n, argv[f], sizeof buf - n - 1); n += strlen(buf+n); diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8 index c89c3df3793f..21948f04daaa 100644 --- a/usr.sbin/ppp/ppp.8 +++ b/usr.sbin/ppp/ppp.8 @@ -1,4 +1,4 @@ -.\" $Id: ppp.8,v 1.97.2.13 1998/04/05 22:48:25 brian Exp $ +.\" $Id: ppp.8,v 1.97.2.14 1998/04/10 13:19:17 brian Exp $ .Dd 20 September 1995 .Os FreeBSD .Dt PPP 8 @@ -989,7 +989,7 @@ See .Pa /etc/ppp/ppp.conf.example . .Sh SETTING THE IDLE TIMER To check/set the idle timer, use the -.Dq show timeout +.Dq show bundle and .Dq set timeout commands: @@ -2600,8 +2600,8 @@ command if you wish processing to happen in the background. .It show Ar var This command allows the user to examine the following: .Bl -tag -width 20 -.It show auth -Show the current authname. +.It show bundle +Show the current bundle settings. .It show ccp Show the current CCP compression statistics. .It show compress @@ -2636,8 +2636,8 @@ Show current protocol totals. Show the current routing tables. .It show stopped Show the current stopped timeouts. -.It show timeout -Show the current idle timeout value. +.It show timer +Show the active alarm timers. .It show version Show the current version number of .Nm ppp . |