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