tcpsinfo_t Structure

The tcpsinfo_t structure contains tcp state information.

typedef struct tcpsinfo {
        uintptr tcps_addr;
        int tcps_local;       /* is delivered locally, boolean */
        int tcps_active;       /* active open (from here), boolean */
        uint16_t tcps_lport;      /* local port */
        uint16_t tcps_rport;      /* remote port */
string tcps_laddr;		/* local address, as a string */
string tcps_raddr;		/* remote address, as a string */
int32_t tcps_state;/* TCP state. Use inline tcp_state_string[]to convert to string */
        uint32_t tcps_iss;     /* initial sequence # sent */
        uint32_t tcps_suna;     /* sequence # sent but unacked */
        uint32_t tcps_snxt;     /* next sequence # to send */
        uint32_t tcps_rack;     /* sequence # acked */
        uint32_t tcps_rnxt;     /* next sequence # expected */
        uint32_t tcps_swnd;     /* send window size */
        uint32_t tcps_snd_ws;   /* send window scaling */
        uint32_t tcps_rwnd;     /* receive window size */
        uint32_t tcps_rcv_ws;   /* receive window scaling */
	uint32_t tcps_cwnd;		/* congestion window */
	uint32_t tcps_cwnd_ssthresh;	/* threshold for congestion avoidance */
	uint32_t tcps_sack_fack;	/* SACK sequence # acked */
	uint32_t tcps_sack_snxt;	/* next SACK seq # for retransmission */
        uint32_t tcps_rto;              /* round-trip timeout, msec */
	uint32_t tcps_mss;		/* max segment size */
        int tcps_retransmit;            /* retransmit send event, boolean */
} tcpsinfo_t;

It may seem redundant to supply the local and remote ports and addresses here as well as in the tcpinfo_t below, but the tcp:::state-change probes do not have associated tcpinfo_t data, so in order to map the state change to a specific port, you require this data here.

Table 11-68 tcpsinfo_t Members

Member Description

tcps_addr

Address of translated tcp_t *.

tcps_local

Local, boolean. 0: is not delivered locally and uses a physical network interface, 1: is delivered locally including loopback interfaces, such as lo0.

tcps_active

Active open, boolean. 0: TCP connection was created from a remote host, 1: TCP connection was created from this host.

tcps_lport

Local port associated with the TCP connection.

tcps_rport

Remote port associated with the TCP connection.

tcps_laddr

Local address associated with the TCP connection, as a string.

tcps_raddr

Remote address associated with the TCP connection, as a string.

tcps_state

The following states are available for a tcps_state member:

  • TCP_STATE_CLOSED

  • TCP_STATE_IDLE

  • TCP_STATE_BOUND

  • TCP_STATE_LISTEN

  • TCP_STATE_SYN_SENT

  • TCP_STATE_SYN_RECEIVED

  • TCP_STATE_ESTABLISHED

  • TCP_STATE_CLOSE_WAIT

  • TCP_STATE_FIN_WAIT_1

  • TCP_STATE_CLOSING

  • TCP_STATE_LAST_ACK

  • TCP_STATE_FIN_WAIT_2

  • TCP_STATE_TIME_WAIT

Use inline tcp_state_string[] to convert state to a string.

tcps_iss

Initial sequence number sent.

tcps_suna

Lowest sequence number for which you have sent data but not received acknowledgement.

tcps_snxt

Next sequence number to send. tcps_snxt - tcps_suna gives the number of bytes pending acknowledgement for the TCP connection.

tcps_rack

Highest sequence number for which you have received and sent acknowledgement.

tcps_rnxt

Next sequence number expected on receive side. tcps_rnxt - tcps_rack gives the number of bytes you have received but not yet acknowledged for the TCP connection.

tcps_swnd

TCP send window size.

tcps_snd_ws

TCP send window scale. tcps_swnd << tcp_snd_ws gives the scaled window size if window scaling options are in use.

tcps_rwnd

TCP receive window size.

tcps_rcv_ws

TCP receive window scale. tcps_rwnd << tcp_rcv_ws gives the scaled window size if window scaling options are in use.

tcps_cwnd

TCP congestion window size. tcps_cwnd_ssthresh TCP congestion window threshold. When the congestion window is greater than ssthresh, congestion avoidance begins.

tcps_cwnd_ssthresh

TCP congestion window threshold. When the congestion window is greater than ssthresh, congestion avoidance begins.

tcps_sack_fack

Highest SACK-acked sequence number.

tcps_sack_snxt

Next sequence num to be retransmitted using SACK.

tcps_rto

Round-trip timeout. If you do not receive acknowledgement of data sent tcps_rto msec ago, retransmit is required.

tcps_mss

Maximum segment size.

tcps_retransmit

Send is a retransmit, boolean. 1 for tcp:::send events that are retransmissions, 0 for tcp events that are not send events, and for send events that are not retransmissions.