2

We can use "netstat -s" to query "segments retransmitted". But:

1) Where does the original data from? /proc? Looks like /proc/net/netstat includes other retransmit counters but no "segments retransmitted".

2) How do I get this programmatically by C?

Thanks!

lisa@ubuntuClient:~/logs# netstat -s | grep trans
    479025 segments retransmited
    TCPLostRetransmit: 4934
    252476 fast retransmits
    103 forward retransmits
    77435 retransmits in slow start
    668 SACK retransmits failed
    TCPRetransFail: 44
    TCPSynRetrans: 2250
Howard Shane
  • 926
  • 13
  • 28

1 Answers1

1

According to the netstat trace:

open("/proc/net/snmp", O_RDONLY)        = 3

These values come from /proc/net/snmp.

Regarding to how to access these values programmatically [in C or any other language], I think netstat can answer that question: read the file and parse its contents :).

Notes:

netstat v1.42, net-tools 1.60

pah
  • 4,700
  • 6
  • 28
  • 37