tcp.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package netlink
  2. // TCP States
  3. const (
  4. TCP_ESTABLISHED = iota + 0x01
  5. TCP_SYN_SENT
  6. TCP_SYN_RECV
  7. TCP_FIN_WAIT1
  8. TCP_FIN_WAIT2
  9. TCP_TIME_WAIT
  10. TCP_CLOSE
  11. TCP_CLOSE_WAIT
  12. TCP_LAST_ACK
  13. TCP_LISTEN
  14. TCP_CLOSING
  15. TCP_NEW_SYN_REC
  16. TCP_MAX_STATES
  17. )
  18. type TCPInfo struct {
  19. State uint8
  20. Ca_state uint8
  21. Retransmits uint8
  22. Probes uint8
  23. Backoff uint8
  24. Options uint8
  25. Snd_wscale uint8 // no uint4
  26. Rcv_wscale uint8
  27. Delivery_rate_app_limited uint8
  28. Fastopen_client_fail uint8
  29. Rto uint32
  30. Ato uint32
  31. Snd_mss uint32
  32. Rcv_mss uint32
  33. Unacked uint32
  34. Sacked uint32
  35. Lost uint32
  36. Retrans uint32
  37. Fackets uint32
  38. Last_data_sent uint32
  39. Last_ack_sent uint32
  40. Last_data_recv uint32
  41. Last_ack_recv uint32
  42. Pmtu uint32
  43. Rcv_ssthresh uint32
  44. Rtt uint32
  45. Rttvar uint32
  46. Snd_ssthresh uint32
  47. Snd_cwnd uint32
  48. Advmss uint32
  49. Reordering uint32
  50. Rcv_rtt uint32
  51. Rcv_space uint32
  52. Total_retrans uint32
  53. Pacing_rate uint64
  54. Max_pacing_rate uint64
  55. Bytes_acked uint64 /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
  56. Bytes_received uint64 /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
  57. Segs_out uint32 /* RFC4898 tcpEStatsPerfSegsOut */
  58. Segs_in uint32 /* RFC4898 tcpEStatsPerfSegsIn */
  59. Notsent_bytes uint32
  60. Min_rtt uint32
  61. Data_segs_in uint32 /* RFC4898 tcpEStatsDataSegsIn */
  62. Data_segs_out uint32 /* RFC4898 tcpEStatsDataSegsOut */
  63. Delivery_rate uint64
  64. Busy_time uint64 /* Time (usec) busy sending data */
  65. Rwnd_limited uint64 /* Time (usec) limited by receive window */
  66. Sndbuf_limited uint64 /* Time (usec) limited by send buffer */
  67. Delivered uint32
  68. Delivered_ce uint32
  69. Bytes_sent uint64 /* RFC4898 tcpEStatsPerfHCDataOctetsOut */
  70. Bytes_retrans uint64 /* RFC4898 tcpEStatsPerfOctetsRetrans */
  71. Dsack_dups uint32 /* RFC4898 tcpEStatsStackDSACKDups */
  72. Reord_seen uint32 /* reordering events seen */
  73. Rcv_ooopack uint32 /* Out-of-order packets received */
  74. Snd_wnd uint32 /* peer's advertised receive window after * scaling (bytes) */
  75. }
  76. type TCPBBRInfo struct {
  77. BBRBW uint64
  78. BBRMinRTT uint32
  79. BBRPacingGain uint32
  80. BBRCwndGain uint32
  81. }