]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2001-02-16 08:23:09 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 16 Feb 2001 08:23:09 +0000 (08:23 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 16 Feb 2001 08:23:09 +0000 (08:23 +0000)
new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de>

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@81 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

README
parser.c
parser.h
processor.c
system.c

diff --git a/README b/README
index 255b17161b9cf4f749d5c71b43a76e7b0dd75dbf..07b135bd31eb3321408034359b3b7e5839c6a5c0 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 #
-# $Id: README,v 1.10 2000/11/28 16:46:11 reinelt Exp $
+# $Id: README,v 1.11 2001/02/16 08:23:09 reinelt Exp $
 #
 
 This is the README file for lcd4linux
@@ -171,6 +171,7 @@ Tokens:
   'io', ISDN bytes sent
   'it', ISDN bytes total (received+send)
   'im', ISDN bytes max (received, send)
+  'ic', ISDN connected (0=offline, 1=online)
   'ti', PPP bytes received
   'to', PPP bytes sent
   'tt', PPP bytes total (received+send)
index 35f1b700d443784e14b65fb3e4c3471f27989130..9bf856e0622b08399ce5c8d0202a7106588fbaf5 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1,4 +1,4 @@
-/* $Id: parser.c,v 1.8 2001/02/14 07:40:16 reinelt Exp $
+/* $Id: parser.c,v 1.9 2001/02/16 08:23:09 reinelt Exp $
  *
  * row definition parser
  *
  *
  *
  * $Log: parser.c,v $
+ * Revision 1.9  2001/02/16 08:23:09  reinelt
+ *
+ * new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de>
+ *
  * Revision 1.8  2001/02/14 07:40:16  reinelt
  *
  * first (incomplete) GPO implementation
@@ -129,6 +133,7 @@ static SYMTAB Symtab[] = {{ "%",  T_PERCENT,    C_GENERIC, 0 },
                          { "io", T_ISDN_OUT,   C_ISDN,    1 },
                          { "it", T_ISDN_TOTAL, C_ISDN,    1 },
                          { "im", T_ISDN_MAX,   C_ISDN,    1 },
+                         { "ic", T_ISDN_CONNECT, C_ISDN,    0 },
                          { "ti", T_PPP_RX,     C_PPP,     1 },
                          { "to", T_PPP_TX,     C_PPP,     1 },
                          { "tt", T_PPP_TOTAL,  C_PPP,     1 },
index fa6b4ac7499cd1b5d7e079a4769e45a8f1bc343b..8a0072c0c4bc9f897ce856a58fe4df3b0d5e4290 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -1,4 +1,4 @@
-/* $Id: parser.h,v 1.6 2001/02/14 07:40:16 reinelt Exp $
+/* $Id: parser.h,v 1.7 2001/02/16 08:23:09 reinelt Exp $
  *
  * row definition parser
  *
  *
  *
  * $Log: parser.h,v $
+ * Revision 1.7  2001/02/16 08:23:09  reinelt
+ *
+ * new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de>
+ *
  * Revision 1.6  2001/02/14 07:40:16  reinelt
  *
  * first (incomplete) GPO implementation
@@ -65,7 +69,7 @@ typedef enum {
   T_DISK_READ, T_DISK_WRITE, T_DISK_TOTAL, T_DISK_MAX,
   T_ETH_RX, T_ETH_TX, T_ETH_TOTAL, T_ETH_MAX,
   T_PPP_RX, T_PPP_TX, T_PPP_TOTAL, T_PPP_MAX,
-  T_ISDN_IN, T_ISDN_OUT, T_ISDN_TOTAL, T_ISDN_MAX,
+  T_ISDN_IN, T_ISDN_OUT, T_ISDN_TOTAL, T_ISDN_MAX, T_ISDN_CONNECT,
   T_SENSOR_1, T_SENSOR_2, T_SENSOR_3, T_SENSOR_4, T_SENSOR_5, 
   T_SENSOR_6, T_SENSOR_7, T_SENSOR_8, T_SENSOR_9
 } TOKEN;
index 50a3acf6061ab50c25f234fb78f5c3897f38757f..71bc9e8d54b9858bbc2627c7457e6f2f1d17d451 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: processor.c,v 1.11 2001/02/14 07:40:16 reinelt Exp $
+/* $Id: processor.c,v 1.12 2001/02/16 08:23:09 reinelt Exp $
  *
  * main data processing
  *
  *
  *
  * $Log: processor.c,v $
+ * Revision 1.12  2001/02/16 08:23:09  reinelt
+ *
+ * new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de>
+ *
  * Revision 1.11  2001/02/14 07:40:16  reinelt
  *
  * first (incomplete) GPO implementation
@@ -181,6 +185,8 @@ static double query (int token)
     return isdn.total;
   case T_ISDN_MAX:
     return isdn.max;
+  case T_ISDN_CONNECT:
+    return isdn.usage;
 
   case T_PPP_RX:
     return ppp.rx;
@@ -349,6 +355,12 @@ static void print_token (int token, char **p)
     else
       *p+=sprintf (*p, " ----");
     break;
+  case T_ISDN_CONNECT:
+    if (isdn.usage)
+      *p+=sprintf (*p, "*",);
+    else
+      *p+=sprintf (*p, " ");
+    break;
   default:
       *p+=sprintf (*p, "%5.0f", query(token));
   }
index 8a55d04b8d7bbffb3b429a5190dec3d327ce8992..ad24e5497108f59e208eeac816369354f99e74c5 100644 (file)
--- a/system.c
+++ b/system.c
@@ -1,4 +1,4 @@
-/* $Id: system.c,v 1.18 2000/11/17 10:36:23 reinelt Exp $
+/* $Id: system.c,v 1.19 2001/02/16 08:23:09 reinelt Exp $
  *
  * system status retreivement
  *
  *
  *
  * $Log: system.c,v $
+ * Revision 1.19  2001/02/16 08:23:09  reinelt
+ *
+ * new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de>
+ *
  * Revision 1.18  2000/11/17 10:36:23  reinelt
  *
  * fixed parsing of /proc/net/dev for 2.0 kernels
@@ -665,7 +669,9 @@ int PPP (int unit, int *rx, int *tx)
   static int fd=-2;
   struct ifpppstatsreq req;
   char buffer[16];
-  
+
+  static double junk=0;
+
   *rx=0;
   *tx=0;
 
@@ -689,9 +695,10 @@ int PPP (int unit, int *rx, int *tx)
   
   snprintf (buffer, sizeof(buffer), "ppp%d_rx", unit);
   *rx=smooth(buffer, 500, req.stats.p.ppp_ibytes);
-
   snprintf (buffer, sizeof(buffer), "ppp%d_tx", unit);
   *tx=smooth(buffer, 500, req.stats.p.ppp_obytes);
+  debug ("ppp_tx=%f smooth=%f", (double)(req.stats.p.ppp_obytes-junk), (double)*tx);
+  junk=req.stats.p.ppp_obytes;
 
   return 0;
 }