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