First of all, as for Gingerbread (and Linux kernel 2.6.35) /sys/class/net
is not a regular file, it's a directory with a bunch of links to directories to real devices' statistics. It's perfectly readable with any permissions. Use Android terminal emulator (AppMenu -> DevTools -> Terminal Emulator) to see how it looks like.
What it looks like. All files below /sys
belong to a special kernel subsystem, they're not real files, just interfaces for reading information from kernel. Monitoring means just reading dedicated files that contains counts of transmitted/received/dropped bytes/packets/etc.
E.g.
In the terminal emulator:
# ls -l /sys/class/net
lrwxrwxrwx root root 2012-03-15 16:49 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx root root 2012-03-15 16:49 eth0 -> ../../devices/platform/smc91x.0/net/eth0
lrwxrwxrwx root root 2012-03-15 16:49 tunl0 -> ../../devices/virtual/net/tunl0
lrwxrwxrwx root root 2012-03-15 16:49 gre0 -> ../../devices/virtual/net/gre0
# ls -l /sys/devices/platform/smc91x.0/net/eth0
### ... A lot of files
drwxr-xr-x root root 2012-03-15 16:47 statistics
### ...
# ls -l /sys/devices/platform/smc91x.0/net/eth0/statistics
-r--r--r-- root root 4096 2012-03-15 17:03 rx_packets
-r--r--r-- root root 4096 2012-03-15 17:03 tx_packets
-r--r--r-- root root 4096 2012-03-15 17:03 rx_bytes
-r--r--r-- root root 4096 2012-03-15 17:03 tx_bytes
-r--r--r-- root root 4096 2012-03-15 17:03 rx_errors
-r--r--r-- root root 4096 2012-03-15 17:03 tx_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_dropped
-r--r--r-- root root 4096 2012-03-15 17:03 tx_dropped
-r--r--r-- root root 4096 2012-03-15 17:03 multicast
-r--r--r-- root root 4096 2012-03-15 17:03 collisions
-r--r--r-- root root 4096 2012-03-15 17:03 rx_length_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_over_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_crc_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_frame_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_fifo_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_missed_errors
-r--r--r-- root root 4096 2012-03-15 17:03 tx_aborted_errors
-r--r--r-- root root 4096 2012-03-15 17:03 tx_carrier_errors
-r--r--r-- root root 4096 2012-03-15 17:03 tx_fifo_errors
-r--r--r-- root root 4096 2012-03-15 17:03 tx_heartbeat_errors
-r--r--r-- root root 4096 2012-03-15 17:03 tx_window_errors
-r--r--r-- root root 4096 2012-03-15 17:03 rx_compressed
-r--r--r-- root root 4096 2012-03-15 17:03 tx_compressed
# cat /sys/devices/platform/smc91x.0/net/eth0/statistics/rx_bytes
410236