Hi,

I run all my sensors with transparent mode set to off, but sometimes
it is necessary to switch to transparent mode to capture on the
management interface for troubleshooting. I wrote a simple script to
do this for our help staff. Since I set my modprobe options for ring.o
in modprobe.conf I test this file to see if transparent_mode is 1 or
0. This however is not a very good test of whether or not the module
is actually in transparent mode or not. This status should probably be
noted in /proc/net/pf_ring/info.

Attached is a patch that adds this info to /proc/net/pf_ring/info.


Wally
--- kernel/net/ring/ring_packet.c.orig	2007-03-02 12:16:43.000000000 -0500
+++ kernel/net/ring/ring_packet.c	2007-03-02 12:12:51.000000000 -0500
@@ -295,14 +295,16 @@
 
   if(data == NULL) {
     /* /proc/net/pf_ring/info */
-    rlen = sprintf(buf,"Version       : %s\n", RING_VERSION);
-    rlen += sprintf(buf + rlen,"Bucket length : %d bytes\n", bucket_len);
-    rlen += sprintf(buf + rlen,"Ring slots    : %d\n", num_slots);
-    rlen += sprintf(buf + rlen,"Sample rate   : %d [1=no sampling]\n", sample_rate);
+    rlen = sprintf(buf,"Version             : %s\n", RING_VERSION);
+    rlen += sprintf(buf + rlen,"Bucket length       : %d bytes\n", bucket_len);
+    rlen += sprintf(buf + rlen,"Ring slots          : %d\n", num_slots);
+    rlen += sprintf(buf + rlen,"Sample rate         : %d [1=no sampling]\n", sample_rate);
 
-    rlen += sprintf(buf + rlen,"Capture TX    : %s\n",
+    rlen += sprintf(buf + rlen,"Capture TX          : %s\n",
 		    enable_tx_capture ? "Yes [RX+TX]" : "No [RX only]");
-    rlen += sprintf(buf + rlen,"Total rings   : %d\n", ring_table_size);
+    rlen += sprintf(buf + rlen,"Transparent mode    : %s\n", 
+		    transparent_mode ? "Yes" : "No");
+    rlen += sprintf(buf + rlen,"Total rings         : %d\n", ring_table_size);
   } else {
     /* detailed statistics about a PF_RING */
     pfr = (struct ring_opt*)data;
_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to