From: Paul Mackerras Date: Tue, 16 Mar 1999 22:54:43 +0000 (+0000) Subject: add data_name to struct protent X-Git-Tag: ppp-2.4.7~789 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=1e7bc3ea35208555bf233daacee9d85ded13f999 add data_name to struct protent call lcp_lowerdown when connection terminates --- diff --git a/pppd/cbcp.c b/pppd/cbcp.c index d2f4786..64472f5 100644 --- a/pppd/cbcp.c +++ b/pppd/cbcp.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: cbcp.c,v 1.5 1999/03/16 02:58:01 paulus Exp $"; +static char rcsid[] = "$Id: cbcp.c,v 1.6 1999/03/16 22:54:38 paulus Exp $"; #endif #include @@ -69,6 +69,7 @@ struct protent cbcp_protent = { NULL, 0, "CBCP", + NULL, cbcp_option_list, NULL, NULL, diff --git a/pppd/ccp.c b/pppd/ccp.c index 7c6b8c7..05cca76 100644 --- a/pppd/ccp.c +++ b/pppd/ccp.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: ccp.c,v 1.25 1999/03/16 03:15:12 paulus Exp $"; +static char rcsid[] = "$Id: ccp.c,v 1.26 1999/03/16 22:54:38 paulus Exp $"; #endif #include @@ -107,6 +107,7 @@ struct protent ccp_protent = { ccp_datainput, 1, "CCP", + "Compressed", ccp_option_list, NULL, NULL, diff --git a/pppd/chap.c b/pppd/chap.c index 27a60f2..b580d2c 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -34,7 +34,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: chap.c,v 1.19 1999/03/16 03:15:13 paulus Exp $"; +static char rcsid[] = "$Id: chap.c,v 1.20 1999/03/16 22:54:38 paulus Exp $"; #endif /* @@ -94,6 +94,7 @@ struct protent chap_protent = { NULL, 1, "CHAP", + NULL, chap_option_list, NULL, NULL, diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 813bdf3..a0956d9 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: ipcp.c,v 1.40 1999/03/16 04:00:53 paulus Exp $"; +static char rcsid[] = "$Id: ipcp.c,v 1.41 1999/03/16 22:54:38 paulus Exp $"; #endif /* @@ -183,6 +183,7 @@ struct protent ipcp_protent = { NULL, 1, "IPCP", + "IP", ipcp_option_list, ip_check_options, ip_demand_conf, diff --git a/pppd/ipxcp.c b/pppd/ipxcp.c index 49e20b4..9851e65 100644 --- a/pppd/ipxcp.c +++ b/pppd/ipxcp.c @@ -19,7 +19,7 @@ #ifdef IPX_CHANGE #ifndef lint -static char rcsid[] = "$Id: ipxcp.c,v 1.11 1999/03/16 04:00:53 paulus Exp $"; +static char rcsid[] = "$Id: ipxcp.c,v 1.12 1999/03/16 22:54:39 paulus Exp $"; #endif /* @@ -157,6 +157,7 @@ struct protent ipxcp_protent = { NULL, 0, "IPXCP", + "IPX", ipxcp_option_list, NULL, NULL, diff --git a/pppd/lcp.c b/pppd/lcp.c index 1e01de1..e1c017b 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: lcp.c,v 1.35 1999/03/16 02:47:00 paulus Exp $"; +static char rcsid[] = "$Id: lcp.c,v 1.36 1999/03/16 22:54:41 paulus Exp $"; #endif /* @@ -192,6 +192,7 @@ struct protent lcp_protent = { NULL, 1, "LCP", + NULL, lcp_option_list, NULL, NULL, diff --git a/pppd/main.c b/pppd/main.c index 3e7ea42..df043da 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: main.c,v 1.60 1999/03/16 03:14:50 paulus Exp $"; +static char rcsid[] = "$Id: main.c,v 1.61 1999/03/16 22:54:42 paulus Exp $"; #endif #include @@ -614,6 +614,8 @@ main(argc, argv) info("Serial link disconnected."); } } + if (!hungup) + lcp_lowerdown(0); fail: if (ttyfd >= 0) @@ -1389,7 +1391,6 @@ format_packet(p, len, printer, arg) { int i, n; u_short proto; - u_char x; struct protent *protp; if (len >= PPP_HDRLEN && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { @@ -1406,16 +1407,25 @@ format_packet(p, len, printer, arg) p += n; len -= n; } else { - printer(arg, "[proto=0x%x]", proto); + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == (protp->protocol & ~0x8000)) + break; + if (protp != 0 && protp->data_name != 0) { + printer(arg, "[%s data]", protp->data_name); + if (len > 8) + printer(arg, "%.8B ...", p); + else + printer(arg, "%.*B", len, p); + len = 0; + } else + printer(arg, "[proto=0x%x]", proto); } } - for (i = 0; i < len && i < 32; ++i) { - GETCHAR(x, p); - printer(arg, " %.2x", x); - } - if (i < len) - printer(arg, " ..."); + if (len > 32) + printer(arg, "%.32B ...", p); + else + printer(arg, "%.*B", len, p); } static void diff --git a/pppd/pppd.h b/pppd/pppd.h index 38b17c6..ff72ff2 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: pppd.h,v 1.30 1999/03/16 02:51:06 paulus Exp $ + * $Id: pppd.h,v 1.31 1999/03/16 22:54:43 paulus Exp $ */ /* @@ -212,6 +212,7 @@ struct protent { void (*datainput) __P((int unit, u_char *pkt, int len)); bool enabled_flag; /* 0 iff protocol is disabled */ char *name; /* Text name of protocol */ + char *data_name; /* Text name of corresponding data protocol */ option_t *options; /* List of command-line options */ /* Check requested options, assign defaults */ void (*check_options) __P((void)); diff --git a/pppd/upap.c b/pppd/upap.c index b59d130..0078adf 100644 --- a/pppd/upap.c +++ b/pppd/upap.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: upap.c,v 1.14 1999/03/16 03:15:15 paulus Exp $"; +static char rcsid[] = "$Id: upap.c,v 1.15 1999/03/16 22:54:43 paulus Exp $"; #endif /* @@ -72,6 +72,7 @@ struct protent pap_protent = { NULL, 1, "PAP", + NULL, pap_option_list, NULL, NULL,