]> git.ozlabs.org Git - ppp.git/commitdiff
add data_name to struct protent
authorPaul Mackerras <paulus@samba.org>
Tue, 16 Mar 1999 22:54:43 +0000 (22:54 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 16 Mar 1999 22:54:43 +0000 (22:54 +0000)
call lcp_lowerdown when connection terminates

pppd/cbcp.c
pppd/ccp.c
pppd/chap.c
pppd/ipcp.c
pppd/ipxcp.c
pppd/lcp.c
pppd/main.c
pppd/pppd.h
pppd/upap.c

index d2f4786737d5e7d1e9d7ea8328ad787b81c303a1..64472f5c29bf0d096e5c58a3c26ccc8c19857071 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #ifndef lint
  */
 
 #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 <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -69,6 +69,7 @@ struct protent cbcp_protent = {
     NULL,
     0,
     "CBCP",
     NULL,
     0,
     "CBCP",
+    NULL,
     cbcp_option_list,
     NULL,
     NULL,
     cbcp_option_list,
     NULL,
     NULL,
index 7c6b8c7824b14ac4f4e9fb38782ebbdbf50a994a..05cca767093158ca9b61d95360803ac3d92aa7fc 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
  */
 
 #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 <stdlib.h>
 #endif
 
 #include <stdlib.h>
@@ -107,6 +107,7 @@ struct protent ccp_protent = {
     ccp_datainput,
     1,
     "CCP",
     ccp_datainput,
     1,
     "CCP",
+    "Compressed",
     ccp_option_list,
     NULL,
     NULL,
     ccp_option_list,
     NULL,
     NULL,
index 27a60f21d058f76b5695d2e61f468737668ff4c5..b580d2cb40e1cc6ce82f40331cdc01e1b23f4c34 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 #ifndef lint
  */
 
 #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
 
 /*
 #endif
 
 /*
@@ -94,6 +94,7 @@ struct protent chap_protent = {
     NULL,
     1,
     "CHAP",
     NULL,
     1,
     "CHAP",
+    NULL,
     chap_option_list,
     NULL,
     NULL,
     chap_option_list,
     NULL,
     NULL,
index 813bdf3e4aa8502bb5c7b9a560eea201d602a522..a0956d9903884a52b5d352daa978d7d1062d3658 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #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
 
 /*
 #endif
 
 /*
@@ -183,6 +183,7 @@ struct protent ipcp_protent = {
     NULL,
     1,
     "IPCP",
     NULL,
     1,
     "IPCP",
+    "IP",
     ipcp_option_list,
     ip_check_options,
     ip_demand_conf,
     ipcp_option_list,
     ip_check_options,
     ip_demand_conf,
index 49e20b45c328f4bfed0194455ba69680304dd2bc..9851e65713df6c1ff595409ccccd817c497200d1 100644 (file)
@@ -19,7 +19,7 @@
 
 #ifdef IPX_CHANGE
 #ifndef lint
 
 #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
 
 /*
 #endif
 
 /*
@@ -157,6 +157,7 @@ struct protent ipxcp_protent = {
     NULL,
     0,
     "IPXCP",
     NULL,
     0,
     "IPXCP",
+    "IPX",
     ipxcp_option_list,
     NULL,
     NULL,
     ipxcp_option_list,
     NULL,
     NULL,
index 1e01de11dfccb1fda3e8ffd1f1741f6ad915851a..e1c017b30b4f8ee8f11a0fcd2cb534f458b8468d 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #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
 
 /*
 #endif
 
 /*
@@ -192,6 +192,7 @@ struct protent lcp_protent = {
     NULL,
     1,
     "LCP",
     NULL,
     1,
     "LCP",
+    NULL,
     lcp_option_list,
     NULL,
     NULL,
     lcp_option_list,
     NULL,
     NULL,
index 3e7ea420cc606a6b9fbee1f0b7d2dc019c156dee..df043dab3c2b172eab8bf7007a09be997da2f589 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #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 <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -614,6 +614,8 @@ main(argc, argv)
                info("Serial link disconnected.");
            }
        }
                info("Serial link disconnected.");
            }
        }
+       if (!hungup)
+           lcp_lowerdown(0);
 
     fail:
        if (ttyfd >= 0)
 
     fail:
        if (ttyfd >= 0)
@@ -1389,7 +1391,6 @@ format_packet(p, len, printer, arg)
 {
     int i, n;
     u_short proto;
 {
     int i, n;
     u_short proto;
-    u_char x;
     struct protent *protp;
 
     if (len >= PPP_HDRLEN && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) {
     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 {
            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
 }
 
 static void
index 38b17c60e844f8de75cdf9d6774a5e3861a31036..ff72ff20784d8451e12c957b3ee1ce280477c491 100644 (file)
@@ -16,7 +16,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * 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 */
     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));
     option_t *options;         /* List of command-line options */
     /* Check requested options, assign defaults */
     void (*check_options) __P((void));
index b59d13031ad9e6c7f0d5f224bfae23f6c586afb2..0078adfeec17d981f51a16bb3f5cdfada9e292da 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #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
 
 /*
 #endif
 
 /*
@@ -72,6 +72,7 @@ struct protent pap_protent = {
     NULL,
     1,
     "PAP",
     NULL,
     1,
     "PAP",
+    NULL,
     pap_option_list,
     NULL,
     NULL,
     pap_option_list,
     NULL,
     NULL,