summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/link.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-05-15 02:24:18 +0000
committerbrian <brian@FreeBSD.org>1999-05-15 02:24:18 +0000
commit891aeb93bc0c41a7c59adbdb8a76e5f24510c0e3 (patch)
tree4fba331e9b0905482ec96b0e860423a3a9947b4a /usr.sbin/ppp/link.c
parentc0bdb16af0991ca8eae6bcf9edd0802e9507bf5a (diff)
downloadFreeBSD-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/link.c')
-rw-r--r--usr.sbin/ppp/link.c18
1 files changed, 17 insertions, 1 deletions
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;
+}
OpenPOWER on IntegriCloud