4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
24 #pragma D depends_on library ip.d
25 #pragma D depends_on module kernel
26 #pragma D depends_on module siftr
27 #pragma D depends_on provider tcp
30 * Convert a SIFTR direction value to a string
32 #pragma D binding "1.12.1" SIFTR_IN
33 inline int SIFTR_IN = 0;
34 #pragma D binding "1.12.1" SIFTR_OUT
35 inline int SIFTR_OUT = 1;
37 /* SIFTR direction strings. */
38 #pragma D binding "1.12.1" siftr_dir_string
39 inline string siftr_dir_string[uint8_t direction] =
40 direction == SIFTR_IN ? "in" :
41 direction == SIFTR_OUT ? "out" :
44 typedef struct siftrinfo {
56 uint32_t snd_ssthresh;
65 u_int snd_buf_hiwater;
67 u_int rcv_buf_hiwater;
69 u_int sent_inflight_bytes;
75 #pragma D binding "1.12.1" translator
76 translator siftrinfo_t < struct pkt_node *p > {
77 direction = p == NULL ? 0 : p->direction;
78 ipver = p == NULL ? 0 : p->ipver;
79 lport = p == NULL ? 0 : ntohs(p->lport);
80 rport = p == NULL ? 0 : ntohs(p->fport);
81 laddr = p == NULL ? "<unknown>" :
82 p->ipver == INP_IPV4 ?
83 inet_ntoa(&p->laddr.id46_addr.ia46_addr4.s_addr) :
84 inet_ntoa6(&p->laddr.id6_addr);
85 raddr = p == NULL ? "<unknown>" :
86 p->ipver == INP_IPV4 ?
87 inet_ntoa(&p->faddr.id46_addr.ia46_addr4.s_addr) :
88 inet_ntoa6(&p->faddr.id6_addr);
89 snd_cwnd = p == NULL ? 0 : p->snd_cwnd;
90 snd_wnd = p == NULL ? 0 : p->snd_wnd;
91 rcv_wnd = p == NULL ? 0 : p->rcv_wnd;
92 t_flags2 = p == NULL ? 0 : p->t_flags2;
93 snd_ssthresh = p == NULL ? 0 : p->snd_ssthresh;
94 conn_state = p == NULL ? 0 : p->conn_state;
95 mss = p == NULL ? 0 : p->mss;
96 srtt = p == NULL ? 0 : p->srtt;
97 sack_enabled = p == NULL ? 0 : p->sack_enabled;
98 snd_scale = p == NULL ? 0 : p->snd_scale;
99 rcv_scale = p == NULL ? 0 : p->rcv_scale;
100 t_flags = p == NULL ? 0 : p->t_flags;
101 rto = p == NULL ? 0 : p->rto;
102 snd_buf_hiwater = p == NULL ? 0 : p->snd_buf_hiwater;
103 snd_buf_cc = p == NULL ? 0 : p->snd_buf_cc;
104 rcv_buf_hiwater = p == NULL ? 0 : p->rcv_buf_hiwater;
105 rcv_buf_cc = p == NULL ? 0 : p->rcv_buf_cc;
106 sent_inflight_bytes = p == NULL ? 0 : p->sent_inflight_bytes;
107 t_segqlen = p == NULL ? 0 : p->t_segqlen;
108 flowid = p == NULL ? 0 : p->flowid;
109 flowtype = p == NULL ? 0 : p->flowtype;