Coverage Report

Created: 2025-02-15 06:25

/src/wireshark/epan/dissectors/packet-qnet6.c
Line
Count
Source (jump to first uncovered line)
1
/* packet-qnet6.c Routines for qnet6 LwL4 dissection Copyright 2009,
2
 * dragonlinux <dragonlinux@gmail.com>
3
 *
4
 * Wireshark - Network traffic analyzer
5
 * By Gerald Combs <gerald@wireshark.org>
6
 * Copyright 1998 Gerald Combs
7
 *
8
 * SPDX-License-Identifier: GPL-2.0-or-later
9
 */
10
11
#include "config.h"
12
13
#include <epan/packet.h>
14
#include <epan/prefs.h>
15
#include <epan/to_str.h>
16
17
#include <epan/etypes.h>
18
#include <epan/crc32-tvb.h>
19
#include <epan/tfs.h>
20
#include <wsutil/array.h>
21
#include <wsutil/crc32.h>
22
#include <epan/ipproto.h>
23
24
void proto_reg_handoff_qnet6(void);
25
void proto_register_qnet6(void);
26
27
static dissector_handle_t qnet6_handle;
28
29
static int proto_qnet6_l4;
30
static int proto_qnet6_qos;
31
static int proto_qnet6_lr;
32
static int proto_qnet6_kif;
33
static int proto_qnet6_nr;
34
35
static int hf_qnet6_l4_padding;
36
static int hf_qnet6_l4_ver;
37
static int hf_qnet6_l4_type;
38
static int hf_qnet6_l4_flags;
39
static int hf_qnet6_l4_flags_first;
40
static int hf_qnet6_l4_flags_last;
41
static int hf_qnet6_l4_flags_crc;
42
static int hf_qnet6_l4_qos_info;
43
static int hf_qnet6_l4_qos_src_nd_for_dst;
44
static int hf_qnet6_l4_qos_dst_nd_for_src;
45
static int hf_qnet6_l4_qos_src_conn_id;
46
static int hf_qnet6_l4_qos_dst_conn_id;
47
static int hf_qnet6_l4_qos_src_seq_num;
48
static int hf_qnet6_l4_qos_qos_type;
49
static int hf_qnet6_l4_qos_src_qos_idx;
50
static int hf_qnet6_l4_layer;
51
static int hf_qnet6_l4_offset;
52
static int hf_qnet6_l4_length;
53
static int hf_qnet6_l4_crc;
54
55
static int hf_qnet6_qos_tcs_src_name_off;
56
static int hf_qnet6_qos_tcs_src_name_generated;
57
static int hf_qnet6_qos_tcs_src_domain_off;
58
static int hf_qnet6_qos_tcs_src_domain_generated;
59
static int hf_qnet6_qos_tcs_dst_name_off;
60
static int hf_qnet6_qos_tcs_dst_name_generated;
61
static int hf_qnet6_qos_tcs_dst_domain_off;
62
static int hf_qnet6_qos_tcs_dst_domain_generated;
63
64
static int hf_qnet6_lr_ver;
65
static int hf_qnet6_lr_type;
66
static int hf_qnet6_lr_total_len;
67
static int hf_qnet6_lr_src;
68
static int hf_qnet6_lr_src_name_off;
69
static int hf_qnet6_lr_src_name_len;
70
static int hf_qnet6_lr_src_name_generated;
71
static int hf_qnet6_lr_src_domain_off;
72
static int hf_qnet6_lr_src_domain_len;
73
static int hf_qnet6_lr_src_domain_generated;
74
static int hf_qnet6_lr_src_addr_off;
75
static int hf_qnet6_lr_src_addr_len;
76
static int hf_qnet6_lr_src_addr_generated;
77
static int hf_qnet6_lr_dst;
78
static int hf_qnet6_lr_dst_name_off;
79
static int hf_qnet6_lr_dst_name_len;
80
static int hf_qnet6_lr_dst_name_generated;
81
static int hf_qnet6_lr_dst_domain_off;
82
static int hf_qnet6_lr_dst_domain_len;
83
static int hf_qnet6_lr_dst_domain_generated;
84
static int hf_qnet6_lr_dst_addr_off;
85
static int hf_qnet6_lr_dst_addr_len;
86
static int hf_qnet6_lr_dst_addr_generated;
87
88
static int hf_qnet6_kif_msgtype;
89
static int hf_qnet6_kif_size;
90
91
static int hf_qnet6_kif_version;
92
static int hf_qnet6_kif_client_info;
93
static int hf_qnet6_kif_zero;
94
95
/*
96
 * client_info
97
 */
98
static int hf_qnet6_kif_client_info_nd;
99
static int hf_qnet6_kif_client_info_pid;
100
static int hf_qnet6_kif_client_info_sid;
101
static int hf_qnet6_kif_client_info_flags;
102
static int hf_qnet6_kif_client_info_cred;
103
static int hf_qnet6_kif_client_info_cred_ruid;
104
static int hf_qnet6_kif_client_info_cred_euid;
105
static int hf_qnet6_kif_client_info_cred_suid;
106
static int hf_qnet6_kif_client_info_cred_rgid;
107
static int hf_qnet6_kif_client_info_cred_egid;
108
static int hf_qnet6_kif_client_info_cred_sgid;
109
static int hf_qnet6_kif_client_info_cred_ngroups;
110
static int hf_qnet6_kif_client_info_cred_grouplist;
111
112
/*
113
 * connect message
114
 */
115
static int hf_qnet6_kif_connect;
116
static int hf_qnet6_kif_connect_server_pid;
117
static int hf_qnet6_kif_connect_server_chid;
118
static int hf_qnet6_kif_connect_client_id;
119
static int hf_qnet6_kif_connect_client_pid;
120
/*
121
 * connect success message
122
 */
123
static int hf_qnet6_kif_connects_client_id;
124
static int hf_qnet6_kif_connects_server_id;
125
static int hf_qnet6_kif_connects_scoid;
126
static int hf_qnet6_kif_connects_nbytes;
127
/*
128
 * connect fail message
129
 */
130
static int hf_qnet6_kif_connectf_client_id;
131
static int hf_qnet6_kif_connectf_status;
132
/*
133
 * connect death message
134
 */
135
static int hf_qnet6_kif_connectd_client_id;
136
/*
137
 * msgsend message
138
 */
139
static int hf_qnet6_kif_msgsend;
140
static int hf_qnet6_kif_msgsend_server_id;
141
static int hf_qnet6_kif_msgsend_client_handle;
142
static int hf_qnet6_kif_msgsend_vinfo;
143
static int hf_qnet6_kif_msgsend_nbytes;
144
/*
145
 * msgread message
146
 */
147
static int hf_qnet6_kif_msgread_msgread_handle;
148
static int hf_qnet6_kif_msgread_client_handle;
149
static int hf_qnet6_kif_msgread_offset;
150
static int hf_qnet6_kif_msgread_nbytes;
151
/*
152
 * msgwrite message
153
 */
154
static int hf_qnet6_kif_msgwrite_status;
155
static int hf_qnet6_kif_msgwrite_handle;
156
static int hf_qnet6_kif_msgwrite_offset;
157
static int hf_qnet6_kif_msgwrite_nbytes;
158
static int hf_qnet6_kif_msgwrite_data;
159
/*
160
 * unblock message
161
 */
162
static int hf_qnet6_kif_unblock_server_id;
163
static int hf_qnet6_kif_unblock_client_handle;
164
static int hf_qnet6_kif_unblock_tid;
165
/*
166
 * event message
167
 */
168
static int hf_qnet6_kif_event_client_handle;
169
static int hf_qnet6_kif_event_event;
170
static int hf_qnet6_kif_event_notify;
171
static int hf_qnet6_kif_event_union1;
172
static int hf_qnet6_kif_event_value;
173
static int hf_qnet6_kif_event_union2;
174
175
/*
176
 * pulse message
177
 */
178
#if 0
179
static int hf_qnet6_kif_pulse_server_id;
180
static int hf_qnet6_kif_pulse_client_handle;
181
static int hf_qnet6_kif_pulse_vinfo;
182
#endif
183
static int hf_qnet6_kif_pulse_pulse;
184
static int hf_qnet6_kif_pulse_priority;
185
/*
186
 * signal message
187
 */
188
static int hf_qnet6_kif_signal_client_handle;
189
static int hf_qnet6_kif_signal_pid;
190
static int hf_qnet6_kif_signal_tid;
191
static int hf_qnet6_kif_signal_signo;
192
static int hf_qnet6_kif_signal_code;
193
static int hf_qnet6_kif_signal_value;
194
/*
195
 * disconnect message
196
 */
197
static int hf_qnet6_kif_disconnect_server_id;
198
199
/*
200
 * vinfo
201
 */
202
static int hf_qnet6_kif_vtid_info_tid;
203
static int hf_qnet6_kif_vtid_info_coid;
204
static int hf_qnet6_kif_vtid_info_priority;
205
static int hf_qnet6_kif_vtid_info_srcmsglen;
206
static int hf_qnet6_kif_vtid_info_keydata;
207
static int hf_qnet6_kif_vtid_info_srcnd;
208
static int hf_qnet6_kif_vtid_info_dstmsglen;
209
static int hf_qnet6_kif_vtid_info_zero;
210
/*
211
 * pulse
212
 */
213
static int hf_qnet6_kif_pulse_pulse_type;
214
static int hf_qnet6_kif_pulse_pulse_subtype;
215
static int hf_qnet6_kif_pulse_pulse_code;
216
static int hf_qnet6_kif_pulse_pulse_reserved;
217
static int hf_qnet6_kif_pulse_pulse_value;
218
static int hf_qnet6_kif_pulse_pulse_scoid;
219
/*
220
 * message
221
 */
222
static int hf_qnet6_kif_msg;
223
static int hf_qnet6_kif_msg_type;
224
static int hf_qnet6_kif_msg_connect_subtype;
225
static int hf_qnet6_kif_msg_connect_filetype;
226
static int hf_qnet6_kif_msg_connect_replymax;
227
static int hf_qnet6_kif_msg_connect_entrymax;
228
static int hf_qnet6_kif_msg_connect_key;
229
static int hf_qnet6_kif_msg_connect_handle;
230
231
static int hf_qnet6_kif_msg_connect_ioflag;
232
233
static int hf_qnet6_kif_msg_connect_ioflag_access;
234
static int hf_qnet6_kif_msg_connect_ioflag_append;
235
static int hf_qnet6_kif_msg_connect_ioflag_dsync;
236
static int hf_qnet6_kif_msg_connect_ioflag_sync;
237
static int hf_qnet6_kif_msg_connect_ioflag_rsync;
238
static int hf_qnet6_kif_msg_connect_ioflag_nonblock;
239
static int hf_qnet6_kif_msg_connect_ioflag_creat;
240
static int hf_qnet6_kif_msg_connect_ioflag_truncate;
241
static int hf_qnet6_kif_msg_connect_ioflag_exclusive;
242
static int hf_qnet6_kif_msg_connect_ioflag_noctrltty;
243
static int hf_qnet6_kif_msg_connect_ioflag_closexec;
244
static int hf_qnet6_kif_msg_connect_ioflag_realids;
245
static int hf_qnet6_kif_msg_connect_ioflag_largefile;
246
static int hf_qnet6_kif_msg_connect_ioflag_async;
247
248
static int hf_qnet6_kif_msg_connect_mode;
249
static int hf_qnet6_kif_msg_connect_mode_other_exe;
250
static int hf_qnet6_kif_msg_connect_mode_other_read;
251
static int hf_qnet6_kif_msg_connect_mode_other_write;
252
static int hf_qnet6_kif_msg_connect_mode_group_read;
253
static int hf_qnet6_kif_msg_connect_mode_group_write;
254
static int hf_qnet6_kif_msg_connect_mode_group_exe;
255
static int hf_qnet6_kif_msg_connect_mode_owner_read;
256
static int hf_qnet6_kif_msg_connect_mode_owner_write;
257
static int hf_qnet6_kif_msg_connect_mode_owner_exe;
258
static int hf_qnet6_kif_msg_connect_mode_setuid;
259
static int hf_qnet6_kif_msg_connect_mode_setgid;
260
static int hf_qnet6_kif_msg_connect_mode_sticky;
261
static int hf_qnet6_kif_msg_connect_mode_format;
262
263
static int hf_qnet6_kif_msg_connect_sflag;
264
static int hf_qnet6_kif_msg_connect_access;
265
static int hf_qnet6_kif_msg_connect_zero;
266
static int hf_qnet6_kif_msg_connect_pathlen;
267
static int hf_qnet6_kif_msg_connect_eflag;
268
static int hf_qnet6_kif_msg_connect_eflag_dir;
269
static int hf_qnet6_kif_msg_connect_eflag_dot;
270
static int hf_qnet6_kif_msg_connect_eflag_dotdot;
271
static int hf_qnet6_kif_msg_connect_extratype;
272
static int hf_qnet6_kif_msg_connect_extralen;
273
static int hf_qnet6_kif_msg_connect_path;
274
static int hf_qnet6_kif_msg_connect_pad_data;
275
static int hf_qnet6_kif_msg_connect_extra_symlink_path;
276
static int hf_qnet6_kif_msg_connect_extra_rename_path;
277
static int hf_qnet6_kif_msg_connect_extra_mount;
278
static int hf_qnet6_kif_msg_connect_extra_data;
279
static int hf_qnet6_kif_msg_connect_extra_link_ocb;
280
/*
281
 * devctl
282
 */
283
static int hf_qnet6_kif_msg_io_combine_len;
284
static int hf_qnet6_kif_msg_devctl_dcmd;
285
static int hf_qnet6_kif_msg_devctl_dcmd_cmd;
286
static int hf_qnet6_kif_msg_devctl_dcmd_ccmd;
287
static int hf_qnet6_kif_msg_devctl_dcmd_size;
288
static int hf_qnet6_kif_msg_devctl_dcmd_class;
289
static int hf_qnet6_kif_msg_devctl_dcmd_from;
290
static int hf_qnet6_kif_msg_devctl_dcmd_to;
291
292
static int hf_qnet6_kif_msg_devctl_nbytes;
293
static int hf_qnet6_kif_msg_devctl_zero;
294
/*
295
 * stat
296
 */
297
/*
298
 * read
299
 */
300
static int hf_qnet6_kif_msg_io_read_nbytes;
301
static int hf_qnet6_kif_msg_io_read_xtypes;
302
static int hf_qnet6_kif_msg_io_read_xtypes_0_7;
303
static int hf_qnet6_kif_msg_io_read_xtypes_8;
304
static int hf_qnet6_kif_msg_io_read_xtypes_14;
305
static int hf_qnet6_kif_msg_io_read_xtypes_15;
306
static int hf_qnet6_kif_msg_io_read_xoffset;
307
static int hf_qnet6_kif_msg_io_read_cond_min;
308
static int hf_qnet6_kif_msg_io_read_cond_time;
309
static int hf_qnet6_kif_msg_io_read_cond_timeout;
310
/*
311
 * write
312
 */
313
static int hf_qnet6_kif_msg_io_write_data;
314
static int hf_qnet6_kif_msg_io_write_nbytes;
315
static int hf_qnet6_kif_msg_io_write_xtypes;
316
static int hf_qnet6_kif_msg_io_write_xtypes_0_7;
317
static int hf_qnet6_kif_msg_io_write_xtypes_8;
318
static int hf_qnet6_kif_msg_io_write_xtypes_14;
319
static int hf_qnet6_kif_msg_io_write_xtypes_15;
320
static int hf_qnet6_kif_msg_io_write_xoffset;
321
322
/*
323
 * seek
324
 */
325
static int hf_qnet6_kif_msg_seek_whence;
326
static int hf_qnet6_kif_msg_seek_offset;
327
/*
328
 * pathconf
329
 */
330
static int hf_qnet6_kif_msg_pathconf_name;
331
/*
332
 * chmod
333
 */
334
static int hf_qnet6_kif_msg_io_chmod;
335
static int hf_qnet6_kif_msg_io_chmod_other_exe;
336
static int hf_qnet6_kif_msg_io_chmod_other_read;
337
static int hf_qnet6_kif_msg_io_chmod_other_write;
338
static int hf_qnet6_kif_msg_io_chmod_group_read;
339
static int hf_qnet6_kif_msg_io_chmod_group_write;
340
static int hf_qnet6_kif_msg_io_chmod_group_exe;
341
static int hf_qnet6_kif_msg_io_chmod_owner_read;
342
static int hf_qnet6_kif_msg_io_chmod_owner_write;
343
static int hf_qnet6_kif_msg_io_chmod_owner_exe;
344
static int hf_qnet6_kif_msg_io_chmod_setuid;
345
static int hf_qnet6_kif_msg_io_chmod_setgid;
346
static int hf_qnet6_kif_msg_io_chmod_sticky;
347
/*
348
 * chown
349
 */
350
static int hf_qnet6_kif_msg_io_chown_gid;
351
static int hf_qnet6_kif_msg_io_chown_uid;
352
/*
353
 * sync
354
 */
355
static int hf_qnet6_kif_msg_io_sync;
356
static int hf_qnet6_kif_msg_syncflag_dsync;
357
static int hf_qnet6_kif_msg_syncflag_sync;
358
static int hf_qnet6_kif_msg_syncflag_rsync;
359
/*
360
 * utime
361
 */
362
static int hf_qnet6_kif_msg_io_utime_curflag;
363
static int hf_qnet6_kif_msg_io_utime_actime;
364
static int hf_qnet6_kif_msg_io_utime_modtime;
365
/*
366
 * fdinfo
367
 */
368
static int hf_qnet6_kif_msg_io_fdinfo_flags;
369
static int hf_qnet6_kif_msg_io_fdinfo_path_len;
370
static int hf_qnet6_kif_msg_io_fdinfo_reserved;
371
/*
372
 * lock
373
 */
374
static int hf_qnet6_kif_msg_io_lock_subtype;
375
static int hf_qnet6_kif_msg_io_lock_nbytes;
376
/*
377
 * space
378
 */
379
static int hf_qnet6_kif_msg_io_space_subtype;
380
static int hf_qnet6_kif_msg_io_space_whence;
381
static int hf_qnet6_kif_msg_io_space_start;
382
static int hf_qnet6_kif_msg_io_space_len;
383
384
static int hf_qnet6_kif_msgsend_extra;
385
/*
386
 * msginfo
387
 */
388
static int hf_qnet6_kif_msg_msginfo_nd;
389
static int hf_qnet6_kif_msg_msginfo_srcnd;
390
static int hf_qnet6_kif_msg_msginfo_pid;
391
static int hf_qnet6_kif_msg_msginfo_tid;
392
static int hf_qnet6_kif_msg_msginfo_chid;
393
static int hf_qnet6_kif_msg_msginfo_scoid;
394
static int hf_qnet6_kif_msg_msginfo_coid;
395
static int hf_qnet6_kif_msg_msginfo_msglen;
396
static int hf_qnet6_kif_msg_msginfo_srcmsglen;
397
static int hf_qnet6_kif_msg_msginfo_dstmsglen;
398
static int hf_qnet6_kif_msg_msginfo_priority;
399
static int hf_qnet6_kif_msg_msginfo_flags;
400
static int hf_qnet6_kif_msg_msginfo_reserved;
401
/*
402
 * openfd
403
 */
404
static int hf_qnet6_kif_msg_openfd_reserved;
405
static int hf_qnet6_kif_msg_openfd_key;
406
static int hf_qnet6_kif_msg_openfd_ioflag;
407
408
static int hf_qnet6_kif_msg_openfd_ioflag_access;
409
static int hf_qnet6_kif_msg_openfd_ioflag_append;
410
static int hf_qnet6_kif_msg_openfd_ioflag_dsync;
411
static int hf_qnet6_kif_msg_openfd_ioflag_sync;
412
static int hf_qnet6_kif_msg_openfd_ioflag_rsync;
413
static int hf_qnet6_kif_msg_openfd_ioflag_nonblock;
414
static int hf_qnet6_kif_msg_openfd_ioflag_creat;
415
static int hf_qnet6_kif_msg_openfd_ioflag_truncate;
416
static int hf_qnet6_kif_msg_openfd_ioflag_exclusive;
417
static int hf_qnet6_kif_msg_openfd_ioflag_noctrltty;
418
static int hf_qnet6_kif_msg_openfd_ioflag_closexec;
419
static int hf_qnet6_kif_msg_openfd_ioflag_realids;
420
static int hf_qnet6_kif_msg_openfd_ioflag_largefile;
421
static int hf_qnet6_kif_msg_openfd_ioflag_async;
422
static int hf_qnet6_kif_msg_openfd_xtype;
423
static int hf_qnet6_kif_msg_openfd_sflag;
424
/*
425
 * dup
426
 */
427
static int hf_qnet6_kif_msg_io_dup_reserved;
428
static int hf_qnet6_kif_msg_io_dup_key;
429
/*
430
 * msg
431
 */
432
static int hf_qnet6_kif_msg_io_msg_mgrid;
433
static int hf_qnet6_kif_msg_io_msg_subtype;
434
/*
435
 * mmap
436
 */
437
static int hf_qnet6_kif_msg_io_mmap_prot;
438
static int hf_qnet6_kif_msg_io_mmap_prot_read;
439
static int hf_qnet6_kif_msg_io_mmap_prot_write;
440
static int hf_qnet6_kif_msg_io_mmap_prot_exec;
441
static int hf_qnet6_kif_msg_io_mmap_offset;
442
/*
443
 * notify
444
 */
445
static int hf_qnet6_kif_msg_io_notify_action;
446
static int hf_qnet6_kif_msg_io_notify_flags;
447
static int hf_qnet6_kif_msg_io_notify_flags_31;
448
static int hf_qnet6_kif_msg_io_notify_flags_30;
449
static int hf_qnet6_kif_msg_io_notify_flags_29;
450
static int hf_qnet6_kif_msg_io_notify_flags_28;
451
static int hf_qnet6_kif_msg_io_notify_mgr;
452
static int hf_qnet6_kif_msg_io_notify_flags_extra_mask;
453
static int hf_qnet6_kif_msg_io_notify_flags_exten;
454
static int hf_qnet6_kif_msg_io_notify_nfds;
455
static int hf_qnet6_kif_msg_io_notify_fd_first;
456
static int hf_qnet6_kif_msg_io_notify_nfds_ready;
457
static int hf_qnet6_kif_msg_io_notify_timo;
458
static int hf_qnet6_kif_msg_io_notify_fds;
459
/*
460
 * NR
461
 */
462
/*
463
 * sys/lsm/qnet/nr_msg.h
464
 */
465
static int hf_qnet6_nr_type;
466
static int hf_qnet6_nr_remote_req_len;
467
static int hf_qnet6_nr_remote_req_id;
468
static int hf_qnet6_nr_remote_req_name;
469
static int hf_qnet6_nr_remote_rep_spare;
470
static int hf_qnet6_nr_remote_rep_id;      /* remote_answer id */
471
static int hf_qnet6_nr_remote_rep_nd;      /* remote_answer nd */
472
static int hf_qnet6_nr_remote_rep_status;  /* remote_error * status */
473
474
/*
475
 * Initialize the subtree pointers
476
 */
477
static int ett_qnet6_l4;
478
static int ett_qnet6_qos;
479
static int ett_qnet6_flags;
480
static int ett_qnet6_qos_info;
481
482
static int ett_qnet6_lr;
483
static int ett_qnet6_lr_src;
484
static int ett_qnet6_lr_src_name_subtree;
485
static int ett_qnet6_lr_src_domain_subtree;
486
static int ett_qnet6_lr_src_addr_subtree;
487
static int ett_qnet6_lr_dst_name_subtree;
488
static int ett_qnet6_lr_dst_domain_subtree;
489
static int ett_qnet6_lr_dst_addr_subtree;
490
static int ett_qnet6_lr_dst;
491
492
static int ett_qnet6_kif;
493
static int ett_qnet6_kif_vinfo;
494
static int ett_qnet6_kif_pulse;
495
static int ett_qnet6_kif_event;
496
static int ett_qnet6_kif_msg;
497
static int ett_qnet6_kif_msg_ioflag;
498
static int ett_qnet6_kif_msg_mode;
499
static int ett_qnet6_kif_msg_eflag;
500
static int ett_qnet6_kif_connect;
501
static int ett_qnet6_kif_chmod_mode;
502
static int ett_qnet6_kif_msgsend;
503
static int ett_qnet6_kif_client_info;
504
static int ett_qnet6_kif_client_info_cred;
505
static int ett_qnet6_kif_client_info_cred_group;
506
static int ett_qnet6_kif_msg_devctl_dcmd;
507
static int ett_qnet6_kif_msg_read_xtypes;
508
static int ett_qnet6_kif_msg_write_xtypes;
509
static int ett_qnet6_kif_msg_sync;
510
static int ett_qnet6_kif_msg_openfd_ioflag;
511
static int ett_qnet6_kif_msg_msginfo;
512
static int ett_qnet6_kif_msg_prot;
513
static int ett_qnet6_kif_msg_notify_flags;
514
static int ett_qnet6_kif_msg_notify_fds;
515
static int ett_qnet6_nr;
516
517
/*
518
 * struct qnet6_lr_pkt { uint8_t version; uint8_t pad0; uint8_t type; uint8_t
519
 * pad1;
520
 *
521
 * uint32_t total_len;
522
 *
523
 * uint32_t src_name_off; uint32_t src_name_len; uint32_t src_domain_off;
524
 * uint32_t src_domain_len; uint32_t src_addr_off; uint32_t src_addr_len;
525
 *
526
 * uint32_t dst_name_off; uint32_t dst_name_len; uint32_t dst_domain_off;
527
 * uint32_t dst_domain_len; uint32_t dst_addr_off; uint32_t dst_addr_len; };
528
 */
529
73
#define QNX_QNET6_LR_PKT_SIZE 56
530
/*
531
 * 56 bytes in header, name, domain, addr data are behind
532
 */
533
534
struct qnet6_kif_hdr
535
{
536
  uint16_t msgtype;
537
  uint16_t size;
538
};
539
540
enum _msg_bases_qnx
541
{
542
  QNX_IO_BASE = 0x100,
543
  QNX_IO_MAX  = 0x1FF
544
};
545
546
enum _io__Uint16types
547
{
548
  QNX_IO_CONNECT = QNX_IO_BASE,
549
  QNX_IO_READ,
550
  QNX_IO_WRITE,
551
  QNX_IO_RSVD_CLOSE_OCB,  /* Place holder in jump table */
552
  QNX_IO_STAT,
553
  QNX_IO_NOTIFY,
554
  QNX_IO_DEVCTL,
555
  QNX_IO_RSVD_UNBLOCK,    /* Place holder in jump table */
556
  QNX_IO_PATHCONF,
557
  QNX_IO_LSEEK,
558
  QNX_IO_CHMOD,
559
  QNX_IO_CHOWN,
560
  QNX_IO_UTIME,
561
  QNX_IO_OPENFD,
562
  QNX_IO_FDINFO,
563
  QNX_IO_LOCK,
564
  QNX_IO_SPACE,
565
  QNX_IO_SHUTDOWN,
566
  QNX_IO_MMAP,
567
  QNX_IO_MSG,
568
  QNX_IO_RSVD,
569
  QNX_IO_DUP,
570
  QNX_IO_CLOSE,
571
  QNX_IO_RSVD_LOCK_OCB,   /* Place holder in jump table */
572
  QNX_IO_RSVD_UNLOCK_OCB, /* Place holder in jump table */
573
  QNX_IO_SYNC,
574
  QNX_IO_POWER
575
};
576
/*
577
 * struct _io_connect subtype
578
 */
579
enum _io_connect_subtypes
580
{
581
  QNX_IO_CONNECT_COMBINE,       /* Combine with IO msg */
582
  QNX_IO_CONNECT_COMBINE_CLOSE, /* Combine with IO msg and always close */
583
  QNX_IO_CONNECT_OPEN,
584
  QNX_IO_CONNECT_UNLINK,
585
  QNX_IO_CONNECT_RENAME,
586
  QNX_IO_CONNECT_MKNOD,
587
  QNX_IO_CONNECT_READLINK,
588
  QNX_IO_CONNECT_LINK,
589
  QNX_IO_CONNECT_RSVD_UNBLOCK,  /* Place holder in jump table */
590
  QNX_IO_CONNECT_MOUNT
591
};
592
593
/*
594
 * struct _io_connect extra_type
595
 */
596
enum _io_connect_extra_type
597
{
598
  QNX_IO_CONNECT_EXTRA_NONE,
599
  QNX_IO_CONNECT_EXTRA_LINK,
600
  QNX_IO_CONNECT_EXTRA_SYMLINK,
601
  QNX_IO_CONNECT_EXTRA_MQUEUE,
602
  QNX_IO_CONNECT_EXTRA_PHOTON,
603
  QNX_IO_CONNECT_EXTRA_SOCKET,
604
  QNX_IO_CONNECT_EXTRA_SEM,
605
  QNX_IO_CONNECT_EXTRA_RESMGR_LINK,
606
  QNX_IO_CONNECT_EXTRA_PROC_SYMLINK,
607
  QNX_IO_CONNECT_EXTRA_RENAME,
608
  QNX_IO_CONNECT_EXTRA_MOUNT,
609
  QNX_IO_CONNECT_EXTRA_MOUNT_OCB,
610
  QNX_IO_CONNECT_EXTRA_TYMEM
611
};
612
#define QNET_LWL4_VER_LITTLE 0x2a /* 42 */
613
#define QNET_LWL4_VER_BIG    0xaa /* 42|0x80, msb is set */
614
615
static const value_string qnet6_ver_vals[] = {
616
  {QNET_LWL4_VER_LITTLE, "LWL4 little endian"},
617
  {QNET_LWL4_VER_BIG, "LWL4 big endian"},
618
  {0, NULL}
619
};
620
621
61
#define QNET_L4_TYPE_USER_DATA    0x0
622
25
#define QNET_L4_TYPE_TCS_INIT     0x1
623
3
#define QNET_L4_TYPE_TCS_REM_UP   0x2
624
7
#define QNET_L4_TYPE_TCS_UP       0x3
625
3
#define QNET_L4_TYPE_TCS_DOWN     0x4
626
1
#define QNET_L4_TYPE_TCS_REM_DOWN 0x5
627
628
396
#define QNET_L4_TYPE_USER 0x8
629
1
#define QNET_L4_TYPE_ACK  0x9
630
0
#define QNET_L4_TYPE_NACK 0xa
631
0
#define QNET_L4_TYPE_LRES 0xb
632
static const value_string qnet6_type_vals[] = {
633
  {QNET_L4_TYPE_USER_DATA,    "LWL4 user data packet"},
634
  {QNET_L4_TYPE_TCS_INIT,     "LWL4 TX establishing connection"},
635
  {QNET_L4_TYPE_TCS_REM_UP,   "LWL4 RX node UP"},
636
  {QNET_L4_TYPE_TCS_UP,       "LWL4 TX node UP"},
637
  {QNET_L4_TYPE_TCS_DOWN,     "LWL4 RX tears connection down"},
638
  {QNET_L4_TYPE_TCS_REM_DOWN, "LWL4 RX tears connection down"},
639
  {QNET_L4_TYPE_USER,         "LWL4 Data packet"},
640
  {QNET_L4_TYPE_ACK,          "LWL4 Ack packet"},
641
  {QNET_L4_TYPE_NACK,         "LWL4 Nack packet"},
642
  {QNET_L4_TYPE_LRES,         "LWL4 Lan Resolver packets"},
643
  {0, NULL}
644
};
645
646
815
#define QNET_L4_FLAGS_FIRST  0x01
647
633
#define QNET_L4_FLAGS_LAST   0x02
648
14
#define QNET_L4_FLAGS_CRC    0x04
649
650
60
#define QNET_L4_LAYER_KIF   0
651
32
#define QNET_L4_LAYER_NR    1
652
24
#define QNET_L4_LAYER_LR    2
653
2
#define QNET_L4_LAYER_SEQ   3
654
static const value_string qnet6_layer_vals[] = {
655
  {QNET_L4_LAYER_KIF, "Kernel Interface"},
656
  {QNET_L4_LAYER_NR,  "Node Resolver"},
657
  {QNET_L4_LAYER_LR,  "Lan Resolver"},
658
  {QNET_L4_LAYER_SEQ, "Sequence"},
659
  {0, NULL}
660
};
661
662
#define QNET_L4_QOS_TYPE_LOADBALANCE  0
663
#define QNET_L4_QOS_TYPE_REDUNDANT    1
664
#define QNET_L4_QOS_TYPE_EXCLUSIVE    2
665
#define QNET_L4_QOS_TYPE_PREFERRED    3
666
static const value_string qnet6_qos_type_vals[] = {
667
  {QNET_L4_QOS_TYPE_LOADBALANCE, "Load balance"},
668
  {QNET_L4_QOS_TYPE_REDUNDANT,   "Redundant"},
669
  {QNET_L4_QOS_TYPE_EXCLUSIVE,   "Exclusive or Sequential"},
670
  {QNET_L4_QOS_TYPE_PREFERRED,   "Preferred link"},
671
  {0, NULL}
672
};
673
674
static const value_string qnet6_lr_ver_vals[] = {
675
  {1, "1"},
676
  {0, NULL}
677
};
678
679
1
#define QNET_LR_TYPE_REQUEST 0x1
680
2
#define QNET_LR_TYPE_REPLY   0x2
681
static const value_string qnet6_lr_type_vals[] = {
682
  {QNET_LR_TYPE_REQUEST, "Request"},
683
  {QNET_LR_TYPE_REPLY,   "Reply"},
684
  {0, NULL}
685
};
686
687
1.10k
#define QNET_KIF_MSGTYPE_MASK   0x007f
688
95
#define QNET_KIF_CRED           0x0100
689
103
#define QNET_KIF_ENDIAN_MASK    0x8080
690
48
#define QNET_KIF_ENDIAN_LITTLE  0x0000
691
55
#define QNET_KIF_ENDIAN_BIG     0x8080
692
693
enum QNET_KIF_MSGTYPE
694
{
695
  QNET_KIF_MSGTYPE_CONNECT,
696
  QNET_KIF_MSGTYPE_CONNECT_MSGSEND,
697
  QNET_KIF_MSGTYPE_CONNECT_SUCCESS,
698
  QNET_KIF_MSGTYPE_CONNECT_FAIL,
699
  QNET_KIF_MSGTYPE_UNBLOCK,
700
  QNET_KIF_MSGTYPE_MSGSEND,
701
  QNET_KIF_MSGTYPE_MSGREAD,
702
  QNET_KIF_MSGTYPE_MSGREAD_XFER,
703
  QNET_KIF_MSGTYPE_MSGWRITE,
704
  QNET_KIF_MSGTYPE_MSGREPLY,
705
  QNET_KIF_MSGTYPE_MSGERROR,
706
  QNET_KIF_MSGTYPE_EVENT,
707
  QNET_KIF_MSGTYPE_PULSE,
708
  QNET_KIF_MSGTYPE_SIGNAL,
709
  QNET_KIF_MSGTYPE_DISCONNECT,
710
  QNET_KIF_MSGTYPE_CONNECT_DEATH,
711
  QNET_KIF_MSGTYPE_MSGREAD_ERROR,
712
  QNET_KIF_MSGTYPE_CONNECT_PULSE
713
714
};
715
/*
716
 * from lib/c/public/devctl.h
717
 */
718
enum QNX_DCMD_DEF
719
{
720
  QNX_DCMD_ALL       = 0x01,
721
  QNX_DCMD_FSYS      = 0x02,
722
  QNX_DCMD_BLK       = QNX_DCMD_FSYS,
723
  QNX_DCMD_CHR       = 0x03,
724
  QNX_DCMD_NET       = 0x04,
725
  QNX_DCMD_MISC      = 0x05,
726
  QNX_DCMD_IP        = 0x06,
727
  QNX_DCMD_MIXER     = 0x07,
728
  QNX_DCMD_PROC      = 0x08,
729
  QNX_DCMD_MEM       = 0x09,
730
  QNX_DCMD_INPUT     = 0x0A,
731
  QNX_DCMD_PHOTON    = 0x0B,
732
  QNX_DCMD_CAM       = 0x0C,
733
  QNX_DCMD_USB       = 0x0D,
734
  QNX_DCMD_MEDIA     = 0x0E,
735
  QNX_DCMD_CAM_SIM   = 0x0F,
736
  QNX_DCMD_MEMCLASS  = 0x10,
737
  QNX_DCMD_PARTITION = 0x11,
738
  QNX_DCMD_IOCTL_TTY = 't',
739
  QNX_DCMD_CTTY      = 'T',
740
  QNX_DCMD_FCTL      = 'f'
741
};
742
enum qnx_mgr_types
743
{
744
  _IOMGR_FSYS     = 0x02,
745
  _IOMGR_TCPIP    = 0x06,
746
  _IOMGR_PHOTON   = 0x0B,
747
  _IOMGR_CAM      = 0x0C,
748
  _IOMGR_PCI      = 0x0d,
749
  _IOMGR_NETMGR   = 0x0e,
750
  _IOMGR_REGISTRY = 0x10,
751
  _IOMGR_PCCARD   = 0x11,
752
  _IOMGR_USB      = 0x12,
753
  _IOMGR_MEDIA    = 0x13,
754
  _IOMGR_PMM      = 0x14,
755
  _IOMGR_DISPLAY  = 0x15,
756
  _IOMGR_INPUT    = 0x16
757
};
758
static const value_string qnet6_kif_mgr_types_vals[] = {
759
  {_IOMGR_FSYS,     "_IOMGR_FSYS"},
760
  {_IOMGR_TCPIP,    "_IOMGR_TCPIP"},
761
  {_IOMGR_PHOTON,   "_IOMGR_PHOTON"},
762
  {_IOMGR_CAM,      "_IOMGR_CAM"},
763
  {_IOMGR_PCI,      "_IOMGR_PCI"},
764
  {_IOMGR_NETMGR,   "_IOMGR_NETMGR "},
765
  {_IOMGR_REGISTRY, "_IOMGR_REGISTRY"},
766
  {_IOMGR_PCCARD,   "_IOMGR_PCCARD"},
767
  {_IOMGR_USB,      "_IOMGR_USB"},
768
  {_IOMGR_MEDIA,    "_IOMGR_MEDIA"},
769
  {_IOMGR_PMM,      "_IOMGR_PMM"},
770
  {_IOMGR_DISPLAY,  "_IOMGR_DISPLAY"},
771
  {_IOMGR_INPUT,    "_IOMGR_INPUT"},
772
  {0, NULL}
773
};
774
775
static const value_string qnet6_kif_msgtype_vals[] = {
776
  {QNET_KIF_MSGTYPE_CONNECT,         "Connect"},
777
  {QNET_KIF_MSGTYPE_CONNECT_MSGSEND, "Connect MsgSend"},
778
  {QNET_KIF_MSGTYPE_CONNECT_SUCCESS, "Connect Success"},
779
  {QNET_KIF_MSGTYPE_CONNECT_FAIL,    "Connect Fail"},
780
  {QNET_KIF_MSGTYPE_UNBLOCK,         "Unblock"},
781
  {QNET_KIF_MSGTYPE_MSGSEND,         "MsgSend"},
782
  {QNET_KIF_MSGTYPE_MSGREAD,         "MsgRead"},
783
  {QNET_KIF_MSGTYPE_MSGREAD_XFER,    "MsgRead_Xfer"},
784
  {QNET_KIF_MSGTYPE_MSGWRITE,        "MsgWrite"},
785
  {QNET_KIF_MSGTYPE_MSGREPLY,        "MsgReply"},
786
  {QNET_KIF_MSGTYPE_MSGERROR,        "MsgError"},
787
  {QNET_KIF_MSGTYPE_EVENT,           "Event"},
788
  {QNET_KIF_MSGTYPE_PULSE,           "Pulse"},
789
  {QNET_KIF_MSGTYPE_SIGNAL,          "Signal"},
790
  {QNET_KIF_MSGTYPE_DISCONNECT,      "Disconnect"},
791
  {QNET_KIF_MSGTYPE_CONNECT_DEATH,   "Connect Death"},
792
  {QNET_KIF_MSGTYPE_MSGREAD_ERROR,   "MsgRead Error"},
793
  {QNET_KIF_MSGTYPE_CONNECT_PULSE,   "Connect Pulse"},
794
  {0, NULL}
795
};
796
797
static const value_string qnet6_kif_msgsend_msgtype_vals[] = {
798
  {QNX_IO_CONNECT,         "_IO_CONNECT"},
799
  {QNX_IO_READ,            "_IO_READ"},
800
  {QNX_IO_WRITE,           "_IO_WRITE"},
801
  {QNX_IO_RSVD_CLOSE_OCB,  "_IO_CLOSE_OCB"},
802
  {QNX_IO_STAT,            "_IO_STAT"},
803
  {QNX_IO_NOTIFY,          "_IO_NOTIFY"},
804
  {QNX_IO_DEVCTL,          "_IO_DEVCTL"},
805
  {QNX_IO_RSVD_UNBLOCK,    "_IO_UNBLOCK"},
806
  {QNX_IO_PATHCONF,        "_IO_PATHCONF"},
807
  {QNX_IO_LSEEK,           "_IO_LSEEK"},
808
  {QNX_IO_CHMOD,           "_IO_CHMOD"},
809
  {QNX_IO_CHOWN,           "_IO_CHOWN"},
810
  {QNX_IO_UTIME,           "_IO_UTIME"},
811
  {QNX_IO_OPENFD,          "_IO_OPENFD"},
812
  {QNX_IO_FDINFO,          "_IO_FDINFO"},
813
  {QNX_IO_LOCK,            "_IO_LOCK"},
814
  {QNX_IO_SPACE,           "_IO_SPACE"},
815
  {QNX_IO_SHUTDOWN,        "_IO_SHUTDOWN"},
816
  {QNX_IO_MMAP,            "_IO_MMAP"},
817
  {QNX_IO_MSG,             "_IO_MSG"},
818
  {QNX_IO_RSVD,            "_IO_RESERVED"},
819
  {QNX_IO_DUP,             "_IO_DUP"},
820
  {QNX_IO_CLOSE,           "_IO_CLOSE"},
821
  {QNX_IO_RSVD_LOCK_OCB,   "_IO_LOCK_OCB"},
822
  {QNX_IO_RSVD_UNLOCK_OCB, "_IO_UNLOCK_OCB"},
823
  {QNX_IO_SYNC,            "_IO_SYNC"},
824
  {QNX_IO_POWER,           "_IO_POWER"},
825
  {0, NULL}
826
};
827
828
static value_string_ext qnet6_kif_msgsend_msgtype_vals_ext = VALUE_STRING_EXT_INIT(qnet6_kif_msgsend_msgtype_vals);
829
830
831
static const value_string qnet6_kif_msgsend_msg_connect_subtype_vals[] = {
832
  {QNX_IO_CONNECT_COMBINE,       "_IO_CONNECT_COMBINE"},
833
  {QNX_IO_CONNECT_COMBINE_CLOSE, "_IO_CONNECT_COMBINE_CLOSE"},
834
  {QNX_IO_CONNECT_OPEN,          "_IO_CONNECT_OPEN"},
835
  {QNX_IO_CONNECT_UNLINK,        "_IO_CONNECT_UNLINK"},
836
  {QNX_IO_CONNECT_RENAME,        "_IO_CONNECT_RENAME"},
837
  {QNX_IO_CONNECT_MKNOD,         "_IO_CONNECT_MKNOD"},
838
  {QNX_IO_CONNECT_READLINK,      "_IO_CONNECT_READLINK"},
839
  {QNX_IO_CONNECT_LINK,          "_IO_CONNECT_LINK"},
840
  {QNX_IO_CONNECT_RSVD_UNBLOCK,  "_IO_CONNECT_UNBLOCK"},
841
  {QNX_IO_CONNECT_MOUNT,         "_IO_CONNECT_MOUNT"},
842
  {0, NULL}
843
};
844
845
static const value_string qnet6_kif_msgsend_msg_connect_extratype_vals[] = {
846
  {QNX_IO_CONNECT_EXTRA_NONE,         "_IO_CONNECT_EXTRA_NONE"},
847
  {QNX_IO_CONNECT_EXTRA_LINK,         "_IO_CONNECT_EXTRA_LINK"},
848
  {QNX_IO_CONNECT_EXTRA_SYMLINK,      "_IO_CONNECT_EXTRA_SYMLINK"},
849
  {QNX_IO_CONNECT_EXTRA_MQUEUE,       "_IO_CONNECT_EXTRA_MQUEUE"},
850
  {QNX_IO_CONNECT_EXTRA_PHOTON,       "_IO_CONNECT_EXTRA_PHOTON"},
851
  {QNX_IO_CONNECT_EXTRA_SOCKET,       "_IO_CONNECT_EXTRA_SOCKET"},
852
  {QNX_IO_CONNECT_EXTRA_SEM,          "_IO_CONNECT_EXTRA_SEM"},
853
  {QNX_IO_CONNECT_EXTRA_RESMGR_LINK,  "_IO_CONNECT_EXTRA_RESMGR_LINK"},
854
  {QNX_IO_CONNECT_EXTRA_PROC_SYMLINK, "_IO_CONNECT_EXTRA_PROC_SYMLINK"},
855
  {QNX_IO_CONNECT_EXTRA_RENAME,       "_IO_CONNECT_EXTRA_RENAME"},
856
  {QNX_IO_CONNECT_EXTRA_MOUNT,        "_IO_CONNECT_EXTRA_MOUNT"},
857
  {QNX_IO_CONNECT_EXTRA_MOUNT_OCB,    "_IO_CONNECT_EXTRA_MOUNT_OCB"},
858
  {QNX_IO_CONNECT_EXTRA_TYMEM,        "_IO_CONNECT_EXTRA_TYMEM"},
859
  {0, NULL}
860
};
861
862
static const value_string qnet6_kif_msgsend_msg_devctl_cmd_class_vals[] = {
863
  {0,                  "QNX Reserved"},
864
  {QNX_DCMD_ALL,       "All io servers"},
865
  {QNX_DCMD_FSYS,      "Filesystem or io-blk"},
866
  {QNX_DCMD_CHR,       "Character"},
867
  {QNX_DCMD_NET,       "Network driver"},
868
  {QNX_DCMD_MISC,      "Misc"},
869
  {QNX_DCMD_IP,        "IP"},
870
  {QNX_DCMD_MIXER,     "Mixer"},
871
  {QNX_DCMD_PROC,      "Proc"},
872
  {QNX_DCMD_MEM,       "Mem"},
873
  {QNX_DCMD_INPUT,     "Input"},
874
  {QNX_DCMD_PHOTON,    "Photon"},
875
  {QNX_DCMD_CAM,       "Cam"},
876
  {QNX_DCMD_USB,       "Usb"},
877
  {QNX_DCMD_MEDIA,     "Media"},
878
  {QNX_DCMD_CAM_SIM,   "CamSim"},
879
  {QNX_DCMD_MEMCLASS,  "Memory Partition"},
880
  {QNX_DCMD_PARTITION, "Adaptive Parition"},
881
  {QNX_DCMD_CTTY,      "T"},
882
  {QNX_DCMD_FCTL,      "f"},
883
  {QNX_DCMD_IOCTL_TTY, "IOCTL_TTY"},
884
  {0, NULL}
885
};
886
887
static value_string_ext qnet6_kif_msgsend_msg_devctl_cmd_class_vals_ext = VALUE_STRING_EXT_INIT(qnet6_kif_msgsend_msg_devctl_cmd_class_vals);
888
889
enum QNX_DCMD_CC_DEF
890
{
891
  QNX_CCMD_DCMD_ALL_GETFLAGS        = 0x101,
892
  QNX_CCMD_DCMD_ALL_SETFLAGS        = 0x102,
893
  QNX_CCMD_DCMD_ALL_GETMOUNTFLAGS   = 0x103,
894
  QNX_CCMD_DCMD_ALL_GETOWN          = 0x104,
895
  QNX_CCMD_DCMD_ALL_SETOWN          = 0x105,
896
  QNX_CCMD_DCMD_ALL_FADVISE         = 0x106,
897
898
  QNX_CCMD_DCMD_PROC_SYSINFO        = 0x800,
899
  QNX_CCMD_DCMD_PROC_INFO           = 0x801,
900
  QNX_CCMD_DCMD_PROC_MAPINFO        = 0x802,
901
  QNX_CCMD_DCMD_PROC_MAPDEBUG       = 0x803,
902
  QNX_CCMD_DCMD_PROC_MAPDEBUG_BASE,
903
  QNX_CCMD_DCMD_PROC_SIGNAL,
904
  QNX_CCMD_DCMD_PROC_STOP,
905
  QNX_CCMD_DCMD_PROC_WAITSTOP,
906
  QNX_CCMD_DCMD_PROC_STATUS,
907
  QNX_CCMD_DCMD_PROC_TIDSTATUS      = QNX_CCMD_DCMD_PROC_STATUS,
908
  QNX_CCMD_DCMD_PROC_CURTHREAD,
909
  QNX_CCMD_DCMD_PROC_RUN,
910
  QNX_CCMD_DCMD_PROC_GETGREG,
911
  QNX_CCMD_DCMD_PROC_SETGREG,
912
  QNX_CCMD_DCMD_PROC_GETFPREG,
913
  QNX_CCMD_DCMD_PROC_SETFPREG,
914
  QNX_CCMD_DCMD_PROC_BREAK,
915
  QNX_CCMD_DCMD_PROC_FREEZETHREAD,
916
  QNX_CCMD_DCMD_PROC_THAWTHREAD,
917
  QNX_CCMD_DCMD_PROC_EVENT,
918
  QNX_CCMD_DCMD_PROC_SET_FLAG,
919
  QNX_CCMD_DCMD_PROC_CLEAR_FLAG,
920
  QNX_CCMD_DCMD_PROC_PAGEDATA,
921
  QNX_CCMD_DCMD_PROC_GETALTREG,        /* 21 */
922
  QNX_CCMD_DCMD_PROC_SETALTREG,
923
  QNX_CCMD_DCMD_PROC_TIMERS,
924
  QNX_CCMD_DCMD_PROC_IRQS,
925
  QNX_CCMD_DCMD_PROC_GETREGSET,
926
  QNX_CCMD_DCMD_PROC_SETREGSET,
927
  QNX_CCMD_DCMD_PROC_THREADCTL,
928
  QNX_CCMD_DCMD_PROC_GET_BREAKLIST,
929
  QNX_CCMD_DCMD_PROC_CHANNELS,
930
  QNX_CCMD_DCMD_PROC_GET_MEMPART_LIST, /* 30 */
931
  QNX_CCMD_DCMD_PROC_ADD_MEMPARTID,
932
  QNX_CCMD_DCMD_PROC_DEL_MEMPARTID,
933
  QNX_CCMD_DCMD_PROC_CHG_MEMPARTID,    /* 33 */
934
935
  QNX_CCMD_DCMD_BLK_PARTENTRY       = 0x201,
936
  QNX_CCMD_DCMD_BLK_FORCE_RELEARN   = 0x202,
937
938
  /*
939
   * lib/io-char/public/sys/dcmd_chr.h
940
   */
941
  QNX_CCMD_DCMD_CHR_TTYINFO         = 0x300 + 10,
942
  QNX_CCMD_DCMD_CHR_SERCTL          = 0x300 + 20,
943
  QNX_CCMD_DCMD_CHR_TCINJECTC       = 0x300 + 22,
944
  QNX_CCMD_DCMD_CHR_TCINJECTR       = 0x300 + 23,
945
  QNX_CCMD_DCMD_CHR_ISATTY          = 0x300 + 24,
946
  QNX_CCMD_DCMD_CHR_GETOBAND        = 0x300 + 25,
947
  QNX_CCMD_DCMD_CHR_ISSIZE          = 0x300 + 27,
948
  QNX_CCMD_DCMD_CHR_OSSIZE          = 0x300 + 28,
949
  QNX_CCMD_DCMD_CHR_PARCTL          = 0x300 + 98,
950
  QNX_CCMD_DCMD_CHR_PNPTEXT         = 0x300 + 99,
951
952
  QNX_CCMD_DCMD_CHR_ISCHARS         = ('f' << 0x8) + 127,
953
954
  QNX_CCMD_DCMD_CHR_TCFLOW          = ('T' << 0x8) + 6,
955
956
  QNX_CCMD_DCMD_CHR_TCGETSID        = ('t' << 0x8) + 7,
957
  QNX_CCMD_DCMD_CHR_TCSETSID        = ('t' << 0x8) + 8,
958
  QNX_CCMD_DCMD_CHR_TCFLUSH         = ('t' << 0x8) + 16,
959
  QNX_CCMD_DCMD_CHR_TCSETATTR       = ('t' << 0x8) + 20,
960
  QNX_CCMD_DCMD_CHR_TCSETATTRD      = ('t' << 0x8) + 21,
961
  QNX_CCMD_DCMD_CHR_TCSETATTRF      = ('t' << 0x8) + 22,
962
  QNX_CCMD_DCMD_CHR_TCGETATTR       = ('t' << 0x8) + 19,
963
  QNX_CCMD_DCMD_CHR_PUTOBAND        = ('t' << 0x8) + 26,
964
  QNX_CCMD_DCMD_CHR_TCDRAIN         = ('t' << 0x8) + 94,
965
  QNX_CCMD_DCMD_CHR_SETSIZE         = ('t' << 0x8) + 103,
966
  QNX_CCMD_DCMD_CHR_GETSIZE         = ('t' << 0x8) + 104,
967
  QNX_CCMD_DCMD_CHR_LINESTATUS      = ('t' << 0x8) + 106,
968
  QNX_CCMD_DCMD_CHR_OSCHARS         = ('t' << 0x8) + 115,
969
  QNX_CCMD_DCMD_CHR_TCSETPGRP       = ('t' << 0x8) + 118,
970
  QNX_CCMD_DCMD_CHR_TCGETPGRP       = ('t' << 0x8) + 119,
971
972
  /*
973
   * lib/malloc/public/malloc_g/malloc-lib.h
974
   */
975
  QNX_CCMD_DCMD_DBGMEM_ADDSYM       = 0x500 + 0,
976
  QNX_CCMD_DCMD_DBGMEM_REGISTER     = 0x500 + 1,
977
978
  /*
979
   * services/io-fs/lib/public/sys/dmd_dio.h
980
   */
981
  QNX_CCMD_DCMD_DIO_DEVICE          = 0xf00 + 1,
982
  QNX_CCMD_DCMD_DIO_ALLOC           = 0xf00 + 2,
983
  QNX_CCMD_DCMD_DIO_IO              = 0xf00 + 3,
984
985
  /*
986
   * services/dumper/public/sys/dcmd_dumper.h
987
   */
988
  QNX_CCMD_DCMD_DUMPER_NOTIFYEVENT  = 0x500 + 1,
989
  QNX_CCMD_DCMD_DUMPER_REMOVEALL    = 0x500 + 3,
990
  QNX_CCMD_DCMD_DUMPER_REMOVEEVENT  = 0x500 + 2,
991
992
  QNX_CCMD_DCMD_FSYS_FORCE_RELEARN  = 0x200 + 2,
993
  QNX_CCMD_DCMD_FSYS_STATISTICS     = 0x200 + 11,
994
  QNX_CCMD_DCMD_FSYS_STATISTICS_CLR = 0x200 + 12,
995
  QNX_CCMD_DCMD_FSYS_STATVFS        = 0x200 + 13,
996
  QNX_CCMD_DCMD_FSYS_PREGROW_FILE,
997
  QNX_CCMD_DCMD_FSYS_DIRECT_IO,
998
  QNX_CCMD_DCMD_FSYS_MOUNTED_ON,
999
  QNX_CCMD_DCMD_FSYS_MOUNTED_AT,
1000
  QNX_CCMD_DCMD_FSYS_MOUNTED_BY,
1001
  QNX_CCMD_DCMD_FSYS_OPTIONS,
1002
  QNX_CCMD_DCMD_FSYS_FILE_FLAGS,
1003
  QNX_CCMD_DCMD_FSYS_MAP_OFFSET     = 0x200 + 21,
1004
1005
  /*
1006
   * services/io-fs/lib/public/sys/dcmd_fsys.h
1007
   */
1008
  QNX_CCMD_DCMD_FSYS_UUID           = 0x200 + 21, /* same with the MAP_OFFSET */
1009
  QNX_CCMD_DCMD_FSYS_DIR_NFILES,
1010
  QNX_CCMD_DCMD_FSYS_PASS_USE,
1011
  QNX_CCMD_DCMD_FSYS_PASS_CHG,
1012
  QNX_CCMD_DCMD_FSYS_PASS_NEW,
1013
  QNX_CCMD_DCMD_FSYS_CACHE_SET      = 0x200 + 26,
1014
1015
  /*
1016
   * services/io-fs/lib/public/sys/dcmd_media.h
1017
   */
1018
  QNX_CCMD_DCMD_MEDIA_SONG          = 0xe00 + 100,
1019
  QNX_CCMD_DCMD_MEDIA_ALBUM         = 0xe00 + 101,
1020
  QNX_CCMD_DCMD_MEDIA_ARTIST,
1021
  QNX_CCMD_DCMD_MEDIA_GENRE,
1022
  QNX_CCMD_DCMD_MEDIA_COMPOSER,
1023
  QNX_CCMD_DCMD_MEDIA_RELEASE_DATE,
1024
  QNX_CCMD_DCMD_MEDIA_TRACK_NUM,
1025
1026
  QNX_CCMD_DCMD_MEDIA_PUBLISHER     = 0xe00 + 107, /* from */
1027
  QNX_CCMD_DCMD_MEDIA_DURATION      = 0xe00 + 107, /* no direction */
1028
1029
  QNX_CCMD_DCMD_MEDIA_NAME, /* 108 */
1030
1031
  QNX_CCMD_DCMD_MEDIA_INFO_STREAM   = 0xe00 + 114, /* 114 */
1032
  QNX_CCMD_DCMD_MEDIA_OPEN_STREAM,
1033
  QNX_CCMD_DCMD_MEDIA_CLOSE_STREAM,
1034
  QNX_CCMD_DCMD_MEDIA_SET_STREAM,
1035
  QNX_CCMD_DCMD_MEDIA_READ_STREAM,
1036
  QNX_CCMD_DCMD_MEDIA_GET_DEVINFO,
1037
  QNX_CCMD_DCMD_MEDIA_UPNP_CDS_BROWSE,
1038
  QNX_CCMD_DCMD_MEDIA_DRM_IS_AUTH,
1039
  QNX_CCMD_DCMD_MEDIA_DRM_REGISTER,
1040
  QNX_CCMD_DCMD_MEDIA_DRM_PROXIMTY,
1041
  QNX_CCMD_DCMD_MEDIA_DRM_LICENSE,
1042
  QNX_CCMD_DCMD_MEDIA_DRM_CHALLENGE, /* 125 */
1043
1044
  QNX_CCMD_DCMD_MEDIA_PLAY          = 0xe00 + 10,
1045
  QNX_CCMD_DCMD_MEDIA_PLAY_AT,
1046
  QNX_CCMD_DCMD_MEDIA_PAUSE,
1047
  QNX_CCMD_DCMD_MEDIA_RESUME,
1048
  QNX_CCMD_DCMD_MEDIA_NEXT_TRACK,
1049
  QNX_CCMD_DCMD_MEDIA_PREV_TRACK,
1050
  QNX_CCMD_DCMD_MEDIA_FASTFWD,
1051
  QNX_CCMD_DCMD_MEDIA_FASTRWD,
1052
  QNX_CCMD_DCMD_MEDIA_PLAYBACK_INFO,
1053
  QNX_CCMD_DCMD_MEDIA_GET_SHUFFLE,
1054
  QNX_CCMD_DCMD_MEDIA_SET_SHUFFLE,
1055
  QNX_CCMD_DCMD_MEDIA_GET_REPEAT,
1056
  QNX_CCMD_DCMD_MEDIA_SET_REPEAT,
1057
1058
  QNX_CCMD_DCMD_MEDIA_DEBUG0        = 0xe00 + 200,
1059
  QNX_CCMD_DCMD_MEDIA_DEBUG1,
1060
  QNX_CCMD_DCMD_MEDIA_DEBUG2,
1061
  QNX_CCMD_DCMD_MEDIA_DEBUG3,
1062
  QNX_CCMD_DCMD_MEDIA_DEBUG4,
1063
  QNX_CCMD_DCMD_MEDIA_DEBUG5,
1064
1065
  QNX_CCMD_DCMD_IO_NET_MAX_QUEUE    = 0x400 + 10,
1066
  QNX_CCMD_DCMD_IO_NET_PROMISCUOUS  = 0x400 + 12,
1067
  QNX_CCMD_DCMD_IO_NET_WIFI         = 0x400 + 14,
1068
  QNX_CCMD_DCMD_IO_NET_REDIRECT_BELOW,
1069
  QNX_CCMD_DCMD_IO_NET_VERSION,
1070
  QNX_CCMD_DCMD_IO_NET_CHANGE_MCAST,
1071
  QNX_CCMD_DCMD_IO_NET_INSTANCE,
1072
  QNX_CCMD_DCMD_IO_NET_TX_FLUSH,
1073
  QNX_CCMD_DCMD_IO_NET_MIIPHY,
1074
  QNX_CCMD_DCMD_IO_NET_GET_CONFIG
1075
1076
};
1077
1078
/*
1079
 * from services/system/public/sys/procfs.h
1080
 */
1081
static const value_string qnet6_kif_msg_devctl_cmd_class_vals[] = {
1082
  {QNX_CCMD_DCMD_BLK_PARTENTRY,         "DCMD_BLK_PARTENTRY"},
1083
  {QNX_CCMD_DCMD_BLK_FORCE_RELEARN,     "DCMD_BLK_FORCE_RELEARN"},
1084
/*   {QNX_CCMD_DCMD_FSYS_FORCE_RELEARN,    "DCMD_FSYS_FORCE_RELEARN"}, XXX - duplicate of QNX_CCMD_DCMD_BLK_FORCE_RELEARN */
1085
  {QNX_CCMD_DCMD_FSYS_STATISTICS,       "DCMD_FSYS_STATISTICS"},
1086
  {QNX_CCMD_DCMD_FSYS_STATISTICS_CLR,   "DCMD_FSYS_STATISTICS_CLR"},
1087
  {QNX_CCMD_DCMD_FSYS_STATVFS,          "DCMD_FSYS_STATVFS"},
1088
  {QNX_CCMD_DCMD_FSYS_PREGROW_FILE,     "DCMD_FSYS_PREGROW_FILE"},
1089
  {QNX_CCMD_DCMD_FSYS_DIRECT_IO,        "DCMD_FSYS_DIRECT_IO"},
1090
  {QNX_CCMD_DCMD_FSYS_MOUNTED_ON,       "DCMD_FSYS_MOUNTED_ON"},
1091
  {QNX_CCMD_DCMD_FSYS_MOUNTED_AT,       "DCMD_FSYS_MOUNTED_AT"},
1092
  {QNX_CCMD_DCMD_FSYS_MOUNTED_BY,       "DCMD_FSYS_MOUNTED_BY"},
1093
  {QNX_CCMD_DCMD_FSYS_OPTIONS,          "DCMD_FSYS_OPTIONS"},
1094
  {QNX_CCMD_DCMD_FSYS_FILE_FLAGS,       "DCMD_FSYS_FILE_FLAGS"},
1095
  {QNX_CCMD_DCMD_FSYS_MAP_OFFSET,       "DCMD_FSYS_MAP_OFFSET"},
1096
/*   {QNX_CCMD_DCMD_FSYS_UUID,             "DCMD_FSYS_UUID"}, XXX - duplicate of QNX_CCMD_DCMD_FSYS_MAP_OFFSET */
1097
  {QNX_CCMD_DCMD_FSYS_DIR_NFILES,       "DCMD_FSYS_DIR_NFILES"},
1098
  {QNX_CCMD_DCMD_FSYS_PASS_USE,         "DCMD_FSYS_PASS_USE"},
1099
  {QNX_CCMD_DCMD_FSYS_PASS_CHG,         "DCMD_FSYS_PASS_CHG"},
1100
  {QNX_CCMD_DCMD_FSYS_PASS_NEW,         "DCMD_FSYS_PASS_NEW"},
1101
  {QNX_CCMD_DCMD_FSYS_CACHE_SET,        "DCMD_FSYS_CACHE_SET"},
1102
  {QNX_CCMD_DCMD_CHR_TTYINFO,           "DCMD_CHR_TTYINFO"},
1103
  {QNX_CCMD_DCMD_CHR_SERCTL,            "DCMD_CHR_SERCTL"},
1104
  {QNX_CCMD_DCMD_CHR_TCINJECTC,         "DCMD_CHR_TCINJECTC"},
1105
  {QNX_CCMD_DCMD_CHR_TCINJECTR,         "DCMD_CHR_TCINJECTR"},
1106
  {QNX_CCMD_DCMD_CHR_ISATTY,            "DCMD_CHR_ISATTY"},
1107
  {QNX_CCMD_DCMD_CHR_GETOBAND,          "DCMD_CHR_GETOBAND"},
1108
  {QNX_CCMD_DCMD_CHR_ISSIZE,            "DCMD_CHR_ISSIZE"},
1109
  {QNX_CCMD_DCMD_CHR_OSSIZE,            "DCMD_CHR_OSSIZE"},
1110
  {QNX_CCMD_DCMD_CHR_PARCTL,            "DCMD_CHR_PARCTL"},
1111
  {QNX_CCMD_DCMD_CHR_PNPTEXT,           "DCMD_CHR_PNPTEXT"},
1112
  {QNX_CCMD_DCMD_IO_NET_MAX_QUEUE,      "DCMD_IO_NET_MAX_QUEUE"},
1113
  {QNX_CCMD_DCMD_IO_NET_PROMISCUOUS,    "DCMD_IO_NET_PROMISCUOUS"},
1114
  {QNX_CCMD_DCMD_IO_NET_WIFI,           "DCMD_IO_NET_WIFI"},
1115
  {QNX_CCMD_DCMD_IO_NET_REDIRECT_BELOW, "DCMD_IO_NET_REDIRECT_BELOW"},
1116
  {QNX_CCMD_DCMD_IO_NET_VERSION,        "DCMD_IO_NET_VERSION"},
1117
  {QNX_CCMD_DCMD_IO_NET_CHANGE_MCAST,   "DCMD_IO_NET_CHANGE_MCAST"},
1118
  {QNX_CCMD_DCMD_IO_NET_INSTANCE,       "DCMD_IO_NET_INSTANCE"},
1119
  {QNX_CCMD_DCMD_IO_NET_TX_FLUSH,       "DCMD_IO_NET_TX_FLUSH"},
1120
  {QNX_CCMD_DCMD_IO_NET_MIIPHY,         "DCMD_IO_NET_MIIPHY"},
1121
  {QNX_CCMD_DCMD_IO_NET_GET_CONFIG,     "DCMD_IO_NET_GET_CONFIG"},
1122
  {QNX_CCMD_DCMD_DBGMEM_ADDSYM,         "DCMD_DBGMEM_ADDSYM"},
1123
  {QNX_CCMD_DCMD_DBGMEM_REGISTER,       "DCMD_DBGMEM_REGISTER"},
1124
/*   {QNX_CCMD_DCMD_DUMPER_NOTIFYEVENT,    "DCMD_DUMPER_NOTIFYEVENT"}, XXX - duplicate of QNX_CCMD_DCMD_DBGMEM_REGISTER */
1125
  {QNX_CCMD_DCMD_DUMPER_REMOVEEVENT,    "DCMD_DUMPER_REMOVEEVENT"},
1126
  {QNX_CCMD_DCMD_DUMPER_REMOVEALL,      "DCMD_DUMPER_REMOVEALL"},
1127
  {QNX_CCMD_DCMD_PROC_SYSINFO,          "DCMD_PROC_SYSINFO:obtain information stored in the system page"},
1128
  {QNX_CCMD_DCMD_PROC_INFO,             "DCMD_PROC_INFO:obtain information about a specific process"},
1129
  {QNX_CCMD_DCMD_PROC_MAPINFO,
1130
   "DCMD_PROC_MAPINFO:obtain segment specific information about mapped memory segments in the specific process "},
1131
  {QNX_CCMD_DCMD_PROC_MAPDEBUG,
1132
   "DCMD_PROC_MAPDEBUG:used by debuggers to find the object that contains the symbol information"},
1133
  {QNX_CCMD_DCMD_PROC_MAPDEBUG_BASE,    "PROC_MAPDEBUG_BASE:obtain information pertaining to the path"},
1134
  {QNX_CCMD_DCMD_PROC_SIGNAL,           "DCMD_PROC_SIGNAL"},
1135
  {QNX_CCMD_DCMD_PROC_STOP,             "DCMD_PROC_STOP"},
1136
  {QNX_CCMD_DCMD_PROC_WAITSTOP,         "DCMD_PROC_WAITSTOP"},
1137
  {QNX_CCMD_DCMD_PROC_STATUS,           "DCMD_PROC_STATUS or TIDSTATUS"},
1138
  {QNX_CCMD_DCMD_PROC_CURTHREAD,        "DCMD_PROC_CURTHREAD"},
1139
  {QNX_CCMD_DCMD_PROC_RUN,              "DCMD_PROC_RUN"},
1140
  {QNX_CCMD_DCMD_PROC_GETGREG,          "DCMD_PROC_GETGREG"},
1141
  {QNX_CCMD_DCMD_PROC_SETGREG,          "DCMD_PROC_SETGREG"},
1142
  {QNX_CCMD_DCMD_PROC_GETFPREG,         ""},
1143
  {QNX_CCMD_DCMD_PROC_SETFPREG,         "DCMD_PROC_SETFPREG"},
1144
  {QNX_CCMD_DCMD_PROC_BREAK,            "DCMD_PROC_BREAK"},
1145
  {QNX_CCMD_DCMD_PROC_FREEZETHREAD,     "DCMD_PROC_FREEZETHREAD"},
1146
  {QNX_CCMD_DCMD_PROC_THAWTHREAD,       "DCMD_PROC_THAWTHREAD"},
1147
  {QNX_CCMD_DCMD_PROC_EVENT,            "DCMD_PROC_EVENT"},
1148
  {QNX_CCMD_DCMD_PROC_SET_FLAG,         "DCMD_PROC_SET_FLAG"},
1149
  {QNX_CCMD_DCMD_PROC_CLEAR_FLAG,       "DCMD_PROC_CLEAR_FLAG"},
1150
  {QNX_CCMD_DCMD_PROC_PAGEDATA,         "DCMD_PROC_PAGEDATA"},
1151
  {QNX_CCMD_DCMD_PROC_GETALTREG,        "DCMD_PROC_GETALTREG"}, /* 21 */
1152
  {QNX_CCMD_DCMD_PROC_SETALTREG,        "DCMD_PROC_SETALTREG"},
1153
  {QNX_CCMD_DCMD_PROC_TIMERS,           "DCMD_PROC_TIMERS"},
1154
  {QNX_CCMD_DCMD_PROC_IRQS,             "DCMD_PROC_IRQS"},
1155
  {QNX_CCMD_DCMD_PROC_GETREGSET,        "DCMD_PROC_GETREGSET"},
1156
  {QNX_CCMD_DCMD_PROC_SETREGSET,        "DCMD_PROC_SETREGSET"},
1157
  {QNX_CCMD_DCMD_PROC_THREADCTL,        "DCMD_PROC_THREADCTL"},
1158
  {QNX_CCMD_DCMD_PROC_GET_BREAKLIST,    "DCMD_PROC_GET_BREAKLIST"},
1159
  {QNX_CCMD_DCMD_PROC_CHANNELS,         "DCMD_PROC_CHANNELS"},
1160
  {QNX_CCMD_DCMD_PROC_GET_MEMPART_LIST, "DCMD_PROC_GET_MEMPART_LIST"}, /* 30 */
1161
  {QNX_CCMD_DCMD_PROC_ADD_MEMPARTID,    "DCMD_PROC_ADD_MEMPARTID"},
1162
  {QNX_CCMD_DCMD_PROC_DEL_MEMPARTID,    "DCMD_PROC_DEL_MEMPARTID"},
1163
  {QNX_CCMD_DCMD_PROC_CHG_MEMPARTID,    "DCMD_PROC_CHG_MEMPARTID"}, /* 33 */
1164
  {QNX_CCMD_DCMD_DIO_DEVICE,            "DCMD_DIO_DEVICE"},
1165
  {QNX_CCMD_DCMD_DIO_ALLOC,             "DCMD_DIO_ALLOC"},
1166
  {QNX_CCMD_DCMD_DIO_IO,                "DCMD_DIO_IO"},
1167
  {QNX_CCMD_DCMD_CHR_TCFLOW,            "DCMD_CHR_TCFLOW"},
1168
  {QNX_CCMD_DCMD_CHR_ISCHARS,           "DCMD_CHR_ISCHARS"},
1169
  {QNX_CCMD_DCMD_CHR_TCGETSID,          "DCMD_CHR_TCGETSID"},
1170
  {QNX_CCMD_DCMD_CHR_TCSETSID,          "DCMD_CHR_TCSETSID"},
1171
  {QNX_CCMD_DCMD_CHR_TCFLUSH,           "DCMD_CHR_TCFLUSH"},
1172
  {QNX_CCMD_DCMD_CHR_TCGETATTR,         "DCMD_CHR_TCGETATTR"},
1173
  {QNX_CCMD_DCMD_CHR_TCSETATTR,         "DCMD_CHR_TCSETATTR"},
1174
  {QNX_CCMD_DCMD_CHR_TCSETATTRD,        "DCMD_CHR_TCSETATTRD"},
1175
  {QNX_CCMD_DCMD_CHR_TCSETATTRF,        "DCMD_CHR_TCSETATTRF"},
1176
  {QNX_CCMD_DCMD_CHR_PUTOBAND,          "DCMD_CHR_PUTOBAND"},
1177
  {QNX_CCMD_DCMD_CHR_TCDRAIN,           "DCMD_CHR_TCDRAIN"},
1178
  {QNX_CCMD_DCMD_CHR_SETSIZE,           "DCMD_CHR_SETSIZE"},
1179
  {QNX_CCMD_DCMD_CHR_GETSIZE,           "DCMD_CHR_GETSIZE"},
1180
  {QNX_CCMD_DCMD_CHR_LINESTATUS,        "DCMD_CHR_LINESTATUS"},
1181
  {QNX_CCMD_DCMD_CHR_OSCHARS,           "DCMD_CHR_OSCHARS"},
1182
  {QNX_CCMD_DCMD_CHR_TCSETPGRP,         "DCMD_CHR_TCSETPGRP"},
1183
  {QNX_CCMD_DCMD_CHR_TCGETPGRP,         "DCMD_CHR_TCGETPGRP"},
1184
  {0, NULL}
1185
};
1186
1187
static value_string_ext qnet6_kif_msg_devctl_cmd_class_vals_ext = VALUE_STRING_EXT_INIT(qnet6_kif_msg_devctl_cmd_class_vals);
1188
1189
enum qnx_io_msg_xtypes
1190
{
1191
  QNX_IO_XTYPE_NONE,
1192
  QNX_IO_XTYPE_READCOND,
1193
  QNX_IO_XTYPE_MQUEUE,
1194
  QNX_IO_XTYPE_TCPIP,
1195
  QNX_IO_XTYPE_TCPIP_MSG,
1196
  QNX_IO_XTYPE_OFFSET,
1197
  QNX_IO_XTYPE_REGISTRY
1198
};
1199
static const value_string qnet6_kif_msgsend_msg_io_read_xtypes_vals[] = {
1200
  {QNX_IO_XTYPE_NONE,      "_IO_XTYPE_NONE"},
1201
  {QNX_IO_XTYPE_READCOND,  "_IO_XTYPE_READCOND"},
1202
  {QNX_IO_XTYPE_MQUEUE,    "_IO_XTYPE_MQUEUE"},
1203
  {QNX_IO_XTYPE_TCPIP,     "_IO_XTYPE_TCPIP"},
1204
  {QNX_IO_XTYPE_TCPIP_MSG, "_IO_XTYPE_TCPIP_MSG"},
1205
  {QNX_IO_XTYPE_OFFSET,    "_IO_XTYPE_OFFSET"},
1206
  {QNX_IO_XTYPE_REGISTRY,  "_IO_XTYPE_REGISTRY"},
1207
  {0, NULL}
1208
};
1209
1210
enum _file_type
1211
{
1212
  QNX_FTYPE_MATCHED = -1,
1213
  QNX_FTYPE_ALL     = -1,
1214
  QNX_FTYPE_ANY     =  0,
1215
  QNX_FTYPE_FILE,
1216
  QNX_FTYPE_LINK,
1217
  QNX_FTYPE_SYMLINK,
1218
  QNX_FTYPE_PIPE,
1219
  QNX_FTYPE_SHMEM,
1220
  QNX_FTYPE_MQUEUE,
1221
  QNX_FTYPE_SOCKET,
1222
  QNX_FTYPE_SEM,
1223
  QNX_FTYPE_PHOTON,
1224
  QNX_FTYPE_DUMPER,
1225
  QNX_FTYPE_MOUNT,
1226
  QNX_FTYPE_NAME,
1227
  QNX_FTYPE_TYMEM
1228
};
1229
static const value_string qnet6_kif_msgsend_msg_connect_filetype_vals[] = {
1230
  {QNX_FTYPE_ALL,     "_FTYPE_ALL"},
1231
  {QNX_FTYPE_ANY,     "_FTYPE_ANY"},
1232
  {QNX_FTYPE_FILE,    "_FTYPE_FILE"},
1233
  {QNX_FTYPE_LINK,    "_FTYPE_LINK"},
1234
  {QNX_FTYPE_SYMLINK, "_FTYPE_SYMLINK"},
1235
  {QNX_FTYPE_PIPE,    "_FTYPE_PIPE"},
1236
  {QNX_FTYPE_SHMEM,   "_FTYPE_SHMEM"},
1237
  {QNX_FTYPE_MQUEUE,  "_FTYPE_MQUEUE"},
1238
  {QNX_FTYPE_SOCKET,  "_FTYPE_SOCKET"},
1239
  {QNX_FTYPE_SEM,     "_FTYPE_SEM"},
1240
  {QNX_FTYPE_PHOTON,  "_FTYPE_PHOTON"},
1241
  {QNX_FTYPE_DUMPER,  "_FTYPE_DUMPER"},
1242
  {QNX_FTYPE_MOUNT,   "_FTYPE_MOUNT"},
1243
  {QNX_FTYPE_NAME,    "_FTYPE_NAME"},
1244
  {QNX_FTYPE_TYMEM,   "_FTYPE_TYMEM"},
1245
  {0, NULL}
1246
};
1247
1248
static const value_string qnet6_kif_msgsend_msg_connect_ioflag_vals[] = {
1249
  {0x0, "readonly"},            /* O_RDONLY 0 */
1250
  {0x1, "writeonly"},           /* O_WRONLY 1 */
1251
  {0x2, "readwrite"},           /* O_RDWR 2 */
1252
#if 0
1253
  {0x4, "append"},              /* O_APPEND 010 */
1254
  {0x5, "datasync"},            /* O_DSYNC 020 */
1255
  {0x6, "sync"},                /* O_SYNC 040 */
1256
1257
  {0x9, "rsync"},               /* O_RSYNC 0100 */
1258
  {0xa, "nonblock"},            /* O_NONBLOCK 0200 */
1259
  {0xb, "creat"},               /* O_CREAT 0400 */
1260
1261
  {0xd, "truncate"},            /* O_TRUNC 01000 */
1262
  {0xe, "exclusive"},           /* O_EXCL 02000 */
1263
  {0xf, "noctrltty"},           /* O_NOCTTY 04000 */
1264
  /*
1265
   * below is QNX extension
1266
   */
1267
  /*
1268
   * O_CLOEXEC 020000
1269
   */
1270
  /*
1271
   * O_REALIDS 040000
1272
   */
1273
  /*
1274
   * O_LARGEFILE 0100000
1275
   */
1276
  /*
1277
   * O_ASYNC 0200000
1278
   */
1279
#endif
1280
  {0, NULL}
1281
};
1282
1283
static const value_string qnet6_kif_msgsend_msg_connect_mode_vals[] = {
1284
#if 0
1285
#define S_IRWXU     000700  /* Read, write, execute/search */
1286
#define S_IRUSR     000400  /* Read permission */
1287
#define S_IWUSR     000200  /* Write permission */
1288
#define S_IXUSR     000100  /* Execute/search permission */
1289
1290
  /*
1291
   *  Group permissions
1292
   */
1293
#define S_IRWXG     000070  /* Read, write, execute/search */
1294
#define S_IRGRP     000040  /* Read permission */
1295
#define S_IWGRP     000020  /* Write permission */
1296
#define S_IXGRP     000010  /* Execute/search permission */
1297
1298
  /*
1299
   *  Other permissions
1300
   */
1301
#define S_IRWXO     000007  /* Read, write, execute/search */
1302
#define S_IROTH     000004  /* Read permission */
1303
#define S_IWOTH     000002  /* Write permission */
1304
#define S_IXOTH     000001  /* Execute/search permission */
1305
#define S_ISUID     004000  /* set user id on execution */
1306
#define S_ISGID     002000  /* set group id on execution */
1307
#define S_ISVTX     001000  /* sticky bit */
1308
1309
#define _S_IFIFO    0x1000  /* FIFO */
1310
#define _S_IFCHR    0x2000  /* Character special */
1311
#define _S_IFDIR    0x4000  /* Directory */
1312
#define _S_IFNAM    0x5000  /* Special named file */
1313
#define _S_IFBLK    0x6000  /* Block special */
1314
#define _S_IFREG    0x8000  /* Regular */
1315
#define _S_IFLNK    0xA000  /* Symbolic link */
1316
#define _S_IFSOCK   0xC000  /* Socket */
1317
#endif
1318
  /*
1319
   * yzhao the value should be the value after bitshift
1320
   */
1321
  {0x1, "FIFO"},
1322
  {0x2, "Character special"},
1323
  {0x4, "Directory"},
1324
  {0x5, "Special named file"},
1325
  {0x6, "Block special"},
1326
  {0x8, "Regular"},
1327
  {0xa, "Symbolic link"},
1328
  {0xc, "Socket"},
1329
  {0, NULL}
1330
};
1331
1332
static const value_string qnet6_kif_msgsend_msg_connect_sflag_vals[] = {
1333
  {0x00, "compatibility mode"},
1334
  {0x01, "DOS-like interpretation of open, locks, etc"},
1335
  {0x10, "deny read/write mode"},
1336
  {0x20, "deny write mode"},
1337
  {0x30, "deny read mode"},
1338
  {0x40, "deny none mode"},
1339
  {0x70, "mask for standard share modes"},
1340
  {0, NULL}
1341
};
1342
1343
static const value_string qnet6_kif_msgsend_msg_connect_access_vals[] = {
1344
  {0x0, "not set"},
1345
  {0x1, "read"}, /* IO_FLAG_RD 1 */
1346
  {0x2, "write"}, /* IO_FLAG_WR 2 */
1347
  {0, NULL}
1348
};
1349
1350
static const value_string qnet6_kif_msgsend_msg_io_seek_whence_vals[] = {
1351
  {0x0, "SEEK_SET"},
1352
  {0x1, "SEEK_CUR"},
1353
  {0x2, "SEEK_END"},
1354
  {0, NULL}
1355
};
1356
1357
enum qnx_io_space_subtype_enum
1358
{
1359
  QNX_F_ALLOCSP64 = 110,
1360
  QNX_F_FREESP64  = 111
1361
};
1362
1363
static const value_string qnet6_kif_msgsend_msg_io_space_subtype_vals[] = {
1364
  {QNX_F_ALLOCSP64, "F_ALLOCSP64"},
1365
  {QNX_F_FREESP64,  "F_FREESP64"},
1366
  {0, NULL}
1367
};
1368
1369
enum pathconf_value
1370
{
1371
  QNX_PC_LINK_MAX           =  1,
1372
  QNX_PC_MAX_CANON,
1373
  QNX_PC_MAX_INPUT,
1374
  QNX_PC_NAME_MAX,
1375
  QNX_PC_PATH_MAX,
1376
  QNX_PC_PIPE_BUF,
1377
  QNX_PC_NO_TRUNC,
1378
  QNX_PC_VDISABLE,
1379
  QNX_PC_CHOWN_RESTRICTED,
1380
  QNX_PC_DOS_SHARE          = 10,
1381
  QNX_PC_IMAGE_VADDR        = 11,
1382
  QNX_PC_ASYNC_IO           = 12,
1383
  QNX_PC_PRIO_IO            = 13,
1384
  QNX_PC_SYNC_IO            = 14,
1385
  QNX_PC_SOCK_MAXBUF        = 15,
1386
  QNX_PC_FILESIZEBITS       = 16,
1387
  QNX_PC_SYMLINK_MAX        = 17,
1388
  QNX_PC_SYMLOOP_MAX        = 18,
1389
  QNX_PC_LINK_DIR           = 19,
1390
  QNX_PC_2_SYMLINKS         = 20,
1391
  QNX_PC_ALLOC_SIZE_MIN     = 21,
1392
  QNX_PC_REC_INCR_XFER_SIZE = 22,
1393
  QNX_PC_REC_MAX_XFER_SIZE  = 23,
1394
  QNX_PC_REC_MIN_XFER_SIZE  = 24,
1395
  QNX_PC_REC_XFER_ALIGN     = 25
1396
};
1397
1398
static const value_string qnet6_kif_msgsend_msg_io_pathconf_name_vals[] = {
1399
  {QNX_PC_LINK_MAX,           "_PC_LINK_MAX"},
1400
  {QNX_PC_MAX_CANON,          "_PC_MAX_CANON"},
1401
  {QNX_PC_MAX_INPUT,          "_PC_MAX_INPUT"},
1402
  {QNX_PC_NAME_MAX,           "_PC_NAME_MAX"},
1403
  {QNX_PC_PATH_MAX,           "_PC_PATH_MAX"},
1404
  {QNX_PC_PIPE_BUF,           "_PC_PIPE_BUF"},
1405
  {QNX_PC_NO_TRUNC,           "_PC_NO_TRUNC"},
1406
  {QNX_PC_VDISABLE,           "_PC_VDISABLE"},
1407
  {QNX_PC_CHOWN_RESTRICTED,   "_PC_CHOWN_RESTRICTED"},
1408
  {QNX_PC_DOS_SHARE,          "_PC_DOS_SHARE"},
1409
  {QNX_PC_IMAGE_VADDR,        "_PC_IMAGE_VADDR"},
1410
  {QNX_PC_ASYNC_IO,           "_PC_ASYNC_IO"},
1411
  {QNX_PC_PRIO_IO,            "_PC_PRIO_IO"},
1412
  {QNX_PC_SYNC_IO,            "_PC_SYNC_IO"},
1413
  {QNX_PC_SOCK_MAXBUF,        "_PC_SOCK_MAXBUF"},
1414
  {QNX_PC_FILESIZEBITS,       "_PC_FILESIZEBITS"},
1415
  {QNX_PC_SYMLINK_MAX,        "_PC_SYMLINK_MAX"},
1416
  {QNX_PC_SYMLOOP_MAX,        "_PC_SYMLOOP_MAX"},
1417
  {QNX_PC_LINK_DIR,           "_PC_LINK_DIR"},
1418
  {QNX_PC_2_SYMLINKS,         "_PC_2_SYMLINKS"},
1419
  {QNX_PC_ALLOC_SIZE_MIN,     "_PC_ALLOC_SIZE_MIN"},
1420
  {QNX_PC_REC_INCR_XFER_SIZE, "_PC_REC_INCR_XFER_SIZE"},
1421
  {QNX_PC_REC_MAX_XFER_SIZE,  "_PC_REC_MAX_XFER_SIZE"},
1422
  {QNX_PC_REC_MIN_XFER_SIZE,  "_PC_REC_MIN_XFER_SIZE"},
1423
  {QNX_PC_REC_XFER_ALIGN,     "_PC_REC_XFER_ALIGN"},
1424
  {0, NULL}
1425
};
1426
1427
static value_string_ext qnet6_kif_msgsend_msg_io_pathconf_name_vals_ext = VALUE_STRING_EXT_INIT(qnet6_kif_msgsend_msg_io_pathconf_name_vals);
1428
1429
enum QNX_IO_OPENFD_XTYPES
1430
{
1431
  _IO_OPENFD_NONE,
1432
  _IO_OPENFD_PIPE,
1433
  _IO_OPENFD_KQUEUE,
1434
  _IO_OPENFD_ACCEPT,
1435
  _IO_OPENFD_SCTP_PEELOFF
1436
};
1437
1438
static const value_string qnet6_kif_msgsend_msg_openfd_xtypes_vals[] = {
1439
  {_IO_OPENFD_NONE,         "_IO_OPENFD_NONE"},
1440
  {_IO_OPENFD_PIPE,         "_IO_OPENFD_PIPE"},
1441
  {_IO_OPENFD_KQUEUE,       "_IO_OPENFD_KQUEUE"},
1442
  {_IO_OPENFD_ACCEPT,       "_IO_OPENFD_ACCEPT"},
1443
  {_IO_OPENFD_SCTP_PEELOFF, "_IO_OPENFD_SCTP_PEELOFF"},
1444
  {0, NULL}
1445
};
1446
1447
48
#define QNX_NTO_SIDE_CHANNEL 0x40000000
1448
30
#define QNX_NTO_GLOBAL_CHANNEL QNX_NTO_SIDE_CHANNEL
1449
1450
/*
1451
 * Perform LWL4 crc check
1452
 */
1453
static bool qnet6_lwl4_check_crc = true;
1454
1455
/*
1456
 * in sys/lsm/qnet/qos.h LR is using sockaddr as addr Family:1 means mac
1457
 * :2 means interface name
1458
 */
1459
12
#define QNET_LR_SA_FAMILY_MAC 1
1460
1461
/*
1462
 * when dissect_qnet6_lr is called in dissect_qnet6, it has already
1463
 * checked whether left length > sizeof(struct qnet6_lr_pkt) so here we
1464
 * have to check whether off, len > left length proto_tree_add_subtree and
1465
 * proto_tree_add_string's difference are text doesn't need the hf_... so
1466
 * it can't be searched.
1467
 */
1468
static int
1469
dissect_qnet6_lr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
1470
21
{
1471
141
#define QNET6_LR_PAIRS 6
1472
21
  proto_item   *ti;
1473
21
  proto_tree   *stree, *srctree, *dstree, *sstree = NULL;
1474
21
  uint32_t      total_len, off, len, rlen;
1475
21
  int           lr_start, i, hf_index_off = -1, hf_index_len = -1, hf_index = -1;
1476
21
  uint8_t       type;
1477
21
  uint8_t const *p, *name[QNET6_LR_PAIRS];
1478
1479
21
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "QNET_LR");
1480
1481
  /*
1482
   * now rlen is the length of data behind qnet6_lr_pkt + qnet6_lr_pkt
1483
   */
1484
21
  rlen = tvb_reported_length_remaining(tvb, *poffset + QNX_QNET6_LR_PKT_SIZE);
1485
1486
21
  lr_start = *poffset;
1487
21
  ti = proto_tree_add_item(tree, proto_qnet6_lr, tvb, *poffset, -1, ENC_NA);
1488
21
  stree = proto_item_add_subtree(ti, ett_qnet6_lr);
1489
1490
  /*
1491
   * version
1492
   */
1493
21
  proto_tree_add_item(stree, hf_qnet6_lr_ver, tvb, (*poffset)++, 1, ENC_BIG_ENDIAN);
1494
21
  (*poffset)++; /* skip spare byte */
1495
  /*
1496
   * type
1497
   */
1498
21
  type = tvb_get_uint8(tvb, *poffset);
1499
21
  proto_tree_add_item(stree, hf_qnet6_lr_type, tvb, (*poffset)++, 1, ENC_BIG_ENDIAN);
1500
21
  (*poffset)++; /* skip another spare byte */
1501
1502
  /*
1503
   * total length which includes this header and name payload
1504
   */
1505
21
  total_len = tvb_get_uint32(tvb, *poffset, encoding);
1506
21
  proto_tree_add_uint(stree, hf_qnet6_lr_total_len, tvb, *poffset, 4, total_len);
1507
21
  *poffset += 4;
1508
1509
21
  ti = proto_tree_add_string(stree, hf_qnet6_lr_src, tvb, *poffset, 4 * 6, "source node information");
1510
21
  srctree = proto_item_add_subtree(ti, ett_qnet6_lr_src);
1511
21
  ti = proto_tree_add_string(stree, hf_qnet6_lr_dst, tvb, *poffset + 4 * 6, 4 * 6, "destination node information");
1512
21
  dstree = proto_item_add_subtree(ti, ett_qnet6_lr_dst);
1513
21
  rlen = MIN(rlen, total_len);
1514
1515
141
  for (i = 0; i < QNET6_LR_PAIRS; i++)
1516
120
    {
1517
120
      if (i < 3)
1518
60
        stree = srctree;
1519
60
      else
1520
60
        stree = dstree;
1521
1522
120
      switch (i)
1523
120
        {
1524
20
        case 0:
1525
20
          hf_index_off = hf_qnet6_lr_src_name_off;
1526
20
          hf_index_len = hf_qnet6_lr_src_name_len;
1527
20
          hf_index = hf_qnet6_lr_src_name_generated;
1528
20
          sstree = proto_tree_add_subtree(stree, tvb, *poffset, 4 * 2,
1529
20
              ett_qnet6_lr_src_name_subtree, NULL, "name");
1530
20
          break;
1531
20
        case 1:
1532
20
          hf_index_off = hf_qnet6_lr_src_domain_off;
1533
20
          hf_index_len = hf_qnet6_lr_src_domain_len;
1534
20
          hf_index = hf_qnet6_lr_src_domain_generated;
1535
20
          sstree = proto_tree_add_subtree(stree, tvb, *poffset, 4 * 2,
1536
20
              ett_qnet6_lr_src_name_subtree, NULL, "domain");
1537
20
          break;
1538
20
        case 2:
1539
20
          hf_index_off = hf_qnet6_lr_src_addr_off;
1540
20
          hf_index_len = hf_qnet6_lr_src_addr_len;
1541
20
          hf_index = hf_qnet6_lr_src_addr_generated;
1542
20
          sstree = proto_tree_add_subtree(stree, tvb, *poffset, 4 * 2,
1543
20
              ett_qnet6_lr_src_name_subtree, NULL, "address");
1544
20
          break;
1545
20
        case 3:
1546
20
          hf_index_off = hf_qnet6_lr_dst_name_off;
1547
20
          hf_index_len = hf_qnet6_lr_dst_name_len;
1548
20
          hf_index = hf_qnet6_lr_dst_name_generated;
1549
20
          sstree = proto_tree_add_subtree(stree, tvb, *poffset, 4 * 2,
1550
20
              ett_qnet6_lr_src_name_subtree, NULL, "name");
1551
20
          break;
1552
20
        case 4:
1553
20
          hf_index_off = hf_qnet6_lr_dst_domain_off;
1554
20
          hf_index_len = hf_qnet6_lr_dst_domain_len;
1555
20
          hf_index = hf_qnet6_lr_dst_domain_generated;
1556
20
          sstree = proto_tree_add_subtree(stree, tvb, *poffset, 4 * 2,
1557
20
              ett_qnet6_lr_src_name_subtree, NULL, "domain");
1558
20
          break;
1559
20
        case 5:
1560
20
          hf_index_off = hf_qnet6_lr_dst_addr_off;
1561
20
          hf_index_len = hf_qnet6_lr_dst_addr_len;
1562
20
          hf_index = hf_qnet6_lr_dst_addr_generated;
1563
20
          sstree = proto_tree_add_subtree(stree, tvb, *poffset, 4 * 2,
1564
20
              ett_qnet6_lr_src_name_subtree, NULL, "address");
1565
20
          break;
1566
120
        }
1567
1568
120
      off = tvb_get_uint32(tvb, *poffset, encoding);
1569
120
      proto_tree_add_item(sstree, hf_index_off, tvb, *poffset, 4, encoding);
1570
120
      *poffset += 4;
1571
1572
120
      len = tvb_get_uint32(tvb, *poffset, encoding);
1573
120
      proto_tree_add_item(sstree, hf_index_len, tvb, *poffset, 4, encoding);
1574
120
      *poffset += 4;
1575
1576
120
      if ((off <= rlen) && (len <= rlen))
1577
28
        {
1578
28
          unsigned addr_data_offset = lr_start + off + QNX_QNET6_LR_PKT_SIZE /* sizeof(struct qnet6_lr_pkt) */;
1579
          /*
1580
           * struct qnet6_lr_pkt is 64 bit aligned
1581
           */
1582
28
          if (i != 2 && i != 5)
1583
22
            {
1584
22
            name[i] = tvb_get_string_enc(pinfo->pool,
1585
22
                                         tvb,
1586
22
                                         addr_data_offset,
1587
22
                                         len,
1588
22
                                         ENC_ASCII|ENC_NA);
1589
22
                ti = proto_tree_add_string(sstree, hf_index, tvb, addr_data_offset, len, name[i]);
1590
22
                proto_item_set_generated(ti);
1591
22
            }
1592
6
          else
1593
6
            {
1594
6
              if (tvb_get_uint8(tvb, addr_data_offset + 1) == QNET_LR_SA_FAMILY_MAC && len >= 2 + 6)
1595
0
                {
1596
0
                  name[i] = tvb_ether_to_str(pinfo->pool, tvb, addr_data_offset + 2);
1597
0
                  ti = proto_tree_add_item(sstree, hf_index, tvb, addr_data_offset + 2, 6, ENC_NA);
1598
0
                  proto_item_set_generated(ti);
1599
0
                }
1600
6
              else
1601
6
                {
1602
                  /* The comment above suggests that value '2' means interface
1603
                   * name, but this was not observed in the provided pcap, so
1604
                   * let's ignore that possibility for now. */
1605
6
                  name[i] = NULL;
1606
6
                }
1607
6
            }
1608
28
        }
1609
92
      else
1610
92
        {
1611
92
          name[i] = NULL;
1612
92
        }
1613
120
    }
1614
1615
21
  switch (type)
1616
21
    {
1617
1
    case QNET_LR_TYPE_REQUEST:
1618
1
      p = name[2];
1619
1
      if (p)
1620
0
        {
1621
0
          col_add_fstr(pinfo->cinfo, COL_INFO,
1622
0
                        "Who is \"%s.%s\"? Tell \"%s.%s\"@%s",
1623
0
                        name[3] ? (const char*)name[3] : "?", name[4] ? (const char*)name[4] : "?",
1624
0
                        name[0] ? (const char*)name[0] : "?", name[1] ? (const char*)name[1] : "?",
1625
0
                        p);
1626
0
        }
1627
1
      break;
1628
2
    case QNET_LR_TYPE_REPLY:
1629
2
      p = name[2];
1630
2
      if (p)
1631
0
        {
1632
0
          col_add_fstr(pinfo->cinfo, COL_INFO,
1633
0
                        "To \"%s.%s\", \"%s.%s\" is at %s",
1634
0
                        name[3] ? (const char*)name[3] : "?", name[4] ? (const char*)name[4] : "?",
1635
0
                        name[0] ? (const char*)name[0] : "?", name[1] ? (const char*)name[1] : "?",
1636
0
                        p);
1637
0
        }
1638
2
      break;
1639
17
    default:
1640
17
      col_set_str(pinfo->cinfo, COL_INFO, "Unknown LR Type");
1641
21
    }
1642
1643
20
  return *poffset - lr_start;
1644
21
}
1645
1646
6
#define QNX_NR_PING_REQ     0
1647
3
#define QNX_NR_PING_ANS     1
1648
0
#define QNX_NR_REMOTE_REQ   2
1649
1
#define QNX_NR_REMOTE_ANS   3
1650
1
#define QNX_NR_REMOTE_ERROR 4
1651
1652
static const value_string qnet6_nr_type_vals[] = {
1653
  {QNX_NR_PING_REQ,     "Network Resolver Ping Request"},
1654
  {QNX_NR_PING_ANS,     "Network Resolver Ping Reply"},
1655
  {QNX_NR_REMOTE_REQ,   "Network Resolver Remote Request"},
1656
  {QNX_NR_REMOTE_ANS,   "Network Resolver Remote Reply"},
1657
  {QNX_NR_REMOTE_ERROR, "Network Resolver Remote Error"},
1658
  {0, NULL}
1659
};
1660
1661
#define QNX_NOTIFY_ACTION_TRANARM 0x0
1662
#define QNX_NOTIFY_ACTION_CONDARM 0x1
1663
#define QNX_NOTIFY_ACTION_POLL    0x2
1664
#define QNX_NOTIFY_ACTION_POLLARM 0x3
1665
static const value_string qnet6_kif_msgsend_msg_io_notify_action_vals[] = {
1666
  {QNX_NOTIFY_ACTION_TRANARM, "_NOTIFY_ACTION_TRANARM"},
1667
  {QNX_NOTIFY_ACTION_CONDARM, "_NOTIFY_ACTION_CONDARM"},
1668
  {QNX_NOTIFY_ACTION_POLL,    "_NOTIFY_ACTION_POLL"},
1669
  {QNX_NOTIFY_ACTION_POLLARM, "_NOTIFY_ACTION_POLLARM"},
1670
  {0, NULL}
1671
};
1672
1673
/*
1674
 * NR related header files are in sys/lsm/qnet/nr_msg.h yzhao
1675
 */
1676
static int
1677
dissect_qnet6_nr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
1678
22
{
1679
22
  proto_item *ti;
1680
22
  proto_tree *stree;
1681
22
  uint8_t     name_len, rlen, type;
1682
1683
22
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "QNET_NR");
1684
1685
22
  ti = proto_tree_add_item(tree, proto_qnet6_nr, tvb, *poffset, -1, ENC_NA);
1686
22
  stree = proto_item_add_subtree(ti, ett_qnet6_nr);
1687
1688
  /*
1689
   * type
1690
   */
1691
22
  type = tvb_get_uint8(tvb, *poffset);
1692
22
  proto_tree_add_item(stree, hf_qnet6_nr_type, tvb, (*poffset)++, 1, ENC_NA);
1693
22
  switch (type)
1694
22
    {
1695
6
    case QNX_NR_PING_REQ:
1696
6
      col_set_str(pinfo->cinfo, COL_INFO, "Network Resolver Ping Request");
1697
6
      break;
1698
3
    case QNX_NR_PING_ANS:
1699
3
      col_set_str(pinfo->cinfo, COL_INFO, "Network Resolver Ping Reply");
1700
      /*
1701
       * ping request/reply there is no further data
1702
       */
1703
3
      break;
1704
0
    case QNX_NR_REMOTE_REQ:
1705
0
      col_set_str(pinfo->cinfo, COL_INFO, "Network Resolver Remote Request");
1706
0
      name_len = tvb_get_uint8(tvb, *poffset);
1707
0
      proto_tree_add_item(stree, hf_qnet6_nr_remote_req_len, tvb, (*poffset)++, 1, ENC_BIG_ENDIAN);
1708
0
      proto_tree_add_item(stree, hf_qnet6_nr_remote_req_id, tvb, *poffset, 2, encoding);
1709
0
      *poffset += 2;
1710
0
      rlen = MIN(name_len, tvb_reported_length_remaining(tvb, *poffset));
1711
0
      proto_tree_add_item(stree, hf_qnet6_nr_remote_req_name, tvb, *poffset, rlen, encoding);
1712
0
      *poffset += rlen;
1713
0
      break;
1714
1
    case QNX_NR_REMOTE_ANS:
1715
1
      col_set_str(pinfo->cinfo, COL_INFO, "Network Resolver Remote Reply");
1716
1
      proto_tree_add_item(stree, hf_qnet6_nr_remote_rep_spare, tvb, (*poffset)++, 1, ENC_BIG_ENDIAN);
1717
1
      proto_tree_add_item(stree, hf_qnet6_nr_remote_rep_id, tvb, *poffset, 2, encoding);
1718
1
      *poffset += 2;
1719
1
      proto_tree_add_item(stree, hf_qnet6_nr_remote_rep_nd, tvb, *poffset, 4, encoding);
1720
1
      *poffset += 4;
1721
1
      break;
1722
1
    case QNX_NR_REMOTE_ERROR:
1723
1
      col_set_str(pinfo->cinfo, COL_INFO, "Network Resolver Remote Error");
1724
1
      proto_tree_add_item(stree, hf_qnet6_nr_remote_rep_spare, tvb, (*poffset)++, 1, ENC_BIG_ENDIAN);
1725
1
      proto_tree_add_item(stree, hf_qnet6_nr_remote_rep_id, tvb, *poffset, 2, encoding);
1726
1
      *poffset += 2;
1727
1
      proto_tree_add_item(stree, hf_qnet6_nr_remote_rep_status, tvb, *poffset, 4, encoding);
1728
1
      *poffset += 4;
1729
1
      break;
1730
11
    default:
1731
11
      col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
1732
11
      break;
1733
22
    }
1734
1735
22
  return 0;
1736
22
}
1737
1738
/*
1739
 * in Neutrino pid_t is _INT32
1740
 */
1741
/*
1742
 * all definitions below are based on QNX Neutrino only supports 32 bits
1743
 * now struct qnet6_kif_connect { uint16_t msgtype; uint16_t size; // Size
1744
 * of message with cred if sent uint32_t version; // Version of local
1745
 * protocol int32_t server_pid; // target process on remote node int32_t
1746
 * server_chid; // target channel on remote node int32_t client_id; //
1747
 * handle for remote node to use for this connection int32_t client_pid;
1748
 * // local process id for remote node to verify }; struct
1749
 * qnet6_kif_connect_success { uint16_t msgtype; //
1750
 * qnet6_kif_CONNECT_SUCCESS uint16_t size; // Size of message uint32_t
1751
 * version; // Version of remote protocol int32_t client_id; // Handle
1752
 * passed in qnet6_kif_connect int32_t server_id; // A handle on remote
1753
 * node to target messages int32_t scoid; // Remote server's server
1754
 * connect id for local information uint32_t nbytes; // Number of bytes to
1755
 * limit qnet6_kif_msgsend to };
1756
 *
1757
 * struct qnet6_kif_connect_fail { uint16_t msgtype; //
1758
 * qnet6_kif_CONNECT_FAIL uint16_t size; // Size of message uint32_t
1759
 * version; // Version of remote protocol int32_t client_id; // Handle
1760
 * passed in qnet6_kif_connect int32_t status; // errno reason for failure
1761
 * };
1762
 *
1763
 * struct qnet6_kif_connect_death { uint16_t msgtype; //
1764
 * qnet6_kif_CONNECT_DEATH uint16_t size; // Size of message int32_t
1765
 * client_id; // Handle passed in qnet6_kif_connect };
1766
 */
1767
/*
1768
 * _vtid_info is in sys/neutrino.h
1769
 */
1770
/*
1771
 * struct _vtid_info { int32_t tid; int32_t coid; int32_t priority; int32_t
1772
 * srcmsglen; int32_t keydata; int32_t srcnd; int32_t dstmsglen; int32_t zero;
1773
 * }; struct qnet6_kif_msgsend { uint16_t msgtype; // qnet6_kif_MSGSEND
1774
 * uint16_t size; // Size of message without message int32_t server_id; //
1775
 * Handle returned in qnet6_kif_connect_success int32_t client_handle; //
1776
 * Local handle for this transaction struct _vtid_info vinfo; // Info that
1777
 * changes frequently uint32_t nbytes; // number of bytes limited by what
1778
 * remote node requested // unsigned char message[]; // Data to be sent
1779
 * };
1780
 *
1781
 * struct qnet6_kif_msgread { uint16_t msgtype; // qnet6_kif_MSGREAD
1782
 * uint16_t size; // Size of message int32_t msgread_handle; // Remote
1783
 * handle to msgxfer to int32_t client_handle; // Local handle for this
1784
 * transaction uint32_t offset; // Requested offset to read from uint32_t
1785
 * nbytes; // Requested size to read };
1786
 *
1787
 * struct qnet6_kif_msgwrite { uint16_t msgtype; // MSGWRITE, MSGREPLY,
1788
 * MSGERROR, MSGREAD_XFER, MSGREAD_ERROR uint16_t size; // Size of message
1789
 * without message int32_t status; // MSGWRITE/MSGREAD_XFER=not used,
1790
 * MSGREPLY=status, MSGERROR,MSGREAD_ERROR=errno int32_t handle; // xfer
1791
 * handle (msgread_handle or client_handle) uint32_t offset; // Requested
1792
 * offset to xfer to uint32_t nbytes; // Requested size to xfer //
1793
 * unsigned char message[]; // Data to be sent };
1794
 *
1795
 * struct qnet6_kif_unblock { uint16_t msgtype; // qnet6_kif_UNBLOCK
1796
 * uint16_t size; // Size of message int32_t server_id; // Handle returned
1797
 * in qnet6_kif_connect_success int32_t client_handle; // Local handle to
1798
 * match for unblock int tid; // Local threadid to unblock (match to
1799
 * vinfo.tid) };
1800
 */
1801
/*
1802
 * _pulse is in sys/neutrino.h too
1803
 */
1804
/*
1805
 * QNX6 doesn't support 64 bits yet so void* will be 32 bits, and I assume
1806
 * the int as 32 bits too(I haven't see int is not 32 bits yet on
1807
 * Windows64 and Linux64 so change it to int32_t sizeof(union sigval) will
1808
 * change when QNX6 supports 64 bits and you may see 32, 64 bits OSes
1809
 * running on different machines with QNX even preference may not help as
1810
 * these are application level data.
1811
 */
1812
/*
1813
 * union sigval_qnx { int32_t sival_int; void *sival_ptr; }; struct
1814
 * sigevent_qnx { int sigev_notify; union { int __sigev_signo; int
1815
 * __sigev_coid; int __sigev_id; void (*__sigev_notify_function) (union
1816
 * sigval); } __sigev_un1; union sigval_qnx sigev_value; union { struct {
1817
 * short __sigev_code; short __sigev_priority; } __st; pthread_attr_t
1818
 * *__sigev_notify_attributes; } __sigev_un2;
1819
 *
1820
 * };
1821
 *
1822
 * struct qnet6_kif_event { uint16_t msgtype; // qnet6_kif_EVENT uint16_t
1823
 * size; // Size of message int32_t client_handle; // Local handle to
1824
 * deliver event to struct sigevent_qnx event; // Event to be delivered
1825
 * };
1826
 *
1827
 * struct _pulse { uint16_t type; uint16_t subtype; int8_t code; uint8_t
1828
 * reserved[3]; // zero must be union sigval_qnx value; int32_t scoid; };
1829
 * struct qnet6_kif_pulse { uint16_t msgtype; // qnet6_kif_PULSE uint16_t
1830
 * size; // Size of message int32_t server_id; // Handle returned in
1831
 * qnet6_kif_connect_success int32_t client_handle; // Local handle for
1832
 * this transaction struct _vtid_info vinfo; // Info that changes
1833
 * frequently struct _pulse pulse; // Pulse to deliver to remote int32_t
1834
 * priority; // Priority in MsgSendPulse() };
1835
 *
1836
 * struct qnet6_kif_signal { uint16_t msgtype; // qnet6_kif_SIGNAL uint16_t
1837
 * size; // Size of message int32_t client_handle; // Local handle for
1838
 * this transaction int32_t pid; // Signal from this pid (local) int32_t
1839
 * tid; // Signal from this tid (local) int32_t signo; // Signal to
1840
 * deliver to remote int32_t code; int32_t value; };
1841
 *
1842
 * struct qnet6_kif_disconnect { uint16_t msgtype; // qnet6_kif_DISCONNECT
1843
 * uint16_t size; // Size of message int32_t server_id; // Handle returned
1844
 * in qnet6_kif_connect_success };
1845
 */
1846
1847
static void
1848
display_channel_id(uint32_t chid, proto_item * ti)
1849
20
{
1850
20
  if (chid & QNX_NTO_GLOBAL_CHANNEL)
1851
10
    {
1852
10
      proto_item_append_text(ti, " _NTO_GLOBAL_CHANNEL|%" PRIu32, chid & ~QNX_NTO_GLOBAL_CHANNEL);
1853
10
    }
1854
20
}
1855
1856
static void
1857
display_coid(uint32_t coid, proto_item * ti)
1858
12
{
1859
12
  if (coid & QNX_NTO_SIDE_CHANNEL)
1860
3
    { /* side channel */
1861
3
      if ((coid & ~QNX_NTO_SIDE_CHANNEL) == 0)
1862
0
        proto_item_append_text(ti, " SYSMGR_COID)");
1863
3
      else
1864
3
        proto_item_append_text(ti," (_NTO_SIDE_CHANNEL|%" PRIu32 ")", coid & ~QNX_NTO_SIDE_CHANNEL);
1865
3
    }
1866
12
}
1867
1868
/*
1869
 * struct qnx_io_devctl { _Uint16t type; _Uint16t combine_len; _Int32t
1870
 * dcmd; _Int32t nbytes; _Int32t zero; };
1871
 *
1872
 * struct qnx_io_devctl_reply { _Uint32t zero; _Int32t ret_val; _Int32t
1873
 * nbytes; _Int32t zero2; }; #define _POSIX_DEVDIR_NONE 0 #define
1874
 * _POSIX_DEVDIR_TO 0x80000000 #define _POSIX_DEVDIR_FROM 0x40000000
1875
 * #define _POSIX_DEVDIR_TOFROM (_POSIX_DEVDIR_TO | _POSIX_DEVDIR_FROM)
1876
 * #define _POSIX_DEVDIR_CMD_MASK 0x0000FFFF
1877
 */
1878
/*
1879
 * direction is encoded in command's highest 2 bits and command only uses
1880
 * 16 bits please reference QNX' lib/c/public/devctl.h
1881
 */
1882
1883
static int
1884
dissect_qnet6_kif_msgsend_msg(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding);
1885
1886
static void
1887
dissect_qnet6_kif_msgsend_msg_extra(tvbuff_t * tvb, proto_tree * tree, int * poffset, int combine_len, int * left, int clen, const char *data)
1888
2
{
1889
2
  int nlen;
1890
1891
2
  nlen = combine_len & ~0x8000;
1892
  /*
1893
   * combine_len includes the type as well
1894
   */
1895
2
  if (nlen > clen)
1896
2
    { /* there are data behind _io_msg */
1897
2
      nlen -= clen;
1898
2
      if (nlen > *left)
1899
1
        nlen = *left;
1900
2
      if (nlen > 0)
1901
2
        {
1902
2
          proto_tree_add_string(tree, hf_qnet6_kif_msgsend_extra, tvb, *poffset, nlen, data);
1903
2
          *poffset += nlen;
1904
2
          *left -= nlen;
1905
2
        }
1906
2
    }
1907
2
}
1908
1909
/*
1910
 * struct _msg_info { // _msg_info _server_info _Uint32t nd; // client
1911
 * server _Uint32t srcnd; // server n/a pid_t pid; // client server
1912
 * _Int32t tid; // thread n/a _Int32t chid; // server server _Int32t
1913
 * scoid; // server server _Int32t coid; // client client _Int32t
1914
 * msglen; // msg n/a _Int32t srcmsglen; // thread n/a _Int32t
1915
 * dstmsglen; // thread n/a _Int16t priority; // thread n/a _Int16t
1916
 * flags; // n/a client _Uint32t reserved; };
1917
 */
1918
0
#define QNX_MSG_INFO_SIZE (12*4)
1919
static int
1920
dissect_qnet6_kif_msgsend_msg_msginfo(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
1921
0
{
1922
0
  int         ret = -1;
1923
0
  uint32_t    chid, coid;
1924
0
  proto_item *ti;
1925
1926
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_nd, tvb, *poffset, 4, encoding);
1927
0
  *poffset += 4;
1928
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_srcnd, tvb, *poffset, 4, encoding);
1929
0
  *poffset += 4;
1930
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_pid, tvb, *poffset, 4, encoding);
1931
0
  *poffset += 4;
1932
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_tid, tvb, *poffset, 4, encoding);
1933
0
  *poffset += 4;
1934
0
  chid = tvb_get_uint32(tvb, *poffset, encoding);
1935
0
  ti = proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_chid, tvb, *poffset, 4, encoding);
1936
0
  display_channel_id(chid, ti);
1937
0
  *poffset += 4;
1938
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_scoid, tvb, *poffset, 4, encoding);
1939
0
  *poffset += 4;
1940
0
  coid = tvb_get_uint32(tvb, *poffset, encoding);
1941
0
  ti = proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_coid, tvb, *poffset, 4, encoding);
1942
0
  display_coid(coid, ti);
1943
0
  *poffset += 4;
1944
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_msglen, tvb, *poffset, 4, encoding);
1945
0
  *poffset += 4;
1946
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_srcmsglen, tvb, *poffset, 4, encoding);
1947
0
  *poffset += 4;
1948
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_dstmsglen, tvb, *poffset, 4, encoding);
1949
0
  *poffset += 4;
1950
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_priority, tvb, *poffset, 2, encoding);
1951
0
  *poffset += 2;
1952
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_flags, tvb, *poffset, 2, encoding);
1953
0
  *poffset += 2;
1954
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_msginfo_reserved, tvb, *poffset, 4, encoding);
1955
0
  *poffset += 4;
1956
1957
0
  return ret;
1958
1959
0
}
1960
1961
// Most of the functions below recurse via dissect_qnet6_kif_msgsend_msg.
1962
// We're guaranteed to run out of packet before we run out of stack, so
1963
// just skip over them.
1964
// NOLINTBEGIN(misc-no-recursion)
1965
1966
/*
1967
 * in dissect_qnet6_kif_msgsend_msg already passed the first 2 bytes
1968
 * msg->type and when dissect_qnet6_kif_msgsend_msg_devctl is called, it
1969
 * is guaranteed that at least there 2+4+4+4 data left
1970
 */
1971
1972
static int
1973
dissect_qnet6_kif_msgsend_msg_devctl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
1974
0
{
1975
0
  int         ret = -1;
1976
0
  int         combine_len, left;
1977
0
  const char *p;
1978
0
  uint32_t    dcmd;
1979
0
  static int * const dcmd_fields[] = {
1980
0
    &hf_qnet6_kif_msg_devctl_dcmd_cmd,
1981
0
    &hf_qnet6_kif_msg_devctl_dcmd_class,
1982
0
    &hf_qnet6_kif_msg_devctl_dcmd_ccmd,
1983
0
    &hf_qnet6_kif_msg_devctl_dcmd_size,
1984
0
    &hf_qnet6_kif_msg_devctl_dcmd_from,
1985
0
    &hf_qnet6_kif_msg_devctl_dcmd_to,
1986
0
    NULL
1987
0
  };
1988
1989
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
1990
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
1991
0
  *poffset += 2;
1992
0
  dcmd = tvb_get_uint32(tvb, *poffset, encoding);
1993
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_devctl_dcmd, ett_qnet6_kif_msg_devctl_dcmd, dcmd_fields, encoding);
1994
0
  *poffset += 4;
1995
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_devctl_nbytes, tvb, *poffset, 4, encoding);
1996
0
  *poffset += 4;
1997
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_devctl_zero, tvb, *poffset, 4, encoding);
1998
0
  *poffset += 4;
1999
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2000
2001
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3, "devctl's extra data");
2002
0
  p = try_val_to_str_ext((dcmd & 0x0000ffff), &qnet6_kif_msg_devctl_cmd_class_vals_ext);
2003
0
  if (p)
2004
0
    col_append_fstr(pinfo->cinfo, COL_INFO, " %s", p);
2005
2006
0
  ret = 0;
2007
  /*
2008
   * how combine_len works? message header1
2009
   * (combine_len=COMBINE_LEN_FLAG| sizeof(header1)+ its data size
2010
   * message header1's data(optional) message header2
2011
   * combine_len=COMBINE_FLAG|sizeof(message header2)+its data size so
2012
   * combine_len is the size of its own header+data|COMBINE_FLAG
2013
   */
2014
  /*
2015
   * if combine_len > sizeof(qnx_io_devctl) then there are other
2016
   * messages behind
2017
   */
2018
0
  if (combine_len & 0x8000)
2019
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2020
0
      if (0 < left)
2021
0
        {
2022
0
          ret =
2023
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2024
0
        }
2025
0
    }
2026
2027
0
  return ret;
2028
0
}
2029
2030
/*
2031
 * struct qnx_io_read { _Uint16t type; _Uint16t combine_len; _Int32t
2032
 * nbytes; _Uint32t xtype; _Uint32t zero; };
2033
 *
2034
 * typedef union { struct qnx_io_read i; } io_read_t;
2035
 */
2036
2037
static int
2038
dissect_qnet6_kif_msgsend_msg_read(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2039
1
{
2040
1
  int     ret = -1;
2041
1
  uint32_t xtypes;
2042
1
  int     combine_len, left;
2043
1
  static int * const xtypes_fields[] = {
2044
1
    &hf_qnet6_kif_msg_io_read_xtypes_0_7,
2045
1
    &hf_qnet6_kif_msg_io_read_xtypes_8,
2046
1
    &hf_qnet6_kif_msg_io_read_xtypes_14,
2047
1
    &hf_qnet6_kif_msg_io_read_xtypes_15,
2048
1
    NULL
2049
1
  };
2050
2051
1
  left = tvb_reported_length_remaining(tvb, *poffset);
2052
1
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2053
1
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2054
1
  *poffset += 2;
2055
1
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_nbytes, tvb,  *poffset, 4, encoding);
2056
1
  *poffset += 4;
2057
1
  xtypes = tvb_get_uint32(tvb, *poffset, encoding);
2058
1
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_io_read_xtypes, ett_qnet6_kif_msg_read_xtypes, xtypes_fields, encoding);
2059
1
  *poffset += 4;
2060
1
  proto_tree_add_item(tree, hf_qnet6_kif_zero, tvb, *poffset, 4, ENC_NA);
2061
1
  *poffset += 4;
2062
2063
  /*
2064
   * if xtypes is not _IO_XTYPE_NONE then after io_read_t it is another
2065
   * structure according the xtype&0xff
2066
   */
2067
1
  left -= 2 + 4 * 3;
2068
1
  switch (xtypes & 0xff)
2069
1
    {
2070
0
    case QNX_IO_XTYPE_OFFSET:
2071
0
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_xoffset, tvb, *poffset, 8, encoding);
2072
0
      *poffset += 8;
2073
0
      left -= 8;
2074
0
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3 + 8, "read's extra data");
2075
0
      break;
2076
1
    case QNX_IO_XTYPE_READCOND:
2077
1
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_cond_min, tvb, *poffset, 4, encoding);
2078
1
      *poffset += 4;
2079
1
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_cond_time,tvb, *poffset, 4, encoding);
2080
1
      *poffset += 4;
2081
1
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_cond_timeout, tvb, *poffset, 4, encoding);
2082
1
      *poffset += 4;
2083
1
      left -= 12;
2084
1
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3 + 12, "read's extra data");
2085
1
      break;
2086
0
    default:
2087
0
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3, "read's extra data");
2088
0
      break;
2089
1
    }
2090
1
  ret = 0;
2091
1
  if (combine_len & 0x8000)
2092
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2093
0
      if (left > 0)
2094
0
        {
2095
0
          ret =
2096
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2097
0
        }
2098
0
    }
2099
2100
1
  return ret;
2101
2102
1
}
2103
2104
static int
2105
dissect_qnet6_kif_msgsend_msg_write(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2106
0
{
2107
0
  int     ret = -1;
2108
0
  uint32_t xtypes;
2109
0
  int     combine_len, left;
2110
0
  static int * const xtypes_fields[] = {
2111
0
    &hf_qnet6_kif_msg_io_write_xtypes_0_7,
2112
0
    &hf_qnet6_kif_msg_io_write_xtypes_8,
2113
0
    &hf_qnet6_kif_msg_io_write_xtypes_14,
2114
0
    &hf_qnet6_kif_msg_io_write_xtypes_15,
2115
0
    NULL
2116
0
  };
2117
2118
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2119
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2120
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2121
0
  *poffset += 2;
2122
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_write_nbytes, tvb, *poffset, 4, encoding);
2123
0
  *poffset += 4;
2124
0
  xtypes = tvb_get_uint32(tvb, *poffset, encoding);
2125
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_io_write_xtypes, ett_qnet6_kif_msg_write_xtypes, xtypes_fields, encoding);
2126
0
  *poffset += 4;
2127
0
  proto_tree_add_item(tree, hf_qnet6_kif_zero, tvb, *poffset, 4, ENC_NA);
2128
0
  *poffset += 4;
2129
2130
  /*
2131
   * if xtypes is not _IO_XTYPE_NONE then after io_read_t it is another
2132
   * structure according the xtype&0xff
2133
   */
2134
0
  left -= 2 + 4 * 3;
2135
0
  switch (xtypes & 0xff)
2136
0
    {
2137
0
    case QNX_IO_XTYPE_OFFSET:
2138
0
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_write_xoffset, tvb, *poffset, 8, encoding);
2139
0
      *poffset += 8;
2140
0
      left -= 8;
2141
0
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3 + 8, "write's extra data");
2142
0
      break;
2143
0
    case QNX_IO_XTYPE_READCOND:
2144
0
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_cond_min, tvb, *poffset, 4, encoding);
2145
0
      *poffset += 4;
2146
0
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_cond_time, tvb, *poffset, 4, encoding);
2147
0
      *poffset += 4;
2148
0
      proto_tree_add_item(tree, hf_qnet6_kif_msg_io_read_cond_timeout, tvb, *poffset, 4, encoding);
2149
0
      *poffset += 4;
2150
0
      left -= 12;
2151
0
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3 + 12, "write's extra data");
2152
0
      break;
2153
0
    default:
2154
0
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3, "write's extra data");
2155
0
      break;
2156
0
    }
2157
2158
0
  ret = 0;
2159
0
  if (combine_len & 0x8000)
2160
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2161
0
      if (left > 0)
2162
0
        {
2163
0
          ret =
2164
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2165
0
        }
2166
0
    }
2167
0
  else
2168
0
    {
2169
0
      if (left > 0)
2170
0
        proto_tree_add_item(tree, hf_qnet6_kif_msg_io_write_data, tvb, *poffset, left, ENC_NA);
2171
0
    }
2172
2173
0
  return ret;
2174
2175
0
}
2176
2177
/*
2178
 *struct qnx_io_lseek {
2179
 _Uint16t type;
2180
 _Uint16t combine_len;
2181
 short whence;
2182
 _Uint16t zero;
2183
 _Uint64t offset;
2184
 };
2185
2186
 typedef union {
2187
 struct qnx_io_lseek i;
2188
 _Uint64t o;
2189
 } io_lseek_t;
2190
 */
2191
static int
2192
dissect_qnet6_kif_msgsend_msg_seek(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2193
0
{
2194
0
  int  ret = -1;
2195
0
  int combine_len, left;
2196
2197
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2198
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2199
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2200
0
  *poffset += 2;
2201
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_seek_whence, tvb, *poffset, 2, encoding);
2202
0
  *poffset += 2;
2203
2204
0
  proto_tree_add_item(tree, hf_qnet6_kif_zero, tvb, *poffset, 2, ENC_NA);
2205
0
  *poffset += 2;
2206
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_seek_offset, tvb, *poffset, 8, encoding);
2207
0
  *poffset += 8;
2208
0
  left -= 2 + 2 + 2 + 8;
2209
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 2 + 2 + 8, "seek's extra data");
2210
2211
0
  ret = 0;
2212
0
  if (combine_len & 0x8000)
2213
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2214
0
      if (left > 0)
2215
0
        {
2216
0
          ret =
2217
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2218
0
        }
2219
0
    }
2220
2221
0
  return ret;
2222
2223
0
}
2224
2225
/*
2226
 *struct qnx_io_pathconf {
2227
 _Uint16t type;
2228
 _Uint16t combine_len;
2229
 short name;
2230
 _Uint16t zero;
2231
 };
2232
2233
 typedef union {
2234
 struct qnx_io_pathconf i;
2235
 } io_pathconf_t;
2236
 */
2237
static int
2238
dissect_qnet6_kif_msgsend_msg_pathconf(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2239
0
{
2240
0
  int  ret = -1;
2241
0
  int combine_len, left;
2242
2243
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2244
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2245
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2246
0
  *poffset += 2;
2247
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_pathconf_name, tvb, *poffset, 2, encoding);
2248
0
  *poffset += 2;
2249
0
  proto_tree_add_item(tree, hf_qnet6_kif_zero, tvb, *poffset, 2, ENC_NA);
2250
0
  *poffset += 2;
2251
2252
0
  left -= 2 + 4;
2253
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4, "pathconf's extra data");
2254
2255
0
  ret = 0;
2256
0
  if (combine_len & 0x8000)
2257
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2258
0
      if (left > 0)
2259
0
        {
2260
0
          ret =
2261
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2262
0
        }
2263
0
    }
2264
2265
0
  return ret;
2266
2267
0
}
2268
2269
/*
2270
 *struct _io_chmod {
2271
 *      _Uint16t type;
2272
 *      _Uint16t combine_len;
2273
 *      mode_t  mode;
2274
 *};
2275
 *
2276
 *typedef union {
2277
 *      struct _io_chmod i;
2278
 *} io_chmod_t;
2279
 */
2280
2281
static int
2282
dissect_qnet6_kif_msgsend_msg_chmod(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2283
0
{
2284
0
  int  ret = -1;
2285
0
  int combine_len, left;
2286
0
  static int * const chmod_fields[] = {
2287
0
    &hf_qnet6_kif_msg_io_chmod_other_exe,
2288
0
    &hf_qnet6_kif_msg_io_chmod_other_write,
2289
0
    &hf_qnet6_kif_msg_io_chmod_other_read,
2290
0
    &hf_qnet6_kif_msg_io_chmod_group_exe,
2291
0
    &hf_qnet6_kif_msg_io_chmod_group_write,
2292
0
    &hf_qnet6_kif_msg_io_chmod_group_read,
2293
0
    &hf_qnet6_kif_msg_io_chmod_owner_exe,
2294
0
    &hf_qnet6_kif_msg_io_chmod_owner_write,
2295
0
    &hf_qnet6_kif_msg_io_chmod_owner_read,
2296
0
    &hf_qnet6_kif_msg_io_chmod_sticky,
2297
0
    &hf_qnet6_kif_msg_io_chmod_setgid,
2298
0
    &hf_qnet6_kif_msg_io_chmod_setuid,
2299
0
    NULL
2300
0
  };
2301
2302
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2303
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2304
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2305
0
  *poffset += 2;
2306
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_io_chmod, ett_qnet6_kif_chmod_mode, chmod_fields, encoding);
2307
0
  *poffset += 4;
2308
2309
0
  left -= 2 + 4;
2310
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4, "chmod's extra data");
2311
2312
0
  ret = 0;
2313
0
  if (combine_len & 0x8000)
2314
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2315
0
      if (left > 0)
2316
0
        {
2317
0
          ret =
2318
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2319
0
        }
2320
0
    }
2321
2322
0
  return ret;
2323
2324
0
}
2325
2326
/*
2327
 * struct qnx_io_fdinfo { _Uint16t type; _Uint16t combine_len; _Uint32t
2328
 * flags; _Int32t path_len; _Uint32t reserved; };
2329
 *
2330
 * struct _io_fdinfo_reply { _Uint32t zero[2]; struct _fdinfo info; //char
2331
 * path[path_len + 1]; }; according to lib/c/qnx/iofdinfo.c: client ->
2332
 * server a io_fdinfo message is sent out, if client requests path then
2333
 * path_len !=0 server -> client a fdinfo_reply replied. client is using 3
2334
 * iov to receive reply: 1.msg.o.zero 2.msg.o.info 3.path buffer in
2335
 * iofunc_fdinfo_default it will memset the first 2 uint32. How do I know
2336
 * it is a corresponding reply?
2337
 */
2338
static int
2339
dissect_qnet6_kif_msgsend_msg_fdinfo(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2340
0
{
2341
0
  int  ret = -1;
2342
0
  int combine_len, left;
2343
2344
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2345
0
  if (left < 2 + 4 + 4 + 4)
2346
0
    return ret;
2347
2348
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2349
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2350
0
  *poffset += 2;
2351
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_fdinfo_flags, tvb, *poffset, 4, encoding);
2352
0
  *poffset += 4;
2353
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_fdinfo_path_len, tvb, *poffset, 4, encoding);
2354
0
  *poffset += 4;
2355
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_fdinfo_reserved, tvb, *poffset, 4, encoding);
2356
0
  *poffset += 4;
2357
2358
0
  left -= 2 + 4 * 3;
2359
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3, "fdinfo's extra data");
2360
0
  ret = 0;
2361
0
  if (combine_len & 0x8000)
2362
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2363
0
      if (left > 0)
2364
0
        {
2365
0
          ret =
2366
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2367
0
        }
2368
0
    }
2369
2370
0
  return ret;
2371
2372
0
}
2373
2374
/*
2375
 * struct _io_lock { _Uint16t type; _Uint16t combine_len; _Uint32t
2376
 * subtype; _Int32t nbytes; //char data[1]; };
2377
 *
2378
 * struct _io_lock_reply { _Uint32t zero[3];
2379
 *
2380
 * };
2381
 */
2382
2383
static int
2384
dissect_qnet6_kif_msgsend_msg_lock(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2385
0
{
2386
0
  int  ret = -1;
2387
0
  int combine_len, left;
2388
2389
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2390
2391
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2392
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2393
0
  *poffset += 2;
2394
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_lock_subtype, tvb, *poffset, 4, encoding);
2395
0
  *poffset += 4;
2396
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_lock_nbytes, tvb, *poffset, 4, encoding);
2397
0
  *poffset += 4;
2398
2399
0
  left -= 2 + 4 + 4;
2400
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 + 4, "lock's extra data");
2401
2402
0
  ret = 0;
2403
0
  if (combine_len & 0x8000)
2404
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2405
0
      if (left > 0)
2406
0
        {
2407
0
          ret =
2408
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2409
0
        }
2410
0
    }
2411
2412
0
  return ret;
2413
2414
0
}
2415
2416
static int
2417
dissect_qnet6_kif_msgsend_msg_space(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2418
0
{
2419
0
  int  ret = -1;
2420
0
  int combine_len, left;
2421
2422
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2423
2424
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2425
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2426
0
  *poffset += 2;
2427
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_space_subtype, tvb, *poffset, 2, encoding);
2428
0
  *poffset += 2;
2429
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_space_whence, tvb, *poffset, 2, encoding);
2430
0
  *poffset += 2;
2431
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_space_start, tvb, *poffset, 8, encoding);
2432
0
  *poffset += 8;
2433
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_space_len, tvb, *poffset, 8, encoding);
2434
0
  *poffset += 8;
2435
2436
0
  left -= 2 * 3 + 8 * 2;
2437
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 * 4 + 8 * 2, "space's extra data");
2438
2439
0
  ret = 0;
2440
0
  if (combine_len & 0x8000)
2441
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2442
0
      if (left > 0)
2443
0
        {
2444
0
          ret =
2445
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2446
0
        }
2447
0
    }
2448
2449
0
  return ret;
2450
2451
0
}
2452
2453
static int
2454
dissect_qnet6_kif_msgsend_msg_chown(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2455
0
{
2456
0
  int  ret = -1;
2457
0
  int combine_len, left;
2458
2459
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2460
2461
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2462
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2463
0
  *poffset += 2;
2464
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_chown_gid, tvb, *poffset, 4, encoding);
2465
0
  *poffset += 4;
2466
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_chown_uid, tvb, *poffset, 4, encoding);
2467
0
  *poffset += 4;
2468
2469
0
  left -= 2 + 4 + 4;
2470
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 + 4, "chown's extra data");
2471
2472
0
  ret = 0;
2473
0
  if (combine_len & 0x8000)
2474
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2475
0
      if (left > 0)
2476
0
        {
2477
0
          ret =
2478
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2479
0
        }
2480
0
    }
2481
2482
0
  return ret;
2483
2484
0
}
2485
2486
/*
2487
 * struct qnx_io_utime { _Uint16t type; _Uint16t combine_len; _Int32t
2488
 * cur_flag; If set, ignore times and set to "now" struct utimbuf times;
2489
 * };
2490
 *
2491
 * in lib/c/public/utime.h struct utimbuf { time_t actime; time_t modtime;
2492
 * };
2493
 */
2494
static int
2495
dissect_qnet6_kif_msgsend_msg_utime(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2496
0
{
2497
0
  int      ret = -1;
2498
0
  int      combine_len, left;
2499
2500
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2501
2502
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2503
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2504
0
  *poffset += 2;
2505
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_utime_curflag, tvb, *poffset, 4, encoding);
2506
0
  *poffset += 4;
2507
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_utime_actime,
2508
0
      tvb, *poffset, 4, ENC_TIME_SECS|encoding);
2509
0
  *poffset += 4;
2510
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_utime_modtime,
2511
0
      tvb, *poffset, 4, ENC_TIME_SECS|encoding);
2512
0
  *poffset += 4;
2513
2514
0
  left -= 2 + 4 + 4 + 4;
2515
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 3, "utime's data");
2516
2517
0
  ret = 0;
2518
0
  if (combine_len & 0x8000)
2519
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2520
0
      if (left > 0)
2521
0
        {
2522
0
          ret =
2523
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2524
0
        }
2525
0
    }
2526
2527
0
  return ret;
2528
2529
0
}
2530
2531
static int
2532
dissect_qnet6_kif_msgsend_msg_sync(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2533
0
{
2534
0
  int  ret = -1;
2535
0
  int combine_len, left;
2536
0
  static int * const sync_fields[] = {
2537
0
    &hf_qnet6_kif_msg_syncflag_dsync,
2538
0
    &hf_qnet6_kif_msg_syncflag_sync,
2539
0
    &hf_qnet6_kif_msg_syncflag_rsync,
2540
0
    NULL
2541
0
  };
2542
2543
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2544
2545
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2546
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2547
0
  *poffset += 2;
2548
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_io_sync, ett_qnet6_kif_msg_sync, sync_fields, encoding);
2549
0
  *poffset += 4;
2550
2551
0
  left -= 2 + 4;
2552
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4, "sync's extra data");
2553
2554
0
  ret = 0;
2555
0
  if (combine_len & 0x8000)
2556
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2557
0
      if (left > 0)
2558
0
        {
2559
0
          ret =
2560
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2561
0
        }
2562
0
    }
2563
2564
0
  return ret;
2565
2566
0
}
2567
2568
static int
2569
dissect_qnet6_kif_msgsend_msg_close(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2570
0
{
2571
0
  int  ret = -1;
2572
0
  int combine_len, left;
2573
2574
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2575
2576
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2577
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2578
0
  *poffset += 2;
2579
2580
0
  left -= 2;
2581
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2, "close's extra data");
2582
0
  ret = 0;
2583
0
  if (combine_len & 0x8000)
2584
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2585
0
      if (left > 0)
2586
0
        {
2587
0
          ret =
2588
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2589
0
        }
2590
0
    }
2591
2592
0
  return ret;
2593
2594
0
}
2595
2596
static int
2597
dissect_qnet6_kif_msgsend_msg_stat(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
2598
0
{
2599
0
  int  ret = -1;
2600
0
  int combine_len, left;
2601
2602
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2603
2604
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2605
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2606
0
  *poffset += 2;
2607
0
  proto_tree_add_item(tree, hf_qnet6_kif_zero, tvb, *poffset, 4, ENC_NA);
2608
0
  *poffset += 4;
2609
2610
0
  left -= 2 + 4;
2611
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4, "stat's extra data");
2612
2613
0
  ret = 0;
2614
0
  if (combine_len & 0x8000)
2615
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2616
0
      if (left > 0)
2617
0
        {
2618
0
          ret =
2619
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2620
0
        }
2621
0
    }
2622
2623
0
  return ret;
2624
2625
0
}
2626
2627
static int
2628
dissect_qnet6_kif_msgsend_msg_shutdown(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2629
1
{
2630
1
  int  ret = -1;
2631
1
  int combine_len, left;
2632
2633
1
  left = tvb_reported_length_remaining(tvb, *poffset);
2634
1
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2635
1
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2636
1
  *poffset += 2;
2637
2638
1
  left -= 2;
2639
1
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2, "shutdown's extra data");
2640
2641
1
  ret = 0;
2642
1
  if (combine_len & 0x8000)
2643
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2644
0
      if (left > 0)
2645
0
        {
2646
0
          ret =
2647
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2648
0
        }
2649
0
    }
2650
2651
1
  return ret;
2652
2653
1
}
2654
2655
static int
2656
dissect_qnet6_kif_msgsend_msg_openfd(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2657
0
{
2658
0
  int         ret = -1;
2659
0
  int         combine_len, left;
2660
0
  proto_tree *stree;
2661
0
  static int * const openfd_ioflag_fields[] = {
2662
0
    &hf_qnet6_kif_msg_openfd_ioflag_access,
2663
0
    &hf_qnet6_kif_msg_openfd_ioflag_append,
2664
0
    &hf_qnet6_kif_msg_openfd_ioflag_dsync,
2665
0
    &hf_qnet6_kif_msg_openfd_ioflag_sync,
2666
0
    &hf_qnet6_kif_msg_openfd_ioflag_rsync,
2667
0
    &hf_qnet6_kif_msg_openfd_ioflag_nonblock,
2668
0
    &hf_qnet6_kif_msg_openfd_ioflag_creat,
2669
0
    &hf_qnet6_kif_msg_openfd_ioflag_truncate,
2670
0
    &hf_qnet6_kif_msg_openfd_ioflag_exclusive,
2671
0
    &hf_qnet6_kif_msg_openfd_ioflag_noctrltty,
2672
0
    &hf_qnet6_kif_msg_openfd_ioflag_closexec,
2673
0
    &hf_qnet6_kif_msg_openfd_ioflag_realids,
2674
0
    &hf_qnet6_kif_msg_openfd_ioflag_largefile,
2675
0
    &hf_qnet6_kif_msg_openfd_ioflag_async,
2676
0
    NULL
2677
0
  };
2678
2679
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2680
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2681
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2682
0
  *poffset += 2;
2683
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_openfd_ioflag, ett_qnet6_kif_msg_openfd_ioflag, openfd_ioflag_fields, encoding);
2684
0
  *poffset += 4;
2685
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_openfd_sflag, tvb, *poffset, 2, encoding);
2686
0
  *poffset += 2;
2687
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_openfd_xtype, tvb, *poffset, 2, encoding);
2688
0
  *poffset += 2;
2689
2690
2691
0
  stree = proto_tree_add_subtree(tree, tvb, *poffset, QNX_MSG_INFO_SIZE, ett_qnet6_kif_msg_msginfo, NULL, "MsgInfo");
2692
2693
  /*
2694
   * dissect msg_info
2695
   */
2696
0
  dissect_qnet6_kif_msgsend_msg_msginfo(tvb, pinfo, stree, poffset, encoding);
2697
2698
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_openfd_reserved, tvb, *poffset, 4, encoding);
2699
0
  *poffset += 4;
2700
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_openfd_key, tvb, *poffset, 4, encoding);
2701
0
  *poffset += 4;
2702
2703
0
  left -= 2 + 4 + 2 * 2 + QNX_MSG_INFO_SIZE + 4 * 2;
2704
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 + 2 * 2 + QNX_MSG_INFO_SIZE + 4 * 2, "openfd's extra data");
2705
2706
0
  ret = 0;
2707
0
  if (combine_len & 0x8000)
2708
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2709
0
      if (left > 0)
2710
0
        {
2711
0
          ret =
2712
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2713
0
        }
2714
0
    }
2715
2716
0
  return ret;
2717
2718
0
}
2719
2720
static int
2721
dissect_qnet6_kif_msgsend_msg_mmap(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2722
0
{
2723
0
  int         ret = -1;
2724
0
  int         combine_len, left;
2725
0
  proto_tree *stree;
2726
0
  static int * const prot_fields[] = {
2727
0
    &hf_qnet6_kif_msg_io_mmap_prot_read,
2728
0
    &hf_qnet6_kif_msg_io_mmap_prot_write,
2729
0
    &hf_qnet6_kif_msg_io_mmap_prot_exec,
2730
0
    NULL
2731
0
  };
2732
2733
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2734
2735
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2736
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2737
0
  *poffset += 2;
2738
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_io_mmap_prot, ett_qnet6_kif_msg_prot, prot_fields, encoding);
2739
0
  *poffset += 4;
2740
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_mmap_offset, tvb, *poffset, 8, encoding);
2741
0
  *poffset += 8;
2742
0
  stree = proto_tree_add_subtree(tree, tvb, *poffset, QNX_MSG_INFO_SIZE, ett_qnet6_kif_msg_msginfo, NULL, "MsgInfo");
2743
  /*
2744
   * dissect msg_info
2745
   */
2746
0
  dissect_qnet6_kif_msgsend_msg_msginfo(tvb, pinfo, stree, poffset, encoding);
2747
2748
0
  proto_tree_add_item(tree, hf_qnet6_kif_zero, tvb, *poffset, 4 * 6, ENC_NA);
2749
0
  *poffset += 4 * 6;
2750
2751
0
  left -= 2 + 4 + 8 + 4 * 6 + QNX_MSG_INFO_SIZE;
2752
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 + 8 + 4 * 6 + QNX_MSG_INFO_SIZE, "mmap's extra data");
2753
2754
0
  ret = 0;
2755
0
  if (combine_len & 0x8000)
2756
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2757
0
      if (left > 0)
2758
0
        {
2759
0
          ret =
2760
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2761
0
        }
2762
0
    }
2763
2764
0
  return ret;
2765
2766
0
}
2767
2768
static int
2769
dissect_qnet6_kif_msgsend_msg_iomsg(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2770
0
{
2771
0
  int  ret = -1;
2772
0
  int combine_len, left;
2773
2774
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2775
2776
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2777
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2778
0
  *poffset += 2;
2779
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_msg_mgrid, tvb, *poffset, 2, encoding);
2780
0
  *poffset += 2;
2781
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_msg_subtype, tvb, *poffset, 2, encoding);
2782
0
  *poffset += 2;
2783
2784
0
  left -= 2 * 3;
2785
2786
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len,  &left, 2 + 2 * 3, "io_msg's data");
2787
2788
0
  ret = 0;
2789
0
  if (combine_len & 0x8000)
2790
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2791
0
      if (left > 0)
2792
0
        {
2793
0
          ret =
2794
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2795
0
        }
2796
0
    }
2797
2798
0
  return ret;
2799
2800
0
}
2801
2802
/*
2803
 * struct qnx_io_notify { _Uint16t type; _Uint16t combine_len; _Int32t
2804
 * action; _Int32t flags; struct sigevent_qnx event;
2805
 *
2806
 * // Following fields only valid if (flags & _NOTIFY_COND_EXTEN) _Int32t
2807
 * mgr[2]; // For use by manager _Int32t flags_extra_mask; _Int32t
2808
 * flags_exten; _Int32t nfds; _Int32t fd_first; _Int32t nfds_ready;
2809
 * _Int64t timo; // struct pollfd fds[nfds]; }; struct pollfd { int fd;
2810
 * //file descriptor short events; //events to look for short revents; //
2811
 * events returned };
2812
 *
2813
 */
2814
static const uint8_t *qnet6_kif_msg_io_notify_event_str[] = {
2815
  "read ", "write ", "rdband "
2816
};
2817
2818
static int
2819
dissect_qnet6_kif_msgsend_msg_notify(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2820
0
{
2821
0
  int         ret = -1;
2822
0
  int         combine_len, left, fd;
2823
0
  uint16_t    event, revent;
2824
0
  proto_tree *stree;
2825
0
  nstime_t    nt;
2826
0
  uint64_t    timo;
2827
0
  uint32_t    nfds, i, j, n, m;
2828
0
  uint8_t     sevent[20], srevent[20]; /* enough to fit "read,write,rdband" */
2829
0
  static int * const notify_flags_fields[] = {
2830
0
    &hf_qnet6_kif_msg_io_notify_flags_28,
2831
0
    &hf_qnet6_kif_msg_io_notify_flags_29,
2832
0
    &hf_qnet6_kif_msg_io_notify_flags_30,
2833
0
    &hf_qnet6_kif_msg_io_notify_flags_31,
2834
0
    NULL
2835
0
  };
2836
2837
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2838
2839
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2840
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2841
0
  *poffset += 2;
2842
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_action, tvb, *poffset, 4, encoding);
2843
0
  *poffset += 4;
2844
0
  proto_tree_add_bitmask(tree, tvb, *poffset, hf_qnet6_kif_msg_io_notify_flags, ett_qnet6_kif_msg_notify_flags, notify_flags_fields, encoding);
2845
0
  *poffset += 4;
2846
  /*
2847
   * sigevent
2848
   */
2849
0
  stree = proto_tree_add_subtree(tree, tvb, *poffset, 4 * 4, ett_qnet6_kif_event, NULL, "sigevent");
2850
  /*
2851
   *poffset += sizeof(struct sigevent_qnx); */
2852
2853
0
  proto_tree_add_item(stree, hf_qnet6_kif_event_notify, tvb, *poffset, 4, encoding);
2854
0
  *poffset += 4;
2855
0
  proto_tree_add_item(stree, hf_qnet6_kif_event_union1, tvb, *poffset, 4, encoding);
2856
0
  *poffset += 4;
2857
0
  proto_tree_add_item(stree, hf_qnet6_kif_event_value, tvb, *poffset, 4, encoding);
2858
0
  *poffset += 4;
2859
0
  proto_tree_add_item(stree, hf_qnet6_kif_event_union2, tvb, *poffset, 4, encoding);
2860
0
  *poffset += 4;
2861
2862
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_mgr, tvb, *poffset, 8, encoding);
2863
0
  *poffset += 8;
2864
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_flags_extra_mask, tvb, *poffset, 4, encoding);
2865
0
  *poffset += 4;
2866
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_flags_exten, tvb, *poffset, 4, encoding);
2867
0
  *poffset += 4;
2868
0
  nfds = tvb_get_uint32(tvb, *poffset, encoding);
2869
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_nfds, tvb, *poffset, 4, encoding);
2870
0
  *poffset += 4;
2871
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_fd_first, tvb, *poffset, 4, encoding);
2872
0
  *poffset += 4;
2873
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_notify_nfds_ready, tvb, *poffset, 4, encoding);
2874
0
  *poffset += 4;
2875
2876
0
  timo = tvb_get_uint64(tvb, *poffset, encoding);
2877
0
  if (timo != 0)
2878
0
    {
2879
0
      if (timo > 1000000000)
2880
0
        {
2881
0
          nt.secs = (int)(timo / 1000000000);
2882
0
          nt.nsecs = (int)(timo - nt.secs * 1000000000);
2883
0
        }
2884
0
      else
2885
0
        {
2886
0
          nt.secs = 0;
2887
0
          nt.nsecs = (int)timo;
2888
0
        }
2889
0
    }
2890
0
  else
2891
0
    {
2892
0
      nt.nsecs = 0;
2893
0
      nt.secs = 0;
2894
0
    }
2895
0
  proto_tree_add_time(tree, hf_qnet6_kif_msg_io_notify_timo, tvb, *poffset, 8, &nt);
2896
0
  *poffset += 8;
2897
2898
0
  left -= 2 + 4 * 2 + 4 * 4 + 4 * 7 + 8;
2899
  /*
2900
   * handle pollfd fds[nfds]
2901
   */
2902
0
  if ((uint32_t) left >= nfds * 8)
2903
0
    { /* each pollfd size is 8 */
2904
0
      stree = proto_tree_add_subtree(tree, tvb, *poffset, nfds * 8, ett_qnet6_kif_msg_notify_fds, NULL, "Poll file descriptors array");
2905
0
      for (i = 0; i < nfds; i++)
2906
0
        {
2907
0
          fd = tvb_get_uint32(tvb, *poffset, encoding);
2908
0
          event = tvb_get_uint16(tvb, *poffset + 4, encoding);
2909
0
          revent = tvb_get_uint16(tvb, *poffset + 4 + 2, encoding);
2910
0
          sevent[0] = srevent[0] = 0;
2911
0
          for (j = n = m = 0; j < 3; j++)
2912
0
            {
2913
0
              if (event & (1<<j))
2914
0
                n += snprintf(sevent + n, sizeof(sevent) - n, "%s", qnet6_kif_msg_io_notify_event_str[j]);
2915
0
              if (revent & (1<<j))
2916
0
                m += snprintf(srevent + m, sizeof(srevent) - m, "%s", qnet6_kif_msg_io_notify_event_str[j]);
2917
0
            }
2918
0
          proto_tree_add_string_format_value(stree, hf_qnet6_kif_msg_io_notify_fds, tvb, *poffset, 8, NULL, "fd:%" PRId32 " " "event:0x%x %s" "revent:0x%x %s", fd, event, sevent, revent, srevent);
2919
0
          *poffset += 8;
2920
0
        }
2921
0
      left -= nfds * 8;
2922
0
      dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + 4 * 2 + 4 * 4 + 4 * 7 + 8 + nfds * 8, "notify's extra data");
2923
2924
0
    }
2925
0
  else
2926
0
    return ret;
2927
2928
0
  ret = 0;
2929
0
  if (combine_len & 0x8000)
2930
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2931
0
      if (left > 0)
2932
0
        {
2933
          /*
2934
           * there is io_notify's data behind _io_notify_t in
2935
           * lib/c/xopen/poll.c msg.i.combine_len = sizeof(msg.i) so in
2936
           * theory we should not see combine_len > sizeof(msg.i) fds
2937
           * array should be behind _io_notify_t for example: fds[100]
2938
           * nfds=100, fd_first=0, fd_ to server1: server1 may cut it
2939
           * from the end to server2: fds[98] nfds=98, fd_first=xxx any
2940
           * server can only cut from the end as iov[1].base is always
2941
           * fds it didn't set these length to combine_len:(
2942
           */
2943
0
          ret = dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2944
0
        }
2945
0
    }
2946
2947
0
  return ret;
2948
2949
0
}
2950
2951
static int
2952
dissect_qnet6_kif_msgsend_msg_dup(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
2953
0
{
2954
0
  int         ret = -1;
2955
0
  int         combine_len, left;
2956
0
  proto_tree *stree;
2957
2958
0
  left = tvb_reported_length_remaining(tvb, *poffset);
2959
0
  combine_len = tvb_get_uint16(tvb, *poffset, encoding);
2960
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_combine_len, tvb, *poffset, 2, encoding);
2961
0
  *poffset += 2;
2962
0
  stree = proto_tree_add_subtree(tree, tvb, *poffset, QNX_MSG_INFO_SIZE, ett_qnet6_kif_msg_msginfo, NULL, "MsgInfo");
2963
2964
0
  dissect_qnet6_kif_msgsend_msg_msginfo(tvb, pinfo, stree, poffset, encoding);
2965
2966
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_dup_reserved, tvb, *poffset, 4, encoding);
2967
0
  *poffset += 4;
2968
0
  proto_tree_add_item(tree, hf_qnet6_kif_msg_io_dup_key, tvb, *poffset, 4, encoding);
2969
0
  *poffset += 4;
2970
2971
0
  left -= 2 + QNX_MSG_INFO_SIZE + 4 * 2;
2972
0
  dissect_qnet6_kif_msgsend_msg_extra(tvb, tree, poffset, combine_len, &left, 2 + 2 + QNX_MSG_INFO_SIZE + 4 * 2, "dup's extra data");
2973
2974
0
  ret = 0;
2975
0
  if (combine_len & 0x8000)
2976
0
    { /* _IO_COMBINE_FLAG is 0x8000 */
2977
0
      if (left > 0)
2978
0
        {
2979
0
          ret =
2980
0
            dissect_qnet6_kif_msgsend_msg(tvb, pinfo, tree, poffset, encoding);
2981
0
        }
2982
0
    }
2983
2984
0
  return ret;
2985
2986
0
}
2987
2988
static int
2989
dissect_qnet6_kif_msgsend_msg(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
2990
8
{
2991
8
  proto_item  *ti;
2992
8
  proto_tree  *stree;
2993
8
  uint16_t     msgtype, subtype, path_len, extra_len, extra_pad;
2994
8
  const char *msgstr;
2995
8
  uint8_t      extra_type;
2996
8
  int          rlen, head_len;
2997
8
  int          ret = -1;
2998
8
  static int * const ioflag_fields[] = {
2999
8
    &hf_qnet6_kif_msg_connect_ioflag_access,
3000
8
    &hf_qnet6_kif_msg_connect_ioflag_append,
3001
8
    &hf_qnet6_kif_msg_connect_ioflag_dsync,
3002
8
    &hf_qnet6_kif_msg_connect_ioflag_sync,
3003
8
    &hf_qnet6_kif_msg_connect_ioflag_rsync,
3004
8
    &hf_qnet6_kif_msg_connect_ioflag_nonblock,
3005
8
    &hf_qnet6_kif_msg_connect_ioflag_creat,
3006
8
    &hf_qnet6_kif_msg_connect_ioflag_truncate,
3007
8
    &hf_qnet6_kif_msg_connect_ioflag_exclusive,
3008
8
    &hf_qnet6_kif_msg_connect_ioflag_noctrltty,
3009
8
    &hf_qnet6_kif_msg_connect_ioflag_closexec,
3010
8
    &hf_qnet6_kif_msg_connect_ioflag_realids,
3011
8
    &hf_qnet6_kif_msg_connect_ioflag_largefile,
3012
8
    &hf_qnet6_kif_msg_connect_ioflag_async,
3013
8
    NULL
3014
8
  };
3015
8
  static int * const mode_fields[] = {
3016
8
    &hf_qnet6_kif_msg_connect_mode_other_exe,
3017
8
    &hf_qnet6_kif_msg_connect_mode_other_write,
3018
8
    &hf_qnet6_kif_msg_connect_mode_other_read,
3019
8
    &hf_qnet6_kif_msg_connect_mode_group_exe,
3020
8
    &hf_qnet6_kif_msg_connect_mode_group_write,
3021
8
    &hf_qnet6_kif_msg_connect_mode_group_read,
3022
8
    &hf_qnet6_kif_msg_connect_mode_owner_exe,
3023
8
    &hf_qnet6_kif_msg_connect_mode_owner_write,
3024
8
    &hf_qnet6_kif_msg_connect_mode_owner_read,
3025
8
    &hf_qnet6_kif_msg_connect_mode_sticky,
3026
8
    &hf_qnet6_kif_msg_connect_mode_setgid,
3027
8
    &hf_qnet6_kif_msg_connect_mode_setuid,
3028
8
    &hf_qnet6_kif_msg_connect_mode_format,
3029
8
    NULL
3030
8
  };
3031
8
  static int * const eflag_fields[] = {
3032
8
    &hf_qnet6_kif_msg_connect_eflag_dir,
3033
8
    &hf_qnet6_kif_msg_connect_eflag_dot,
3034
8
    &hf_qnet6_kif_msg_connect_eflag_dotdot,
3035
8
    NULL
3036
8
  };
3037
3038
8
  rlen = tvb_reported_length_remaining(tvb, *poffset);
3039
3040
8
  ti = proto_tree_add_string(tree, hf_qnet6_kif_msg, tvb, *poffset, -1, "upper layer message(QNX6 message passing)");
3041
8
  stree = proto_item_add_subtree(ti, ett_qnet6_kif_msg);
3042
3043
8
  msgtype = tvb_get_uint16(tvb, *poffset, encoding);
3044
8
  proto_tree_add_item(stree, hf_qnet6_kif_msg_type, tvb, *poffset, 2, encoding);
3045
8
  *poffset += 2;
3046
8
  msgstr = try_val_to_str_ext(msgtype, &qnet6_kif_msgsend_msgtype_vals_ext);
3047
8
  if (msgstr != NULL)
3048
5
    {
3049
5
      col_append_fstr(pinfo->cinfo, COL_INFO, " %s", msgstr);
3050
5
      proto_item_set_text(ti, "%s", msgstr);
3051
5
    }
3052
8
  rlen -= 2;
3053
3054
8
  switch (msgtype)
3055
8
    {
3056
3
    case QNX_IO_CONNECT:
3057
3
      if (rlen < 2) /* there is no subtype */
3058
0
        return ret;
3059
3060
3
      head_len = 2 + 2 + 4 + 2 * 2 + 4 * 4 + 2 * 4 + 1 * 2 + 2;
3061
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_subtype,tvb, *poffset, 2, encoding);
3062
3
      subtype = tvb_get_uint16(tvb, *poffset, encoding);
3063
3
      *poffset += 2;
3064
3
      rlen -= 2;
3065
3
      if (head_len - 2 - 2 > rlen) /* there is no rest of io_connect */
3066
0
        return ret;
3067
3
      rlen -=(head_len - 2 - 2);
3068
      /*
3069
       * file type is 1, 2, 3, 4,.... so it is value_strings
3070
       */
3071
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_filetype,tvb, *poffset, 4, encoding);
3072
3
      *poffset += 4;
3073
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_replymax, tvb, *poffset, 2, encoding);
3074
3
      *poffset += 2;
3075
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_entrymax, tvb, *poffset, 2, encoding);
3076
3
      *poffset += 2;
3077
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_key, tvb, *poffset, 4, encoding);
3078
3
      *poffset += 4;
3079
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_handle, tvb, *poffset, 4, encoding);
3080
3
      *poffset += 4;
3081
3082
3
      proto_tree_add_bitmask(stree, tvb, *poffset, hf_qnet6_kif_msg_connect_ioflag, ett_qnet6_kif_msg_ioflag, ioflag_fields, encoding);
3083
3084
3
      *poffset += 4;
3085
3
      proto_tree_add_bitmask(stree, tvb, *poffset, hf_qnet6_kif_msg_connect_mode, ett_qnet6_kif_msg_mode, mode_fields, encoding);
3086
3
      *poffset += 4;
3087
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_sflag, tvb, *poffset, 2, encoding);
3088
3
      *poffset += 2;
3089
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_access, tvb, *poffset, 2, encoding);
3090
3
      *poffset += 2;
3091
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_zero, tvb, *poffset, 2, encoding);
3092
3
      *poffset += 2;
3093
3
      path_len = tvb_get_uint16(tvb, *poffset, encoding);
3094
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_pathlen, tvb, *poffset, 2, encoding);
3095
3
      *poffset += 2;
3096
3
      proto_tree_add_bitmask(stree, tvb, *poffset, hf_qnet6_kif_msg_connect_eflag, ett_qnet6_kif_msg_eflag, eflag_fields, encoding);
3097
3
      *poffset += 1;
3098
3
      extra_type = tvb_get_uint8(tvb, *poffset);
3099
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extratype, tvb, *poffset, 1, encoding);
3100
3
      *poffset += 1;
3101
3
      extra_len = tvb_get_uint16(tvb, *poffset, encoding);
3102
3
      proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extralen, tvb, *poffset, 2, encoding);
3103
3
      *poffset += 2;
3104
3
      if (path_len > rlen)
3105
1
        path_len = rlen;
3106
      /*
3107
       * after extra_len is path_len=strlen(path)+1(path,null),
3108
       * extra_len
3109
       */
3110
3
      if (path_len > 0)
3111
2
        {
3112
2
          proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_path, tvb, *poffset, path_len, ENC_ASCII);
3113
2
          *poffset += path_len;
3114
2
          rlen -= path_len;
3115
2
        }
3116
3
      col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(subtype,
3117
3
            qnet6_kif_msgsend_msg_connect_subtype_vals, "Unknown"));
3118
3119
3
      if (extra_len > 0 && rlen > 0)
3120
1
        {
3121
          /*
3122
           * extra data is QNX_MSG_ALIGN which is 8 default is there
3123
3124
           */
3125
1
          if ((path_len + head_len) &(8 - 1))
3126
1
            {
3127
1
              extra_pad =(8 -((path_len + head_len) &(8 - 1)));
3128
1
              if (extra_pad > rlen)
3129
0
                extra_pad = rlen;
3130
1
              if (extra_pad > 0)
3131
1
                {
3132
1
                  proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_pad_data, tvb, *poffset, extra_pad, ENC_NA);
3133
1
                  *poffset += extra_pad;
3134
1
                  rlen -= extra_pad;
3135
1
                }
3136
1
            }
3137
          /*
3138
           * COMBINE_CLOSE and COMBINE are used when it is _IO_CONNECT
3139
           * it will have an additional io message in extra difference
3140
           * in COMBINE_CLOSE and COMBINE is resource manager will call
3141
           * close handler if it is COMBINE_CLOSE for use there is no
3142
           * difference. yzhao I haven't see any app supports COMBINE
3143
           * and support !EXTRA_NONE
3144
           */
3145
1
          if (extra_len > rlen)
3146
1
            extra_len = rlen;
3147
3148
1
          switch (subtype)
3149
1
            {
3150
0
            case QNX_IO_CONNECT_COMBINE_CLOSE:
3151
0
            case QNX_IO_CONNECT_COMBINE:
3152
0
              if (extra_len >= 4 /* type+combine_len in io message */
3153
0
                  && rlen >= 4)
3154
0
                ret = dissect_qnet6_kif_msgsend_msg(tvb, pinfo, stree, poffset, encoding);
3155
0
              return ret;
3156
1
            default:
3157
1
              switch (extra_type)
3158
1
                {
3159
0
                case QNX_IO_CONNECT_EXTRA_LINK: /* 1 */
3160
0
                  proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extra_link_ocb, tvb, *poffset, extra_len, encoding);
3161
0
                  break;
3162
0
                case QNX_IO_CONNECT_EXTRA_SYMLINK: /* 2 */
3163
                  /*
3164
                   * extra data is the symlink new path name
3165
                   */
3166
0
                  proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extra_symlink_path, tvb, *poffset, extra_len, ENC_ASCII);
3167
0
                  break;
3168
0
                case QNX_IO_CONNECT_EXTRA_RENAME:
3169
                  /*
3170
                   * extra data is the mv old new ,extra is old path
3171
                   * name path is the new name
3172
                   */
3173
0
                  proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extra_rename_path, tvb, *poffset, extra_len, ENC_ASCII);
3174
0
                  break;
3175
0
                case QNX_IO_CONNECT_EXTRA_MOUNT:
3176
0
                case QNX_IO_CONNECT_EXTRA_MOUNT_OCB:
3177
0
                  proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extra_mount, tvb, *poffset, extra_len, ENC_ASCII);
3178
0
                  break;
3179
0
                case QNX_IO_CONNECT_EXTRA_NONE: /* 0 */
3180
1
                default:
3181
1
                  proto_tree_add_item(stree, hf_qnet6_kif_msg_connect_extra_data, tvb, *poffset, extra_len, ENC_NA);
3182
1
                  break;
3183
1
                }
3184
1
              break;
3185
1
            }
3186
3187
1
          *poffset += extra_len;
3188
1
        }
3189
3190
3
      ret = 0;
3191
3
      break;
3192
0
    case QNX_IO_DEVCTL:
3193
0
      ret = dissect_qnet6_kif_msgsend_msg_devctl(tvb, pinfo, stree, poffset, encoding);
3194
0
      break;
3195
1
    case QNX_IO_READ:
3196
1
      ret = dissect_qnet6_kif_msgsend_msg_read(tvb, pinfo, stree, poffset, encoding);
3197
1
      break;
3198
0
    case QNX_IO_WRITE:
3199
0
      ret = dissect_qnet6_kif_msgsend_msg_write(tvb, pinfo, stree, poffset, encoding);
3200
0
      break;
3201
0
    case QNX_IO_PATHCONF:
3202
0
      ret = dissect_qnet6_kif_msgsend_msg_pathconf(tvb, pinfo, stree, poffset, encoding);
3203
0
      break;
3204
0
    case QNX_IO_STAT:
3205
0
      ret = dissect_qnet6_kif_msgsend_msg_stat(tvb, pinfo, stree, poffset, encoding);
3206
0
      break;
3207
0
    case QNX_IO_LSEEK:
3208
0
      ret = dissect_qnet6_kif_msgsend_msg_seek(tvb, pinfo, stree, poffset, encoding);
3209
0
      break;
3210
0
    case QNX_IO_CHMOD:
3211
0
      ret = dissect_qnet6_kif_msgsend_msg_chmod(tvb, pinfo, stree, poffset, encoding);
3212
0
      break;
3213
0
    case QNX_IO_CHOWN:
3214
0
      ret = dissect_qnet6_kif_msgsend_msg_chown(tvb, pinfo, stree, poffset, encoding);
3215
0
      break;
3216
0
    case QNX_IO_UTIME:
3217
0
      ret = dissect_qnet6_kif_msgsend_msg_utime(tvb, pinfo, stree, poffset, encoding);
3218
0
      break;
3219
0
    case QNX_IO_FDINFO:
3220
0
      ret = dissect_qnet6_kif_msgsend_msg_fdinfo(tvb, pinfo, stree, poffset, encoding);
3221
0
      break;
3222
0
    case QNX_IO_LOCK:
3223
0
      ret = dissect_qnet6_kif_msgsend_msg_lock(tvb, pinfo, stree, poffset, encoding);
3224
0
      break;
3225
0
    case QNX_IO_SPACE:
3226
0
      ret = dissect_qnet6_kif_msgsend_msg_space(tvb, pinfo, stree, poffset, encoding);
3227
0
      break;
3228
0
    case QNX_IO_CLOSE:
3229
      /*
3230
       * io_close there is no data but only combine_len
3231
       */
3232
0
      ret = dissect_qnet6_kif_msgsend_msg_close(tvb, pinfo, stree, poffset, encoding);
3233
0
      break;
3234
0
    case QNX_IO_SYNC:
3235
0
      ret = dissect_qnet6_kif_msgsend_msg_sync(tvb, pinfo, stree, poffset, encoding);
3236
0
      break;
3237
0
    case QNX_IO_OPENFD:
3238
0
      ret = dissect_qnet6_kif_msgsend_msg_openfd(tvb, pinfo, stree, poffset, encoding);
3239
0
      break;
3240
1
    case QNX_IO_SHUTDOWN:
3241
1
      ret = dissect_qnet6_kif_msgsend_msg_shutdown(tvb, pinfo, stree, poffset, encoding);
3242
1
      break;
3243
0
    case QNX_IO_MMAP:
3244
0
      ret = dissect_qnet6_kif_msgsend_msg_mmap(tvb, pinfo, stree, poffset, encoding);
3245
0
      break;
3246
0
    case QNX_IO_MSG:
3247
0
      ret = dissect_qnet6_kif_msgsend_msg_iomsg(tvb, pinfo, stree, poffset, encoding);
3248
0
      break;
3249
0
    case QNX_IO_NOTIFY:
3250
0
      ret = dissect_qnet6_kif_msgsend_msg_notify(tvb, pinfo, stree, poffset, encoding);
3251
0
      break;
3252
0
    case QNX_IO_DUP:
3253
0
      ret = dissect_qnet6_kif_msgsend_msg_dup(tvb, pinfo, stree, poffset, encoding);
3254
0
      break;
3255
3256
3
    default:
3257
3
      break;
3258
8
    }
3259
3260
8
  return ret;
3261
8
}
3262
3263
// NOLINTEND(misc-no-recursion)
3264
3265
static void
3266
qos_tcs_init_addtree(tvbuff_t * tvb, proto_tree * tree, int * poffset, unsigned encoding, int hf_off, int hf_generated, int rlen, int name_start)
3267
87
{
3268
87
  uint16_t    off;
3269
87
  proto_item *ti;
3270
87
  int         i;
3271
3272
87
  proto_tree_add_item(tree, hf_off, tvb, *poffset, 2, encoding);
3273
87
  off = tvb_get_uint16(tvb, *poffset, encoding);
3274
87
  if ((int) off < rlen)
3275
46
    {
3276
46
      i = off;
3277
460
      while(i <= rlen)
3278
456
        {
3279
456
          if (tvb_get_uint8(tvb, name_start + i)== 0)
3280
42
            break;
3281
414
          i++;
3282
414
        }
3283
46
      if (i <= rlen)
3284
42
        {
3285
42
          ti = proto_tree_add_item(tree, hf_generated, tvb, name_start + off, i - off, ENC_ASCII|ENC_NA);
3286
42
          proto_item_set_generated(ti);
3287
42
        }
3288
3289
46
    }
3290
87
  *poffset += 2;
3291
3292
87
}
3293
3294
static int
3295
dissect_qnet6_qos(uint8_t qtype, tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
3296
41
{
3297
41
  proto_item *ti;
3298
41
  proto_tree *stree;
3299
41
  int         rlen, name_start;
3300
3301
41
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "QNET_QOS");
3302
3303
41
  switch (qtype)
3304
41
    {
3305
25
    case QNET_L4_TYPE_TCS_INIT:
3306
25
      ti = proto_tree_add_item(tree, proto_qnet6_qos, tvb, *poffset, -1, ENC_NA);
3307
25
      stree = proto_item_add_subtree(ti, ett_qnet6_qos);
3308
      /*
3309
       * after l4_pkt header is the tcs_init_strings uint16_t
3310
       * src_name_off, src_domain_off, dst_name_off, dst_domain_off
3311
       */
3312
3313
25
      rlen = tvb_reported_length_remaining(tvb, *poffset);
3314
25
      if (rlen <(int) 2 * 4) /* at least we have tcs_init_strings */
3315
1
        return -1;
3316
      /*
3317
       * after tcs_init_strings how much left
3318
       */
3319
24
      rlen -= 2 * 4;
3320
24
      name_start = *poffset + 2 * 4;
3321
3322
24
      qos_tcs_init_addtree(tvb, stree, poffset, encoding, hf_qnet6_qos_tcs_src_name_off, hf_qnet6_qos_tcs_src_name_generated, rlen, name_start);
3323
24
      qos_tcs_init_addtree(tvb, stree, poffset, encoding, hf_qnet6_qos_tcs_src_domain_off, hf_qnet6_qos_tcs_src_domain_generated, rlen, name_start);
3324
24
      qos_tcs_init_addtree(tvb, stree, poffset, encoding, hf_qnet6_qos_tcs_dst_name_off, hf_qnet6_qos_tcs_dst_name_generated, rlen, name_start);
3325
24
      qos_tcs_init_addtree(tvb, stree, poffset, encoding, hf_qnet6_qos_tcs_dst_domain_off, hf_qnet6_qos_tcs_dst_domain_generated, rlen, name_start);
3326
3327
24
      col_set_str(pinfo->cinfo, COL_INFO, "Qos TCS_INIT Message");
3328
3329
24
      break;
3330
3
    case QNET_L4_TYPE_TCS_REM_UP:
3331
3
      col_set_str(pinfo->cinfo, COL_INFO, "Qos TCS_REM_UP Message");
3332
3
      break;
3333
7
    case QNET_L4_TYPE_TCS_UP:
3334
7
      col_set_str(pinfo->cinfo, COL_INFO, "Qos TCS_UP Message");
3335
7
      break;
3336
3
    case QNET_L4_TYPE_TCS_DOWN:
3337
3
      col_set_str(pinfo->cinfo, COL_INFO, "Qos TCS_DOWN Message");
3338
3
      break;
3339
1
    case QNET_L4_TYPE_TCS_REM_DOWN:
3340
1
      col_set_str(pinfo->cinfo, COL_INFO, "Qos TCS_REM_DOWN Message");
3341
1
      break;
3342
2
    default:
3343
2
      break;
3344
3345
41
    }
3346
3347
36
  return 0;
3348
41
}
3349
3350
/*
3351
 * _client_info is defined in sys / neutrino.h and uid_t, gid_t are _INT32
3352
 */
3353
#if defined(__NGROUPS_MAX)
3354
#define O__NGROUPS_MAX __NGROUPS_MAX
3355
#undef __NGROUPS_MAX
3356
#define __NGROUPS_MAX 8
3357
#else
3358
11
#define __NGROUPS_MAX 8
3359
#endif
3360
/*
3361
 * struct _cred_info { int32_t ruid; int32_t euid; int32_t suid; int32_t rgid;
3362
 * int32_t egid; int32_t sgid; uint32_t ngroups; int32_t
3363
 * grouplist[__NGROUPS_MAX]; };
3364
 *
3365
 * struct _client_info { uint32_t nd; int32_t pid; int32_t sid; uint32_t flags;
3366
 * struct _cred_info cred; };
3367
 */
3368
/*
3369
 * dissect_qnet6_kif_cred will return -1 if there are some data there. and
3370
 * it is supposed to be part of cred but not enough or 0 if cred is fully
3371
 * parsed
3372
 */
3373
static int
3374
dissect_qnet6_kif_cred(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, int * poffset, unsigned encoding)
3375
16
{
3376
16
  proto_item *ti, *ti1, *ti2;
3377
16
  proto_tree *stree, *sstree;
3378
16
  uint32_t ngroups;
3379
16
  int nleft, ret = -1, length;
3380
3381
16
  ti = NULL; /* for compiler warning */
3382
16
  nleft = tvb_reported_length_remaining(tvb, *poffset);
3383
16
  length =((4 * 4 /* nd,pid,sid,flags */ ) +
3384
16
           (4 * 3 * 2 + 4) /* ruid,euid,suid,rgid,egid,sgid,ngroups */ );
3385
  /*
3386
   * at least we need everything before the array
3387
   * grouplist[__NGROUPS_MAX]
3388
   */
3389
16
  if (nleft < length)
3390
5
    return ret;
3391
11
  ti1 = proto_tree_add_string(tree, hf_qnet6_kif_client_info, tvb, *poffset, MIN(length, nleft), "client information");
3392
11
  stree = proto_item_add_subtree(ti1, ett_qnet6_kif_client_info);
3393
  /*
3394
   * nd
3395
   */
3396
11
  proto_tree_add_item(stree, hf_qnet6_kif_client_info_nd, tvb, *poffset, 4, encoding);
3397
11
  *poffset += 4;
3398
  /*
3399
   * pid
3400
   */
3401
11
  proto_tree_add_item(stree, hf_qnet6_kif_client_info_pid, tvb, *poffset, 4, encoding);
3402
11
  *poffset += 4;
3403
  /*
3404
   * sid
3405
   */
3406
11
  proto_tree_add_item(stree, hf_qnet6_kif_client_info_sid, tvb, *poffset, 4, encoding);
3407
11
  *poffset += 4;
3408
  /*
3409
   * flags
3410
   */
3411
11
  proto_tree_add_item(stree, hf_qnet6_kif_client_info_flags, tvb, *poffset, 4, encoding);
3412
11
  *poffset += 4;
3413
11
  ti2 = proto_tree_add_string(stree, hf_qnet6_kif_client_info_cred, tvb, *poffset, MIN(4 * 6 + 4, nleft - 4 * 4), "client information");
3414
11
  sstree = proto_item_add_subtree(ti2, ett_qnet6_kif_client_info_cred);
3415
3416
  /*
3417
   * ruid
3418
   */
3419
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_ruid, tvb, *poffset, 4, encoding);
3420
11
  *poffset += 4;
3421
  /*
3422
   * euid
3423
   */
3424
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_euid, tvb, *poffset, 4, encoding);
3425
11
  *poffset += 4;
3426
  /*
3427
   * suid
3428
   */
3429
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_suid, tvb, *poffset, 4, encoding);
3430
11
  *poffset += 4;
3431
  /*
3432
   * rgid
3433
   */
3434
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_rgid, tvb, *poffset, 4, encoding);
3435
11
  *poffset += 4;
3436
  /*
3437
   * egid
3438
   */
3439
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_egid, tvb, *poffset, 4, encoding);
3440
11
  *poffset += 4;
3441
  /*
3442
   * sgid
3443
   */
3444
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_sgid, tvb, *poffset, 4, encoding);
3445
11
  *poffset += 4;
3446
11
  ngroups = tvb_get_uint32(tvb, *poffset, encoding);
3447
  /*
3448
   * ngroups
3449
   */
3450
11
  proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_ngroups, tvb, *poffset, 4, encoding);
3451
11
  *poffset += 4;
3452
11
  if (ngroups > __NGROUPS_MAX) /* ngroups is wrong */
3453
6
    return ret;
3454
5
  nleft -= length;
3455
5
  nleft = MIN(nleft, __NGROUPS_MAX * 4);
3456
5
  if (nleft < (int) ngroups * 4)
3457
0
    return ret;
3458
  /*
3459
   * nleft at least >=0
3460
   */
3461
5
  nleft = MIN(ngroups * 4,(uint32_t) nleft);
3462
  /*
3463
   * nleft is possible 0,4,...
3464
   */
3465
5
  if (nleft >= 4)
3466
1
    {
3467
1
      ti = proto_tree_add_item(sstree, hf_qnet6_kif_client_info_cred_grouplist, tvb, *poffset, 4, encoding);
3468
1
      *poffset += 4;
3469
1
      nleft -= 4;
3470
1
      length += 4;
3471
1
    }
3472
3473
7
  for (; nleft > 0; nleft -= 4)
3474
2
    {
3475
2
      proto_item_append_text(ti, " %" PRIu32, tvb_get_uint32(tvb, *poffset, encoding));
3476
2
      *poffset += 4;
3477
2
      length += 4;
3478
2
    }
3479
5
  proto_item_set_len(ti1, length);
3480
5
  proto_item_set_len(ti2, length - 4 * 4); /* except nd,pid,sid,flags */
3481
5
  if (ti)
3482
1
    proto_item_set_len(ti, length - 4 * 4 - 4 * 6 - 4);
3483
5
  ret = 0;
3484
3485
5
  return ret;
3486
5
}
3487
3488
static int
3489
dissect_qnet6_kif(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int * poffset, unsigned encoding)
3490
52
{
3491
52
  proto_item           *ti;
3492
52
  proto_tree           *stree, *stree1, *sstree;
3493
52
  int                   rlen;
3494
52
  struct qnet6_kif_hdr  khdr;
3495
52
  const value_string   *p;
3496
52
  int                   ret = -1;
3497
52
  uint32_t              nleft, coid, chid;
3498
3499
52
  ti = proto_tree_add_item(tree, proto_qnet6_kif, tvb, *poffset, -1, ENC_NA);
3500
52
  stree = proto_item_add_subtree(ti, ett_qnet6_kif);
3501
3502
  /*
3503
   * when dissect_qnet6_kif is called it is guaranteed that at least msgtype
3504
   * and size are in packet
3505
   */
3506
52
  khdr.msgtype = tvb_get_uint16(tvb, *poffset, encoding);
3507
52
  khdr.size = tvb_get_uint16(tvb, *poffset + 2, encoding);
3508
3509
52
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "QNET_KIF");
3510
52
  for (p = qnet6_kif_msgtype_vals;
3511
1.02k
       p < qnet6_kif_msgtype_vals + array_length(qnet6_kif_msgtype_vals);
3512
969
       p++)
3513
969
    {
3514
969
      if (p->value ==(khdr.msgtype & QNET_KIF_MSGTYPE_MASK))
3515
59
        {
3516
59
          if (p->strptr)
3517
48
            col_set_str(pinfo->cinfo, COL_INFO, p->strptr);
3518
59
        }
3519
969
    }
3520
3521
52
  if ((khdr.msgtype & QNET_KIF_MSGTYPE_MASK) !=
3522
52
      QNET_KIF_MSGTYPE_CONNECT_MSGSEND)
3523
39
    {
3524
      /*
3525
       * msgtype
3526
       */
3527
39
      ti = proto_tree_add_item(stree, hf_qnet6_kif_msgtype, tvb, *poffset, 2, encoding);
3528
39
      if (khdr.msgtype & QNET_KIF_CRED)
3529
14
        proto_item_append_text(ti, " CRED");
3530
39
      if ((khdr.msgtype & QNET_KIF_ENDIAN_MASK) == QNET_KIF_ENDIAN_BIG)
3531
3
        proto_item_append_text(ti, " BIG_ENDIAN");
3532
36
      else if ((khdr.msgtype & QNET_KIF_ENDIAN_MASK) == QNET_KIF_ENDIAN_LITTLE)
3533
27
        proto_item_append_text(ti, " LITTLE_ENDIAN");
3534
39
      *poffset += 2;
3535
      /*
3536
       * size
3537
       */
3538
39
      proto_tree_add_item(stree, hf_qnet6_kif_size, tvb, *poffset, 2, encoding);
3539
39
      *poffset += 2;
3540
39
    }
3541
  /*
3542
   * how much data left and not parsed yet
3543
   */
3544
52
  rlen = tvb_reported_length_remaining(tvb, *poffset);
3545
3546
52
  switch (khdr.msgtype & QNET_KIF_MSGTYPE_MASK)
3547
52
    {
3548
11
    case QNET_KIF_MSGTYPE_CONNECT:
3549
      /*
3550
       * version
3551
       */
3552
11
      proto_tree_add_item(stree, hf_qnet6_kif_version, tvb, *poffset, 4, encoding);
3553
11
      *poffset += 4;
3554
      /*
3555
       * server pid
3556
       */
3557
11
      proto_tree_add_item(stree, hf_qnet6_kif_connect_server_pid, tvb, *poffset, 4, encoding);
3558
11
      *poffset += 4;
3559
      /*
3560
       * server chid
3561
       */
3562
11
      chid = tvb_get_uint32(tvb, *poffset, encoding);
3563
11
      ti = proto_tree_add_item(stree,hf_qnet6_kif_connect_server_chid, tvb,*poffset, 4, encoding);
3564
11
      display_channel_id(chid, ti);
3565
11
      *poffset += 4;
3566
      /*
3567
       * client id
3568
       */
3569
11
      proto_tree_add_item(stree, hf_qnet6_kif_connect_client_id, tvb, *poffset, 4, encoding);
3570
11
      *poffset += 4;
3571
      /*
3572
       * client pid
3573
       */
3574
11
      proto_tree_add_item(stree, hf_qnet6_kif_connect_client_pid, tvb, *poffset, 4, encoding);
3575
11
      *poffset += 4;
3576
      /*
3577
       * dissect_qnet6_kif_cred will check whether no more data
3578
       */
3579
11
      if (khdr.msgtype & QNET_KIF_CRED)
3580
7
        {
3581
7
          ret = dissect_qnet6_kif_cred(tvb, pinfo, stree, poffset, encoding);
3582
7
          if (ret != 0)
3583
4
            return ret;
3584
7
        }
3585
7
      break;
3586
12
    case QNET_KIF_MSGTYPE_CONNECT_MSGSEND:
3587
      /*
3588
       * still don't know how many ngroups in cred_info so needs to
3589
       * modify its size later proto_item_set_len should be called later
3590
       * when we know ngroups.
3591
       */
3592
      /*
3593
       * connect_msgsend format: connect cred (optional, msgtype
3594
       * indicates it size=sizeof(connect)+optinal sizeof(cred)) msgsend
3595
       * cred (optional)
3596
       */
3597
      /*
3598
       * if no struct qnet6_kif_connect
3599
       */
3600
12
      if (rlen < 4 + 4 + 4 + 4 + 4 + 4)
3601
2
        return ret;
3602
10
      ti = proto_tree_add_string(stree, hf_qnet6_kif_connect, tvb, *poffset,
3603
10
                                 2 * 2 + 4 * 5 + ((khdr.msgtype & QNET_KIF_CRED) ? (4 * 4 + 4 * 7) : 0),
3604
10
                                 "qnet connect message");
3605
10
      stree1 = proto_item_add_subtree(ti, ett_qnet6_kif_connect);
3606
      /*
3607
       * msgtype
3608
       */
3609
10
      ti = proto_tree_add_item(stree1, hf_qnet6_kif_msgtype, tvb, *poffset, 2, encoding);
3610
10
      if (khdr.msgtype & QNET_KIF_CRED)
3611
4
        proto_item_append_text(ti, " CRED");
3612
10
      if ((khdr.msgtype & QNET_KIF_ENDIAN_MASK) == QNET_KIF_ENDIAN_BIG)
3613
0
        proto_item_append_text(ti, " BIG_ENDIAN");
3614
10
      else if ((khdr.msgtype & QNET_KIF_ENDIAN_MASK) == QNET_KIF_ENDIAN_LITTLE)
3615
9
        proto_item_append_text(ti, " LITTLE_ENDIAN");
3616
10
      *poffset += 2;
3617
      /*
3618
       * size
3619
       */
3620
10
      proto_tree_add_item(stree1, hf_qnet6_kif_size, tvb, *poffset, 2, encoding);
3621
10
      *poffset += 2;
3622
      /*
3623
       * version
3624
       */
3625
10
      proto_tree_add_item(stree1, hf_qnet6_kif_version, tvb, *poffset, 4, encoding);
3626
10
      *poffset += 4;
3627
      /*
3628
       * server pid
3629
       */
3630
10
      proto_tree_add_item(stree1, hf_qnet6_kif_connect_server_pid, tvb, *poffset, 4, encoding);
3631
10
      *poffset += 4;
3632
      /*
3633
       * server chid
3634
       */
3635
10
      chid = tvb_get_uint32(tvb, *poffset, encoding);
3636
10
      ti = proto_tree_add_item(stree1, hf_qnet6_kif_connect_server_chid, tvb, *poffset, 4, encoding);
3637
10
      display_channel_id(chid, ti);
3638
10
      *poffset += 4;
3639
      /*
3640
       * client id
3641
       */
3642
10
      proto_tree_add_item(stree1, hf_qnet6_kif_connect_client_id, tvb, *poffset, 4, encoding);
3643
10
      *poffset += 4;
3644
      /*
3645
       * client pid
3646
       */
3647
10
      proto_tree_add_item(stree1, hf_qnet6_kif_connect_client_pid, tvb, *poffset, 4, encoding);
3648
10
      *poffset += 4;
3649
10
      if (khdr.msgtype & QNET_KIF_CRED)
3650
4
        {
3651
4
          ret = dissect_qnet6_kif_cred(tvb, pinfo, stree1, poffset, encoding);
3652
4
          if (ret != 0)
3653
3
            return ret;
3654
4
        }
3655
3656
7
      rlen = tvb_reported_length_remaining(tvb, *poffset);
3657
7
      if (rlen < 4 /* type+size */ )
3658
1
        return ret;
3659
      /*
3660
       * msgsend msgtype, size part
3661
       */
3662
6
      ti = proto_tree_add_string(stree, hf_qnet6_kif_msgsend, tvb, *poffset, -1, "qnet msgsend message");
3663
6
      stree = proto_item_add_subtree(ti, ett_qnet6_kif_msgsend);
3664
3665
6
      khdr.msgtype = tvb_get_uint16(tvb, *poffset, encoding);
3666
6
      khdr.size = tvb_get_uint16(tvb, *poffset + 2, encoding);
3667
      /*
3668
       * msgtype
3669
       */
3670
6
      ti = proto_tree_add_item(stree, hf_qnet6_kif_msgtype, tvb, *poffset, 2, encoding);
3671
6
      if (khdr.msgtype & QNET_KIF_CRED)
3672
5
        proto_item_append_text(ti, " CRED");
3673
6
      if ((khdr.msgtype & QNET_KIF_ENDIAN_MASK) == QNET_KIF_ENDIAN_BIG)
3674
4
        proto_item_append_text(ti, " BIG_ENDIAN");
3675
2
      else if ((khdr.msgtype & QNET_KIF_ENDIAN_MASK) == QNET_KIF_ENDIAN_LITTLE)
3676
2
        proto_item_append_text(ti, " LITTLE_ENDIAN");
3677
6
      *poffset += 2;
3678
      /*
3679
       * size
3680
       */
3681
6
      proto_tree_add_item(stree, hf_qnet6_kif_size, tvb, *poffset, 2, encoding);
3682
6
      *poffset += 2;
3683
6
      rlen -= 4;
3684
6
      goto lmsgsend;
3685
0
      break;
3686
1
    case QNET_KIF_MSGTYPE_CONNECT_SUCCESS:
3687
1
      if (rlen < 4 + 4 + 4 + 4 + 4) /* ver, sid,cid,scoid,nbytes */
3688
0
        return ret;
3689
      /*
3690
       * version
3691
       */
3692
1
      proto_tree_add_item(stree, hf_qnet6_kif_version, tvb, *poffset, 4, encoding);
3693
1
      *poffset += 4;
3694
      /*
3695
       * server id
3696
       */
3697
1
      proto_tree_add_item(stree, hf_qnet6_kif_connects_server_id, tvb, *poffset, 4, encoding);
3698
1
      *poffset += 4;
3699
      /*
3700
       * client id
3701
       */
3702
1
      proto_tree_add_item(stree, hf_qnet6_kif_connects_client_id, tvb, *poffset, 4, encoding);
3703
1
      *poffset += 4;
3704
      /*
3705
       * scoid
3706
       */
3707
1
      proto_tree_add_item(stree, hf_qnet6_kif_connects_scoid, tvb, *poffset, 4, encoding);
3708
1
      *poffset += 4;
3709
      /*
3710
       * nbytes
3711
       */
3712
1
      proto_tree_add_item(stree, hf_qnet6_kif_connects_nbytes, tvb, *poffset, 4, encoding);
3713
1
      *poffset += 4;
3714
1
      if (khdr.msgtype & QNET_KIF_CRED)
3715
0
        {
3716
0
          ret = dissect_qnet6_kif_cred(tvb, pinfo, stree, poffset, encoding);
3717
0
          if (ret != 0)
3718
0
            return ret;
3719
0
        }
3720
1
      break;
3721
3
    case QNET_KIF_MSGTYPE_CONNECT_FAIL:
3722
3
      if (rlen < 4 + 4 + 4) /* ver, cid, status */
3723
1
        return ret;
3724
      /*
3725
       * version
3726
       */
3727
2
      proto_tree_add_item(stree, hf_qnet6_kif_version, tvb, *poffset, 4, encoding);
3728
2
      *poffset += 4;
3729
      /*
3730
       * client id
3731
       */
3732
2
      proto_tree_add_item(stree, hf_qnet6_kif_connectf_client_id, tvb, *poffset, 4, encoding);
3733
2
      *poffset += 4;
3734
      /*
3735
       * status
3736
       */
3737
2
      proto_tree_add_item(stree, hf_qnet6_kif_connectf_status, tvb, *poffset, 4, encoding);
3738
2
      *poffset += 4;
3739
2
      break;
3740
0
    case QNET_KIF_MSGTYPE_CONNECT_DEATH:
3741
0
      if (rlen < 4)
3742
0
        return ret;
3743
      /*
3744
       * client id
3745
       */
3746
0
      proto_tree_add_item(stree, hf_qnet6_kif_connectd_client_id, tvb, *poffset, 4, encoding);
3747
0
      *poffset += 4;
3748
0
      break;
3749
8
    case QNET_KIF_MSGTYPE_MSGSEND:
3750
3751
8
    case QNET_KIF_MSGTYPE_PULSE:
3752
14
    lmsgsend:
3753
14
      if (rlen < 4 * 10) /* sid,client_handle, tid, coid,priority, srcmsglen,keydata,srcnd,dstmsglen */
3754
2
        return ret;
3755
      /*
3756
       * server id
3757
       */
3758
12
      proto_tree_add_item(stree, hf_qnet6_kif_msgsend_server_id, tvb, *poffset, 4, encoding);
3759
12
      *poffset += 4;
3760
      /*
3761
       * client handle
3762
       */
3763
12
      proto_tree_add_item(stree, hf_qnet6_kif_msgsend_client_handle, tvb, *poffset, 4, encoding);
3764
12
      *poffset += 4;
3765
      /*
3766
       * vinfo, it is packed as 64 bits aligned so sizeof should work
3767
       * well on 32, 64 bits platforms
3768
       */
3769
12
      ti = proto_tree_add_string(stree, hf_qnet6_kif_msgsend_vinfo, tvb, *poffset, 4 * 8, "virtual thread information");
3770
12
      sstree = proto_item_add_subtree(ti, ett_qnet6_kif_vinfo);
3771
      /*
3772
       * tid
3773
       */
3774
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_tid, tvb, *poffset, 4, encoding);
3775
12
      *poffset += 4;
3776
12
      coid = tvb_get_uint32(tvb, *poffset, encoding);
3777
12
      ti = proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_coid, tvb, *poffset, 4, encoding);
3778
12
      display_coid(coid, ti);
3779
12
      *poffset += 4;
3780
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_priority, tvb, *poffset, 4, encoding);
3781
12
      *poffset += 4;
3782
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_srcmsglen, tvb, *poffset, 4, encoding);
3783
12
      *poffset += 4;
3784
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_keydata, tvb, *poffset, 4, encoding);
3785
12
      *poffset += 4;
3786
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_srcnd, tvb, *poffset, 4, encoding);
3787
12
      *poffset += 4;
3788
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_dstmsglen, tvb, *poffset, 4, encoding);
3789
12
      *poffset += 4;
3790
12
      proto_tree_add_item(sstree, hf_qnet6_kif_vtid_info_zero, tvb, *poffset, 4, encoding);
3791
12
      *poffset += 4;
3792
3793
12
      rlen -= 40;
3794
12
      if ((khdr.msgtype & QNET_KIF_MSGTYPE_MASK) ==
3795
12
          QNET_KIF_MSGTYPE_MSGSEND
3796
12
          || (khdr.msgtype & QNET_KIF_MSGTYPE_MASK) ==
3797
5
          QNET_KIF_MSGTYPE_CONNECT_MSGSEND)
3798
8
        {
3799
          /*
3800
           * nbytes
3801
           */
3802
8
          proto_tree_add_item(stree, hf_qnet6_kif_msgsend_nbytes, tvb, *poffset, 4, encoding);
3803
8
          *poffset += 4;
3804
3805
          /*
3806
           * start to dissect resmgr_iomsgs which starts with uint16_t
3807
           * type
3808
           */
3809
8
          ret = dissect_qnet6_kif_msgsend_msg(tvb, pinfo, stree, poffset, encoding);
3810
8
          if (ret != 0)
3811
3
            return ret;
3812
8
        }
3813
4
      else
3814
4
        {
3815
4
          if (rlen < 2 * 2 + 1 + 3 + 4 * 3)
3816
1
            return ret;
3817
          /*
3818
           * pulse is done
3819
           */
3820
3
          ti = proto_tree_add_string(stree, hf_qnet6_kif_pulse_pulse, tvb, *poffset, 4 * 4 , "pulse information");
3821
3
          sstree = proto_item_add_subtree(ti, ett_qnet6_kif_pulse);
3822
3
          proto_tree_add_item(sstree, hf_qnet6_kif_pulse_pulse_type, tvb, *poffset, 2, encoding);
3823
3
          *poffset += 2;
3824
3
          proto_tree_add_item(sstree, hf_qnet6_kif_pulse_pulse_subtype, tvb, *poffset, 2, encoding);
3825
3
          *poffset += 2;
3826
3
          proto_tree_add_item(sstree, hf_qnet6_kif_pulse_pulse_code, tvb, *poffset, 1, encoding);
3827
3
          *poffset += 1;
3828
3
          proto_tree_add_item(sstree, hf_qnet6_kif_pulse_pulse_reserved, tvb, *poffset, 3, encoding);
3829
3
          *poffset += 3;
3830
3
          proto_tree_add_item(sstree, hf_qnet6_kif_pulse_pulse_value, tvb, *poffset, 4, encoding);
3831
3
          *poffset += 4;
3832
3
          proto_tree_add_item(sstree, hf_qnet6_kif_pulse_pulse_scoid, tvb, *poffset, 4, encoding);
3833
3
          *poffset += 4;
3834
          /*
3835
           * priority
3836
           */
3837
3
          proto_tree_add_item(stree, hf_qnet6_kif_pulse_priority, tvb, *poffset, 4, encoding);
3838
3
          *poffset += 4;
3839
3
        }
3840
8
      if (khdr.msgtype & QNET_KIF_CRED)
3841
5
        {
3842
5
          ret = dissect_qnet6_kif_cred(tvb, pinfo, stree, poffset, encoding);
3843
5
          if (ret != 0)
3844
4
            return ret;
3845
5
        }
3846
4
      break;
3847
4
    case QNET_KIF_MSGTYPE_MSGREAD:
3848
3
      if (rlen < 4 * 4)
3849
1
        return ret;
3850
      /*
3851
       * msgread handle
3852
       */
3853
2
      proto_tree_add_item(stree, hf_qnet6_kif_msgread_msgread_handle, tvb, *poffset, 4, encoding);
3854
2
      *poffset += 4;
3855
      /*
3856
       * client handle
3857
       */
3858
2
      proto_tree_add_item(stree, hf_qnet6_kif_msgread_client_handle, tvb, *poffset, 4, encoding);
3859
2
      *poffset += 4;
3860
      /*
3861
       * offset
3862
       */
3863
2
      proto_tree_add_item(stree, hf_qnet6_kif_msgread_offset, tvb, *poffset, 4, encoding);
3864
2
      *poffset += 4;
3865
      /*
3866
       * nbytes
3867
       */
3868
2
      proto_tree_add_item(stree, hf_qnet6_kif_msgread_nbytes, tvb, *poffset, 4, encoding);
3869
2
      *poffset += 4;
3870
2
      break;
3871
1
    case QNET_KIF_MSGTYPE_MSGWRITE:
3872
3
    case QNET_KIF_MSGTYPE_MSGREPLY:
3873
4
    case QNET_KIF_MSGTYPE_MSGERROR:
3874
6
    case QNET_KIF_MSGTYPE_MSGREAD_XFER:
3875
7
    case QNET_KIF_MSGTYPE_MSGREAD_ERROR:
3876
7
      if (rlen < 4 * 4)
3877
0
        return ret;
3878
3879
      /*
3880
       * status
3881
       */
3882
7
      proto_tree_add_item(stree, hf_qnet6_kif_msgwrite_status, tvb, *poffset, 4, encoding);
3883
7
      *poffset += 4;
3884
      /*
3885
       * handle
3886
       */
3887
7
      proto_tree_add_item(stree, hf_qnet6_kif_msgwrite_handle, tvb, *poffset, 4, encoding);
3888
7
      *poffset += 4;
3889
      /*
3890
       * offset
3891
       */
3892
7
      proto_tree_add_item(stree, hf_qnet6_kif_msgwrite_offset, tvb, *poffset, 4, encoding);
3893
7
      *poffset += 4;
3894
      /*
3895
       * nbytes
3896
       */
3897
7
      nleft = tvb_get_uint32(tvb, *poffset, encoding);
3898
7
      proto_tree_add_item(stree, hf_qnet6_kif_msgwrite_nbytes, tvb, *poffset, 4, encoding);
3899
7
      *poffset += 4;
3900
      /*
3901
       * else data
3902
       */
3903
7
      if (rlen - 4 * 4 > 0)
3904
7
        proto_tree_add_item(stree, hf_qnet6_kif_msgwrite_data, tvb, *poffset, MIN(nleft, (uint32_t) rlen - 4 * 4), ENC_NA);
3905
3906
7
      break;
3907
2
    case QNET_KIF_MSGTYPE_UNBLOCK:
3908
2
      if (rlen < 4 * 3)
3909
0
        return ret;
3910
      /*
3911
       * server id
3912
       */
3913
2
      proto_tree_add_item(stree, hf_qnet6_kif_unblock_server_id, tvb, *poffset, 4, encoding);
3914
2
      *poffset += 4;
3915
      /*
3916
       * client handle
3917
       */
3918
2
      proto_tree_add_item(stree, hf_qnet6_kif_unblock_client_handle, tvb, *poffset, 4, encoding);
3919
2
      *poffset += 4;
3920
      /*
3921
       * tid
3922
       */
3923
2
      proto_tree_add_item(stree, hf_qnet6_kif_unblock_tid, tvb, *poffset, 4, encoding);
3924
2
      *poffset += 4;
3925
3926
2
      break;
3927
0
    case QNET_KIF_MSGTYPE_EVENT:
3928
0
      if (rlen < 4)
3929
0
        return ret;
3930
      /*
3931
       * client handle
3932
       */
3933
0
      proto_tree_add_item(stree, hf_qnet6_kif_event_client_handle, tvb, *poffset, 4, encoding);
3934
0
      *poffset += 4;
3935
0
      if (rlen < 4 * 4)
3936
0
        return ret;
3937
      /*
3938
       * sigevent
3939
       */
3940
0
      ti = proto_tree_add_item(stree, hf_qnet6_kif_event_event, tvb, *poffset, 4 * 4, ENC_NA);
3941
      /*
3942
       *poffset += sizeof(struct sigevent_qnx); */
3943
0
      sstree = proto_item_add_subtree(ti, ett_qnet6_kif_event);
3944
3945
0
      proto_tree_add_item(sstree, hf_qnet6_kif_event_notify, tvb, *poffset, 4, encoding);
3946
0
      *poffset += 4;
3947
0
      proto_tree_add_item(sstree, hf_qnet6_kif_event_union1, tvb, *poffset, 4, encoding);
3948
0
      *poffset += 4;
3949
0
      proto_tree_add_item(sstree, hf_qnet6_kif_event_value, tvb, *poffset, 4, encoding);
3950
0
      *poffset += 4;
3951
0
      proto_tree_add_item(sstree, hf_qnet6_kif_event_union2, tvb, *poffset, 4, encoding);
3952
0
      *poffset += 4;
3953
3954
0
      break;
3955
0
    case QNET_KIF_MSGTYPE_SIGNAL:
3956
0
      if (rlen < 4 * 6)
3957
0
        return ret;
3958
      /*
3959
       * client handle
3960
       */
3961
0
      proto_tree_add_item(stree, hf_qnet6_kif_signal_client_handle, tvb, *poffset, 4, encoding);
3962
0
      *poffset += 4;
3963
      /*
3964
       * pid
3965
       */
3966
0
      proto_tree_add_item(stree, hf_qnet6_kif_signal_pid, tvb, *poffset, 4, encoding);
3967
0
      *poffset += 4;
3968
      /*
3969
       * tid
3970
       */
3971
0
      proto_tree_add_item(stree, hf_qnet6_kif_signal_tid, tvb, *poffset, 4, encoding);
3972
0
      *poffset += 4;
3973
      /*
3974
       * signo
3975
       */
3976
0
      proto_tree_add_item(stree, hf_qnet6_kif_signal_signo, tvb, *poffset, 4, encoding);
3977
0
      *poffset += 4;
3978
      /*
3979
       * code
3980
       */
3981
0
      proto_tree_add_item(stree, hf_qnet6_kif_signal_code, tvb, *poffset, 4, encoding);
3982
0
      *poffset += 4;
3983
      /*
3984
       * value
3985
       */
3986
0
      proto_tree_add_item(stree, hf_qnet6_kif_signal_value, tvb, *poffset, 4, encoding);
3987
0
      *poffset += 4;
3988
0
      if (khdr.msgtype & QNET_KIF_CRED)
3989
0
        {
3990
0
          ret = dissect_qnet6_kif_cred(tvb, pinfo, stree, poffset, encoding);
3991
0
          if (ret != 0)
3992
0
            return ret;
3993
0
        }
3994
0
      break;
3995
1
    case QNET_KIF_MSGTYPE_DISCONNECT:
3996
1
      if (rlen < 4)
3997
0
        return ret;
3998
      /*
3999
       * server id
4000
       */
4001
1
      proto_tree_add_item(stree, hf_qnet6_kif_disconnect_server_id, tvb, *poffset, 4, encoding);
4002
1
      *poffset += 4;
4003
4
    default:
4004
4
      break;
4005
52
    }
4006
28
  ret = 0;
4007
4008
28
  return ret;
4009
52
}
4010
4011
#ifdef O__NGROUPS_MAX
4012
#define __NGROUPS_MAX O__NGROUPS_MAX
4013
#else
4014
#undef __NGROUPS_MAX
4015
#endif
4016
4017
static int
4018
dissect_qnet6(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_)
4019
249
{
4020
4021
249
  proto_item *ti;
4022
249
  proto_tree *qnet6_tree, *stree;
4023
249
  uint8_t     qflags, qlayer, qtype, crcbuf[4];
4024
249
  unsigned    encoding;
4025
249
  int         offset = 0;
4026
249
  int         len, plen, cklen;
4027
249
  uint32_t    crc, crcp;
4028
249
  static int * const flags[] = {
4029
249
    &hf_qnet6_l4_flags_first,
4030
249
    &hf_qnet6_l4_flags_last,
4031
249
    &hf_qnet6_l4_flags_crc,
4032
249
    NULL
4033
249
  };
4034
4035
249
  memset(crcbuf, 0, sizeof(crcbuf));
4036
  /*
4037
   * Check that there's enough data
4038
   */
4039
249
  len = (int) tvb_reported_length(tvb);
4040
249
  if (len < 36 + 2) /* sizeof (l4_pkt) + 2 bytes pad after 0x8204 */
4041
15
    return 0;
4042
4043
234
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "QNET_LWL4");
4044
4045
  /*
4046
   * write to Info column
4047
   */
4048
234
  col_set_str(pinfo->cinfo, COL_INFO, "Qnet6");
4049
4050
234
  ti = proto_tree_add_item(tree, proto_qnet6_l4, tvb, 0, 36 + 2, ENC_NA);
4051
234
  qnet6_tree = proto_item_add_subtree(ti, ett_qnet6_l4);
4052
4053
234
  proto_tree_add_item(qnet6_tree, hf_qnet6_l4_padding, tvb, offset, 2, ENC_BIG_ENDIAN);
4054
234
  offset += 2;
4055
4056
  /*
4057
   * version
4058
   */
4059
234
  encoding =(tvb_get_uint8(tvb, offset) & 0x80) ? ENC_BIG_ENDIAN : ENC_LITTLE_ENDIAN;
4060
234
  proto_tree_add_item(qnet6_tree, hf_qnet6_l4_ver, tvb, offset++, 1, ENC_BIG_ENDIAN);
4061
4062
  /*
4063
   * type
4064
   */
4065
234
  qtype = tvb_get_uint8(tvb, offset);
4066
234
  proto_tree_add_item(qnet6_tree, hf_qnet6_l4_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
4067
4068
234
  col_add_str(pinfo->cinfo, COL_INFO, val_to_str(qtype, qnet6_type_vals, "Unknown LWL4 Type %u packets"));
4069
  /*
4070
   * flags
4071
   */
4072
234
  proto_tree_add_bitmask_with_flags(qnet6_tree, tvb, offset,
4073
234
                hf_qnet6_l4_flags, ett_qnet6_flags, flags, ENC_NA, BMT_NO_APPEND|BMT_NO_FALSE);
4074
234
  qflags = tvb_get_uint8(tvb, offset);
4075
234
  offset++;
4076
  /*
4077
   * layer
4078
   */
4079
234
  qlayer = tvb_get_uint8(tvb, offset);
4080
234
  proto_tree_add_item(qnet6_tree, hf_qnet6_l4_layer, tvb, offset++, 1, encoding);
4081
  /*
4082
   * qos_info
4083
   */
4084
  /*
4085
   * src_nd_for_dst
4086
   */
4087
234
  ti = proto_tree_add_item(qnet6_tree, hf_qnet6_l4_qos_info, tvb, offset, 20, ENC_NA);
4088
234
  stree = proto_item_add_subtree(ti, ett_qnet6_qos_info);
4089
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_src_nd_for_dst, tvb, offset, 2, encoding);
4090
234
  offset += 2;
4091
  /*
4092
   * dst_nd_for_src
4093
   */
4094
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_dst_nd_for_src, tvb, offset, 2, encoding);
4095
234
  offset += 2;
4096
  /*
4097
   * src connection id
4098
   */
4099
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_src_conn_id, tvb, offset, 4, encoding);
4100
234
  offset += 4;
4101
  /*
4102
   * dst connection id
4103
   */
4104
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_dst_conn_id, tvb, offset, 4, encoding);
4105
234
  offset += 4;
4106
  /*
4107
   * sequence number
4108
   */
4109
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_src_seq_num, tvb, offset, 4, encoding);
4110
234
  offset += 4;
4111
  /*
4112
   * qos type
4113
   */
4114
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_qos_type, tvb, offset, 2, encoding);
4115
234
  offset += 2;
4116
  /*
4117
   * qos index
4118
   */
4119
234
  proto_tree_add_item(stree, hf_qnet6_l4_qos_src_qos_idx, tvb, offset, 2, encoding);
4120
234
  offset += 2;
4121
  /*
4122
   * end of qos_info
4123
   */
4124
  /*
4125
   * offset in this stream
4126
   */
4127
234
  proto_tree_add_item(qnet6_tree, hf_qnet6_l4_offset, tvb, offset, 4, encoding);
4128
234
  offset += 4;
4129
  /*
4130
   * length of its payload
4131
   */
4132
234
  plen = tvb_get_uint32(tvb, offset, encoding);
4133
234
  proto_tree_add_uint(qnet6_tree, hf_qnet6_l4_length, tvb, offset, 4, plen);
4134
234
  offset += 4;
4135
  /*
4136
   * crc value
4137
   */
4138
234
  crcp = tvb_get_uint32(tvb, offset, encoding);
4139
  /*
4140
   * crc value is l4_pkt header + data behind with original crc is 0
4141
   */
4142
234
  if ((qflags & (QNET_L4_FLAGS_FIRST)) &&
4143
234
      (qflags & QNET_L4_FLAGS_LAST) && ((qnet6_lwl4_check_crc) || (qflags & QNET_L4_FLAGS_CRC)))
4144
143
    {
4145
      /*
4146
       * only do crc when first|last|crc are all set
4147
       */
4148
      /*
4149
       * 1.cksum header of l4_pkt except crc field
4150
       */
4151
      /*
4152
       * qnet is using initial seed 0 not 0xffffffff
4153
       */
4154
143
      crc = crc32_mpeg2_tvb_offset_seed(tvb, 2, 36 - 4, 0);
4155
143
      crc = ~crc;
4156
      /*
4157
       * 2. cksum crc field with 4 bytes 0
4158
       */
4159
143
      crc = crc32_mpeg2_seed(crcbuf, 4, ~crc);
4160
143
      crc = ~crc;
4161
143
      cklen = len - 36 - 2;
4162
143
      if (plen < cklen)
4163
47
        cklen = plen;
4164
      /*
4165
       * data after header
4166
       */
4167
143
      if (cklen > 0)
4168
101
        {
4169
101
          crc = crc32_mpeg2_tvb_offset_seed(tvb, 36 + 2, cklen, ~crc);
4170
101
          crc = ~crc;
4171
101
        }
4172
      /*
4173
       * qnet l4's crc didn't xor itself at last so we have to
4174
       * workaround it
4175
       */
4176
143
      crc = ~crc;
4177
143
      if (crcp == crc)
4178
0
        proto_tree_add_uint_format(qnet6_tree, hf_qnet6_l4_crc, tvb, offset, 4, crcp, "crc32:0x%x [correct]", crcp);
4179
143
      else
4180
143
        proto_tree_add_uint_format(qnet6_tree, hf_qnet6_l4_crc, tvb, offset, 4, crcp, "crc32:0x%x [incorrect, should be 0x%x]", crcp, crc);
4181
143
    }
4182
91
  else
4183
91
    {
4184
91
      proto_tree_add_item(qnet6_tree, hf_qnet6_l4_crc, tvb, offset, 4, encoding);
4185
91
    }
4186
234
  offset += 4;
4187
  /*
4188
   * Continue adding tree items to process the packet here
4189
   */
4190
  /*
4191
   * there is no data behind l4_pkt header in this packet
4192
   */
4193
234
  if (len == offset)
4194
3
    return offset;
4195
  /*
4196
   * don't support fragment yet
4197
   */
4198
231
  if (!((qflags & QNET_L4_FLAGS_FIRST) && (qflags & QNET_L4_FLAGS_LAST)))
4199
88
    {
4200
88
      if (!(qflags & QNET_L4_FLAGS_FIRST))
4201
33
        {
4202
33
          if (qflags & QNET_L4_FLAGS_LAST)
4203
17
            col_prepend_fstr(pinfo->cinfo, COL_INFO, "Last Fragmented ");
4204
16
          else
4205
16
            col_prepend_fstr(pinfo->cinfo, COL_INFO, "Fragmented ");
4206
33
          return offset;
4207
33
        }
4208
88
    }
4209
4210
  /*
4211
   * if (plen == 0 ) there is no payload indicated by the length in
4212
   * l4_pkt header but we need to go through upper protocol layer to
4213
   * show protocol and info. so upper layer should be careful of
4214
   * the length
4215
   */
4216
4217
  /*
4218
   * qtype < QNET_L4_TYPE_USER is qos packet so qlayer is useless
4219
   */
4220
198
  if (qtype < QNET_L4_TYPE_USER && qtype > QNET_L4_TYPE_USER_DATA)
4221
41
    {
4222
41
      dissect_qnet6_qos(qtype, tvb, pinfo, tree, &offset, encoding);
4223
41
    }
4224
157
  else
4225
157
    {
4226
157
      switch (qtype)
4227
157
        {
4228
1
        case QNET_L4_TYPE_ACK:
4229
1
          col_set_str(pinfo->cinfo, COL_INFO, "Ack");
4230
1
          break;
4231
0
        case QNET_L4_TYPE_NACK:
4232
0
          col_set_str(pinfo->cinfo, COL_INFO, "Nack");
4233
0
          break;
4234
0
        case QNET_L4_TYPE_LRES:
4235
0
          col_set_str(pinfo->cinfo, COL_INFO, "Lan Resolver Packets");
4236
0
          break;
4237
155
        default:
4238
155
          break;
4239
157
        }
4240
156
      switch (qlayer)
4241
156
        {
4242
60
        case QNET_L4_LAYER_KIF:
4243
60
          if (plen >= 4 /* sizeof(struct qnet6_kif_hdr) */ )
4244
52
            {
4245
52
              dissect_qnet6_kif (tvb, pinfo, tree, &offset, encoding);
4246
52
            }
4247
60
          break;
4248
32
        case QNET_L4_LAYER_NR:
4249
          /*
4250
           * at least a type in payload
4251
           */
4252
32
          if (plen >= (int) 1)
4253
22
            dissect_qnet6_nr(tvb, pinfo, tree, &offset, encoding);
4254
32
          break;
4255
24
        case QNET_L4_LAYER_LR:
4256
24
          if (plen >= QNX_QNET6_LR_PKT_SIZE
4257
              /*
4258
               * sizeof(struct qnet6_lr_pkt)
4259
24
               */ )
4260
21
            {
4261
21
              dissect_qnet6_lr(tvb, pinfo, tree, &offset, encoding);
4262
21
            }
4263
24
          break;
4264
2
        case QNET_L4_LAYER_SEQ:
4265
2
          col_set_str(pinfo->cinfo, COL_INFO, "Qos Sequence hole filler Packets");
4266
2
          break;
4267
156
        }
4268
156
    }
4269
194
  if (!((qflags & QNET_L4_FLAGS_FIRST) && (qflags & QNET_L4_FLAGS_LAST)))
4270
54
    {
4271
54
      if (qflags & QNET_L4_FLAGS_FIRST)
4272
54
        {
4273
          /*
4274
           * do as much as we can
4275
           */
4276
54
          col_prepend_fstr(pinfo->cinfo, COL_INFO, "First fragmented ");
4277
54
        }
4278
54
    }
4279
194
  return offset;
4280
198
}
4281
4282
/*
4283
 * Register the protocol with Wireshark
4284
 */
4285
4286
void
4287
proto_register_qnet6(void)
4288
14
{
4289
14
  static hf_register_info hf[] = {
4290
14
    {&hf_qnet6_l4_padding,
4291
14
     {"Padding", "qnet6.l4.padding",
4292
14
      FT_UINT16, BASE_HEX, NULL, 0,
4293
14
      NULL, HFILL
4294
14
     }
4295
14
    },
4296
14
    {&hf_qnet6_l4_ver,
4297
14
     {"Version", "qnet6.l4.ver",
4298
14
      FT_UINT8, BASE_DEC, VALS(qnet6_ver_vals), 0,
4299
14
      "QNET6 L4 Packet Version", HFILL
4300
14
     }
4301
14
    },
4302
14
    {&hf_qnet6_l4_type,
4303
14
     {"Type", "qnet6.l4.type",
4304
14
      FT_UINT8, BASE_HEX, VALS(qnet6_type_vals), 0,
4305
14
      "QNET6 L4 Upper layer protocol type", HFILL}
4306
14
    },
4307
14
    {&hf_qnet6_l4_flags,
4308
14
     {"Flag", "qnet6.l4.flags",
4309
14
      FT_UINT8, BASE_HEX, NULL, 0,
4310
14
      NULL, HFILL}
4311
14
    },
4312
14
    {&hf_qnet6_l4_flags_first,
4313
14
     {"First Fragment", "qnet6.l4.flags.first",
4314
14
      FT_BOOLEAN, 8, TFS(&tfs_yes_no), QNET_L4_FLAGS_FIRST,
4315
14
      "QNET6 L4 Packet first fragment", HFILL}
4316
14
    },
4317
14
    {&hf_qnet6_l4_flags_last,
4318
14
     {"Last Fragment", "qnet6.l4.flags.last",
4319
14
      FT_BOOLEAN, 8, TFS(&tfs_yes_no), QNET_L4_FLAGS_LAST,
4320
14
      "QNET6 L4 Packet last fragment", HFILL}
4321
14
    },
4322
14
    {&hf_qnet6_l4_flags_crc,
4323
14
     {"CRC", "qnet6.l4.flags.crc",
4324
14
      FT_BOOLEAN, 8, TFS(&tfs_used_notused), QNET_L4_FLAGS_CRC,
4325
14
      "QNET6 L4 Packet crc used", HFILL}
4326
14
    },
4327
4328
14
    {&hf_qnet6_l4_layer,
4329
14
     {"Layer", "qnet6.l4.layer",
4330
14
      FT_UINT8, BASE_DEC, VALS(qnet6_layer_vals), 0,
4331
14
      "QNET6 L4 Packet layer", HFILL}
4332
14
    },
4333
    /* start from here is for qos_info  */
4334
    /* in qos_info, node id is like ip address
4335
     * but node id is not global like ip address
4336
     * node id is unique on any node only. dragonlinux
4337
     */
4338
14
    {&hf_qnet6_l4_qos_info,
4339
14
     {"Qos info", "qnet6.qos.qos_info",
4340
14
      FT_NONE, BASE_NONE, NULL, 0,
4341
14
      NULL, HFILL}
4342
14
    },
4343
14
    {&hf_qnet6_l4_qos_src_nd_for_dst,
4344
14
     {"Src_nd_for_dst", "qnet6.qos.src_nd_for_dst",
4345
14
      FT_UINT16, BASE_DEC, NULL, 0,
4346
14
      "QNET6 source node id for destination node", HFILL}
4347
14
    },
4348
14
    {&hf_qnet6_l4_qos_dst_nd_for_src,
4349
14
     {"Dst_nd_for_src", "qnet6.qos.dst_nd_for_src",
4350
14
      FT_UINT16, BASE_DEC, NULL, 0,
4351
14
      "QNET6 destination node id for source node", HFILL}
4352
14
    },
4353
    /* in qos_info, connection id is like port number */
4354
14
    {&hf_qnet6_l4_qos_src_conn_id,
4355
14
     {"Sconn", "qnet6.qos.sconn",
4356
14
      FT_UINT32, BASE_HEX, NULL, 0,
4357
14
      "QNET6 source node's connection id", HFILL}
4358
14
    },
4359
14
    {&hf_qnet6_l4_qos_dst_conn_id,
4360
14
     {"Dconn", "qnet6.qos.dconn",
4361
14
      FT_UINT32, BASE_HEX, NULL, 0,
4362
14
      "QNET6 destination node's connection id", HFILL}
4363
14
    },
4364
14
    {&hf_qnet6_l4_qos_src_seq_num,
4365
14
     {"Seq", "qnet6.qos.seq",
4366
14
      FT_UINT32, BASE_DEC, NULL, 0,
4367
14
      "QNET6 connection sequence number", HFILL}
4368
14
    },
4369
14
    {&hf_qnet6_l4_qos_qos_type,
4370
14
     {"Qos_type", "qnet6.qos.qos_type",
4371
14
      FT_UINT16, BASE_DEC, VALS(qnet6_qos_type_vals), 0,
4372
14
      "QNET6 qos type", HFILL}
4373
14
    },
4374
14
    {&hf_qnet6_l4_qos_src_qos_idx,
4375
14
     {"Src_qos_idx", "qnet6.qos.src_qos_idx",
4376
14
      FT_UINT16, BASE_DEC, NULL, 0,
4377
14
      "QNET6 source node qos index", HFILL}
4378
14
    },
4379
4380
    /* end of qos_info in l4_pkt */
4381
14
    {&hf_qnet6_l4_offset,
4382
14
     {"Offset", "qnet6.l4.offset",
4383
14
      FT_UINT32, BASE_DEC, NULL, 0,
4384
14
      "QNET6 Packet offset in stream", HFILL}
4385
14
    },
4386
14
    {&hf_qnet6_l4_length,
4387
14
     {"Length", "qnet6.l4.length",
4388
14
      FT_UINT32, BASE_DEC, NULL, 0,
4389
14
      "QNET6 Packet payload length", HFILL}
4390
14
    },
4391
14
    {&hf_qnet6_l4_crc,
4392
14
     {"Crc", "qnet6.l4.crc",
4393
14
      FT_UINT32, BASE_HEX, NULL, 0,
4394
14
      "QNET6 Packet cksum of header and payload", HFILL}
4395
14
    }
4396
4397
14
  };
4398
14
  static hf_register_info hf_qos[] = {
4399
14
    {&hf_qnet6_qos_tcs_src_name_off,
4400
14
     {"Src_name_off", "qnet6.qos.src_name_off",
4401
14
      FT_UINT16, BASE_DEC, NULL, 0,
4402
14
      "Source name offset", HFILL}
4403
14
    },
4404
14
    {&hf_qnet6_qos_tcs_src_name_generated,
4405
14
     {"Src_name", "qnet6.qos.src_name",
4406
14
      FT_STRING, BASE_NONE, NULL, 0,
4407
14
      "Source name", HFILL}
4408
14
    },
4409
14
    {&hf_qnet6_qos_tcs_src_domain_off,
4410
14
     {"Src_domain_off", "qnet6.qos.src_domain_off",
4411
14
      FT_UINT16, BASE_DEC, NULL, 0,
4412
14
      "Source domain name offset", HFILL}
4413
14
    },
4414
14
    {&hf_qnet6_qos_tcs_src_domain_generated,
4415
14
     {"Src_domain", "qnet6.qos.src_domain",
4416
14
      FT_STRING, BASE_NONE, NULL, 0,
4417
14
      "Source domain name", HFILL}
4418
14
    },
4419
14
    {&hf_qnet6_qos_tcs_dst_name_off,
4420
14
     {"Dst_name_off", "qnet6.qos.dst_name_off",
4421
14
      FT_UINT16, BASE_DEC, NULL, 0,
4422
14
      "Destination name offset", HFILL}
4423
14
    },
4424
14
    {&hf_qnet6_qos_tcs_dst_name_generated,
4425
14
     {"Dst_name", "qnet6.qos.dst_name",
4426
14
      FT_STRING, BASE_NONE, NULL, 0,
4427
14
      "Destination name", HFILL}
4428
14
    },
4429
14
    {&hf_qnet6_qos_tcs_dst_domain_off,
4430
14
     {"Dst_domain_off", "qnet6.qos.dst_domain_off",
4431
14
      FT_UINT16, BASE_DEC, NULL, 0,
4432
14
      "Destination domain name offset", HFILL}
4433
14
    },
4434
14
    {&hf_qnet6_qos_tcs_dst_domain_generated,
4435
14
     {"Dst_domain", "qnet6.qos.dst_domain",
4436
14
      FT_STRING, BASE_NONE, NULL, 0,
4437
14
      "Destination domain name", HFILL}
4438
14
    }
4439
14
  };
4440
14
  static hf_register_info hf_nr[] = {
4441
    /* type, size are the first uint8_t in all nr messages */
4442
14
    {&hf_qnet6_nr_type,
4443
14
     {"Type", "qnet6.nr.type",
4444
14
      FT_UINT8, BASE_DEC, VALS(qnet6_nr_type_vals), 0,
4445
14
      "Network Resolver Message Type", HFILL}
4446
14
    },
4447
14
    {&hf_qnet6_nr_remote_req_len,
4448
14
     {"Req_len", "qnet6.nr.req_len",
4449
14
      FT_UINT8, BASE_DEC, NULL, 0,
4450
14
      "Network Resolver remote request length", HFILL}
4451
14
    },
4452
14
    {&hf_qnet6_nr_remote_req_id,
4453
14
     {"Req_id", "qnet6.nr.req_id",
4454
14
      FT_UINT16, BASE_HEX_DEC, NULL, 0,
4455
14
      "Network Resolver remote request id", HFILL}
4456
14
    },
4457
14
    {&hf_qnet6_nr_remote_req_name,
4458
14
     {"Req_name", "qnet6.nr.req_name",
4459
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
4460
14
      "Network Resolver remote request name", HFILL}
4461
14
    },
4462
14
    {&hf_qnet6_nr_remote_rep_spare,
4463
14
     {"Rep_spare", "qnet6.nr.rep_spare",
4464
14
      FT_UINT8, BASE_HEX, NULL, 0,
4465
14
      "Network Resolver remote answer pad byte", HFILL}
4466
14
    },
4467
14
    {&hf_qnet6_nr_remote_rep_id,
4468
14
     {"Rep_id", "qnet6.nr.rep_id",
4469
14
      FT_UINT16, BASE_HEX, NULL, 0,
4470
14
      "Network Resolver remote answer id", HFILL}
4471
14
    },
4472
14
    {&hf_qnet6_nr_remote_rep_nd,
4473
14
     {"Rep_nd", "qnet6.nr.rep_nd",
4474
14
      FT_UINT32, BASE_HEX, NULL, 0,
4475
14
      "Network Resolver remote answer node id", HFILL}
4476
14
    },
4477
14
    {&hf_qnet6_nr_remote_rep_status,
4478
14
     {"Rep_status", "qnet6.nr.rep_status",
4479
14
      FT_UINT32, BASE_HEX, NULL, 0,
4480
14
      "Network Resolver remote answer error status", HFILL}
4481
14
    }
4482
14
  };
4483
4484
14
  static hf_register_info hf_lr[] = {
4485
    /* start of qnet6_lr_pkt */
4486
14
    {&hf_qnet6_lr_ver,
4487
14
     {"Version", "qnet6.lr.ver",
4488
14
      FT_UINT8, BASE_DEC, VALS(qnet6_lr_ver_vals), 0,
4489
14
      "Lan Resolver Version", HFILL}
4490
14
    },
4491
14
    {&hf_qnet6_lr_type,
4492
14
     {"Type", "qnet6.lr.type",
4493
14
      FT_UINT8, BASE_HEX, VALS(qnet6_lr_type_vals), 0,
4494
14
      "Lan Resolver Message Type", HFILL}
4495
14
    },
4496
14
    {&hf_qnet6_lr_total_len,
4497
14
     {"Length", "qnet6.lr.length",
4498
14
      FT_UINT32, BASE_DEC, NULL, 0,
4499
14
      "LR Message total length(include header + payload)", HFILL}
4500
14
    },
4501
14
    {&hf_qnet6_lr_src,
4502
14
     {"Source", "qnet6.lr.src",
4503
14
      FT_STRING, BASE_NONE, NULL, 0,
4504
14
      "LR Message source node", HFILL}
4505
14
    },
4506
4507
14
    {&hf_qnet6_lr_src_name_off,
4508
14
     {"Offset", "qnet6.lr.src.name.off",
4509
14
      FT_UINT32, BASE_DEC, NULL, 0,
4510
14
      "LR Message source name offset", HFILL}
4511
14
    },
4512
14
    {&hf_qnet6_lr_src_name_len,
4513
14
     {"Length", "qnet6.lr.src.name.len",
4514
14
      FT_UINT32, BASE_DEC, NULL, 0,
4515
14
      "LR Message source name length", HFILL}
4516
14
    },
4517
14
    {&hf_qnet6_lr_src_name_generated,
4518
14
     {"Name", "qnet6.lr.src.name.name",
4519
14
      FT_STRING, BASE_NONE, NULL, 0,
4520
14
      "LR Message source name", HFILL}
4521
14
    },
4522
14
    {&hf_qnet6_lr_src_domain_off,
4523
14
     {"Offset", "qnet6.lr.src.domain.off",
4524
14
      FT_UINT32, BASE_DEC, NULL, 0,
4525
14
      "LR Message source domain name offset", HFILL}
4526
14
    },
4527
14
    {&hf_qnet6_lr_src_domain_len,
4528
14
     {"Length", "qnet6.lr.src.domain.len",
4529
14
      FT_UINT32, BASE_DEC, NULL, 0,
4530
14
      "LR Message source domain name length", HFILL}
4531
14
    },
4532
14
    {&hf_qnet6_lr_src_domain_generated,
4533
14
     {"Domain", "qnet6.lr.src.domain",
4534
14
      FT_STRING, BASE_NONE, NULL, 0,
4535
14
      "LR Message source domain name", HFILL}
4536
14
    },
4537
14
    {&hf_qnet6_lr_src_addr_off,
4538
14
     {"Offset", "qnet6.lr.src.addr.off",
4539
14
      FT_UINT32, BASE_DEC, NULL, 0,
4540
14
      "LR Message source address offset", HFILL}
4541
14
    },
4542
14
    {&hf_qnet6_lr_src_addr_len,
4543
14
     {"Length", "qnet6.lr.src.addr.len",
4544
14
      FT_UINT32, BASE_DEC, NULL, 0,
4545
14
      "LR Message source address length", HFILL}
4546
14
    },
4547
14
    {&hf_qnet6_lr_src_addr_generated,
4548
14
     {"Address", "qnet6.lr.src.addr",
4549
14
      FT_ETHER, BASE_NONE, NULL, 0,
4550
14
      "LR Message source address", HFILL}
4551
14
    },
4552
14
    {&hf_qnet6_lr_dst,
4553
14
     {"Destination", "qnet6.lr.dst",
4554
14
      FT_STRING, BASE_NONE, NULL, 0,
4555
14
      "LR Message destination node", HFILL}
4556
14
    },
4557
14
    {&hf_qnet6_lr_dst_name_off,
4558
14
     {"Offset", "qnet6.lr.dst.name.off",
4559
14
      FT_UINT32, BASE_DEC, NULL, 0,
4560
14
      "LR Message destination name offset", HFILL}
4561
14
    },
4562
14
    {&hf_qnet6_lr_dst_name_len,
4563
14
     {"Length", "qnet6.lr.dst.name.len",
4564
14
      FT_UINT32, BASE_DEC, NULL, 0,
4565
14
      "LR Message destination name length", HFILL}
4566
14
    },
4567
14
    {&hf_qnet6_lr_dst_name_generated,
4568
14
     {"Name", "qnet6.lr.dst.name",
4569
14
      FT_STRING, BASE_NONE, NULL, 0,
4570
14
      "LR Message destination name", HFILL}
4571
14
    },
4572
14
    {&hf_qnet6_lr_dst_domain_off,
4573
14
     {"Offset", "qnet6.lr.dst.domain.off",
4574
14
      FT_UINT32, BASE_DEC, NULL, 0,
4575
14
      "LR Message destination domain name offset", HFILL}
4576
14
    },
4577
14
    {&hf_qnet6_lr_dst_domain_len,
4578
14
     {"Length", "qnet6.lr.dst_domain_len",
4579
14
      FT_UINT32, BASE_DEC, NULL, 0,
4580
14
      "LR Message destination domain name length", HFILL}
4581
14
    },
4582
14
    {&hf_qnet6_lr_dst_domain_generated,
4583
14
     {"Domain", "qnet6.lr.dst.domain",
4584
14
      FT_STRING, BASE_NONE, NULL, 0,
4585
14
      "LR Message destination domain name", HFILL}
4586
14
    },
4587
14
    {&hf_qnet6_lr_dst_addr_off,
4588
14
     {"Offset", "qnet6.lr.dst.addr.off",
4589
14
      FT_UINT32, BASE_DEC, NULL, 0,
4590
14
      "LR Message destination address offset", HFILL}
4591
14
    },
4592
14
    {&hf_qnet6_lr_dst_addr_len,
4593
14
     {"Length", "qnet6.lr.dst.addr.len",
4594
14
      FT_UINT32, BASE_DEC, NULL, 0,
4595
14
      "LR Message destination address length", HFILL}
4596
14
    },
4597
14
    {&hf_qnet6_lr_dst_addr_generated,
4598
14
     {"Address", "qnet6.lr.dst.addr",
4599
14
      FT_ETHER, BASE_NONE, NULL, 0,
4600
14
      "LR Message destination address", HFILL}
4601
14
    }
4602
4603
14
  };
4604
4605
14
  static hf_register_info hf_kif[] = {
4606
    /* msgtype, size are the first 2 in all kif messages */
4607
14
    {&hf_qnet6_kif_msgtype,
4608
14
     {"Type", "qnet6.kif.type",
4609
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgtype_vals), QNET_KIF_MSGTYPE_MASK,
4610
14
      "Kernel Interface Message Type", HFILL}
4611
14
    },
4612
14
    {&hf_qnet6_kif_size,
4613
14
     {"Size", "qnet6.kif.size",
4614
14
      FT_UINT16, BASE_HEX, NULL, 0,
4615
14
      "Kernel Interface Message header size", HFILL}
4616
14
    },
4617
    /* some kif messages will include version as well */
4618
14
    {&hf_qnet6_kif_version,
4619
14
     {"Version", "qnet6.kif.version",
4620
14
      FT_UINT32, BASE_HEX, NULL, 0,
4621
14
      "Kernel Interface Message version", HFILL}
4622
14
    },
4623
    /* connect message after msghdr */
4624
14
    {&hf_qnet6_kif_connect,
4625
14
     {"Connect", "qnet6.kif.connect",
4626
14
      FT_STRING, BASE_NONE, NULL, 0,
4627
14
      "Connect Message", HFILL}
4628
14
    },
4629
14
    {&hf_qnet6_kif_msgsend,
4630
14
     {"Msgsend", "qnet6.kif.msgsend",
4631
14
      FT_STRING, BASE_NONE, NULL, 0,
4632
14
      "Msgsend Message", HFILL}
4633
14
    },
4634
14
    {&hf_qnet6_kif_connect_server_pid,
4635
14
     {"Server_pid", "qnet6.kif.connect.server_pid",
4636
14
      FT_UINT32, BASE_DEC, NULL, 0,
4637
14
      "Kernel Interface Message Server Pid", HFILL}
4638
14
    },
4639
14
    {&hf_qnet6_kif_connect_server_chid,
4640
14
     {"Server_chid", "qnet6.kif.connect.server_chid",
4641
14
      FT_UINT32, BASE_HEX_DEC, NULL, 0,
4642
14
      "Kernel Interface Message Server channel id", HFILL}
4643
14
    },
4644
14
    {&hf_qnet6_kif_connect_client_id,
4645
14
     {"Client_id", "qnet6.kif.connect.client_id",
4646
14
      FT_UINT32, BASE_HEX_DEC, NULL, 0,
4647
14
      "Kernel Interface Message client id", HFILL}
4648
14
    },
4649
14
    {&hf_qnet6_kif_connect_client_pid,
4650
14
     {"Client_pid", "qnet6.kif.connect.client_pid",
4651
14
      FT_UINT32, BASE_DEC, NULL, 0,
4652
14
      "Kernel Interface Message Client Pid", HFILL}
4653
14
    },
4654
    /* connect success message after msghdr */
4655
14
    {&hf_qnet6_kif_connects_client_id,
4656
14
     {"Client_id", "qnet6.kif.connect_success.client_id",
4657
14
      FT_INT32, BASE_DEC, NULL, 0,
4658
14
      "Kernel Interface Message client id", HFILL}
4659
14
    },
4660
14
    {&hf_qnet6_kif_connects_server_id,
4661
14
     {"Server_id", "qnet6.kif.connect_success.server_id",
4662
14
      FT_INT32, BASE_DEC, NULL, 0,
4663
14
      "Kernel Interface Message Server id", HFILL}
4664
14
    },
4665
14
    {&hf_qnet6_kif_connects_scoid,
4666
14
     {"Scoid", "qnet6.kif.connect_success.scoid",
4667
14
      FT_INT32, BASE_DEC, NULL, 0,
4668
14
      "Kernel Interface Message server connection id", HFILL}
4669
14
    },
4670
14
    {&hf_qnet6_kif_connects_nbytes,
4671
14
     {"Nbytes", "qnet6.kif.connect_success.nbytes",
4672
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
4673
14
      "Kernel Interface Message limit for msgsend", HFILL}
4674
14
    },
4675
    /* connect fail after msghdr and version */
4676
14
    {&hf_qnet6_kif_connectf_client_id,
4677
14
     {"Client_id", "qnet6.kif.connect_fail.client_id",
4678
14
      FT_INT32, BASE_DEC, NULL, 0,
4679
14
      "Kernel Interface Connect Fail Message client id", HFILL}
4680
14
    },
4681
14
    {&hf_qnet6_kif_connectf_status,
4682
14
     {"Status", "qnet6.kif.connect_fail.status",
4683
14
      FT_INT32, BASE_DEC, NULL, 0,
4684
14
      "Kernel Interface Connect Fail Message Status", HFILL}
4685
14
    },
4686
    /* connect death after msghdr */
4687
14
    {&hf_qnet6_kif_connectd_client_id,
4688
14
     {"Client_id", "qnet6.kif.connect_death.client_id",
4689
14
      FT_INT32, BASE_DEC, NULL, 0,
4690
14
      "Kernel Interface Connect Death Message client id", HFILL}
4691
14
    },
4692
4693
    /* msgsend message after msghdr */
4694
14
    {&hf_qnet6_kif_msgsend_server_id,
4695
14
     {"Server_id", "qnet6.kif.msgsend.server_id",
4696
14
      FT_INT32, BASE_DEC, NULL, 0,
4697
14
      "Kernel Interface MsgSend Message Server id", HFILL}
4698
14
    },
4699
14
    {&hf_qnet6_kif_msgsend_client_handle,
4700
14
     {"Client_handle", "qnet6.kif.msgsend.client_handle",
4701
14
      FT_INT32, BASE_DEC, NULL, 0,
4702
14
      "MsgSend Message client handle", HFILL}
4703
14
    },
4704
    /* msgsend vtid_info here */
4705
14
    {&hf_qnet6_kif_msgsend_vinfo,
4706
14
     {"Vinfo", "qnet6.kif.msgsend.vinfo",
4707
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
4708
14
      "Kernel Interface MsgSend Message virtual thread information", HFILL}
4709
14
    },
4710
14
    {&hf_qnet6_kif_vtid_info_tid,
4711
14
     {"Vtid", "qnet6.kif.msgsend.vtid_info.tid",
4712
14
      FT_INT32, BASE_DEC, NULL, 0,
4713
14
      "Virtual thread information thread id", HFILL}
4714
14
    },
4715
14
    {&hf_qnet6_kif_vtid_info_coid,
4716
14
     {"Coid", "qnet6.kif.msgsend.vtid_info.coid",
4717
14
      FT_INT32, BASE_DEC, NULL, 0,
4718
14
      "Kernel Interface MsgSend Message virtual thread connection id", HFILL}
4719
14
    },
4720
14
    {&hf_qnet6_kif_vtid_info_priority,
4721
14
     {"Priority", "qnet6.kif.msgsend.vtid_info.priority",
4722
14
      FT_INT32, BASE_DEC, NULL, 0,
4723
14
      "MsgSend Message virtual thread priority", HFILL}
4724
14
    },
4725
14
    {&hf_qnet6_kif_vtid_info_srcmsglen,
4726
14
     {"Srcmsglen", "qnet6.kif.msgsend.vtid_info.srcmsglen",
4727
14
      FT_INT32, BASE_DEC, NULL, 0,
4728
14
      "MsgSend Message virtual thread source message length", HFILL}
4729
14
    },
4730
14
    {&hf_qnet6_kif_vtid_info_keydata,
4731
14
     {"Keydata", "qnet6.kif.msgsend.vtid_info.keydata",
4732
14
      FT_INT32, BASE_DEC, NULL, 0,
4733
14
      "MsgSend Message virtual thread keydata", HFILL}
4734
14
    },
4735
14
    {&hf_qnet6_kif_vtid_info_srcnd,
4736
14
     {"Srcnd", "qnet6.kif.msgsend.vtid_info.srcnd",
4737
14
      FT_INT32, BASE_DEC, NULL, 0,
4738
14
      "MsgSend Message virtual thread source node id", HFILL}
4739
14
    },
4740
14
    {&hf_qnet6_kif_vtid_info_dstmsglen,
4741
14
     {"Dstmsglen", "qnet6.kif.msgsend.vtid_info.dstmsglen",
4742
14
      FT_INT32, BASE_DEC, NULL, 0,
4743
14
      "MsgSend Message virtual thread destination message length", HFILL}
4744
14
    },
4745
14
    {&hf_qnet6_kif_vtid_info_zero,
4746
14
     {"Zero", "qnet6.kif.msgsend.vtid_info.zero",
4747
14
      FT_INT32, BASE_DEC, NULL, 0,
4748
14
      "MsgSend Message virtual thread reserved part", HFILL}
4749
14
    },
4750
14
    {&hf_qnet6_kif_msgsend_nbytes,
4751
14
     {"Nbytes", "qnet6.kif.msgsend.nbytes",
4752
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
4753
14
      "Kernel Interface MsgSend Message limit for msgsend", HFILL}
4754
14
    },
4755
14
    {&hf_qnet6_kif_msgread_msgread_handle,
4756
14
     {"Msgread_handle", "qnet6.kif.msgread.msgread_handle",
4757
14
      FT_INT32, BASE_DEC, NULL, 0,
4758
14
      "MsgRead Message handle", HFILL}
4759
14
    },
4760
14
    {&hf_qnet6_kif_msgread_client_handle,
4761
14
     {"Client_handle", "qnet6.kif.msgread.client_handle",
4762
14
      FT_INT32, BASE_DEC, NULL, 0,
4763
14
      "MsgRead Message client handle", HFILL}
4764
14
    },
4765
14
    {&hf_qnet6_kif_msgread_offset,
4766
14
     {"Offset", "qnet6.kif.msgread.offset",
4767
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
4768
14
      "MsgRead Message limit for msgread", HFILL}
4769
14
    },
4770
14
    {&hf_qnet6_kif_msgread_nbytes,
4771
14
     {"Nbytes", "qnet6.kif.msgread.nbytes",
4772
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
4773
14
      "MsgRead Message limit for msgread", HFILL}
4774
14
    },
4775
    /* msgwrite */
4776
14
    {&hf_qnet6_kif_msgwrite_status,
4777
14
     {"Status", "qnet6.kif.msgwrite.status",
4778
14
      FT_INT32, BASE_DEC, NULL, 0,
4779
14
      "Msgwrite Message client handle", HFILL}
4780
14
    },
4781
14
    {&hf_qnet6_kif_msgwrite_handle,
4782
14
     {"Handle", "qnet6.kif.msgwrite.handle",
4783
14
      FT_INT32, BASE_DEC, NULL, 0,
4784
14
      "Msgwrite Message client handle", HFILL}
4785
14
    },
4786
14
    {&hf_qnet6_kif_msgwrite_offset,
4787
14
     {"Offset", "qnet6.kif.msgwrite.offset",
4788
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
4789
14
      "Msgwrite Message limit for msgwrite", HFILL}
4790
14
    },
4791
14
    {&hf_qnet6_kif_msgwrite_nbytes,
4792
14
     {"Nbytes", "qnet6.kif.msgwrite.nbytes",
4793
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
4794
14
      "Msgwrite Message limit for msgwrite", HFILL}
4795
14
    },
4796
14
    {&hf_qnet6_kif_msgwrite_data,
4797
14
     {"Data", "qnet6.kif.msgwrite.data",
4798
14
      FT_BYTES, BASE_NONE, NULL, 0,
4799
14
      NULL, HFILL}
4800
14
    },
4801
    /* unblock */
4802
14
    {&hf_qnet6_kif_unblock_server_id,
4803
14
     {"Server_id", "qnet6.kif.unblock.server_id",
4804
14
      FT_INT32, BASE_DEC, NULL, 0,
4805
14
      "Unblock Message Server id", HFILL}
4806
14
    },
4807
14
    {&hf_qnet6_kif_unblock_client_handle,
4808
14
     {"Client_handle", "qnet6.kif.unblock.client_handle",
4809
14
      FT_INT32, BASE_DEC, NULL, 0,
4810
14
      "Unblock Message client handle", HFILL}
4811
14
    },
4812
14
    {&hf_qnet6_kif_unblock_tid,
4813
14
     {"Tid", "qnet6.kif.unblock.tid",
4814
14
      FT_INT32, BASE_DEC, NULL, 0,
4815
14
      "thread information thread id", HFILL}
4816
14
    },
4817
    /* event */
4818
14
    {&hf_qnet6_kif_event_client_handle,
4819
14
     {"Client_handle", "qnet6.kif.event.client_handle",
4820
14
      FT_INT32, BASE_DEC, NULL, 0,
4821
14
      "Event Message client handle", HFILL}
4822
14
    },
4823
    /* event */
4824
14
    {&hf_qnet6_kif_event_event,
4825
14
     {"Sigevent", "qnet6.kif.event.event",
4826
14
      FT_NONE, BASE_NONE, NULL, 0,
4827
14
      NULL, HFILL}
4828
14
    },
4829
14
    {&hf_qnet6_kif_event_notify,
4830
14
     {"Sigevent_notify", "qnet6.kif.event.sigevent_notify",
4831
14
      FT_INT32, BASE_DEC, NULL, 0,
4832
14
      "Event Message sigevent notify", HFILL}
4833
14
    },
4834
14
    {&hf_qnet6_kif_event_union1,
4835
14
     {"Sigevent_union1", "qnet6.kif.event.sigevent_union1",
4836
14
      FT_INT32, BASE_DEC, NULL, 0,
4837
14
      "Event Message sigevent union1", HFILL}
4838
14
    },
4839
14
    {&hf_qnet6_kif_event_value,
4840
14
     {"Sigevent_sigvalue", "qnet6.kif.event.sigevent_sigvalue",
4841
14
      FT_INT32, BASE_DEC, NULL, 0,
4842
14
      "Event Message sigevent sigvalue", HFILL}
4843
14
    },
4844
14
    {&hf_qnet6_kif_event_union2,
4845
14
     {"Sigevent_union2", "qnet6.kif.event.sigevent_union2",
4846
14
      FT_INT32, BASE_DEC, NULL, 0,
4847
14
      "Event Message sigevent union2", HFILL}
4848
14
    },
4849
    /* pulse */
4850
    /* will use msgsend */
4851
14
    {&hf_qnet6_kif_pulse_pulse,
4852
14
     {"Pulse", "qnet6.kif.pulse",
4853
14
      FT_STRING, BASE_NONE, NULL, 0,
4854
14
      NULL, HFILL}
4855
14
    },
4856
14
    {&hf_qnet6_kif_pulse_pulse_type,
4857
14
     {"Type", "qnet6.kif.pulse.pulse.type",
4858
14
      FT_UINT16, BASE_HEX_DEC, NULL, 0,
4859
14
      NULL, HFILL}
4860
14
    },
4861
14
    {&hf_qnet6_kif_pulse_pulse_subtype,
4862
14
     {"Subtype", "qnet6.kif.pulse.pulse.subtype",
4863
14
      FT_UINT16, BASE_HEX_DEC, NULL, 0,
4864
14
      NULL, HFILL}
4865
14
    },
4866
14
    {&hf_qnet6_kif_pulse_pulse_code,
4867
14
     {"Code", "qnet6.kif.pulse.pulse.code",
4868
14
      FT_INT8, BASE_DEC, NULL, 0,
4869
14
      NULL, HFILL}
4870
14
    },
4871
14
    {&hf_qnet6_kif_pulse_pulse_reserved,
4872
14
     {"Reserved", "qnet6.kif.pulse.pulse.reserved",
4873
14
      FT_UINT24, BASE_DEC, NULL, 0,
4874
14
      NULL, HFILL}
4875
14
    },
4876
14
    {&hf_qnet6_kif_pulse_pulse_value,
4877
14
     {"Value", "qnet6.kif.pulse.pulse.value",
4878
14
      FT_UINT32, BASE_HEX_DEC, NULL, 0,
4879
14
      NULL, HFILL}
4880
14
    },
4881
14
    {&hf_qnet6_kif_pulse_pulse_scoid,
4882
14
     {"Scoid", "qnet6.kif.pulse.pulse.scoid",
4883
14
      FT_INT32, BASE_DEC, NULL, 0,
4884
14
      NULL, HFILL}
4885
14
    },
4886
14
    {&hf_qnet6_kif_pulse_priority,
4887
14
     {"Priority", "qnet6.kif.pulse.priority",
4888
14
      FT_INT32, BASE_DEC, NULL, 0,
4889
14
      NULL, HFILL}
4890
14
    },
4891
    /* signal */
4892
14
    {&hf_qnet6_kif_signal_client_handle,
4893
14
     {"Client_handle", "qnet6.kif.signal.client_handle",
4894
14
      FT_INT32, BASE_DEC, NULL, 0,
4895
14
      "Signal Message client handle", HFILL}
4896
14
    },
4897
14
    {&hf_qnet6_kif_signal_pid,
4898
14
     {"Pid", "qnet6.kif.signal.pid",
4899
14
      FT_INT32, BASE_DEC, NULL, 0,
4900
14
      "Signal Message from this pid", HFILL}
4901
14
    },
4902
14
    {&hf_qnet6_kif_signal_tid,
4903
14
     {"Tid", "qnet6.kif.signal.tid",
4904
14
      FT_INT32, BASE_DEC, NULL, 0,
4905
14
      "Signal Message from this tid", HFILL}
4906
14
    },
4907
14
    {&hf_qnet6_kif_signal_signo,
4908
14
     {"Signo", "qnet6.kif.signal.signo",
4909
14
      FT_INT32, BASE_DEC, NULL, 0,
4910
14
      "Signal number delivered to remote", HFILL}
4911
14
    },
4912
14
    {&hf_qnet6_kif_signal_code,
4913
14
     {"Code", "qnet6.kif.signal.code",
4914
14
      FT_INT32, BASE_DEC, NULL, 0,
4915
14
      "Signal code delivered to remote", HFILL}
4916
14
    },
4917
14
    {&hf_qnet6_kif_signal_value,
4918
14
     {"Value", "qnet6.kif.signal.value",
4919
14
      FT_INT32, BASE_DEC, NULL, 0,
4920
14
      "Signal value delivered to remote", HFILL}
4921
14
    },
4922
    /* disconnect */
4923
14
    {&hf_qnet6_kif_disconnect_server_id,
4924
14
     {"Server_id", "qnet6.kif.disconnect.server_id",
4925
14
      FT_INT32, BASE_DEC, NULL, 0,
4926
14
      "disconnect message server id from connect success message", HFILL}
4927
14
    },
4928
    /* msg info */
4929
14
    {&hf_qnet6_kif_msg,
4930
14
     {"Message", "qnet6.kif.msgsend.msg",
4931
14
      FT_STRING, BASE_NONE, NULL, 0,
4932
14
      NULL, HFILL}
4933
14
    },
4934
14
    {&hf_qnet6_kif_msg_type,
4935
14
     {"Type", "qnet6.kif.msgsend.msg.type",
4936
14
      FT_UINT16, BASE_HEX|BASE_EXT_STRING, &qnet6_kif_msgsend_msgtype_vals_ext, 0,
4937
14
      NULL, HFILL}
4938
14
    },
4939
14
    {&hf_qnet6_kif_msg_connect_subtype,
4940
14
     {"Subtype", "qnet6.kif.msgsend.msg.connect.subtype",
4941
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_subtype_vals), 0,
4942
14
      NULL, HFILL}
4943
14
    },
4944
14
    {&hf_qnet6_kif_msg_connect_filetype,
4945
14
     {"File_type", "qnet6.kif.msgsend.msg.connect.file_type",
4946
14
      FT_UINT32, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_filetype_vals), 0,
4947
14
      "file type", HFILL}
4948
14
    },
4949
14
    {&hf_qnet6_kif_msg_connect_replymax,
4950
14
     {"Reply_max", "qnet6.kif.msgsend.msg.connect.reply_max",
4951
14
      FT_UINT16, BASE_HEX_DEC, NULL, 0,
4952
14
      NULL, HFILL}
4953
14
    },
4954
14
    {&hf_qnet6_kif_msg_connect_entrymax,
4955
14
     {"Entry_max", "qnet6.kif.msgsend.msg.connect.entry_max",
4956
14
      FT_UINT16, BASE_HEX_DEC, NULL, 0,
4957
14
      NULL, HFILL}
4958
14
    },
4959
14
    {&hf_qnet6_kif_msg_connect_key,
4960
14
     {"Key", "qnet6.kif.msgsend.msg.connect.key",
4961
14
      FT_UINT32, BASE_HEX, NULL, 0,
4962
14
      NULL, HFILL}
4963
14
    },
4964
14
    {&hf_qnet6_kif_msg_connect_handle,
4965
14
     {"Handle", "qnet6.kif.msgsend.msg.connect.handle",
4966
14
      FT_UINT32, BASE_HEX_DEC, NULL, 0,
4967
14
      NULL, HFILL}
4968
14
    },
4969
14
    {&hf_qnet6_kif_msg_connect_ioflag,
4970
14
     {"Ioflag", "qnet6.kif.msgsend.msg.connect.ioflag",
4971
14
      FT_UINT32, BASE_OCT, NULL, 0,
4972
14
      "file io flag", HFILL}
4973
14
    },
4974
    /* for FT_BOOLEAN, its display field must be parent bit width */
4975
4976
14
    {&hf_qnet6_kif_msg_connect_ioflag_access,
4977
14
     {"access", "qnet6.kif.msgsend.msg.connect.ioflag.access",
4978
14
      FT_UINT32, BASE_DEC, VALS(qnet6_kif_msgsend_msg_connect_ioflag_vals), 03,
4979
14
      "access mode", HFILL}
4980
14
    },
4981
14
    {&hf_qnet6_kif_msg_connect_ioflag_append,
4982
14
     {"append", "qnet6.kif.msgsend.msg.connect.ioflag.append",
4983
14
      FT_BOOLEAN, 32, NULL, 010,
4984
14
      "append mode", HFILL}
4985
14
    },
4986
14
    {&hf_qnet6_kif_msg_connect_ioflag_dsync,
4987
14
     {"dsync", "qnet6.kif.msgsend.msg.connect.ioflag.dsync",
4988
14
      FT_BOOLEAN, 32, NULL, 020,
4989
14
      "data sync mode", HFILL}
4990
14
    },
4991
14
    {&hf_qnet6_kif_msg_connect_ioflag_sync,
4992
14
     {"sync", "qnet6.kif.msgsend.msg.connect.ioflag.sync",
4993
14
      FT_BOOLEAN, 32, NULL, 040,
4994
14
      "file sync mode", HFILL}
4995
14
    },
4996
14
    {&hf_qnet6_kif_msg_connect_ioflag_rsync,
4997
14
     {"rsync", "qnet6.kif.msgsend.msg.connect.ioflag.rsync",
4998
14
      FT_BOOLEAN, 32, NULL, 0100,
4999
14
      "alias for data sync mode", HFILL}
5000
14
    },
5001
14
    {&hf_qnet6_kif_msg_connect_ioflag_nonblock,
5002
14
     {"nonblock", "qnet6.kif.msgsend.msg.connect.ioflag.nonblock",
5003
14
      FT_BOOLEAN, 32, NULL, 0200,
5004
14
      "alias for data sync mode", HFILL}
5005
14
    },
5006
14
    {&hf_qnet6_kif_msg_connect_ioflag_creat,
5007
14
     {"creat", "qnet6.kif.msgsend.msg.connect.ioflag.creat",
5008
14
      FT_BOOLEAN, 32, NULL, 0400,
5009
14
      "creat mode", HFILL}
5010
14
    },
5011
14
    {&hf_qnet6_kif_msg_connect_ioflag_truncate,
5012
14
     {"truncate", "qnet6.kif.msgsend.msg.connect.ioflag.truncate",
5013
14
      FT_BOOLEAN, 32, NULL, 01000,
5014
14
      "truncate mode", HFILL}
5015
14
    },
5016
14
    {&hf_qnet6_kif_msg_connect_ioflag_exclusive,
5017
14
     {"exclusive", "qnet6.kif.msgsend.msg.connect.ioflag.exclusive",
5018
14
      FT_BOOLEAN, 32, NULL, 02000,
5019
14
      "exclusive mode", HFILL}
5020
14
    },
5021
14
    {&hf_qnet6_kif_msg_connect_ioflag_noctrltty,
5022
14
     {"noctrltty", "qnet6.kif.msgsend.msg.connect.ioflag.noctrltty",
5023
14
      FT_BOOLEAN, 32, NULL, 04000,
5024
14
      "noctrltty mode", HFILL}
5025
14
    },
5026
14
    {&hf_qnet6_kif_msg_connect_ioflag_closexec,
5027
14
     {"closexec", "qnet6.kif.msgsend.msg.connect.ioflag.closexec",
5028
14
      FT_BOOLEAN, 32, NULL, 010000,
5029
14
      "closexec mode", HFILL}
5030
14
    },
5031
14
    {&hf_qnet6_kif_msg_connect_ioflag_realids,
5032
14
     {"realids", "qnet6.kif.msgsend.msg.connect.ioflag.realids",
5033
14
      FT_BOOLEAN, 32, NULL, 020000,
5034
14
      "realids mode", HFILL}
5035
14
    },
5036
14
    {&hf_qnet6_kif_msg_connect_ioflag_largefile,
5037
14
     {"largefile", "qnet6.kif.msgsend.msg.connect.ioflag.largefile",
5038
14
      FT_BOOLEAN, 32, NULL, 0100000,
5039
14
      "largefile mode", HFILL}
5040
14
    },
5041
14
    {&hf_qnet6_kif_msg_connect_ioflag_async,
5042
14
     {"async", "qnet6.kif.msgsend.msg.connect.ioflag.async",
5043
14
      FT_BOOLEAN, 32, NULL, 0200000,
5044
14
      "async mode", HFILL}
5045
14
    },
5046
5047
14
    {&hf_qnet6_kif_msg_connect_mode,
5048
14
     {"Mode", "qnet6.kif.msgsend.msg.connect.mode",
5049
14
      FT_UINT32, BASE_HEX, NULL, 0,
5050
14
      NULL, HFILL}
5051
14
    },
5052
14
    {&hf_qnet6_kif_msg_connect_mode_other_exe,
5053
14
     {"Oexec", "qnet6.kif.msgsend.msg.connect.mode.other.exec",
5054
14
      FT_BOOLEAN, 32, NULL, 01,
5055
14
      "others exec permission", HFILL}
5056
14
    },
5057
5058
14
    {&hf_qnet6_kif_msg_connect_mode_other_write,
5059
14
     {"Owrite", "qnet6.kif.msgsend.msg.connect.mode.other.write",
5060
14
      FT_BOOLEAN, 32, NULL, 02,
5061
14
      "others write permission", HFILL}
5062
14
    },
5063
14
    {&hf_qnet6_kif_msg_connect_mode_other_read,
5064
14
     {"Oread", "qnet6.kif.msgsend.msg.connect.mode.other.read",
5065
14
      FT_BOOLEAN, 32, NULL, 04,
5066
14
      "others read permission", HFILL}
5067
14
    },
5068
14
    {&hf_qnet6_kif_msg_connect_mode_group_exe,
5069
14
     {"Gexec", "qnet6.kif.msgsend.msg.connect.mode.group.exec",
5070
14
      FT_BOOLEAN, 32, NULL, 010,
5071
14
      "group exec permission", HFILL}
5072
14
    },
5073
14
    {&hf_qnet6_kif_msg_connect_mode_group_write,
5074
14
     {"Gwrite", "qnet6.kif.msgsend.msg.connect.mode.group.write",
5075
14
      FT_BOOLEAN, 32, NULL, 020,
5076
14
      "group write permission", HFILL}
5077
14
    },
5078
14
    {&hf_qnet6_kif_msg_connect_mode_group_read,
5079
14
     {"Gread", "qnet6.kif.msgsend.msg.connect.mode.group.read",
5080
14
      FT_BOOLEAN, 32, NULL, 040,
5081
14
      "group read permission", HFILL}
5082
14
    },
5083
14
    {&hf_qnet6_kif_msg_connect_mode_owner_exe,
5084
14
     {"Uexec", "qnet6.kif.msgsend.msg.connect.mode.owner.exec",
5085
14
      FT_BOOLEAN, 32, NULL, 0100,
5086
14
      "owner exec permission", HFILL}
5087
14
    },
5088
14
    {&hf_qnet6_kif_msg_connect_mode_owner_write,
5089
14
     {"Uwrite", "qnet6.kif.msgsend.msg.connect.mode.owner.write",
5090
14
      FT_BOOLEAN, 32, NULL, 0200,
5091
14
      "owner write permission", HFILL}
5092
14
    },
5093
14
    {&hf_qnet6_kif_msg_connect_mode_owner_read,
5094
14
     {"Uread", "qnet6.kif.msgsend.msg.connect.mode.owner.read",
5095
14
      FT_BOOLEAN, 32, NULL, 0400,
5096
14
      "owner read permission", HFILL}
5097
14
    },
5098
14
    {&hf_qnet6_kif_msg_connect_mode_sticky,
5099
14
     {"sticky", "qnet6.kif.msgsend.msg.connect.mode.sticky",
5100
14
      FT_BOOLEAN, 32, NULL, 01000,
5101
14
      "sticky bit", HFILL}
5102
14
    },
5103
14
    {&hf_qnet6_kif_msg_connect_mode_setgid,
5104
14
     {"setgid", "qnet6.kif.msgsend.msg.connect.mode.setgid",
5105
14
      FT_BOOLEAN, 32, NULL, 02000,
5106
14
      "set gid when execution", HFILL}
5107
14
    },
5108
14
    {&hf_qnet6_kif_msg_connect_mode_setuid,
5109
14
     {"setuid", "qnet6.kif.msgsend.msg.connect.mode.setuid",
5110
14
      FT_BOOLEAN, 32, NULL, 04000,
5111
14
      "set uid when execution", HFILL}
5112
14
    },
5113
5114
14
    {&hf_qnet6_kif_msg_connect_mode_format,
5115
14
     {"format", "qnet6.kif.msgsend.msg.connect.mode.format",
5116
14
      FT_UINT32, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_mode_vals), 0xf000,
5117
14
      "file format", HFILL}
5118
14
    },
5119
14
    {&hf_qnet6_kif_msg_connect_sflag,
5120
14
     {"Sflag", "qnet6.kif.msgsend.msg.connect.sflag",
5121
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_sflag_vals), 0,
5122
14
      NULL, HFILL}
5123
14
    },
5124
14
    {&hf_qnet6_kif_msg_connect_access,
5125
14
     {"Access", "qnet6.kif.msgsend.msg.connect.access",
5126
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_access_vals), 0,
5127
14
      NULL, HFILL}
5128
14
    },
5129
14
    {&hf_qnet6_kif_msg_connect_zero,
5130
14
     {"Zero", "qnet6.kif.msgsend.msg.connect.zero",
5131
14
      FT_UINT16, BASE_HEX, NULL, 0,
5132
14
      NULL, HFILL}
5133
14
    },
5134
14
    {&hf_qnet6_kif_msg_connect_pathlen,
5135
14
     {"Path_len", "qnet6.kif.msgsend.msg.connect.path_len",
5136
14
      FT_UINT16, BASE_HEX, NULL, 0,
5137
14
      "path length", HFILL}
5138
14
    },
5139
14
    {&hf_qnet6_kif_msg_connect_eflag,
5140
14
     {"Eflag", "qnet6.kif.msgsend.msg.connect.eflag",
5141
14
      FT_UINT8, BASE_HEX, NULL, 0,
5142
14
      NULL, HFILL}
5143
14
    },
5144
14
    {&hf_qnet6_kif_msg_connect_eflag_dir,
5145
14
     {"dir", "qnet6.kif.msgsend.msg.connect.eflag.dir",
5146
14
      FT_BOOLEAN, 8, NULL, 1,
5147
14
      "path referenced a directory", HFILL}
5148
14
    },
5149
14
    {&hf_qnet6_kif_msg_connect_eflag_dot,
5150
14
     {"dot", "qnet6.kif.msgsend.msg.connect.eflag.dot",
5151
14
      FT_BOOLEAN, 8, NULL, 2,
5152
14
      "Last component was . or ..", HFILL}
5153
14
    },
5154
14
    {&hf_qnet6_kif_msg_connect_eflag_dotdot,
5155
14
     {"dotdot", "qnet6.kif.msgsend.msg.connect.eflag.dotdot",
5156
14
      FT_BOOLEAN, 8, NULL, 4,
5157
14
      "Last component was ..", HFILL}
5158
14
    },
5159
14
    {&hf_qnet6_kif_msg_connect_extratype,
5160
14
     {"Extra_type", "qnet6.kif.msgsend.msg.connect.extra_type",
5161
14
      FT_UINT8, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_extratype_vals), 0,
5162
14
      NULL, HFILL}
5163
14
    },
5164
14
    {&hf_qnet6_kif_msg_connect_extralen,
5165
14
     {"Extra_len", "qnet6.kif.msgsend.msg.connect.extra_len",
5166
14
      FT_UINT16, BASE_HEX_DEC, NULL, 0,
5167
14
      "extra data length", HFILL}
5168
14
    },
5169
14
    {&hf_qnet6_kif_msg_connect_path,
5170
14
     {"Path", "qnet6.kif.msgsend.msg.connect.path",
5171
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
5172
14
      "path name", HFILL}
5173
14
    },
5174
14
    {&hf_qnet6_kif_msg_connect_pad_data,
5175
14
     {"Pad data", "qnet6.kif.msgsend.msg.pad_data",
5176
14
      FT_BYTES, BASE_NONE, NULL, 0,
5177
14
      NULL, HFILL}
5178
14
    },
5179
14
    {&hf_qnet6_kif_msg_connect_extra_link_ocb,
5180
14
     {"Ocb", "qnet6.kif.msgsend.msg.connect.extra.link.ocb",
5181
14
      FT_UINT32, BASE_HEX, NULL, 0,
5182
14
      "Ocb pointer value", HFILL}
5183
14
    },
5184
14
    {&hf_qnet6_kif_msg_connect_extra_symlink_path,
5185
14
     {"Path", "qnet6.kif.msgsend.msg.connect.extra.symlink.path",
5186
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
5187
14
      "Symlink new path name", HFILL}
5188
14
    },
5189
14
    {&hf_qnet6_kif_msg_connect_extra_rename_path,
5190
14
     {"Path", "qnet6.kif.msgsend.msg.connect.extra.rename.path",
5191
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
5192
14
      "Rename old path name", HFILL}
5193
14
    },
5194
14
    {&hf_qnet6_kif_msg_connect_extra_mount,
5195
14
     {"Mount", "qnet6.kif.msgsend.msg.connect.extra.mount",
5196
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
5197
14
      NULL, HFILL}
5198
14
    },
5199
14
    {&hf_qnet6_kif_msg_connect_extra_data,
5200
14
     {"Extra Data", "qnet6.kif.msgsend.msg.connect.extra.data",
5201
14
      FT_BYTES, BASE_NONE, NULL, 0,
5202
14
      NULL, HFILL}
5203
14
    },
5204
5205
    /* _IO_DEVCTL */
5206
14
    {&hf_qnet6_kif_msg_io_combine_len,
5207
14
     {"Combine_len", "qnet6.kif.msgsend.msg.combine_len",
5208
14
      FT_UINT16, BASE_HEX, NULL, 0,
5209
14
      "combine length", HFILL}
5210
14
    },
5211
    /* when it is in this field is dcmd,
5212
     *            out              ret_val
5213
     */
5214
14
    {&hf_qnet6_kif_msg_devctl_dcmd,
5215
14
     {"Dcmd", "qnet6.kif.msgsend.msg.dcmd",
5216
14
      FT_UINT32, BASE_HEX, NULL, 0,
5217
14
      "Devctl Command and Direction", HFILL}
5218
14
    },
5219
    /* if use FT_INT32 then can't use bitmask !!! */
5220
14
    {&hf_qnet6_kif_msg_devctl_dcmd_ccmd,
5221
14
     {"Ccmd", "qnet6.kif.msgsend.msg.dcmd.ccmd",
5222
14
      FT_UINT32, BASE_HEX_DEC|BASE_EXT_STRING, &qnet6_kif_msg_devctl_cmd_class_vals_ext, 0xffff,
5223
14
      "Devctl Class+Command", HFILL}
5224
14
    },
5225
14
    {&hf_qnet6_kif_msg_devctl_dcmd_cmd,
5226
14
     {"Cmd", "qnet6.kif.msgsend.msg.dcmd.cmd",
5227
14
      FT_UINT32, BASE_HEX_DEC, NULL, 0xff,
5228
14
      "Devctl Command", HFILL}
5229
14
    },
5230
14
    {&hf_qnet6_kif_msg_devctl_dcmd_class,
5231
14
     {"Class", "qnet6.kif.msgsend.msg.dcmd.class",
5232
14
      FT_UINT32, BASE_HEX|BASE_EXT_STRING, &qnet6_kif_msgsend_msg_devctl_cmd_class_vals_ext, 0xff00,
5233
14
      "Devctl Command", HFILL}
5234
14
    },
5235
14
    {&hf_qnet6_kif_msg_devctl_dcmd_size,
5236
14
     {"Size", "qnet6.kif.msgsend.msg.dcmd.size",
5237
14
      FT_UINT32, BASE_HEX, NULL, 0x3fff0000,
5238
14
      "Devctl Command", HFILL}
5239
14
    },
5240
14
    {&hf_qnet6_kif_msg_devctl_dcmd_from,
5241
14
     {"From", "qnet6.kif.msgsend.msg.dcmd.from",
5242
14
      FT_UINT32, BASE_HEX, NULL, 0x40000000,
5243
14
      "Devctl Direction has from", HFILL}
5244
14
    },
5245
14
    {&hf_qnet6_kif_msg_devctl_dcmd_to,
5246
14
     {"To", "qnet6.kif.msgsend.msg.dcmd.to",
5247
14
      FT_UINT32, BASE_HEX, NULL, 0x80000000,
5248
14
      "Devctl Direction has to", HFILL}
5249
14
    },
5250
14
    {&hf_qnet6_kif_msg_devctl_nbytes,
5251
14
     {"Nbytes", "qnet6.kif.msgsend.msg.nbytes",
5252
14
      FT_INT32, BASE_DEC, NULL, 0,
5253
14
      "payload length", HFILL}
5254
14
    },
5255
14
    {&hf_qnet6_kif_msg_devctl_zero,
5256
14
     {"Zero", "qnet6.kif.msgsend.msg.zero",
5257
14
      FT_INT32, BASE_DEC, NULL, 0,
5258
14
      "pad", HFILL}
5259
14
    },
5260
    /* io_read */
5261
14
    {&hf_qnet6_kif_msg_io_read_nbytes,
5262
14
     {"Nbytes", "qnet6.kif.msgsend.msg.read.nbytes",
5263
14
      FT_INT32, BASE_DEC, NULL, 0,
5264
14
      "read buffer size", HFILL}
5265
14
    },
5266
14
    {&hf_qnet6_kif_msg_io_read_xtypes,
5267
14
     {"Xtypes", "qnet6.kif.msgsend.msg.read.xtypes",
5268
14
      FT_UINT32, BASE_HEX, NULL, 0,
5269
14
      "Extended types for io message", HFILL}
5270
14
    },
5271
14
    {&hf_qnet6_kif_msg_io_read_xtypes_0_7,
5272
14
     {"Xtype", "qnet6.kif.msgsend.msg.read.xtypes0-7",
5273
14
      FT_UINT32, BASE_HEX, VALS(qnet6_kif_msgsend_msg_io_read_xtypes_vals), 0x000000ff,
5274
14
      "Extended types 0-7 bits", HFILL}
5275
14
    },
5276
14
    {&hf_qnet6_kif_msg_io_read_xtypes_8,
5277
14
     {"DirExtraHint", "qnet6.kif.msgsend.msg.read.xtypes8",
5278
14
      FT_UINT32, BASE_HEX, NULL, 0x00000100,
5279
14
      "_IO_XFLAG_DIR_EXTRA_HINT", HFILL}
5280
14
    },
5281
14
    {&hf_qnet6_kif_msg_io_read_xtypes_14,
5282
14
     {"Nonblock", "qnet6.kif.msgsend.msg.read.xtypes14",
5283
14
      FT_UINT32, BASE_HEX, NULL, 0x4000,
5284
14
      "_IO_XFLAG_NONBLOCK", HFILL}
5285
14
    },
5286
14
    {&hf_qnet6_kif_msg_io_read_xtypes_15,
5287
14
     {"Block", "qnet6.kif.msgsend.msg.read.xtypes15",
5288
14
      FT_UINT32, BASE_HEX, NULL, 0x8000,
5289
14
      "_IO_XFLAG_BLOCK", HFILL}
5290
14
    },
5291
14
    {&hf_qnet6_kif_msg_io_read_xoffset,
5292
14
     {"Xoffset", "qnet6.kif.msgsend.msg.read.xoffset",
5293
14
      FT_INT64, BASE_DEC, NULL, 0,
5294
14
      "Extended offset in io message", HFILL}
5295
14
    },
5296
14
    {&hf_qnet6_kif_msg_io_read_cond_min,
5297
14
     {"Min", "qnet6.kif.msgsend.msg.read.readcond.min",
5298
14
      FT_INT32, BASE_DEC, NULL, 0,
5299
14
      "Extended attribute minimum characters for readcond", HFILL}
5300
14
    },
5301
14
    {&hf_qnet6_kif_msg_io_read_cond_time,
5302
14
     {"Time", "qnet6.kif.msgsend.msg.read.readcond.time",
5303
14
      FT_INT32, BASE_DEC, NULL, 0,
5304
14
      "Extended attribute for readcond in 1/10 second", HFILL}
5305
14
    },
5306
14
    {&hf_qnet6_kif_msg_io_read_cond_timeout,
5307
14
     {"Timeout", "qnet6.kif.msgsend.msg.read.readcond.timeout",
5308
14
      FT_INT32, BASE_DEC, NULL, 0,
5309
14
      "Extended attribute timeout for readcond in 1/10 second", HFILL}
5310
14
    },
5311
    /* io_write */
5312
14
    {&hf_qnet6_kif_msg_io_write_data,
5313
14
     {"Write Data", "qnet6.kif.msgsend.msg.write.data",
5314
14
      FT_BYTES, BASE_NONE, NULL, 0,
5315
14
      NULL, HFILL}
5316
14
    },
5317
14
    {&hf_qnet6_kif_msg_io_write_nbytes,
5318
14
     {"Nbytes", "qnet6.kif.msgsend.msg.write.nbytes",
5319
14
      FT_INT32, BASE_DEC, NULL, 0,
5320
14
      "write buffer size", HFILL}
5321
14
    },
5322
14
    {&hf_qnet6_kif_msg_io_write_xtypes,
5323
14
     {"Xtypes", "qnet6.kif.msgsend.msg.write.xtypes",
5324
14
      FT_UINT32, BASE_HEX, NULL, 0,
5325
14
      "Extended types for io message", HFILL}
5326
14
    },
5327
14
    {&hf_qnet6_kif_msg_io_write_xtypes_0_7,
5328
14
     {"Xtype", "qnet6.kif.msgsend.msg.write.xtypes0-7",
5329
14
      FT_UINT32, BASE_HEX, VALS(qnet6_kif_msgsend_msg_io_read_xtypes_vals), 0x000000ff,
5330
14
      "Extended types 0-7 bits", HFILL}
5331
14
    },
5332
14
    {&hf_qnet6_kif_msg_io_write_xtypes_8,
5333
14
     {"DirExtraHint", "qnet6.kif.msgsend.msg.write.xtypes8",
5334
14
      FT_UINT32, BASE_HEX, NULL, 0x00000100,
5335
14
      "_IO_XFLAG_DIR_EXTRA_HINT", HFILL}
5336
14
    },
5337
14
    {&hf_qnet6_kif_msg_io_write_xtypes_14,
5338
14
     {"Nonblock", "qnet6.kif.msgsend.msg.write.xtypes14",
5339
14
      FT_UINT32, BASE_HEX, NULL, 0x00004000,
5340
14
      "_IO_XFLAG_NONBLOCK", HFILL}
5341
14
    },
5342
14
    {&hf_qnet6_kif_msg_io_write_xtypes_15,
5343
14
     {"Block", "qnet6.kif.msgsend.msg.write.xtypes15",
5344
14
      FT_UINT32, BASE_HEX, NULL, 0x00008000,
5345
14
      "_IO_XFLAG_BLOCK", HFILL}
5346
14
    },
5347
14
    {&hf_qnet6_kif_msg_io_write_xoffset,
5348
14
     {"Xoffset", "qnet6.kif.msgsend.msg.write.xoffset",
5349
14
      FT_INT64, BASE_DEC, NULL, 0,
5350
14
      "Extended offset in io message", HFILL}
5351
14
    },
5352
    /* io_seek */
5353
14
    {&hf_qnet6_kif_msg_seek_whence,
5354
14
     {"Whence", "qnet6.kif.msgsend.msg.lseek.whence",
5355
14
      FT_INT16, BASE_DEC, VALS(qnet6_kif_msgsend_msg_io_seek_whence_vals), 0,
5356
14
      "whence in file", HFILL}
5357
14
    },
5358
14
    {&hf_qnet6_kif_msg_seek_offset,
5359
14
     {"Offset", "qnet6.kif.msgsend.msg.lseek.offset",
5360
14
      FT_UINT64, BASE_DEC_HEX, NULL, 0,
5361
14
      "offset according to whence in file", HFILL}
5362
14
    },
5363
    /* io_pathconf */
5364
14
    {&hf_qnet6_kif_msg_pathconf_name,
5365
14
     {"name", "qnet6.kif.msgsend.msg.pathconf.name",
5366
14
      FT_INT16, BASE_DEC|BASE_EXT_STRING, &qnet6_kif_msgsend_msg_io_pathconf_name_vals_ext, 0,
5367
14
      "pathconf(name)", HFILL}
5368
14
    },
5369
    /* io_chmod */
5370
14
    {&hf_qnet6_kif_msg_io_chmod,
5371
14
     {"mode", "qnet6.kif.msgsend.msg.chmod.mode",
5372
14
      FT_UINT32, BASE_HEX, NULL, 0,
5373
14
      NULL, HFILL}
5374
14
    },
5375
14
    {&hf_qnet6_kif_msg_io_chmod_other_exe,
5376
14
     {"Oexec", "qnet6.kif.msgsend.msg.chmod.other.exec",
5377
14
      FT_BOOLEAN, 32, NULL, 01,
5378
14
      "others exec permission", HFILL}
5379
14
    },
5380
5381
14
    {&hf_qnet6_kif_msg_io_chmod_other_write,
5382
14
     {"Owrite", "qnet6.kif.msgsend.msg.chmod.other.write",
5383
14
      FT_BOOLEAN, 32, NULL, 02,
5384
14
      "others write permission", HFILL}
5385
14
    },
5386
14
    {&hf_qnet6_kif_msg_io_chmod_other_read,
5387
14
     {"Oread", "qnet6.kif.msgsend.msg.chmod.other.read",
5388
14
      FT_BOOLEAN, 32, NULL, 04,
5389
14
      "others read permission", HFILL}
5390
14
    },
5391
14
    {&hf_qnet6_kif_msg_io_chmod_group_exe,
5392
14
     {"Gexec", "qnet6.kif.msgsend.msg.chmod.group.exec",
5393
14
      FT_BOOLEAN, 32, NULL, 010,
5394
14
      "group exec permission", HFILL}
5395
14
    },
5396
14
    {&hf_qnet6_kif_msg_io_chmod_group_write,
5397
14
     {"Gwrite", "qnet6.kif.msgsend.msg.chmod.group.write",
5398
14
      FT_BOOLEAN, 32, NULL, 020,
5399
14
      "group write permission", HFILL}
5400
14
    },
5401
14
    {&hf_qnet6_kif_msg_io_chmod_group_read,
5402
14
     {"Gread", "qnet6.kif.msgsend.msg.chmod.group.read",
5403
14
      FT_BOOLEAN, 32, NULL, 040,
5404
14
      "group read permission", HFILL}
5405
14
    },
5406
14
    {&hf_qnet6_kif_msg_io_chmod_owner_exe,
5407
14
     {"Uexec", "qnet6.kif.msgsend.msg.chmod.owner.exec",
5408
14
      FT_BOOLEAN, 32, NULL, 0100,
5409
14
      "owner exec permission", HFILL}
5410
14
    },
5411
14
    {&hf_qnet6_kif_msg_io_chmod_owner_write,
5412
14
     {"Uwrite", "qnet6.kif.msgsend.msg.chmod.owner.write",
5413
14
      FT_BOOLEAN, 32, NULL, 0200,
5414
14
      "owner write permission", HFILL}
5415
14
    },
5416
14
    {&hf_qnet6_kif_msg_io_chmod_owner_read,
5417
14
     {"Uread", "qnet6.kif.msgsend.msg.chmod.owner.read",
5418
14
      FT_BOOLEAN, 32, NULL, 0400,
5419
14
      "owner read permission", HFILL}
5420
14
    },
5421
14
    {&hf_qnet6_kif_msg_io_chmod_sticky,
5422
14
     {"sticky", "qnet6.kif.msgsend.msg.chmod.sticky",
5423
14
      FT_BOOLEAN, 32, NULL, 01000,
5424
14
      "sticky bit", HFILL}
5425
14
    },
5426
14
    {&hf_qnet6_kif_msg_io_chmod_setgid,
5427
14
     {"setgid", "qnet6.kif.msgsend.msg.chmod.setgid",
5428
14
      FT_BOOLEAN, 32, NULL, 02000,
5429
14
      "set gid when execution", HFILL}
5430
14
    },
5431
14
    {&hf_qnet6_kif_msg_io_chmod_setuid,
5432
14
     {"setuid", "qnet6.kif.msgsend.msg.chmod.setuid",
5433
14
      FT_BOOLEAN, 32, NULL, 04000,
5434
14
      "set uid when execution", HFILL}
5435
14
    },
5436
    /* io_chown */
5437
14
    {&hf_qnet6_kif_msg_io_chown_gid,
5438
14
     {"gid", "qnet6.kif.msgsend.msg.chown.gid",
5439
14
      FT_UINT32, BASE_HEX, NULL, 0,
5440
14
      "chown gid", HFILL}
5441
14
    },
5442
14
    {&hf_qnet6_kif_msg_io_chown_uid,
5443
14
     {"uid", "qnet6.kif.msgsend.msg.chown.uid",
5444
14
      FT_UINT32, BASE_HEX, NULL, 0,
5445
14
      "chown uid", HFILL}
5446
14
    },
5447
    /* io_sync */
5448
14
    {&hf_qnet6_kif_msg_io_sync,
5449
14
     {"sync", "qnet6.kif.msgsend.msg.sync",
5450
14
      FT_UINT32, BASE_HEX, NULL, 0,
5451
14
      "io sync command", HFILL}
5452
14
    },
5453
14
    {&hf_qnet6_kif_msg_syncflag_dsync,
5454
14
     {"dsync", "qnet6.kif.msgsend.msg.sync.flag.dsync",
5455
14
      FT_BOOLEAN, 32, NULL, 020,
5456
14
      "data sync mode", HFILL}
5457
14
    },
5458
14
    {&hf_qnet6_kif_msg_syncflag_sync,
5459
14
     {"sync", "qnet6.kif.msgsend.msg.sync.flag.sync",
5460
14
      FT_BOOLEAN, 32, NULL, 040,
5461
14
      "file sync mode", HFILL}
5462
14
    },
5463
14
    {&hf_qnet6_kif_msg_syncflag_rsync,
5464
14
     {"rsync", "qnet6.kif.msgsend.msg.sync.flag.rsync",
5465
14
      FT_BOOLEAN, 32, NULL, 0100,
5466
14
      "alias for data sync mode", HFILL}
5467
14
    },
5468
    /* utime */
5469
14
    {&hf_qnet6_kif_msg_io_utime_curflag,
5470
14
     {"curflag", "qnet6.kif.msgsend.msg.utime.curflag",
5471
14
      FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0,
5472
14
      "whether use current time", HFILL}
5473
14
    },
5474
14
    {&hf_qnet6_kif_msg_io_utime_actime,
5475
14
     {"actime", "qnet6.kif.msgsend.msg.utime.actime",
5476
14
      FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
5477
14
      "access time in seconds since the Epoch", HFILL}
5478
14
    },
5479
14
    {&hf_qnet6_kif_msg_io_utime_modtime,
5480
14
     {"modtime", "qnet6.kif.msgsend.msg.utime.modtime",
5481
14
      FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
5482
14
      "modification time in seconds since the Epoch", HFILL}
5483
14
    },
5484
    /* fdinfo */
5485
14
    {&hf_qnet6_kif_msg_io_fdinfo_flags,
5486
14
     {"flags", "qnet6.kif.msgsend.msg.fdinfo.flags",
5487
14
      FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0,
5488
14
      "_FDINFO_FLAG_LOCALPATH", HFILL}
5489
14
    },
5490
14
    {&hf_qnet6_kif_msg_io_fdinfo_path_len,
5491
14
     {"pathlen", "qnet6.kif.msgsend.msg.fdinfo.pathlen",
5492
14
      FT_UINT32, BASE_HEX, NULL, 0,
5493
14
      "returned path buffer's length", HFILL}
5494
14
    },
5495
14
    {&hf_qnet6_kif_msg_io_fdinfo_reserved,
5496
14
     {"reserved", "qnet6.kif.msgsend.msg.fdinfo.reserved",
5497
14
      FT_UINT32, BASE_HEX, NULL, 0,
5498
14
      "reserved fields", HFILL}
5499
14
    },
5500
    /* lock */
5501
14
    {&hf_qnet6_kif_msg_io_lock_subtype,
5502
14
     {"subtype", "qnet6.kif.msgsend.msg.lock.subtype",
5503
14
      FT_UINT32, BASE_HEX, NULL, 0,
5504
14
      "io lock subytpe", HFILL}
5505
14
    },
5506
14
    {&hf_qnet6_kif_msg_io_lock_nbytes,
5507
14
     {"nbytes", "qnet6.kif.msgsend.msg.lock.nbytes",
5508
14
      FT_UINT32, BASE_HEX, NULL, 0,
5509
14
      "io lock nbytes", HFILL}
5510
14
    },
5511
    /* space */
5512
14
    {&hf_qnet6_kif_msg_io_space_subtype,
5513
14
     {"subtype", "qnet6.kif.msgsend.msg.space.subtype",
5514
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_io_space_subtype_vals), 0,
5515
14
      "io space subytpe", HFILL}
5516
14
    },
5517
14
    {&hf_qnet6_kif_msg_io_space_whence,
5518
14
     {"whence", "qnet6.kif.msgsend.msg.space.whence",
5519
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_io_seek_whence_vals), 0,
5520
14
      "io space whence", HFILL}
5521
14
    },
5522
14
    {&hf_qnet6_kif_msg_io_space_start,
5523
14
     {"start", "qnet6.kif.msgsend.msg.space.start",
5524
14
      FT_UINT64, BASE_HEX, NULL, 0,
5525
14
      "io space start", HFILL}
5526
14
    },
5527
14
    {&hf_qnet6_kif_msg_io_space_len,
5528
14
     {"len", "qnet6.kif.msgsend.msg.space.len",
5529
14
      FT_UINT64, BASE_HEX, NULL, 0,
5530
14
      "io space len", HFILL}
5531
14
    },
5532
14
    {&hf_qnet6_kif_msgsend_extra,
5533
14
     {"Extra", "qnet6.kif.msgsend.extra",
5534
14
      FT_STRING, BASE_NONE, NULL, 0,
5535
14
      NULL, HFILL}
5536
14
    },
5537
5538
    /* msg_info */
5539
14
    {&hf_qnet6_kif_msg_msginfo_nd,
5540
14
     {"Node", "qnet6.kif.msgsend.msg_info.nd",
5541
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
5542
14
      "node id", HFILL}
5543
14
    },
5544
14
    {&hf_qnet6_kif_msg_msginfo_srcnd,
5545
14
     {"Srcnode", "qnet6.kif.msgsend.msg_info.srcnd",
5546
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
5547
14
      "source node id", HFILL}
5548
14
    },
5549
14
    {&hf_qnet6_kif_msg_msginfo_pid,
5550
14
     {"Pid", "qnet6.kif.msgsend.msg_info.pid",
5551
14
      FT_INT32, BASE_DEC, NULL, 0,
5552
14
      "process id", HFILL}
5553
14
    },
5554
14
    {&hf_qnet6_kif_msg_msginfo_tid,
5555
14
     {"Tid", "qnet6.kif.msgsend.msg_info.tid",
5556
14
      FT_INT32, BASE_DEC, NULL, 0,
5557
14
      "thread id", HFILL}
5558
14
    },
5559
14
    {&hf_qnet6_kif_msg_msginfo_chid,
5560
14
     {"Chid", "qnet6.kif.msgsend.msg_info.chid",
5561
14
      FT_INT32, BASE_DEC, NULL, 0,
5562
14
      "channel id", HFILL}
5563
14
    },
5564
14
    {&hf_qnet6_kif_msg_msginfo_scoid,
5565
14
     {"Scoid", "qnet6.kif.msgsend.msg_info.scoid",
5566
14
      FT_INT32, BASE_DEC, NULL, 0,
5567
14
      "server connection id", HFILL}
5568
14
    },
5569
14
    {&hf_qnet6_kif_msg_msginfo_coid,
5570
14
     {"Coid", "qnet6.kif.msgsend.msg_info.coid",
5571
14
      FT_INT32, BASE_DEC, NULL, 0,
5572
14
      "connection id", HFILL}
5573
14
    },
5574
14
    {&hf_qnet6_kif_msg_msginfo_msglen,
5575
14
     {"Msglen", "qnet6.kif.msgsend.msg_info.msglen",
5576
14
      FT_INT32, BASE_DEC, NULL, 0,
5577
14
      "message length", HFILL}
5578
14
    },
5579
14
    {&hf_qnet6_kif_msg_msginfo_srcmsglen,
5580
14
     {"Srcmsglen", "qnet6.kif.msgsend.msg_info.srcmsglen",
5581
14
      FT_INT32, BASE_DEC, NULL, 0,
5582
14
      "source message length", HFILL}
5583
14
    },
5584
14
    {&hf_qnet6_kif_msg_msginfo_dstmsglen,
5585
14
     {"Dstmsglen", "qnet6.kif.msgsend.msg_info.dstmsglen",
5586
14
      FT_INT32, BASE_DEC, NULL, 0,
5587
14
      "destination message length", HFILL}
5588
14
    },
5589
14
    {&hf_qnet6_kif_msg_msginfo_priority,
5590
14
     {"Priority", "qnet6.kif.msgsend.msg_info.priority",
5591
14
      FT_INT16, BASE_DEC, NULL, 0,
5592
14
      NULL, HFILL}
5593
14
    },
5594
14
    {&hf_qnet6_kif_msg_msginfo_flags,
5595
14
     {"Flags", "qnet6.kif.msgsend.msg_info.flags",
5596
14
      FT_INT16, BASE_DEC, NULL, 0,
5597
14
      NULL, HFILL}
5598
14
    },
5599
14
    {&hf_qnet6_kif_msg_msginfo_reserved,
5600
14
     {"Reserved", "qnet6.kif.msgsend.msg_info.reserved",
5601
14
      FT_UINT32, BASE_HEX, NULL, 0,
5602
14
      NULL, HFILL}
5603
14
    },
5604
    /* openfd */
5605
5606
14
    {&hf_qnet6_kif_msg_openfd_ioflag,
5607
14
     {"Ioflag", "qnet6.kif.msgsend.msg.openfd.ioflag",
5608
14
      FT_UINT32, BASE_OCT, NULL, 0,
5609
14
      "file io flag", HFILL}
5610
14
    },
5611
    /* for FT_BOOLEAN, its display field must be parent bit width */
5612
5613
14
    {&hf_qnet6_kif_msg_openfd_ioflag_access,
5614
14
     {"access", "qnet6.kif.msgsend.msg.openfd.ioflag.access",
5615
14
      FT_UINT32, BASE_DEC, VALS(qnet6_kif_msgsend_msg_connect_ioflag_vals), 03,
5616
14
      "access mode", HFILL}
5617
14
    },
5618
14
    {&hf_qnet6_kif_msg_openfd_ioflag_append,
5619
14
     {"append", "qnet6.kif.msgsend.msg.openfd.ioflag.append",
5620
14
      FT_BOOLEAN, 32, NULL, 010,
5621
14
      "append mode", HFILL}
5622
14
    },
5623
14
    {&hf_qnet6_kif_msg_openfd_ioflag_dsync,
5624
14
     {"dsync", "qnet6.kif.msgsend.msg.openfd.ioflag.dsync",
5625
14
      FT_BOOLEAN, 32, NULL, 020,
5626
14
      "data sync mode", HFILL}
5627
14
    },
5628
14
    {&hf_qnet6_kif_msg_openfd_ioflag_sync,
5629
14
     {"sync", "qnet6.kif.msgsend.msg.openfd.ioflag.sync",
5630
14
      FT_BOOLEAN, 32, NULL, 040,
5631
14
      "file sync mode", HFILL}
5632
14
    },
5633
14
    {&hf_qnet6_kif_msg_openfd_ioflag_rsync,
5634
14
     {"rsync", "qnet6.kif.msgsend.msg.openfd.ioflag.rsync",
5635
14
      FT_BOOLEAN, 32, NULL, 0100,
5636
14
      "alias for data sync mode", HFILL}
5637
14
    },
5638
14
    {&hf_qnet6_kif_msg_openfd_ioflag_nonblock,
5639
14
     {"nonblock", "qnet6.kif.msgsend.msg.openfd.ioflag.nonblock",
5640
14
      FT_BOOLEAN, 32, NULL, 0200,
5641
14
      "alias for data sync mode", HFILL}
5642
14
    },
5643
14
    {&hf_qnet6_kif_msg_openfd_ioflag_creat,
5644
14
     {"creat", "qnet6.kif.msgsend.msg.openfd.ioflag.creat",
5645
14
      FT_BOOLEAN, 32, NULL, 0400,
5646
14
      "creat mode", HFILL}
5647
14
    },
5648
14
    {&hf_qnet6_kif_msg_openfd_ioflag_truncate,
5649
14
     {"truncate", "qnet6.kif.msgsend.msg.openfd.ioflag.truncate",
5650
14
      FT_BOOLEAN, 32, NULL, 01000,
5651
14
      "truncate mode", HFILL}
5652
14
    },
5653
14
    {&hf_qnet6_kif_msg_openfd_ioflag_exclusive,
5654
14
     {"exclusive", "qnet6.kif.msgsend.msg.openfd.ioflag.exclusive",
5655
14
      FT_BOOLEAN, 32, NULL, 02000,
5656
14
      "exclusive mode", HFILL}
5657
14
    },
5658
14
    {&hf_qnet6_kif_msg_openfd_ioflag_noctrltty,
5659
14
     {"noctrltty", "qnet6.kif.msgsend.msg.openfd.ioflag.noctrltty",
5660
14
      FT_BOOLEAN, 32, NULL, 04000,
5661
14
      "noctrltty mode", HFILL}
5662
14
    },
5663
14
    {&hf_qnet6_kif_msg_openfd_ioflag_closexec,
5664
14
     {"closexec", "qnet6.kif.msgsend.msg.openfd.ioflag.closexec",
5665
14
      FT_BOOLEAN, 32, NULL, 010000,
5666
14
      "closexec mode", HFILL}
5667
14
    },
5668
14
    {&hf_qnet6_kif_msg_openfd_ioflag_realids,
5669
14
     {"realids", "qnet6.kif.msgsend.msg.openfd.ioflag.realids",
5670
14
      FT_BOOLEAN, 32, NULL, 020000,
5671
14
      "realids mode", HFILL}
5672
14
    },
5673
14
    {&hf_qnet6_kif_msg_openfd_ioflag_largefile,
5674
14
     {"largefile", "qnet6.kif.msgsend.msg.openfd.ioflag.largefile",
5675
14
      FT_BOOLEAN, 32, NULL, 0100000,
5676
14
      "largefile mode", HFILL}
5677
14
    },
5678
14
    {&hf_qnet6_kif_msg_openfd_ioflag_async,
5679
14
     {"async", "qnet6.kif.msgsend.msg.openfd.ioflag.async",
5680
14
      FT_BOOLEAN, 32, NULL, 0200000,
5681
14
      "async mode", HFILL}
5682
14
    },
5683
14
    {&hf_qnet6_kif_msg_openfd_sflag,
5684
14
     {"Sflag", "qnet6.kif.msgsend.msg.openfd.sflag",
5685
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_connect_sflag_vals), 0,
5686
14
      NULL, HFILL}
5687
14
    },
5688
14
    {&hf_qnet6_kif_msg_openfd_xtype,
5689
14
     {"Xtype", "qnet6.kif.msgsend.msg.openfd.xtype",
5690
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_msgsend_msg_openfd_xtypes_vals), 0,
5691
14
      "openfd xtype", HFILL}
5692
14
    },
5693
14
    {&hf_qnet6_kif_msg_openfd_reserved,
5694
14
     {"Reserved", "qnet6.kif.msgsend.msg.openfd.reserved",
5695
14
      FT_UINT32, BASE_HEX, NULL, 0,
5696
14
      "openfd reserved fields", HFILL}
5697
14
    },
5698
14
    {&hf_qnet6_kif_msg_openfd_key,
5699
14
     {"Key", "qnet6.kif.msgsend.msg.openfd.key",
5700
14
      FT_UINT32, BASE_HEX, NULL, 0,
5701
14
      "openfd key", HFILL}
5702
14
    },
5703
    /* mmap */
5704
14
    {&hf_qnet6_kif_msg_io_mmap_prot,
5705
14
     {"Prot", "qnet6.kif.msgsend.msg.mmap.prot",
5706
14
      FT_UINT32, BASE_HEX, NULL, 0,
5707
14
      "protection field of mmap", HFILL}
5708
14
    },
5709
14
    {&hf_qnet6_kif_msg_io_mmap_prot_read,
5710
14
     {"Read", "qnet6.kif.msgsend.msg.mmap.prot.read",
5711
14
      FT_BOOLEAN, 32, NULL, 0x00000100,
5712
14
      "protection field of mmap", HFILL}
5713
14
    },
5714
14
    {&hf_qnet6_kif_msg_io_mmap_prot_write,
5715
14
     {"Write", "qnet6.kif.msgsend.msg.mmap.prot.write",
5716
14
      FT_BOOLEAN, 32, NULL, 0x00000200,
5717
14
      "protection field of mmap", HFILL}
5718
14
    },
5719
14
    {&hf_qnet6_kif_msg_io_mmap_prot_exec,
5720
14
     {"Exec", "qnet6.kif.msgsend.msg.mmap.prot.exec",
5721
14
      FT_BOOLEAN, 32, NULL, 0x00000400,
5722
14
      "protection field of mmap", HFILL}
5723
14
    },
5724
14
    {&hf_qnet6_kif_msg_io_mmap_offset,
5725
14
     {"Offset", "qnet6.kif.msgsend.msg.mmap.offset",
5726
14
      FT_UINT64, BASE_HEX, NULL, 0,
5727
14
      "offset of object", HFILL}
5728
14
    },
5729
    /* notify */
5730
14
    {&hf_qnet6_kif_msg_io_notify_action,
5731
14
     {"Action", "qnet6.kif.msgsend.msg.notify.action",
5732
14
      FT_UINT32, BASE_HEX, VALS(qnet6_kif_msgsend_msg_io_notify_action_vals), 0,
5733
14
      "action of notify", HFILL}
5734
14
    },
5735
14
    {&hf_qnet6_kif_msg_io_notify_flags,
5736
14
     {"Action", "qnet6.kif.msgsend.msg.notify.action",
5737
14
      FT_UINT32, BASE_HEX, NULL, 0,
5738
14
      "flags of notify", HFILL}
5739
14
    },
5740
14
    {&hf_qnet6_kif_msg_io_notify_flags_31,
5741
14
     {"Exten", "qnet6.kif.msgsend.msg.notify.flags.exten",
5742
14
      FT_BOOLEAN, 32, NULL, 0x80000000,
5743
14
      "exten flag of notify", HFILL}
5744
14
    },
5745
14
    {&hf_qnet6_kif_msg_io_notify_flags_30,
5746
14
     {"Oband", "qnet6.kif.msgsend.msg.notify.flags.oband",
5747
14
      FT_BOOLEAN, 32, NULL, 0x40000000,
5748
14
      "outband flag of notify", HFILL}
5749
14
    },
5750
14
    {&hf_qnet6_kif_msg_io_notify_flags_29,
5751
14
     {"Output", "qnet6.kif.msgsend.msg.notify.flags.output",
5752
14
      FT_BOOLEAN, 32, NULL, 0x20000000,
5753
14
      "output flag of notify", HFILL}
5754
14
    },
5755
14
    {&hf_qnet6_kif_msg_io_notify_flags_28,
5756
14
     {"Input", "qnet6.kif.msgsend.msg.notify.flags.input",
5757
14
      FT_BOOLEAN, 32, NULL, 0x10000000,
5758
14
      "input flag of notify", HFILL}
5759
14
    },
5760
5761
14
    {&hf_qnet6_kif_msg_io_notify_mgr,
5762
14
     {"Manager", "qnet6.kif.msgsend.msg.notify.mgr",
5763
14
      FT_UINT64, BASE_HEX, NULL, 0,
5764
14
      "managers of notify", HFILL}
5765
14
    },
5766
14
    {&hf_qnet6_kif_msg_io_notify_flags_extra_mask,
5767
14
     {"FlagsExtraMask", "qnet6.kif.msgsend.msg.notify.flags_extra_mask",
5768
14
      FT_UINT32, BASE_HEX, NULL, 0,
5769
14
      "extra mask of flags", HFILL}
5770
14
    },
5771
14
    {&hf_qnet6_kif_msg_io_notify_flags_exten,
5772
14
     {"FlagsExten", "qnet6.kif.msgsend.msg.notify.flags_exten",
5773
14
      FT_UINT32, BASE_HEX, NULL, 0,
5774
14
      "glags exten", HFILL}
5775
14
    },
5776
14
    {&hf_qnet6_kif_msg_io_notify_nfds,
5777
14
     {"Nfds", "qnet6.kif.msgsend.msg.notify.nfds",
5778
14
      FT_UINT32, BASE_HEX, NULL, 0,
5779
14
      "number of fds", HFILL}
5780
14
    },
5781
14
    {&hf_qnet6_kif_msg_io_notify_fd_first,
5782
14
     {"Firstfd", "qnet6.kif.msgsend.msg.notify.fd_first",
5783
14
      FT_UINT32, BASE_HEX, NULL, 0,
5784
14
      "first fd in nfds array", HFILL}
5785
14
    },
5786
14
    {&hf_qnet6_kif_msg_io_notify_nfds_ready,
5787
14
     {"Ready", "qnet6.kif.msgsend.msg.notify.nfds_ready",
5788
14
      FT_UINT32, BASE_HEX, NULL, 0,
5789
14
      "number of ready fds", HFILL}
5790
14
    },
5791
14
    {&hf_qnet6_kif_msg_io_notify_timo,
5792
14
     {"Timeout", "qnet6.kif.msgsend.msg.notify.timeo",
5793
14
      FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
5794
14
      "notify timeout", HFILL}
5795
14
    },
5796
14
    {&hf_qnet6_kif_msg_io_notify_fds,
5797
14
     {"FDS", "qnet6.kif.msgsend.msg.notify.fds",
5798
14
      FT_STRING, BASE_NONE, NULL, 0,
5799
14
      NULL, HFILL}
5800
14
    },
5801
5802
    /* iomsg*/
5803
14
    {&hf_qnet6_kif_msg_io_msg_mgrid,
5804
14
     {"Mgrid", "qnet6.kif.msgsend.msg.iomsg.mgrid",
5805
14
      FT_UINT16, BASE_HEX, VALS(qnet6_kif_mgr_types_vals), 0,
5806
14
      "manager id", HFILL}
5807
14
    },
5808
14
    {&hf_qnet6_kif_msg_io_msg_subtype,
5809
14
     {"subtype", "qnet6.kif.msgsend.msg.iomsg.subtype",
5810
14
      FT_UINT16, BASE_HEX, NULL, 0,
5811
14
      NULL, HFILL}
5812
14
    },
5813
    /* dup */
5814
14
    {&hf_qnet6_kif_msg_io_dup_reserved,
5815
14
     {"Reserved", "qnet6.kif.msgsend.msg.dup.reserved",
5816
14
      FT_UINT32, BASE_HEX, NULL, 0,
5817
14
      "dup message reserved fields", HFILL}
5818
14
    },
5819
14
    {&hf_qnet6_kif_msg_io_dup_key,
5820
14
     {"Key", "qnet6.kif.msgsend.msg.dup.key",
5821
14
      FT_UINT32, BASE_HEX, NULL, 0,
5822
14
      "dup message key", HFILL}
5823
14
    },
5824
5825
    /* _client_info */
5826
14
    {&hf_qnet6_kif_client_info,
5827
14
     {"Client_info", "qnet6.kif.client_info",
5828
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
5829
14
      "client information", HFILL}
5830
14
    },
5831
14
    {&hf_qnet6_kif_zero,
5832
14
     {"Zero", "qnet6.kif.zero",
5833
14
      FT_BYTES, BASE_NONE, NULL, 0,
5834
14
      "All bytes should be zero", HFILL}
5835
14
    },
5836
14
    {&hf_qnet6_kif_client_info_nd,
5837
14
     {"Nd", "qnet6.kif.client_info.nd",
5838
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
5839
14
      "node id", HFILL}
5840
14
    },
5841
14
    {&hf_qnet6_kif_client_info_pid,
5842
14
     {"Pid", "qnet6.kif.client_info.pid",
5843
14
      FT_INT32, BASE_DEC, NULL, 0,
5844
14
      "process id", HFILL}
5845
14
    },
5846
14
    {&hf_qnet6_kif_client_info_sid,
5847
14
     {"Sid", "qnet6.kif.client_info.sid",
5848
14
      FT_INT32, BASE_DEC, NULL, 0,
5849
14
      "server connection id", HFILL}
5850
14
    },
5851
14
    {&hf_qnet6_kif_client_info_flags,
5852
14
     {"Flags", "qnet6.kif.client_info.flags",
5853
14
      FT_UINT32, BASE_HEX, NULL, 0,
5854
14
      "connection flags", HFILL}
5855
14
    },
5856
14
    {&hf_qnet6_kif_client_info_cred,
5857
14
     {"Cred", "qnet6.kif.client_info.cred",
5858
14
      FT_STRINGZ, BASE_NONE, NULL, 0,
5859
14
      "client credential information", HFILL}
5860
14
    },
5861
14
    {&hf_qnet6_kif_client_info_cred_ruid,
5862
14
     {"Ruid", "qnet6.kif.client_info.cred.ruid",
5863
14
      FT_INT32, BASE_DEC, NULL, 0,
5864
14
      "client real uid", HFILL}
5865
14
    },
5866
14
    {&hf_qnet6_kif_client_info_cred_euid,
5867
14
     {"Euid", "qnet6.kif.client_info.cred.euid",
5868
14
      FT_INT32, BASE_DEC, NULL, 0,
5869
14
      "client effective uid", HFILL}
5870
14
    },
5871
14
    {&hf_qnet6_kif_client_info_cred_suid,
5872
14
     {"Suid", "qnet6.kif.client_info.cred.suid",
5873
14
      FT_INT32, BASE_DEC, NULL, 0,
5874
14
      "client saved uid", HFILL}
5875
14
    },
5876
14
    {&hf_qnet6_kif_client_info_cred_rgid,
5877
14
     {"Rgid", "qnet6.kif.client_info.cred.rgid",
5878
14
      FT_INT32, BASE_DEC, NULL, 0,
5879
14
      "client real gid", HFILL}
5880
14
    },
5881
14
    {&hf_qnet6_kif_client_info_cred_egid,
5882
14
     {"Egid", "qnet6.kif.client_info.cred.egid",
5883
14
      FT_INT32, BASE_DEC, NULL, 0,
5884
14
      "client effective gid", HFILL}
5885
14
    },
5886
14
    {&hf_qnet6_kif_client_info_cred_sgid,
5887
14
     {"Sgid", "qnet6.kif.client_info.cred.sgid",
5888
14
      FT_INT32, BASE_DEC, NULL, 0,
5889
14
      "client saved gid", HFILL}
5890
14
    },
5891
14
    {&hf_qnet6_kif_client_info_cred_ngroups,
5892
14
     {"Ngroups", "qnet6.kif.client_info.cred.ngroups",
5893
14
      FT_UINT32, BASE_DEC_HEX, NULL, 0,
5894
14
      "number of groups client belongs to", HFILL}
5895
14
    },
5896
14
    {&hf_qnet6_kif_client_info_cred_grouplist,
5897
14
     {"Grouplist", "qnet6.kif.client_info.cred.grouplist",
5898
14
      FT_UINT32, BASE_DEC, NULL, 0,
5899
14
      "groups client belongs to", HFILL}
5900
14
    }
5901
14
  };
5902
5903
  /* Setup protocol subtree array */
5904
14
  static int *ett[] = {
5905
14
    &ett_qnet6_l4,
5906
14
    &ett_qnet6_flags,
5907
14
    &ett_qnet6_qos_info
5908
14
  };
5909
14
  static int *ett_lr[] = {
5910
14
    &ett_qnet6_lr,
5911
14
    &ett_qnet6_lr_src,
5912
14
    &ett_qnet6_lr_src_name_subtree,
5913
14
    &ett_qnet6_lr_src_domain_subtree,
5914
14
    &ett_qnet6_lr_src_addr_subtree,
5915
14
    &ett_qnet6_lr_dst,
5916
14
    &ett_qnet6_lr_dst_name_subtree,
5917
14
    &ett_qnet6_lr_dst_domain_subtree,
5918
14
    &ett_qnet6_lr_dst_addr_subtree
5919
14
  };
5920
5921
14
  static int *ett_kif[] = {
5922
14
    &ett_qnet6_kif,
5923
14
    &ett_qnet6_kif_vinfo,
5924
14
    &ett_qnet6_kif_pulse,
5925
14
    &ett_qnet6_kif_event,
5926
14
    &ett_qnet6_kif_msg,
5927
14
    &ett_qnet6_kif_msg_ioflag,
5928
14
    &ett_qnet6_kif_msg_mode,
5929
14
    &ett_qnet6_kif_msg_eflag,
5930
14
    &ett_qnet6_kif_connect,
5931
14
    &ett_qnet6_kif_msgsend,
5932
14
    &ett_qnet6_kif_client_info,
5933
14
    &ett_qnet6_kif_client_info_cred,
5934
14
    &ett_qnet6_kif_client_info_cred_group,
5935
14
    &ett_qnet6_kif_msg_devctl_dcmd,
5936
14
    &ett_qnet6_kif_msg_read_xtypes,
5937
14
    &ett_qnet6_kif_msg_write_xtypes,
5938
14
    &ett_qnet6_kif_chmod_mode,
5939
14
    &ett_qnet6_kif_msg_sync,
5940
14
    &ett_qnet6_kif_msg_msginfo,
5941
14
    &ett_qnet6_kif_msg_openfd_ioflag,
5942
14
    &ett_qnet6_kif_msg_prot,
5943
14
    &ett_qnet6_kif_msg_notify_flags,
5944
14
    &ett_qnet6_kif_msg_notify_fds
5945
14
  };
5946
14
  static int *ett_nr[] = {
5947
14
    &ett_qnet6_nr
5948
14
  };
5949
14
  static int *ett_qos[] = {
5950
14
    &ett_qnet6_qos
5951
14
  };
5952
14
  module_t *qnet6_module;
5953
5954
  /* Register the protocol name and description */
5955
14
  proto_qnet6_l4 = proto_register_protocol("QNX6 QNET LWL4 protocol", "LWL4", "lwl4");
5956
5957
14
  proto_qnet6_qos = proto_register_protocol("QNX6 QNET QOS protocol", "QOS", "qos");
5958
5959
14
  proto_qnet6_lr = proto_register_protocol("QNX6 QNET LR protocol", "LR", "lr");
5960
5961
14
  proto_qnet6_kif = proto_register_protocol("QNX6 QNET KIF protocol", "KIF", "kif");
5962
5963
14
  proto_qnet6_nr =  proto_register_protocol("QNX6 QNET Network Resolver protocol", "NR", "nr");
5964
5965
  /* Register the dissector handle */
5966
14
  qnet6_handle = register_dissector("lwl4", dissect_qnet6, proto_qnet6_l4);
5967
5968
  /* Required function calls to register the header fields and subtrees used */
5969
14
  proto_register_field_array(proto_qnet6_l4, hf, array_length(hf));
5970
14
  proto_register_subtree_array(ett, array_length(ett));
5971
5972
14
  proto_register_field_array(proto_qnet6_qos, hf_qos, array_length(hf_qos));
5973
14
  proto_register_subtree_array(ett_qos, array_length(ett_qos));
5974
5975
14
  proto_register_field_array(proto_qnet6_lr, hf_lr, array_length(hf_lr));
5976
14
  proto_register_subtree_array(ett_lr, array_length(ett_lr));
5977
5978
14
  proto_register_field_array(proto_qnet6_kif, hf_kif, array_length(hf_kif));
5979
14
  proto_register_subtree_array(ett_kif, array_length(ett_kif));
5980
5981
14
  proto_register_field_array(proto_qnet6_nr, hf_nr, array_length(hf_nr));
5982
14
  proto_register_subtree_array(ett_nr, array_length(ett_nr));
5983
5984
14
  qnet6_module = prefs_register_protocol(proto_qnet6_l4, NULL);
5985
14
  prefs_register_bool_preference(qnet6_module, "check_crc",
5986
14
                                  "Validate the LWL4 crc even crc bit is not set",
5987
14
                                  "Whether to validate the LWL4 crc when crc bit is not set",
5988
14
                                  &qnet6_lwl4_check_crc);
5989
5990
14
}
5991
5992
5993
void
5994
proto_reg_handoff_qnet6(void)
5995
14
{
5996
14
  dissector_add_uint("ethertype", ETHERTYPE_QNX_QNET6, qnet6_handle);
5997
14
  dissector_add_uint("ip.proto", IP_PROTO_QNX, qnet6_handle);
5998
14
}
5999
6000
6001
/*
6002
 * Editor modelines
6003
 *
6004
 * Local Variables:
6005
 * c-basic-offset: 2
6006
 * tab-width: 8
6007
 * indent-tabs-mode: nil
6008
 * End:
6009
 *
6010
 * ex: set shiftwidth=2 tabstop=8 expandtab:
6011
 * :indentSize=2:tabSize=8:noTabs=true:
6012
 */