diff options
author | brian <brian@FreeBSD.org> | 1999-05-15 02:24:18 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-05-15 02:24:18 +0000 |
commit | 891aeb93bc0c41a7c59adbdb8a76e5f24510c0e3 (patch) | |
tree | 4fba331e9b0905482ec96b0e860423a3a9947b4a /usr.sbin/ppp | |
parent | c0bdb16af0991ca8eae6bcf9edd0802e9507bf5a (diff) | |
download | FreeBSD-src-891aeb93bc0c41a7c59adbdb8a76e5f24510c0e3.zip FreeBSD-src-891aeb93bc0c41a7c59adbdb8a76e5f24510c0e3.tar.gz |
Add ``show layers'' to see the protocol layering for a link.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/command.c | 6 | ||||
-rw-r--r-- | usr.sbin/ppp/link.c | 18 | ||||
-rw-r--r-- | usr.sbin/ppp/link.h | 4 |
3 files changed, 24 insertions, 4 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 159b148..c6b8d20 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.192 1999/05/08 11:06:21 brian Exp $ + * $Id: command.c,v 1.193 1999/05/12 09:48:44 brian Exp $ * */ #include <sys/param.h> @@ -143,7 +143,7 @@ #define NEG_DNS 52 const char Version[] = "2.21"; -const char VersionDate[] = "$Date: 1999/05/08 11:06:21 $"; +const char VersionDate[] = "$Date: 1999/05/12 09:48:44 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -757,6 +757,8 @@ static struct cmdtab const ShowCommands[] = { "Interface status", "show iface"}, {"ipcp", NULL, ipcp_Show, LOCAL_AUTH, "IPCP status", "show ipcp"}, + {"layers", NULL, link_ShowLayers, LOCAL_AUTH | LOCAL_CX_OPT, + "Protocol layers", "show layers"}, {"lcp", NULL, lcp_ReportStatus, LOCAL_AUTH | LOCAL_CX, "LCP status", "show lcp"}, {"link", "datalink", datalink_Show, LOCAL_AUTH | LOCAL_CX, diff --git a/usr.sbin/ppp/link.c b/usr.sbin/ppp/link.c index 42c5e0c..9cc1d51 100644 --- a/usr.sbin/ppp/link.c +++ b/usr.sbin/ppp/link.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: link.c,v 1.9 1999/05/08 11:06:58 brian Exp $ + * $Id: link.c,v 1.10 1999/05/12 09:48:51 brian Exp $ * */ @@ -64,6 +64,7 @@ #include "pap.h" #include "chap.h" #include "cbcp.h" +#include "command.h" static void Despatch(struct bundle *, struct link *, struct mbuf *, u_short); @@ -339,3 +340,18 @@ Despatch(struct bundle *bundle, struct link *l, struct mbuf *bp, u_short proto) mbuf_Free(bp); } } + +int +link_ShowLayers(struct cmdargs const *arg) +{ + struct link *l = command_ChooseLink(arg); + int layer; + + for (layer = l->nlayers; layer; layer--) + prompt_Printf(arg->prompt, "%s%s", layer == l->nlayers ? "" : ", ", + l->layer[layer - 1]->name); + if (l->nlayers) + prompt_Printf(arg->prompt, "\n"); + + return 0; +} diff --git a/usr.sbin/ppp/link.h b/usr.sbin/ppp/link.h index 6225014..7c04083 100644 --- a/usr.sbin/ppp/link.h +++ b/usr.sbin/ppp/link.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: link.h,v 1.4 1998/08/25 17:48:42 brian Exp $ + * $Id: link.h,v 1.5 1999/05/08 11:07:00 brian Exp $ * */ @@ -36,6 +36,7 @@ struct bundle; struct prompt; +struct cmdargs; struct link { int type; /* _LINK type */ @@ -73,3 +74,4 @@ extern void link_EmptyStack(struct link *); #define PROTO_OUT 2 extern void link_ProtocolRecord(struct link *, u_short, int); extern void link_ReportProtocolStatus(struct link *, struct prompt *); +extern int link_ShowLayers(struct cmdargs const *); |