diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-07-17 20:08:56 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-07-17 20:08:56 +0000 |
commit | 1f683b526329e503fa3e8bfc25e2baf56c12037e (patch) | |
tree | 90af0fd25e189029a0e87a1e58662bf0de3dae5d | |
parent | 9f1ee6a3173c8c3f9936ce94cd8c660cc68ebbbe (diff) |
rev 1.52
Show the port number (tty slot, pppoe session id etc) under
``show physical''.
From brian FreeBSD
-rw-r--r-- | usr.sbin/ppp/ppp/physical.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/usr.sbin/ppp/ppp/physical.c b/usr.sbin/ppp/ppp/physical.c index 045eb6a4000..7634c8fe980 100644 --- a/usr.sbin/ppp/ppp/physical.c +++ b/usr.sbin/ppp/ppp/physical.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: physical.c,v 1.38 2005/07/17 19:13:25 brad Exp $ + * $OpenBSD: physical.c,v 1.39 2005/07/17 20:08:55 brad Exp $ * */ @@ -444,16 +444,25 @@ physical_ShowStatus(struct cmdargs const *arg) struct physical *p = arg->cx->physical; struct cd *cd; const char *dev; - int n; + int n, slot; prompt_Printf(arg->prompt, "Name: %s\n", p->link.name); prompt_Printf(arg->prompt, " State: "); if (p->fd < 0) prompt_Printf(arg->prompt, "closed\n"); - else if (p->handler && p->handler->openinfo) - prompt_Printf(arg->prompt, "open (%s)\n", (*p->handler->openinfo)(p)); - else - prompt_Printf(arg->prompt, "open\n"); + else { + slot = physical_Slot(p); + if (p->handler && p->handler->openinfo) { + if (slot == -1) + prompt_Printf(arg->prompt, "open (%s)\n", (*p->handler->openinfo)(p)); + else + prompt_Printf(arg->prompt, "open (%s, port %d)\n", + (*p->handler->openinfo)(p), slot); + } else if (slot == -1) + prompt_Printf(arg->prompt, "open\n"); + else + prompt_Printf(arg->prompt, "open (port %d)\n", slot); + } prompt_Printf(arg->prompt, " Device: %s", *p->name.full ? p->name.full : |