Documentation ¶
Overview ¶
Package tcp provides TCP state constants and string coversions for those constants.
Index ¶
Constants ¶
const AllFlags = 0xFFF
AllFlags includes flag bits for all TCP connection states. It corresponds to TCPF_ALL in some linux code.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinuxTCPInfo ¶
type LinuxTCPInfo struct { State uint8 CAState uint8 Retransmits uint8 Probes uint8 Backoff uint8 Options uint8 WScale uint8 AppLimited uint8 RTO uint32 ATO uint32 SndMSS uint32 RcvMSS uint32 Unacked uint32 Sacked uint32 Lost uint32 Retrans uint32 Fackets uint32 /* Times. */ // These seem to be elapsed time, so they increase on almost every sample. // We can probably use them to get more info about intervals between samples. LastDataSent uint32 LastAckSent uint32 LastDataRecv uint32 LastAckRecv uint32 /* Metrics. */ PMTU uint32 RcvSsThresh uint32 RTT uint32 RTTVar uint32 SndSsThresh uint32 SndCwnd uint32 AdvMSS uint32 Reordering uint32 RcvRTT uint32 RcvSpace uint32 TotalRetrans uint32 PacingRate int64 MaxPacingRate int64 BytesAcked uint64 BytesReceived uint64 SegsOut uint32 SegsIn uint32 NotsentBytes uint32 MinRTT uint32 DataSegsIn uint32 DataSegsOut uint32 DeliveryRate uint64 BusyTime int64 RWndLimited int64 SndBufLimited int64 Delivered uint32 DeliveredCE uint32 BytesSent uint64 BytesRetrans uint64 DSackDups uint32 ReordSeen uint32 RcvOooPack uint32 SndWnd uint32 }
LinuxTCPInfo is the linux defined structure returned in RouteAttr DIAG_INFO messages. It corresponds to the struct tcp_info in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/tcp.h
type State ¶
type State int32
State is the enumeration of TCP states. https://datatracker.ietf.org/doc/draft-ietf-tcpm-rfc793bis/ and uapi/linux/tcp.h
const ( INVALID State = 0 ESTABLISHED State = 1 SYN_SENT State = 2 SYN_RECV State = 3 FIN_WAIT1 State = 4 FIN_WAIT2 State = 5 TIME_WAIT State = 6 CLOSE State = 7 CLOSE_WAIT State = 8 LAST_ACK State = 9 LISTEN State = 10 CLOSING State = 11 )
All of these constants' names make the linter complain, but we inherited these names from external C code, so we will keep them.