aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-05-15 02:24:18 +0000
committerBrian Somers <brian@FreeBSD.org>1999-05-15 02:24:18 +0000
commit4faec4307043d4c9f17808813ef594ef88c1904d (patch)
tree76375d1fe5204c43df924e2a4eee6d024a7b19bb
parentfca33042eda6578043c4e91d01428cb14f949789 (diff)
Notes
-rw-r--r--usr.sbin/ppp/command.c6
-rw-r--r--usr.sbin/ppp/link.c18
-rw-r--r--usr.sbin/ppp/link.h4
3 files changed, 24 insertions, 4 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 159b148ad3ed..c6b8d20168e1 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 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;
+}
diff --git a/usr.sbin/ppp/link.h b/usr.sbin/ppp/link.h
index 62250141aba6..7c040830a0b0 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 *);