Hi there. I've been collecting network statistics from my OpenWrt router.
Right now, I was testing a script on my computer, where I would compare the TCP mem value (in kernel pages) in...
$ cat /proc/net/sockstat
sockets: used 1100
TCP: inuse 11 orphan 0 tw 1 alloc 13 mem 0
UDP: inuse 14 mem 60
UDPLITE: inuse 0
RAW: inuse 1
FRAG: inuse 0 memory 0
...with the tcp_mem maximum threshold in /proc/sys/net/ipv4/tcp_mem (the value to the right - in kernel pages):
$ cat /proc/sys/net/ipv4/tcp_mem
91971 122628 183942
and then report to my app when the TCP buffer is getting closer to the maximum.
However, there is no sockstat file in OpenWrt.
Can anyone suggest me another way to get the current TCP buffer utilization? I know about the rmem_max and wmem_max files in /proc/sys/net/core, but when I sum their value it does not equal the maximum value of tcp_mem, so I discarded that option.