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