diff options
author | Brian Somers <brian@FreeBSD.org> | 1999-05-15 02:24:18 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1999-05-15 02:24:18 +0000 |
commit | 4faec4307043d4c9f17808813ef594ef88c1904d (patch) | |
tree | 76375d1fe5204c43df924e2a4eee6d024a7b19bb /usr.sbin/ppp/link.c | |
parent | fca33042eda6578043c4e91d01428cb14f949789 (diff) | |
download | src-4faec4307043d4c9f17808813ef594ef88c1904d.tar.gz src-4faec4307043d4c9f17808813ef594ef88c1904d.zip |
Add ``show layers'' to see the protocol layering for a link.
Notes
Notes:
svn path=/head/; revision=47211
Diffstat (limited to 'usr.sbin/ppp/link.c')
-rw-r--r-- | usr.sbin/ppp/link.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.sbin/ppp/link.c b/usr.sbin/ppp/link.c index 42c5e0cdd6be..9cc1d51dc408 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; +} |