Print this page
3903 DTrace SCTP Provider


 128         int32_t tcps_rcv_ws;            /* receive window scaling */
 129         uint32_t tcps_cwnd;             /* congestion window */
 130         uint32_t tcps_cwnd_ssthresh;    /* threshold for congestion avoidance */
 131         uint32_t tcps_sack_fack;        /* SACK sequence # we have acked */
 132         uint32_t tcps_sack_snxt;        /* next SACK seq # for retransmission */
 133         uint32_t tcps_rto;              /* round-trip timeout, msec */
 134         uint32_t tcps_mss;              /* max segment size */
 135         int tcps_retransmit;            /* retransmit send event, boolean */
 136 } tcpsinfo_t;
 137 
 138 /*
 139  * tcplsinfo provides the old tcp state for state changes.
 140  */
 141 typedef struct tcplsinfo {
 142         int32_t tcps_state;             /* previous TCP state */
 143 } tcplsinfo_t;
 144 
 145 /*
 146  * __dtrace_tcp_tcph_t is used by the tcpinfo_t * translator to take either
 147  * the non-NULL tcph_t * passed in or, if it is NULL, uses arg3 (tcp_t *)
 148  * from the tcp:::send and tcp:::recieve probes and translates the tcp_t *
 149  * into the tcpinfo_t.  When no headers are available - as is the case for
 150  * TCP fusion tcp:::send and tcp:::receive - this allows us to present the
 151  * consumer with header data based on tcp_t * content and hide TCP fusion
 152  * implementation details.
 153  */
 154 typedef tcph_t * __dtrace_tcp_tcph_t;
 155 
 156 #pragma D binding "1.6.3" translator
 157 translator tcpinfo_t < tcph_t *T > {
 158         tcp_sport = ntohs(*(uint16_t *)T->th_lport);
 159         tcp_dport = ntohs(*(uint16_t *)T->th_fport);
 160         tcp_seq = ntohl(*(uint32_t *)T->th_seq);
 161         tcp_ack = ntohl(*(uint32_t *)T->th_ack);
 162         tcp_offset = (*(uint8_t *)T->th_offset_and_rsrvd & 0xf0) >> 2;
 163         tcp_flags = *(uint8_t *)T->th_flags;
 164         tcp_window = ntohs(*(uint16_t *)T->th_win);
 165         tcp_checksum = ntohs(*(uint16_t *)T->th_sum);
 166         tcp_urgent = ntohs(*(uint16_t *)T->th_urp);
 167         tcp_hdr = T;
 168 };




 128         int32_t tcps_rcv_ws;            /* receive window scaling */
 129         uint32_t tcps_cwnd;             /* congestion window */
 130         uint32_t tcps_cwnd_ssthresh;    /* threshold for congestion avoidance */
 131         uint32_t tcps_sack_fack;        /* SACK sequence # we have acked */
 132         uint32_t tcps_sack_snxt;        /* next SACK seq # for retransmission */
 133         uint32_t tcps_rto;              /* round-trip timeout, msec */
 134         uint32_t tcps_mss;              /* max segment size */
 135         int tcps_retransmit;            /* retransmit send event, boolean */
 136 } tcpsinfo_t;
 137 
 138 /*
 139  * tcplsinfo provides the old tcp state for state changes.
 140  */
 141 typedef struct tcplsinfo {
 142         int32_t tcps_state;             /* previous TCP state */
 143 } tcplsinfo_t;
 144 
 145 /*
 146  * __dtrace_tcp_tcph_t is used by the tcpinfo_t * translator to take either
 147  * the non-NULL tcph_t * passed in or, if it is NULL, uses arg3 (tcp_t *)
 148  * from the tcp:::send and tcp:::receive probes and translates the tcp_t *
 149  * into the tcpinfo_t.  When no headers are available - as is the case for
 150  * TCP fusion tcp:::send and tcp:::receive - this allows us to present the
 151  * consumer with header data based on tcp_t * content and hide TCP fusion
 152  * implementation details.
 153  */
 154 typedef tcph_t * __dtrace_tcp_tcph_t;
 155 
 156 #pragma D binding "1.6.3" translator
 157 translator tcpinfo_t < tcph_t *T > {
 158         tcp_sport = ntohs(*(uint16_t *)T->th_lport);
 159         tcp_dport = ntohs(*(uint16_t *)T->th_fport);
 160         tcp_seq = ntohl(*(uint32_t *)T->th_seq);
 161         tcp_ack = ntohl(*(uint32_t *)T->th_ack);
 162         tcp_offset = (*(uint8_t *)T->th_offset_and_rsrvd & 0xf0) >> 2;
 163         tcp_flags = *(uint8_t *)T->th_flags;
 164         tcp_window = ntohs(*(uint16_t *)T->th_win);
 165         tcp_checksum = ntohs(*(uint16_t *)T->th_sum);
 166         tcp_urgent = ntohs(*(uint16_t *)T->th_urp);
 167         tcp_hdr = T;
 168 };