I just poked around at an older bug report, and realized that since the
great -M patch, I've been losing almost all my traffic in the IP Traffic/IP
Protos tabs.  So I hacked a bit of code together to create a "Remote" report
in the IP Protos | Distribution report.

Poof, that's where the traffic is going.

Before I spend too much resources chasing things, can somebody patch their
(fairly current) version of Ntop and confirm this for me?

Thanks!

-----Burton

--- ../ntop-current-starting/report.c   Thu Feb  7 09:24:19 2002
+++ report.c    Thu Feb  7 17:00:40 2002
@@ -2246,10 +2250,65 @@
        printTableEntry(buf, sizeof(buf),
"Other TCP/UDP-based Prot.",
                        COLOR_1, remainingTraffic, percentage);
       }

       sendString("</TABLE>"TABLE_OFF"<P>\n");
+
+      sendString("</CENTER>\n");
+    }
+
+    /* ********************************************************** */
+
+    printSectionTitle("Remote Traffic");
+
+    total =
(float)(myGlobals.device[actualReportDeviceId].tcpGlobalTrafficStats.remote+
+
myGlobals.device[actualReportDeviceId].udpGlobalTrafficStats.remote)/1024;
+    if(total == 0)
+      printNoDataYet();
+    else {
+      sendString(""TABLE_ON"<TABLE BORDER=1 WIDTH=\"100%%\"><TR>"
+                 "<TH "TH_BG" WIDTH=150>IP&nbsp;Protocol</TH>"
+                 "<TH "TH_BG" WIDTH=100>Data</TH><TH "TH_BG" WIDTH=250>"
+                 "Percentage</TH></TR>\n");
+      if(total == 0) total = 1; /* Avoids divisions by zero */
+      remainingTraffic = 0;
+
+      partialTotal =
(float)myGlobals.device[actualReportDeviceId].tcpGlobalTrafficStats.remote/1
024;
+      percentage = ((float)(partialTotal*100))/((float)total);
+      printTableEntryPercentage(buf, sizeof(buf), "TCP&nbsp;vs.&nbsp;UDP",
+                                "TCP", "UDP", total, percentage);
+
+      sendString("</TABLE>"TABLE_OFF"\n");
+      sendString(""TABLE_ON"<TABLE BORDER=1 WIDTH=\"100%%\"><TR>"
+                  "<TH "TH_BG" WIDTH=150>TCP/UDP&nbsp;Protocol</TH>"
+                 "<TH "TH_BG" WIDTH=100>Data</TH><TH "TH_BG" WIDTH=250>"
+                 "Percentage</TH></TR>\n");
+
+      for(i=0; i<myGlobals.numIpProtosToMonitor; i++) {
+        partialTotal =
(float)myGlobals.device[actualReportDeviceId].ipProtoStats[i].remote/1024;
+
+        if(partialTotal > 0) {
+          remainingTraffic += partialTotal;
+          percentage = ((float)(partialTotal*100))/((float)total);
+          printTableEntry(buf, sizeof(buf),
myGlobals.protoIPTrafficInfos[i],
+                          COLOR_1, partialTotal, percentage);
+        }
+      }
+
+      if(total > remainingTraffic)
+        remainingTraffic = total - remainingTraffic;
+      else
+        remainingTraffic = 0;
+
+      if(remainingTraffic > 0) {
+        percentage = ((float)(remainingTraffic*100))/((float)total);
+        printTableEntry(buf, sizeof(buf),
"Other&nbsp;TCP/UDP-based&nbsp;Prot.",
+                        COLOR_1, remainingTraffic, percentage);
+      }
+
+      sendString("</TABLE>"TABLE_OFF"<P>\n");
+
       sendString("</CENTER>\n");
     }

     /* ********************************************************** */


_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listmanager.unipi.it/mailman/listinfo/ntop-dev

Reply via email to