xref: /titanic_51/usr/src/lib/libdtrace/common/iscsit.d (revision be6802e44a2dc59129ccfb75410526d5c1d023ee)
1a668b114SPriya Krishnan /*
2a668b114SPriya Krishnan  * CDDL HEADER START
3a668b114SPriya Krishnan  *
4a668b114SPriya Krishnan  * The contents of this file are subject to the terms of the
5a668b114SPriya Krishnan  * Common Development and Distribution License (the "License").
6a668b114SPriya Krishnan  * You may not use this file except in compliance with the License.
7a668b114SPriya Krishnan  *
8a668b114SPriya Krishnan  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a668b114SPriya Krishnan  * or http://www.opensolaris.org/os/licensing.
10a668b114SPriya Krishnan  * See the License for the specific language governing permissions
11a668b114SPriya Krishnan  * and limitations under the License.
12a668b114SPriya Krishnan  *
13a668b114SPriya Krishnan  * When distributing Covered Code, include this CDDL HEADER in each
14a668b114SPriya Krishnan  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15a668b114SPriya Krishnan  * If applicable, add the following below this CDDL HEADER, with the
16a668b114SPriya Krishnan  * fields enclosed by brackets "[]" replaced with your own identifying
17a668b114SPriya Krishnan  * information: Portions Copyright [yyyy] [name of copyright owner]
18a668b114SPriya Krishnan  *
19a668b114SPriya Krishnan  * CDDL HEADER END
20a668b114SPriya Krishnan  */
21a668b114SPriya Krishnan 
22a668b114SPriya Krishnan /*
23a668b114SPriya Krishnan  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24a668b114SPriya Krishnan  * Use is subject to license terms.
25a668b114SPriya Krishnan  */
26a668b114SPriya Krishnan 
27a668b114SPriya Krishnan #pragma D depends_on library ip.d
28a668b114SPriya Krishnan #pragma D depends_on library net.d	/* conninfo_t */
29*be6802e4SPriya Krishnan #pragma D depends_on library scsi.d	/* scsicmd_t and iscsiinfo_t */
30a668b114SPriya Krishnan #pragma D depends_on module genunix
31a668b114SPriya Krishnan #pragma D depends_on module iscsit
32a668b114SPriya Krishnan #pragma D depends_on module idm
33a668b114SPriya Krishnan 
34a668b114SPriya Krishnan #pragma D binding "1.5" translator
35a668b114SPriya Krishnan translator conninfo_t < idm_conn_t *P > {
36a668b114SPriya Krishnan 	ci_local = (P->ic_laddr.ss_family == AF_INET) ?
37a668b114SPriya Krishnan 	    inet_ntoa((ipaddr_t *)
38a668b114SPriya Krishnan 	    &((struct sockaddr_in *)&P->ic_laddr)->sin_addr) :
39a668b114SPriya Krishnan 	    inet_ntoa6(&((struct sockaddr_in6 *)&P->ic_laddr)->sin6_addr);
40a668b114SPriya Krishnan 
41a668b114SPriya Krishnan 	ci_remote = (P->ic_raddr.ss_family == AF_INET) ?
42a668b114SPriya Krishnan 	    inet_ntoa((ipaddr_t *)
43a668b114SPriya Krishnan 	    &((struct sockaddr_in *)&P->ic_raddr)->sin_addr) :
44a668b114SPriya Krishnan 	    inet_ntoa6(&((struct sockaddr_in6 *)&P->ic_raddr)->sin6_addr);
45a668b114SPriya Krishnan 
46a668b114SPriya Krishnan 	ci_protocol = (P->ic_laddr.ss_family == AF_INET) ? "ipv4" : "ipv6";
47a668b114SPriya Krishnan };
48a668b114SPriya Krishnan 
49a668b114SPriya Krishnan #pragma D binding "1.5" translator
50a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_async_evt_hdr_t *P > {
51a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
52a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
53a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
54a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
55a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
56a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
57a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
58a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
59a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
60a668b114SPriya Krishnan             ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
61a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
62a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
63a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
64a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
65a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
66a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
67a668b114SPriya Krishnan 	ii_itt = 0;
68a668b114SPriya Krishnan 	ii_ttt = 0;
69a668b114SPriya Krishnan 	ii_cmdsn = 0;
70a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
71a668b114SPriya Krishnan 	ii_datasn = 0;
72a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
73a668b114SPriya Krishnan 	ii_flags = P->flags;
74a668b114SPriya Krishnan };
75a668b114SPriya Krishnan 
76a668b114SPriya Krishnan #pragma D binding "1.5" translator
77a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_login_hdr_t *P > {
78a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
79a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
80a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
81a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
82a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
83a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
84a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
85a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
86a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
87a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
88a668b114SPriya Krishnan 	ii_ttt = 0xffffffff;
89a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->cmdsn);
90a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
91a668b114SPriya Krishnan 	ii_datasn = 0;
92a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
93a668b114SPriya Krishnan 	ii_flags = P->flags;
94a668b114SPriya Krishnan };
95a668b114SPriya Krishnan 
96a668b114SPriya Krishnan #pragma D binding "1.5" translator
97a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_login_rsp_hdr_t *P > {
98a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
99a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
100a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
101a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
102a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
103a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
104a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
105a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
106a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
107a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
108a668b114SPriya Krishnan 	ii_ttt = 0xffffffff;
109a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
110a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
111a668b114SPriya Krishnan 	ii_datasn = 0;
112a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
113a668b114SPriya Krishnan 	ii_flags = P->flags;
114a668b114SPriya Krishnan };
115a668b114SPriya Krishnan 
116a668b114SPriya Krishnan #pragma D binding "1.5" translator
117a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_logout_hdr_t *P > {
118a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
119a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
120a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
121a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
122a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
123a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
124a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
125a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
126a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
127a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
128a668b114SPriya Krishnan 	ii_ttt = 0xffffffff;
129a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->cmdsn);
130a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
131a668b114SPriya Krishnan 	ii_datasn = 0;
132a668b114SPriya Krishnan 	ii_datalen = 0;
133a668b114SPriya Krishnan 	ii_flags = P->flags;
134a668b114SPriya Krishnan };
135a668b114SPriya Krishnan 
136a668b114SPriya Krishnan #pragma D binding "1.5" translator
137a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_logout_rsp_hdr_t *P > {
138a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
139a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
140a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
141a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
142a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
143a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
144a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
145a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
146a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
147a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
148a668b114SPriya Krishnan 	ii_ttt = 0xffffffff;
149a668b114SPriya Krishnan 	ii_cmdsn = 0;
150a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
151a668b114SPriya Krishnan 	ii_datasn = 0;
152a668b114SPriya Krishnan 	ii_datalen = 0;
153a668b114SPriya Krishnan 	ii_flags = P->flags;
154a668b114SPriya Krishnan };
155a668b114SPriya Krishnan 
156a668b114SPriya Krishnan #pragma D binding "1.5" translator
157a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_rtt_hdr_t *P > {
158a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
159a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
160a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
161a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
162a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
163a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
164a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
165a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
166a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
167a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
168a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
169a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
170a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
171a668b114SPriya Krishnan 	ii_datasn = ntohl(P->rttsn);
172a668b114SPriya Krishnan 	ii_datalen = 0;
173a668b114SPriya Krishnan 	ii_flags = P->flags;
174a668b114SPriya Krishnan };
175a668b114SPriya Krishnan 
176a668b114SPriya Krishnan #pragma D binding "1.5" translator
177a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_data_rsp_hdr_t *P > {
178a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
179a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
180a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
181a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
182a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
183a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
184a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
185a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
186a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
187a668b114SPriya Krishnan 	    ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
188a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
189a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
190a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
191a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
192a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
193a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
194a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
195a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
196a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
197a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
198a668b114SPriya Krishnan 	ii_datasn = ntohl(P->datasn);
199a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
200a668b114SPriya Krishnan 	ii_flags = P->flags;
201a668b114SPriya Krishnan };
202a668b114SPriya Krishnan 
203a668b114SPriya Krishnan #pragma D binding "1.5" translator
204a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_data_hdr_t *P > {
205a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
206a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
207a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
208a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
209a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
210a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
211a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
212a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
213a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
214a668b114SPriya Krishnan             ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
215a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
216a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
217a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
218a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
219a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
220a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
221a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
222a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
223a668b114SPriya Krishnan 	ii_cmdsn = 0;
224a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
225a668b114SPriya Krishnan 	ii_datasn = ntohl(P->datasn);
226a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
227a668b114SPriya Krishnan 	ii_flags = P->flags;
228a668b114SPriya Krishnan };
229a668b114SPriya Krishnan 
230a668b114SPriya Krishnan #pragma D binding "1.5" translator
231a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_nop_in_hdr_t *P > {
232a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
233a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
234a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
235a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
236a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
237a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
238a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
239a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
240a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
241a668b114SPriya Krishnan             ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
242a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
243a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
244a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
245a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
246a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
247a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
248a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
249a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
250a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
251a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
252a668b114SPriya Krishnan 	ii_datasn = 0;
253a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
254a668b114SPriya Krishnan 	ii_flags = P->flags;
255a668b114SPriya Krishnan };
256a668b114SPriya Krishnan 
257a668b114SPriya Krishnan #pragma D binding "1.5" translator
258a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_nop_out_hdr_t *P > {
259a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
260a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
261a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
262a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
263a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
264a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
265a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
266a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
267a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
268a668b114SPriya Krishnan             ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
269a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
270a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
271a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
272a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
273a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
274a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
275a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
276a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
277a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->cmdsn);
278a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
279a668b114SPriya Krishnan 	ii_datasn = 0;
280a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
281a668b114SPriya Krishnan 	ii_flags = P->flags;
282a668b114SPriya Krishnan };
283a668b114SPriya Krishnan 
284a668b114SPriya Krishnan #pragma D binding "1.5" translator
285a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_scsi_cmd_hdr_t *P > {
286a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
287a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
288a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
289a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
290a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
291a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
292a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
293a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
294a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
295a668b114SPriya Krishnan             ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
296a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
297a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
298a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
299a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
300a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
301a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
302a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
303a668b114SPriya Krishnan 	ii_ttt = 0xffffffff;
304a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->cmdsn);
305a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
306a668b114SPriya Krishnan 	ii_datasn = 0;
307a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
308a668b114SPriya Krishnan 	ii_flags = P->flags;
309a668b114SPriya Krishnan };
310a668b114SPriya Krishnan 
311a668b114SPriya Krishnan #pragma D binding "1.5" translator
312a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_scsi_rsp_hdr_t *P > {
313a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
314a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
315a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
316a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
317a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
318a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
319a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
320a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
321a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
322a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
323a668b114SPriya Krishnan 	ii_ttt = 0xffffffff;
324a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
325a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
326a668b114SPriya Krishnan 	ii_datasn = ntohl(P->expdatasn);
327a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
328a668b114SPriya Krishnan 	ii_flags = P->flags;
329a668b114SPriya Krishnan };
330a668b114SPriya Krishnan 
331a668b114SPriya Krishnan #pragma D binding "1.5" translator
332a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_scsi_task_mgt_hdr_t *P > {
333a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
334a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
335a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
336a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
337a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
338a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
339a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
340a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
341a668b114SPriya Krishnan 	ii_lun = (((uint64_t)P->lun[0] << (64 - 0*8 - 8)) +
342a668b114SPriya Krishnan             ((uint64_t)P->lun[1] << (64 - 1*8 - 8)) +
343a668b114SPriya Krishnan             ((uint64_t)P->lun[2] << (64 - 2*8 - 8)) +
344a668b114SPriya Krishnan             ((uint64_t)P->lun[3] << (64 - 3*8 - 8)) +
345a668b114SPriya Krishnan             ((uint64_t)P->lun[4] << (64 - 4*8 - 8)) +
346a668b114SPriya Krishnan             ((uint64_t)P->lun[5] << (64 - 5*8 - 8)) +
347a668b114SPriya Krishnan             ((uint64_t)P->lun[6] << (64 - 6*8 - 8)) +
348a668b114SPriya Krishnan             ((uint64_t)P->lun[7] << (64 - 7*8 - 8)));
349a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
350a668b114SPriya Krishnan 	ii_ttt = ntohl(P->rtt);
351a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->cmdsn);
352a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
353a668b114SPriya Krishnan 	ii_datasn = 0;
354a668b114SPriya Krishnan 	ii_datalen = 0;
355a668b114SPriya Krishnan 	ii_flags = 0;
356a668b114SPriya Krishnan };
357a668b114SPriya Krishnan 
358a668b114SPriya Krishnan #pragma D binding "1.5" translator
359a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_scsi_task_mgt_rsp_hdr_t *P > {
360a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
361a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
362a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
363a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
364a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
365a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
366a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
367a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
368a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
369a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
370a668b114SPriya Krishnan 	ii_ttt = ntohl(P->rtt);
371a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
372a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
373a668b114SPriya Krishnan 	ii_datasn = 0;
374a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
375a668b114SPriya Krishnan 	ii_flags = P->flags;
376a668b114SPriya Krishnan };
377a668b114SPriya Krishnan 
378a668b114SPriya Krishnan #pragma D binding "1.5" translator
379a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_text_hdr_t *P > {
380a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
381a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
382a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
383a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
384a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
385a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
386a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
387a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
388a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
389a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
390a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
391a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->cmdsn);
392a668b114SPriya Krishnan 	ii_statsn = ntohl(P->expstatsn);
393a668b114SPriya Krishnan 	ii_datasn = 0;
394a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
395a668b114SPriya Krishnan 	ii_flags = P->flags;
396a668b114SPriya Krishnan };
397a668b114SPriya Krishnan 
398a668b114SPriya Krishnan #pragma D binding "1.5" translator
399a668b114SPriya Krishnan translator iscsiinfo_t < iscsi_text_rsp_hdr_t *P > {
400a668b114SPriya Krishnan 	ii_initiator = ((idm_conn_t *)arg0)->ic_initiator_name;
401a668b114SPriya Krishnan 	ii_target = ((idm_conn_t *)arg0)->ic_target_name;
402a668b114SPriya Krishnan 	ii_isid = ((idm_conn_t *)arg0)->ic_isid;
403a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
404a668b114SPriya Krishnan 	ii_transport = (((idm_conn_t *)arg0)->ic_transport_type ==
405a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
406a668b114SPriya Krishnan 	    (((idm_conn_t *)arg0)->ic_transport_type ==
407a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
408a668b114SPriya Krishnan 	ii_lun = 0; /* NA */
409a668b114SPriya Krishnan 	ii_itt = ntohl(P->itt);
410a668b114SPriya Krishnan 	ii_ttt = ntohl(P->ttt);
411a668b114SPriya Krishnan 	ii_cmdsn = ntohl(P->expcmdsn);
412a668b114SPriya Krishnan 	ii_statsn = ntohl(P->statsn);
413a668b114SPriya Krishnan 	ii_datasn = 0;
414a668b114SPriya Krishnan 	ii_datalen = P->dlength[0] << 16 | P->dlength[1] << 8 | P->dlength[2];
415a668b114SPriya Krishnan 	ii_flags = P->flags;
416a668b114SPriya Krishnan };
417a668b114SPriya Krishnan 
418a668b114SPriya Krishnan #pragma D binding "1.5" translator
419a668b114SPriya Krishnan translator iscsiinfo_t < idm_conn_t *P > {
420a668b114SPriya Krishnan 	ii_initiator = P->ic_initiator_name;
421a668b114SPriya Krishnan 	ii_target = P->ic_target_name;
422a668b114SPriya Krishnan 	ii_isid = P->ic_isid;
423a668b114SPriya Krishnan 	ii_tsih = ((idm_conn_t *)arg0)->ic_tsih;
424a668b114SPriya Krishnan 	ii_transport = (P->ic_transport_type ==
425a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_ISER) ? "iser-ib" :
426a668b114SPriya Krishnan 	    (P->ic_transport_type ==
427a668b114SPriya Krishnan 	    IDM_TRANSPORT_TYPE_SOCKETS) ? "sockets" : "Unknown";
428a668b114SPriya Krishnan 	ii_lun = 0;
429a668b114SPriya Krishnan 	ii_itt = 0;
430a668b114SPriya Krishnan 	ii_ttt = 0;
431a668b114SPriya Krishnan 	ii_cmdsn = 0;
432a668b114SPriya Krishnan 	ii_statsn = 0;
433a668b114SPriya Krishnan 	ii_datasn = 0;
434a668b114SPriya Krishnan 	ii_datalen = 0;
435a668b114SPriya Krishnan 	ii_flags = 0;
436a668b114SPriya Krishnan };
437a668b114SPriya Krishnan 
438a668b114SPriya Krishnan #pragma D binding "1.5" translator
439a668b114SPriya Krishnan translator xferinfo_t < uintptr_t P > {
440a668b114SPriya Krishnan 	xfer_laddr = (arg1 == NULL) ? 0xffffffff : (uintptr_t)arg1;
441a668b114SPriya Krishnan 	xfer_loffset = arg2;
442a668b114SPriya Krishnan 	xfer_lkey = 0; /* not used */
443a668b114SPriya Krishnan 	xfer_len = arg6;
444a668b114SPriya Krishnan 	xfer_raddr = arg3;
445a668b114SPriya Krishnan 	xfer_roffset = arg4;
446a668b114SPriya Krishnan 	xfer_rkey = arg5;
447a668b114SPriya Krishnan 	xfer_type = arg7;
448a668b114SPriya Krishnan };
449a668b114SPriya Krishnan 
450a668b114SPriya Krishnan inline int IDM_TRANSPORT_TYPE_ISER = 0;
451a668b114SPriya Krishnan #pragma D binding "1.5" IDM_TRANSPORT_TYPE_ISER
452a668b114SPriya Krishnan inline int IDM_TRANSPORT_TYPE_SOCKETS = 1;
453a668b114SPriya Krishnan #pragma D binding "1.5" IDM_TRANSPORT_TYPE_SOCKETS
454a668b114SPriya Krishnan 
455