How can I detect changes in / proc / net / files?

I am looking forward to creating a network monitor by looking at the contents of the / proc / net folder. This is my special requirement so that I cannot spoof packets or something like that. My whole source is / proc / net. For example, I can get all active TCP connection data from / proc / net / tcp etc.

The content of these files keeps changing, so I want to read these files all the time, but also I only need to read when they change, that is, if there is no network connected, the contents of the file will not change and I will not 't' need to read them.

I searched for inotify but found no changes in / proc / net / files.

inotifywatch /proc/net/

      

Continuous polling, I think, will be ineffective. So look for an offer .. Thanks in advance.

+3


source to share


1 answer


0


source







All Articles