1 /* packet-mq.c
2  * Routines for IBM WebSphere MQ packet dissection
3  *
4  * metatech <metatechbe@gmail.com>
5  * Robert Grange <robionekenobi@bluewin.ch>
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * SPDX-License-Identifier: GPL-2.0-or-later
12  */
13 
14  /*  WebSphere MQ in a nutshell
15   *
16   *   IBM WebSphere MQ (formerly IBM MQSeries) is an asynchronous proprietary messaging middleware that is
17   *    based on message queues.
18   *   MQ can run on more than 35 platforms, amongst which UNIX, Windows and mainframes.
19   *   MQ can be transported on top of TCP, UDP, HTTP, NetBIOS, SPX, SNA LU 6.2, DECnet.
20   *   MQ has language bindings for C, C++, Java, .NET, COBOL, PL/I, OS/390 assembler, TAL, Visual Basic.
21   *
22   *   The basic MQ topology is on one side the queue manager which hosts the queues.  On the other side the
23   *   applications connect to the queue manager, open a queue, and put or get messages to/from that queue.
24   *
25   *   The MQ middleware allows very generic operations (send, receive) and can be compared to the
26   *   socket API in terms of genericity, but it is more abstract and offers higher-level functionalities
27   *   (eg transactions, ...)
28   *
29   *   The MQ middleware is not really intended to be run over public networks between parties
30   *   that do not know each other in advance, but is rather used on private corporate networks
31   *   between business applications (it can be compared to a database server for that aspect).
32   *
33   *   The wire format of an MQ segment is a sequence of structures.
34   *   Most structures start with a 4-letter struct identifier.
35   *   MQ is a fixed-sized format, most fields have maximum lengths defined in the MQ API.
36   *   MQ is popular on mainframes because it was available before TCP/IP.
37   *   MQ supports both ASCII-based and EBCDIC-based character sets.
38   *
39   *   MQ API documentation is called "WebSphere MQ Application Programming
40   *   Reference"
41   *
42   *   See:
43   *
44   *       http://www-01.ibm.com/support/docview.wss?uid=pub1sc34606203
45   *
46   *       http://www-01.ibm.com/support/docview.wss?uid=pub1sc34694001
47   *
48   *   Possible structures combinations :
49   *   TSH [ ID ^ UID ^ CONN ^ INQ ^ OD ]
50   *   TSH MSH XQH MD [ PAYLOAD ]
51   *   TSH [OD] MD [ GMO ^ PMO ] [ [XQH MD] PAYLOAD ]
52   *   TSH [ SPQU ^ SPPU ^ SPGU ^ SPAU [ SPQI ^ SPQO ^ SPPI ^ SPPO ^ SPGI ^ SPGO ^ SPAI ^ SPAO]]
53   *   TSH [ XA ] [ XINFO | XID ]
54   *   where PAYLOAD = [ DH ] [ DLH ] [ MDE ] BUFF
55   *
56   *   This dissector is a beta version.  To be improved
57   *   - Translate the integers/flags into their descriptions
58   *   - Find the semantics of the unknown fields
59   *   - Display EBCDIC strings as ASCII
60   *   - Packets which structures built on different platforms
61   */
62 
63 #include "config.h"
64 
65 #include <epan/packet.h>
66 #include <epan/ptvcursor.h>
67 #include <epan/exceptions.h>
68 #include <epan/reassemble.h>
69 #include <epan/expert.h>
70 #include <epan/prefs.h>
71 #include <epan/strutil.h>
72 
73 #include "packet-windows-common.h"
74 #include "packet-tcp.h"
75 #include <packet-tls.h>
76 
77 #include "packet-mq.h"
78 
79 void proto_register_mq(void);
80 void proto_reg_handoff_mq(void);
81 
82 static int proto_mq = -1;
83 static int hf_mq_tsh_StructID = -1;
84 static int hf_mq_tsh_mqseglen = -1;
85 static int hf_mq_tsh_convid = -1;
86 static int hf_mq_tsh_requestid = -1;
87 static int hf_mq_tsh_byteorder = -1;
88 static int hf_mq_tsh_opcode = -1;
89 static int hf_mq_tsh_ctlflgs1 = -1;
90 
91 static int hf_mq_tsh_ctlflgs2 = -1;
92 static int hf_mq_tsh_luwid = -1;
93 static int hf_mq_tsh_encoding = -1;
94 
95 static int hf_mq_tsh_ccsid = -1;
96 static int hf_mq_tsh_reserved = -1;
97 
98 /* Transmission Segment Control Flags 1 */
99 static int hf_mq_tsh_tcf_confirmreq = -1;
100 static int hf_mq_tsh_tcf_error = -1;
101 static int hf_mq_tsh_tcf_reqclose = -1;
102 static int hf_mq_tsh_tcf_closechann = -1;
103 static int hf_mq_tsh_tcf_first = -1;
104 static int hf_mq_tsh_tcf_last = -1;
105 static int hf_mq_tsh_tcf_reqacc = -1;
106 static int hf_mq_tsh_tcf_dlq = -1;
107 static int* const pf_flds_tcf[] =
108 {
109     &hf_mq_tsh_tcf_dlq,
110     &hf_mq_tsh_tcf_reqacc,
111     &hf_mq_tsh_tcf_last,
112     &hf_mq_tsh_tcf_first,
113     &hf_mq_tsh_tcf_closechann,
114     &hf_mq_tsh_tcf_reqclose,
115     &hf_mq_tsh_tcf_error,
116     &hf_mq_tsh_tcf_confirmreq,
117     NULL
118 };
119 
120 /* Transmission Segment Control Flags 2 */
121 static int hf_mq_tsh_tcf2_HdrComp = -1;
122 static int hf_mq_tsh_tcf2_MsgComp = -1;
123 static int hf_mq_tsh_tcf2_CSH = -1;
124 static int hf_mq_tsh_tcf2_CmitIntv = -1;
125 static int* const pf_flds_tcf2[] =
126 {
127     &hf_mq_tsh_tcf2_CmitIntv,
128     &hf_mq_tsh_tcf2_CSH,
129     &hf_mq_tsh_tcf2_MsgComp,
130     &hf_mq_tsh_tcf2_HdrComp,
131     NULL
132 };
133 
134 static int hf_mq_api_replylen = -1;
135 static int hf_mq_api_compcode = -1;
136 static int hf_mq_api_reascode = -1;
137 static int hf_mq_api_objecthdl = -1;
138 static int hf_mq_socket_conversid = -1;
139 static int hf_mq_socket_requestid = -1;
140 static int hf_mq_socket_type = -1;
141 static int hf_mq_socket_parm1 = -1;
142 static int hf_mq_socket_parm2 = -1;
143 static int hf_mq_msh_StructID = -1;
144 static int hf_mq_msh_seqnum = -1;
145 static int hf_mq_msh_datalength = -1;
146 static int hf_mq_msh_unknown1 = -1;
147 static int hf_mq_msh_msglength = -1;
148 static int hf_mq_xqh_StructID = -1;
149 static int hf_mq_xqh_version = -1;
150 static int hf_mq_xqh_remoteq = -1;
151 static int hf_mq_xqh_remoteqmgr = -1;
152 
153 static int hf_mq_id_StructID = -1;
154 static int hf_mq_id_FapLevel = -1;
155 static int hf_mq_id_cf1 = -1;
156 static int hf_mq_id_ecf1 = -1;
157 static int hf_mq_id_ief1 = -1;
158 static int hf_mq_id_Reserved = -1;
159 static int hf_mq_id_MaxMsgBatch = -1;
160 static int hf_mq_id_MaxTrSize = -1;
161 static int hf_mq_id_MaxMsgSize = -1;
162 static int hf_mq_id_SeqWrapVal = -1;
163 static int hf_mq_id_channel = -1;
164 static int hf_mq_id_cf2 = -1;
165 static int hf_mq_id_ecf2 = -1;
166 static int hf_mq_id_ccsid = -1;
167 static int hf_mq_id_qmgrname = -1;
168 static int hf_mq_id_HBInterval = -1;
169 static int hf_mq_id_EFLLength = -1;
170 static int hf_mq_id_ief2 = -1;
171 static int hf_mq_id_Reserved1 = -1;
172 static int hf_mq_id_HdrCprsLst = -1;
173 static int hf_mq_id_MsgCprsLst = -1;
174 static int hf_mq_id_Reserved2 = -1;
175 static int hf_mq_id_SSLKeyRst = -1;
176 static int hf_mq_id_ConvBySkt = -1;
177 static int hf_mq_id_cf3 = -1;
178 static int hf_mq_id_ecf3 = -1;
179 static int hf_mq_id_Reserved3 = -1;
180 static int hf_mq_id_ProcessId = -1;
181 static int hf_mq_id_ThreadId = -1;
182 static int hf_mq_id_TraceId = -1;
183 static int hf_mq_id_ProdId = -1;
184 static int hf_mq_id_mqmid = -1;
185 static int hf_mq_id_pal = -1;
186 static int hf_mq_id_r = -1;
187 
188 /* Initial Data - Capability Flag 1 */
189 static int hf_mq_id_cf1_msgseq = -1;
190 static int hf_mq_id_cf1_convcap = -1;
191 static int hf_mq_id_cf1_splitmsg = -1;
192 static int hf_mq_id_cf1_RqstInit = -1;
193 static int hf_mq_id_cf1_RqstSecu = -1;
194 static int hf_mq_id_cf1_mqreq = -1;
195 static int hf_mq_id_cf1_svrsec = -1;
196 static int hf_mq_id_cf1_runtime = -1;
197 static int* const pf_flds_cf1[] =
198 {
199     &hf_mq_id_cf1_runtime,
200     &hf_mq_id_cf1_svrsec,
201     &hf_mq_id_cf1_mqreq,
202     &hf_mq_id_cf1_RqstSecu,
203     &hf_mq_id_cf1_RqstInit,
204     &hf_mq_id_cf1_splitmsg,
205     &hf_mq_id_cf1_convcap,
206     &hf_mq_id_cf1_msgseq,
207     NULL
208 };
209 
210 /* Initial Data - Init Error Flag 1 */
211 static int hf_mq_id_ief1_ccsid = -1;
212 static int hf_mq_id_ief1_enc = -1;
213 static int hf_mq_id_ief1_mxtrsz = -1;
214 static int hf_mq_id_ief1_fap = -1;
215 static int hf_mq_id_ief1_mxmsgsz = -1;
216 static int hf_mq_id_ief1_mxmsgpb = -1;
217 static int hf_mq_id_ief1_seqwrap = -1;
218 static int hf_mq_id_ief1_hbint = -1;
219 static int* const pf_flds_ef1[] =
220 {
221     &hf_mq_id_ief1_hbint,
222     &hf_mq_id_ief1_seqwrap,
223     &hf_mq_id_ief1_mxmsgpb,
224     &hf_mq_id_ief1_mxmsgsz,
225     &hf_mq_id_ief1_fap,
226     &hf_mq_id_ief1_mxtrsz,
227     &hf_mq_id_ief1_enc,
228     &hf_mq_id_ief1_ccsid,
229     NULL
230 };
231 
232 /* Initial Data - Capability Flag 2 */
233 static int hf_mq_id_cf2_CanDstLst = -1;
234 static int hf_mq_id_cf2_FstMsgReq = -1;
235 static int hf_mq_id_cf2_RespConv = -1;
236 static int hf_mq_id_cf2_XARequest = -1;
237 static int hf_mq_id_cf2_XARunTApp = -1;
238 static int hf_mq_id_cf2_SPIRqst = -1;
239 static int hf_mq_id_cf2_DualUOW = -1;
240 static int hf_mq_id_cf2_CanTrcRte = -1;
241 static int* const pf_flds_cf2[] =
242 {
243     &hf_mq_id_cf2_CanTrcRte,
244     &hf_mq_id_cf2_SPIRqst,
245     &hf_mq_id_cf2_XARunTApp,
246     &hf_mq_id_cf2_XARequest,
247     &hf_mq_id_cf2_DualUOW,
248     &hf_mq_id_cf2_RespConv,
249     &hf_mq_id_cf2_FstMsgReq,
250     &hf_mq_id_cf2_CanDstLst,
251     NULL
252 };
253 
254 /* Initial Data - Init Error Flag 2 */
255 static int hf_mq_id_ief2_HdrCmpLst = -1;
256 static int hf_mq_id_ief2_MsgCmpLst = -1;
257 static int hf_mq_id_ief2_SSLReset = -1;
258 static int* const pf_flds_ef2[] =
259 {
260     &hf_mq_id_ief2_SSLReset,
261     &hf_mq_id_ief2_MsgCmpLst,
262     &hf_mq_id_ief2_HdrCmpLst,
263     NULL
264 };
265 
266 /* Initial Data - Capability Flag 3 */
267 static int hf_mq_id_cf3_CanMsgPrp = -1;
268 static int hf_mq_id_cf3_CanMulticast = -1;
269 static int hf_mq_id_cf3_PropIntSep = -1;
270 static int hf_mq_id_cf3_MPlxSyGet = -1;
271 static int hf_mq_id_cf3_ProtAlgorit = -1;
272 static int hf_mq_id_cf3_CanGenConnTag = -1;
273 
274 static int* const pf_flds_cf3[] =
275 {
276     &hf_mq_id_cf3_ProtAlgorit,
277     &hf_mq_id_cf3_MPlxSyGet,
278     &hf_mq_id_cf3_PropIntSep,
279     &hf_mq_id_cf3_CanMulticast,
280     &hf_mq_id_cf3_CanMsgPrp,
281     &hf_mq_id_cf3_CanGenConnTag,
282     NULL
283 };
284 
285 static int hf_mq_uid_StructID = -1;
286 static int hf_mq_uid_userid = -1;
287 static int hf_mq_uid_password = -1;
288 static int hf_mq_uid_longuserid = -1;
289 static int hf_mq_sidlen = -1;
290 static int hf_mq_sidtyp = -1;
291 static int hf_mq_securityid = -1;
292 
293 static int hf_mq_conn_QMgr = -1;
294 static int hf_mq_conn_appname = -1;
295 static int hf_mq_conn_apptype = -1;
296 static int hf_mq_conn_acttoken = -1;
297 static int hf_mq_conn_Xoptions = -1;
298 static int hf_mq_conn_options = -1;
299 static int hf_mq_fcno_StructID = -1;
300 static int hf_mq_fcno_prodid = -1;
301 static int hf_mq_fcno_mqmid = -1;
302 static int hf_mq_fcno_version = -1;
303 static int hf_mq_fcno_capflag = -1;
304 static int hf_mq_fcno_conn_tag = -1;
305 static int hf_mq_fcno_retconn_tag = -1;
306 static int hf_mq_fcno_unknowb01 = -1;
307 
308 static int hf_mq_inq_nbsel = -1;
309 static int hf_mq_inq_nbint = -1;
310 static int hf_mq_inq_charlen = -1;
311 static int hf_mq_inq_sel = -1;
312 static int hf_mq_inq_intvalue = -1;
313 static int hf_mq_inq_charvalues = -1;
314 
315 static int hf_mq_spi_verb = -1;
316 static int hf_mq_spi_version = -1;
317 static int hf_mq_spi_length = -1;
318 static int hf_mq_spi_base_StructID = -1;
319 static int hf_mq_spi_base_version = -1;
320 static int hf_mq_spi_base_length = -1;
321 static int hf_mq_spi_spqo_nbverb = -1;
322 static int hf_mq_spi_spqo_verbid = -1;
323 static int hf_mq_spi_spqo_maxiover = -1;
324 static int hf_mq_spi_spqo_maxinver = -1;
325 static int hf_mq_spi_spqo_maxouver = -1;
326 static int hf_mq_spi_spqo_flags = -1;
327 static int hf_mq_spi_spai_mode = -1;
328 static int hf_mq_spi_spai_unknown1 = -1;
329 static int hf_mq_spi_spai_unknown2 = -1;
330 static int hf_mq_spi_spai_msgid = -1;
331 static int hf_mq_spi_spgi_batchsz = -1;
332 static int hf_mq_spi_spgi_batchint = -1;
333 static int hf_mq_spi_spgi_maxmsgsz = -1;
334 static int hf_mq_spi_spgo_options = -1;
335 static int hf_mq_spi_spgo_size = -1;
336 
337 static int hf_mq_spi_opt_blank = -1;
338 static int hf_mq_spi_opt_syncp = -1;
339 static int hf_mq_spi_opt_deferred = -1;
340 static int* const pf_flds_spiopt[] =
341 {
342     &hf_mq_spi_opt_deferred,
343     &hf_mq_spi_opt_syncp,
344     &hf_mq_spi_opt_blank,
345     NULL
346 };
347 
348 static int hf_mq_put_length = -1;
349 
350 static int hf_mq_close_options = -1;
351 static int hf_mq_close_options_DELETE = -1;
352 static int hf_mq_close_options_DELETE_PURGE = -1;
353 static int hf_mq_close_options_KEEP_SUB = -1;
354 static int hf_mq_close_options_REMOVE_SUB = -1;
355 static int hf_mq_close_options_QUIESCE = -1;
356 static int* const pf_flds_clsopt[] =
357 {
358     &hf_mq_close_options_QUIESCE,
359     &hf_mq_close_options_REMOVE_SUB,
360     &hf_mq_close_options_KEEP_SUB,
361     &hf_mq_close_options_DELETE_PURGE,
362     &hf_mq_close_options_DELETE,
363     NULL
364 };
365 
366 static int hf_mq_open_options = -1;
367 static int hf_mq_open_options_INPUT_SHARED = -1;
368 static int hf_mq_open_options_INPUT_AS_Q_DEF = -1;
369 static int hf_mq_open_options_INPUT_EXCLUSIVE = -1;
370 static int hf_mq_open_options_BROWSE = -1;
371 static int hf_mq_open_options_OUTPUT = -1;
372 static int hf_mq_open_options_INQUIRE = -1;
373 static int hf_mq_open_options_SET = -1;
374 static int hf_mq_open_options_SAVE_ALL_CTX = -1;
375 static int hf_mq_open_options_PASS_IDENT_CTX = -1;
376 static int hf_mq_open_options_PASS_ALL_CTX = -1;
377 static int hf_mq_open_options_SET_IDENT_CTX = -1;
378 static int hf_mq_open_options_SET_ALL_CONTEXT = -1;
379 static int hf_mq_open_options_ALT_USER_AUTH = -1;
380 static int hf_mq_open_options_FAIL_IF_QUIESC = -1;
381 static int hf_mq_open_options_BIND_ON_OPEN = -1;
382 static int hf_mq_open_options_BIND_NOT_FIXED = -1;
383 static int hf_mq_open_options_RESOLVE_NAMES = -1;
384 static int hf_mq_open_options_CO_OP = -1;
385 static int hf_mq_open_options_RESOLVE_LOCAL_Q = -1;
386 static int hf_mq_open_options_NO_READ_AHEAD = -1;
387 static int hf_mq_open_options_READ_AHEAD = -1;
388 static int hf_mq_open_options_NO_MULTICAST = -1;
389 static int hf_mq_open_options_BIND_ON_GROUP = -1;
390 static int* const pf_flds_opnopt[] =
391 {
392     &hf_mq_open_options_BIND_ON_GROUP,
393     &hf_mq_open_options_NO_MULTICAST,
394     &hf_mq_open_options_READ_AHEAD,
395     &hf_mq_open_options_NO_READ_AHEAD,
396     &hf_mq_open_options_RESOLVE_LOCAL_Q,
397     &hf_mq_open_options_CO_OP,
398     &hf_mq_open_options_RESOLVE_NAMES,
399     &hf_mq_open_options_BIND_NOT_FIXED,
400     &hf_mq_open_options_BIND_ON_OPEN,
401     &hf_mq_open_options_FAIL_IF_QUIESC,
402     &hf_mq_open_options_ALT_USER_AUTH,
403     &hf_mq_open_options_SET_ALL_CONTEXT,
404     &hf_mq_open_options_SET_IDENT_CTX,
405     &hf_mq_open_options_PASS_ALL_CTX,
406     &hf_mq_open_options_PASS_IDENT_CTX,
407     &hf_mq_open_options_SAVE_ALL_CTX,
408     &hf_mq_open_options_SET,
409     &hf_mq_open_options_INQUIRE,
410     &hf_mq_open_options_OUTPUT,
411     &hf_mq_open_options_BROWSE,
412     &hf_mq_open_options_INPUT_EXCLUSIVE,
413     &hf_mq_open_options_INPUT_SHARED,
414     &hf_mq_open_options_INPUT_AS_Q_DEF,
415     NULL
416 };
417 
418 static int hf_mq_fopa_StructID = -1;
419 static int hf_mq_fopa_version = -1;
420 static int hf_mq_fopa_length = -1;
421 static int hf_mq_fopa_DefPersistence = -1;
422 static int hf_mq_fopa_DefPutRespType = -1;
423 static int hf_mq_fopa_DefReadAhead = -1;
424 static int hf_mq_fopa_PropertyControl = -1;
425 static int hf_mq_fopa_Unknown = -1;
426 
427 static int hf_mq_fcmi_StructID = -1;
428 static int hf_mq_fcmi_unknown = -1;
429 
430 static int hf_mq_ping_length = -1;
431 static int hf_mq_ping_buffer = -1;
432 static int hf_mq_reset_length = -1;
433 static int hf_mq_reset_seqnum = -1;
434 static int hf_mq_status_length = -1;
435 static int hf_mq_status_code = -1;
436 static int hf_mq_status_value = -1;
437 
438 static int hf_mq_caut_StructID = -1;
439 static int hf_mq_caut_AuthType = -1;
440 static int hf_mq_caut_UsrMaxLen = -1;
441 static int hf_mq_caut_PwdMaxLen = -1;
442 static int hf_mq_caut_UsrLength = -1;
443 static int hf_mq_caut_PwdLength = -1;
444 static int hf_mq_caut_usr = -1;
445 static int hf_mq_caut_psw = -1;
446 
447 static int hf_mq_od_StructID = -1;
448 static int hf_mq_od_version = -1;
449 static int hf_mq_od_objecttype = -1;
450 static int hf_mq_od_objectname = -1;
451 static int hf_mq_od_objqmgrname = -1;
452 static int hf_mq_od_dynqname = -1;
453 static int hf_mq_od_altuserid = -1;
454 static int hf_mq_od_recspresent = -1;
455 static int hf_mq_od_knowndstcnt = -1;
456 static int hf_mq_od_unknowdstcnt = -1;
457 static int hf_mq_od_invaldstcnt = -1;
458 static int hf_mq_od_objrecofs = -1;
459 static int hf_mq_od_resprecofs = -1;
460 static int hf_mq_od_objrecptr = -1;
461 static int hf_mq_od_resprecptr = -1;
462 static int hf_mq_od_altsecurid = -1;
463 static int hf_mq_od_resolvqname = -1;
464 static int hf_mq_od_resolvqmgrnm = -1;
465 static int hf_mq_od_resolvobjtyp = -1;
466 
467 static int hf_mq_or_objname = -1;
468 static int hf_mq_or_objqmgrname = -1;
469 static int hf_mq_rr_compcode = -1;
470 static int hf_mq_rr_reascode = -1;
471 static int hf_mq_pmr_msgid = -1;
472 static int hf_mq_pmr_correlid = -1;
473 static int hf_mq_pmr_groupid = -1;
474 static int hf_mq_pmr_feedback = -1;
475 static int hf_mq_pmr_acttoken = -1;
476 static int hf_mq_md_StructID = -1;
477 static int hf_mq_md_version = -1;
478 static int hf_mq_md_report = -1;
479 static int hf_mq_md_msgtype = -1;
480 static int hf_mq_md_expiry = -1;
481 static int hf_mq_md_feedback = -1;
482 static int hf_mq_md_encoding = -1;
483 static int hf_mq_md_ccsid = -1;
484 static int hf_mq_md_format = -1;
485 static int hf_mq_md_priority = -1;
486 static int hf_mq_md_persistence = -1;
487 static int hf_mq_md_msgid = -1;
488 static int hf_mq_md_correlid = -1;
489 static int hf_mq_md_backoutcnt = -1;
490 static int hf_mq_md_replytoq = -1;
491 static int hf_mq_md_replytoqmgr = -1;
492 static int hf_mq_md_userid = -1;
493 static int hf_mq_md_acttoken = -1;
494 static int hf_mq_md_appliddata = -1;
495 static int hf_mq_md_putappltype = -1;
496 static int hf_mq_md_putapplname = -1;
497 static int hf_mq_md_putdate = -1;
498 static int hf_mq_md_puttime = -1;
499 static int hf_mq_md_apporigdata = -1;
500 static int hf_mq_md_groupid = -1;
501 static int hf_mq_md_msgseqnumber = -1;
502 static int hf_mq_md_offset = -1;
503 static int hf_mq_md_msgflags = -1;
504 static int hf_mq_md_origlen = -1;
505 static int hf_mq_dlh_StructID = -1;
506 static int hf_mq_dlh_version = -1;
507 static int hf_mq_dlh_reason = -1;
508 static int hf_mq_dlh_destq = -1;
509 static int hf_mq_dlh_destqmgr = -1;
510 static int hf_mq_dlh_encoding = -1;
511 static int hf_mq_dlh_ccsid = -1;
512 static int hf_mq_dlh_format = -1;
513 static int hf_mq_dlh_putappltype = -1;
514 static int hf_mq_dlh_putapplname = -1;
515 static int hf_mq_dlh_putdate = -1;
516 static int hf_mq_dlh_puttime = -1;
517 
518 static int hf_mq_gmo_StructID = -1;
519 static int hf_mq_gmo_version = -1;
520 static int hf_mq_gmo_options = -1;
521 static int hf_mq_gmo_waitinterval = -1;
522 static int hf_mq_gmo_signal1 = -1;
523 static int hf_mq_gmo_signal2 = -1;
524 static int hf_mq_gmo_resolvqname = -1;
525 static int hf_mq_gmo_matchoptions = -1;
526 static int hf_mq_gmo_groupstatus = -1;
527 static int hf_mq_gmo_segmstatus = -1;
528 static int hf_mq_gmo_segmentation = -1;
529 static int hf_mq_gmo_reserved = -1;
530 static int hf_mq_gmo_msgtoken = -1;
531 static int hf_mq_gmo_returnedlen = -1;
532 static int hf_mq_gmo_reserved2 = -1;
533 static int hf_mq_gmo_msghandle = -1;
534 
535 static int hf_mq_gmo_options_PROPERTIES_COMPATIBILITY = -1;
536 static int hf_mq_gmo_options_PROPERTIES_IN_HANDLE = -1;
537 static int hf_mq_gmo_options_NO_PROPERTIES = -1;
538 static int hf_mq_gmo_options_PROPERTIES_FORCE_MQRFH2 = -1;
539 static int hf_mq_gmo_options_UNMARKED_BROWSE_MSG = -1;
540 static int hf_mq_gmo_options_UNMARK_BROWSE_HANDLE = -1;
541 static int hf_mq_gmo_options_UNMARK_BROWSE_CO_OP = -1;
542 static int hf_mq_gmo_options_MARK_BROWSE_CO_OP = -1;
543 static int hf_mq_gmo_options_MARK_BROWSE_HANDLE = -1;
544 static int hf_mq_gmo_options_ALL_SEGMENTS_AVAILABLE = -1;
545 static int hf_mq_gmo_options_ALL_MSGS_AVAILABLE = -1;
546 static int hf_mq_gmo_options_COMPLETE_MSG = -1;
547 static int hf_mq_gmo_options_LOGICAL_ORDER = -1;
548 static int hf_mq_gmo_options_CONVERT = -1;
549 static int hf_mq_gmo_options_FAIL_IF_QUIESCING = -1;
550 static int hf_mq_gmo_options_SYNCPOINT_IF_PERSISTENT = -1;
551 static int hf_mq_gmo_options_BROWSE_MSG_UNDER_CURSOR = -1;
552 static int hf_mq_gmo_options_UNLOCK = -1;
553 static int hf_mq_gmo_options_LOCK = -1;
554 static int hf_mq_gmo_options_MSG_UNDER_CURSOR = -1;
555 static int hf_mq_gmo_options_MARK_SKIP_BACKOUT = -1;
556 static int hf_mq_gmo_options_ACCEPT_TRUNCATED_MSG = -1;
557 static int hf_mq_gmo_options_BROWSE_NEXT = -1;
558 static int hf_mq_gmo_options_BROWSE_FIRST = -1;
559 static int hf_mq_gmo_options_SET_SIGNAL = -1;
560 static int hf_mq_gmo_options_NO_SYNCPOINT = -1;
561 static int hf_mq_gmo_options_SYNCPOINT = -1;
562 static int hf_mq_gmo_options_WAIT = -1;
563 static int* const pf_flds_gmoopt[] =
564 {
565     &hf_mq_gmo_options_PROPERTIES_COMPATIBILITY,
566     &hf_mq_gmo_options_PROPERTIES_IN_HANDLE,
567     &hf_mq_gmo_options_NO_PROPERTIES,
568     &hf_mq_gmo_options_PROPERTIES_FORCE_MQRFH2,
569     &hf_mq_gmo_options_UNMARKED_BROWSE_MSG,
570     &hf_mq_gmo_options_UNMARK_BROWSE_HANDLE,
571     &hf_mq_gmo_options_UNMARK_BROWSE_CO_OP,
572     &hf_mq_gmo_options_MARK_BROWSE_CO_OP,
573     &hf_mq_gmo_options_MARK_BROWSE_HANDLE,
574     &hf_mq_gmo_options_ALL_SEGMENTS_AVAILABLE,
575     &hf_mq_gmo_options_ALL_MSGS_AVAILABLE,
576     &hf_mq_gmo_options_COMPLETE_MSG,
577     &hf_mq_gmo_options_LOGICAL_ORDER,
578     &hf_mq_gmo_options_CONVERT,
579     &hf_mq_gmo_options_FAIL_IF_QUIESCING,
580     &hf_mq_gmo_options_SYNCPOINT_IF_PERSISTENT,
581     &hf_mq_gmo_options_BROWSE_MSG_UNDER_CURSOR,
582     &hf_mq_gmo_options_UNLOCK,
583     &hf_mq_gmo_options_LOCK,
584     &hf_mq_gmo_options_MSG_UNDER_CURSOR,
585     &hf_mq_gmo_options_MARK_SKIP_BACKOUT,
586     &hf_mq_gmo_options_ACCEPT_TRUNCATED_MSG,
587     &hf_mq_gmo_options_BROWSE_NEXT,
588     &hf_mq_gmo_options_BROWSE_FIRST,
589     &hf_mq_gmo_options_SET_SIGNAL,
590     &hf_mq_gmo_options_NO_SYNCPOINT,
591     &hf_mq_gmo_options_SYNCPOINT,
592     &hf_mq_gmo_options_WAIT,
593     NULL
594 };
595 
596 static int hf_mq_gmo_matchoptions_MATCH_MSG_TOKEN = -1;
597 static int hf_mq_gmo_matchoptions_MATCH_OFFSET = -1;
598 static int hf_mq_gmo_matchoptions_MATCH_MSG_SEQ_NUMBER = -1;
599 static int hf_mq_gmo_matchoptions_MATCH_GROUP_ID = -1;
600 static int hf_mq_gmo_matchoptions_MATCH_CORREL_ID = -1;
601 static int hf_mq_gmo_matchoptions_MATCH_MSG_ID = -1;
602 static int* const pf_flds_mtchopt[] =
603 {
604     &hf_mq_gmo_matchoptions_MATCH_MSG_TOKEN,
605     &hf_mq_gmo_matchoptions_MATCH_OFFSET,
606     &hf_mq_gmo_matchoptions_MATCH_MSG_SEQ_NUMBER,
607     &hf_mq_gmo_matchoptions_MATCH_GROUP_ID,
608     &hf_mq_gmo_matchoptions_MATCH_CORREL_ID,
609     &hf_mq_gmo_matchoptions_MATCH_MSG_ID,
610     NULL
611 };
612 
613 static int hf_mq_lpoo_StructID = -1;
614 static int hf_mq_lpoo_version = -1;
615 static int hf_mq_lpoo_lpiopts = -1;
616 static int hf_mq_lpoo_defpersist = -1;
617 static int hf_mq_lpoo_defputresptype = -1;
618 static int hf_mq_lpoo_defreadahead = -1;
619 static int hf_mq_lpoo_propertyctl = -1;
620 static int hf_mq_lpoo_qprotect = -1;
621 static int hf_mq_lpoo_qprotect_val1 = -1;
622 static int hf_mq_lpoo_qprotect_val2 = -1;
623 
624 static int hf_mq_lpoo_lpiopts_SAVE_IDENTITY_CTXT = -1;
625 static int hf_mq_lpoo_lpiopts_SAVE_ORIGIN_CTXT = -1;
626 static int hf_mq_lpoo_lpiopts_SAVE_USER_CTXT = -1;
627 static int* const pf_flds_lpooopt[] =
628 {
629     &hf_mq_lpoo_lpiopts_SAVE_USER_CTXT,
630     &hf_mq_lpoo_lpiopts_SAVE_ORIGIN_CTXT,
631     &hf_mq_lpoo_lpiopts_SAVE_IDENTITY_CTXT,
632     NULL
633 };
634 
635 
636 static int hf_mq_charv_vsptr = -1;
637 static int hf_mq_charv_vsoffset = -1;
638 static int hf_mq_charv_vsbufsize = -1;
639 static int hf_mq_charv_vslength = -1;
640 static int hf_mq_charv_vsccsid = -1;
641 static int hf_mq_charv_vsvalue = -1;
642 
643 static int hf_mq_pmo_StructID = -1;
644 static int hf_mq_pmo_version = -1;
645 static int hf_mq_pmo_options = -1;
646 static int hf_mq_pmo_timeout = -1;
647 static int hf_mq_pmo_context = -1;
648 static int hf_mq_pmo_knowndstcnt = -1;
649 static int hf_mq_pmo_unkndstcnt = -1;
650 static int hf_mq_pmo_invaldstcnt = -1;
651 static int hf_mq_pmo_resolvqname = -1;
652 static int hf_mq_pmo_resolvqmgr = -1;
653 static int hf_mq_pmo_recspresent = -1;
654 static int hf_mq_pmo_putmsgrecfld = -1;
655 static int hf_mq_pmo_putmsgrecofs = -1;
656 static int hf_mq_pmo_resprecofs = -1;
657 static int hf_mq_pmo_putmsgrecptr = -1;
658 static int hf_mq_pmo_resprecptr = -1;
659 static int hf_mq_pmo_originalmsghandle = -1;
660 static int hf_mq_pmo_newmsghandle = -1;
661 static int hf_mq_pmo_action = -1;
662 static int hf_mq_pmo_publevel = -1;
663 
664 static int hf_mq_xa_length = -1;
665 static int hf_mq_xa_returnvalue = -1;
666 static int hf_mq_xa_tmflags = -1;
667 static int hf_mq_xa_rmid = -1;
668 static int hf_mq_xa_count = -1;
669 static int hf_mq_xa_xid_formatid = -1;
670 static int hf_mq_xa_xid_glbxid_len = -1;
671 static int hf_mq_xa_xid_brq_length = -1;
672 static int hf_mq_xa_xid_globalxid = -1;
673 static int hf_mq_xa_xid_brq = -1;
674 static int hf_mq_xa_xainfo_length = -1;
675 static int hf_mq_xa_xainfo_value = -1;
676 
677 static int hf_mq_pmo_options_NOT_OWN_SUBS = -1;
678 static int hf_mq_pmo_options_SUPPRESS_REPLYTO = -1;
679 static int hf_mq_pmo_options_SCOPE_QMGR = -1;
680 static int hf_mq_pmo_options_MD_FOR_OUTPUT_ONLY = -1;
681 static int hf_mq_pmo_options_RETAIN = -1;
682 static int hf_mq_pmo_options_WARN_IF_NO_SUBS_MATCHED = -1;
683 static int hf_mq_pmo_options_RESOLVE_LOCAL_Q = -1;
684 static int hf_mq_pmo_options_SYNC_RESPONSE = -1;
685 static int hf_mq_pmo_options_ASYNC_RESPONSE = -1;
686 static int hf_mq_pmo_options_LOGICAL_ORDER = -1;
687 static int hf_mq_pmo_options_NO_CONTEXT = -1;
688 static int hf_mq_pmo_options_FAIL_IF_QUIESCING = -1;
689 static int hf_mq_pmo_options_ALTERNATE_USER_AUTHORITY = -1;
690 static int hf_mq_pmo_options_SET_ALL_CONTEXT = -1;
691 static int hf_mq_pmo_options_SET_IDENTITY_CONTEXT = -1;
692 static int hf_mq_pmo_options_PASS_ALL_CONTEXT = -1;
693 static int hf_mq_pmo_options_PASS_IDENTITY_CONTEXT = -1;
694 static int hf_mq_pmo_options_NEW_CORREL_ID = -1;
695 static int hf_mq_pmo_options_NEW_MSG_ID = -1;
696 static int hf_mq_pmo_options_DEFAULT_CONTEXT = -1;
697 static int hf_mq_pmo_options_NO_SYNCPOINT = -1;
698 static int hf_mq_pmo_options_SYNCPOINT = -1;
699 static int* const pf_flds_pmoopt[] =
700 {
701     &hf_mq_pmo_options_NOT_OWN_SUBS,
702     &hf_mq_pmo_options_SUPPRESS_REPLYTO,
703     &hf_mq_pmo_options_SCOPE_QMGR,
704     &hf_mq_pmo_options_MD_FOR_OUTPUT_ONLY,
705     &hf_mq_pmo_options_RETAIN,
706     &hf_mq_pmo_options_WARN_IF_NO_SUBS_MATCHED,
707     &hf_mq_pmo_options_RESOLVE_LOCAL_Q,
708     &hf_mq_pmo_options_SYNC_RESPONSE,
709     &hf_mq_pmo_options_ASYNC_RESPONSE,
710     &hf_mq_pmo_options_LOGICAL_ORDER,
711     &hf_mq_pmo_options_NO_CONTEXT,
712     &hf_mq_pmo_options_FAIL_IF_QUIESCING,
713     &hf_mq_pmo_options_ALTERNATE_USER_AUTHORITY,
714     &hf_mq_pmo_options_SET_ALL_CONTEXT,
715     &hf_mq_pmo_options_SET_IDENTITY_CONTEXT,
716     &hf_mq_pmo_options_PASS_ALL_CONTEXT,
717     &hf_mq_pmo_options_PASS_IDENTITY_CONTEXT,
718     &hf_mq_pmo_options_NEW_CORREL_ID,
719     &hf_mq_pmo_options_NEW_MSG_ID,
720     &hf_mq_pmo_options_DEFAULT_CONTEXT,
721     &hf_mq_pmo_options_NO_SYNCPOINT,
722     &hf_mq_pmo_options_SYNCPOINT,
723     NULL
724 };
725 
726 static int hf_mq_xa_tmflags_join = -1;
727 static int hf_mq_xa_tmflags_endrscan = -1;
728 static int hf_mq_xa_tmflags_startrscan = -1;
729 static int hf_mq_xa_tmflags_suspend = -1;
730 static int hf_mq_xa_tmflags_success = -1;
731 static int hf_mq_xa_tmflags_resume = -1;
732 static int hf_mq_xa_tmflags_fail = -1;
733 static int hf_mq_xa_tmflags_onephase = -1;
734 static int* const pf_flds_tmflags[] =
735 {
736     &hf_mq_xa_tmflags_onephase,
737     &hf_mq_xa_tmflags_fail,
738     &hf_mq_xa_tmflags_resume,
739     &hf_mq_xa_tmflags_success,
740     &hf_mq_xa_tmflags_suspend,
741     &hf_mq_xa_tmflags_startrscan,
742     &hf_mq_xa_tmflags_endrscan,
743     &hf_mq_xa_tmflags_join,
744     NULL
745 };
746 
747 static int hf_mq_msgreq_version = -1;
748 static int hf_mq_msgreq_handle = -1;
749 static int hf_mq_msgreq_RecvBytes = -1;
750 static int hf_mq_msgreq_RqstBytes = -1;
751 static int hf_mq_msgreq_MaxMsgLen = -1;
752 static int hf_mq_msgreq_WaitIntrv = -1;
753 static int hf_mq_msgreq_QueStatus = -1;
754 static int hf_mq_msgreq_RqstFlags = -1;
755 static int hf_mq_msgreq_GlbMsgIdx = -1;
756 static int hf_mq_msgreq_SelectIdx = -1;
757 static int hf_mq_msgreq_MQMDVers = -1;
758 static int hf_mq_msgreq_ccsid = -1;
759 static int hf_mq_msgreq_encoding = -1;
760 static int hf_mq_msgreq_MsgSeqNum = -1;
761 static int hf_mq_msgreq_offset = -1;
762 static int hf_mq_msgreq_mtchMsgId = -1;
763 static int hf_mq_msgreq_mtchCorId = -1;
764 static int hf_mq_msgreq_mtchGrpid = -1;
765 static int hf_mq_msgreq_mtchMsgTk = -1;
766 
767 static int hf_mq_msgreq_flags_selection = -1;
768 static int hf_mq_msgreq_flags_F00000008 = -1;
769 static int hf_mq_msgreq_flags_F00000004 = -1;
770 static int hf_mq_msgreq_flags_F00000002 = -1;
771 static int* const pf_flds_msgreq_flags[] =
772 {
773     &hf_mq_msgreq_flags_selection,
774     &hf_mq_msgreq_flags_F00000008,
775     &hf_mq_msgreq_flags_F00000004,
776     &hf_mq_msgreq_flags_F00000002,
777     NULL
778 };
779 
780 static int hf_mq_msgasy_version = -1;
781 static int hf_mq_msgasy_handle = -1;
782 static int hf_mq_msgasy_MsgIndex = -1;
783 static int hf_mq_msgasy_GlbMsgIdx = -1;
784 static int hf_mq_msgasy_SegLength = -1;
785 static int hf_mq_msgasy_SeleIndex = -1;
786 static int hf_mq_msgasy_SegmIndex = -1;
787 static int hf_mq_msgasy_ReasonCod = -1;
788 static int hf_mq_msgasy_ActMsgLen = -1;
789 static int hf_mq_msgasy_TotMsgLen = -1;
790 static int hf_mq_msgasy_MsgToken = -1;
791 static int hf_mq_msgasy_Status = -1;
792 static int hf_mq_msgasy_resolQNLn = -1;
793 static int hf_mq_msgasy_resolQNme = -1;
794 static int hf_mq_msgasy_padding = -1;
795 
796 static int hf_mq_notif_vers = -1;
797 static int hf_mq_notif_handle = -1;
798 static int hf_mq_notif_code = -1;
799 static int hf_mq_notif_value = -1;
800 
801 static int hf_mq_head_StructID = -1;
802 static int hf_mq_head_version = -1;
803 static int hf_mq_head_length = -1;
804 static int hf_mq_head_encoding = -1;
805 static int hf_mq_head_ccsid = -1;
806 static int hf_mq_head_format = -1;
807 static int hf_mq_head_flags = -1;
808 static int hf_mq_head_struct = -1;
809 
810 static int hf_mq_dh_flags_newmsgid = -1;
811 static int* const pf_flds_dh_flags[] =
812 {
813     &hf_mq_dh_flags_newmsgid,
814     NULL
815 };
816 static int hf_mq_dh_putmsgrecfld = -1;
817 static int hf_mq_dh_recspresent = -1;
818 static int hf_mq_dh_objrecofs = -1;
819 static int hf_mq_dh_putmsgrecofs = -1;
820 
821 static int hf_mq_iih_flags_passexpir = -1;
822 static int hf_mq_iih_flags_replyfmtnone = -1;
823 static int hf_mq_iih_flags_ignorepurg = -1;
824 static int hf_mq_iih_flags_cmqrqstresp = -1;
825 static int* const pf_flds_iih_flags[] =
826 {
827     &hf_mq_iih_flags_cmqrqstresp,
828     &hf_mq_iih_flags_ignorepurg,
829     &hf_mq_iih_flags_replyfmtnone,
830     &hf_mq_iih_flags_passexpir,
831     NULL
832 };
833 static int hf_mq_iih_ltermoverride = -1;
834 static int hf_mq_iih_mfsmapname = -1;
835 static int hf_mq_iih_replytofmt = -1;
836 static int hf_mq_iih_authenticator = -1;
837 static int hf_mq_iih_transinstid = -1;
838 static int hf_mq_iih_transstate = -1;
839 static int hf_mq_iih_commimode = -1;
840 static int hf_mq_iih_securityscope = -1;
841 static int hf_mq_iih_reserved = -1;
842 
843 static int hf_mq_ims_ll = -1;
844 static int hf_mq_ims_zz = -1;
845 static int hf_mq_ims_trx = -1;
846 static int hf_mq_ims_data = -1;
847 
848 static int hf_mq_tm_StructID = -1;
849 static int hf_mq_tm_version = -1;
850 static int hf_mq_tm_QName = -1;
851 static int hf_mq_tm_ProcessNme = -1;
852 static int hf_mq_tm_TriggerData = -1;
853 static int hf_mq_tm_ApplType = -1;
854 static int hf_mq_tm_ApplId = -1;
855 static int hf_mq_tm_EnvData = -1;
856 static int hf_mq_tm_UserData = -1;
857 
858 static int hf_mq_tmc2_StructID = -1;
859 static int hf_mq_tmc2_version = -1;
860 static int hf_mq_tmc2_QName = -1;
861 static int hf_mq_tmc2_ProcessNme = -1;
862 static int hf_mq_tmc2_TriggerData = -1;
863 static int hf_mq_tmc2_ApplType = -1;
864 static int hf_mq_tmc2_ApplId = -1;
865 static int hf_mq_tmc2_EnvData = -1;
866 static int hf_mq_tmc2_UserData = -1;
867 static int hf_mq_tmc2_QMgrName = -1;
868 
869 static int hf_mq_cih_flags_synconret = -1;
870 static int hf_mq_cih_flags_replywonulls = -1;
871 static int hf_mq_cih_flags_passexpir = -1;
872 static int* const pf_flds_cih_flags[] =
873 {
874     &hf_mq_cih_flags_synconret,
875     &hf_mq_cih_flags_replywonulls,
876     &hf_mq_cih_flags_passexpir,
877     NULL
878 };
879 static int hf_mq_cih_returncode = -1;
880 static int hf_mq_cih_compcode = -1;
881 static int hf_mq_cih_reasoncode = -1;
882 static int hf_mq_cih_uowcontrols = -1;
883 static int hf_mq_cih_getwaitintv = -1;
884 static int hf_mq_cih_linktype = -1;
885 static int hf_mq_cih_outdatalen = -1;
886 static int hf_mq_cih_facilkeeptime = -1;
887 static int hf_mq_cih_adsdescriptor = -1;
888 static int hf_mq_cih_converstask = -1;
889 static int hf_mq_cih_taskendstatus = -1;
890 static int hf_mq_cih_bridgefactokn = -1;
891 static int hf_mq_cih_function = -1;
892 static int hf_mq_cih_abendcode = -1;
893 static int hf_mq_cih_authenticator = -1;
894 static int hf_mq_cih_reserved = -1;
895 static int hf_mq_cih_replytofmt = -1;
896 static int hf_mq_cih_remotesysid = -1;
897 static int hf_mq_cih_remotetransid = -1;
898 static int hf_mq_cih_transactionid = -1;
899 static int hf_mq_cih_facilitylike = -1;
900 static int hf_mq_cih_attentionid = -1;
901 static int hf_mq_cih_startcode = -1;
902 static int hf_mq_cih_cancelcode = -1;
903 static int hf_mq_cih_nexttransid = -1;
904 static int hf_mq_cih_reserved2 = -1;
905 static int hf_mq_cih_reserved3 = -1;
906 static int hf_mq_cih_cursorpos = -1;
907 static int hf_mq_cih_erroroffset = -1;
908 static int hf_mq_cih_inputitem = -1;
909 static int hf_mq_cih_reserved4 = -1;
910 
911 static int hf_mq_rfh_ccsid = -1;
912 static int hf_mq_rfh_length = -1;
913 static int hf_mq_rfh_string = -1;
914 
915 static int hf_mq_rmh_flags_last = -1;
916 static int* const pf_flds_rmh_flags[] =
917 {
918     &hf_mq_rmh_flags_last,
919     NULL
920 };
921 static int hf_mq_rmh_objecttype = -1;
922 static int hf_mq_rmh_objectinstid = -1;
923 static int hf_mq_rmh_srcenvlen = -1;
924 static int hf_mq_rmh_srcenvofs = -1;
925 static int hf_mq_rmh_srcnamelen = -1;
926 static int hf_mq_rmh_srcnameofs = -1;
927 static int hf_mq_rmh_dstenvlen = -1;
928 static int hf_mq_rmh_dstenvofs = -1;
929 static int hf_mq_rmh_dstnamelen = -1;
930 static int hf_mq_rmh_dstnameofs = -1;
931 static int hf_mq_rmh_datalogiclen = -1;
932 static int hf_mq_rmh_datalogicofsl = -1;
933 static int hf_mq_rmh_datalogicofsh = -1;
934 
935 static int hf_mq_wih_servicename = -1;
936 static int hf_mq_wih_servicestep = -1;
937 static int hf_mq_wih_msgtoken = -1;
938 static int hf_mq_wih_reserved = -1;
939 
940 static gint ett_mq = -1;
941 static gint ett_mq_tsh = -1;
942 static gint ett_mq_tsh_tcf = -1;
943 static gint ett_mq_tsh_tcf2 = -1;
944 static gint ett_mq_api = -1;
945 static gint ett_mq_socket = -1;
946 static gint ett_mq_caut = -1;
947 static gint ett_mq_msh = -1;
948 static gint ett_mq_xqh = -1;
949 static gint ett_mq_id = -1;
950 static gint ett_mq_id_cf1 = -1;
951 static gint ett_mq_id_cf2 = -1;
952 static gint ett_mq_id_cf3 = -1;
953 static gint ett_mq_id_ecf1 = -1;
954 static gint ett_mq_id_ecf2 = -1;
955 static gint ett_mq_id_ecf3 = -1;
956 static gint ett_mq_id_ief1 = -1;
957 static gint ett_mq_id_ief2 = -1;
958 static gint ett_mq_uid = -1;
959 static gint ett_mq_conn = -1;
960 static gint ett_mq_fcno = -1;
961 static gint ett_mq_msg = -1;
962 static gint ett_mq_inq = -1;
963 static gint ett_mq_spi = -1;
964 static gint ett_mq_spi_base = -1; /* Factorisation of common SPI items */
965 static gint ett_mq_spi_options = -1;
966 static gint ett_mq_put = -1;
967 static gint ett_mq_open = -1;
968 static gint ett_mq_open_option = -1;
969 static gint ett_mq_close_option = -1;
970 static gint ett_mq_fopa = -1;
971 static gint ett_mq_fcmi = -1;
972 static gint ett_mq_ping = -1;
973 static gint ett_mq_reset = -1;
974 static gint ett_mq_status = -1;
975 static gint ett_mq_od = -1;
976 static gint ett_mq_od_objstr = -1;
977 static gint ett_mq_od_selstr = -1;
978 static gint ett_mq_od_resobjstr = -1;
979 static gint ett_mq_or = -1;
980 static gint ett_mq_rr = -1;
981 static gint ett_mq_pmr = -1;
982 static gint ett_mq_md = -1;
983 static gint ett_mq_dlh = -1;
984 static gint ett_mq_dh = -1;
985 static gint ett_mq_gmo = -1;
986 static gint ett_mq_gmo_option = -1;
987 static gint ett_mq_gmo_matchoption = -1;
988 static gint ett_mq_pmo = -1;
989 static gint ett_mq_pmo_option = -1;
990 static gint ett_mq_rfh_ValueName = -1;
991 static gint ett_mq_msgreq_RqstFlags = -1;
992 
993 static gint ett_mq_lpoo = -1;
994 static gint ett_mq_lpoo_lpiopts = -1;
995 
996 static gint ett_mq_head = -1; /* Factorisation of common Header structure items (DH, MDE, CIH, IIH, RFH, RMH, WIH, TM, TMC2 */
997 static gint ett_mq_head_flags = -1;
998 static gint ett_mq_ims = -1;
999 
1000 static gint ett_mq_xa = -1;
1001 static gint ett_mq_xa_tmflags = -1;
1002 static gint ett_mq_xa_xid = -1;
1003 static gint ett_mq_xa_info = -1;
1004 static gint ett_mq_charv = -1;
1005 static gint ett_mq_reassemb = -1;
1006 static gint ett_mq_notif = -1;
1007 
1008 static gint ett_mq_structid = -1;
1009 
1010 static expert_field ei_mq_reassembly_error = EI_INIT;
1011 
1012 static dissector_handle_t mq_handle;
1013 static dissector_handle_t mq_spx_handle;
1014 static dissector_handle_t mqpcf_handle;
1015 
1016 static heur_dissector_list_t mq_heur_subdissector_list;
1017 
1018 static gboolean mq_desegment = TRUE;
1019 static gboolean mq_reassembly = TRUE;
1020 
1021 static gboolean mq_in_reassembly = FALSE;
1022 
1023 static reassembly_table mq_reassembly_table;
1024 
1025 DEF_VALSB(notifcode)
1026 /*  1*/ DEF_VALS2(NC_GET_INHIBITED, "GET_INHIBITED"),
1027 /*  2*/ DEF_VALS2(NC_GET_ALLOWED, "GET_ALLOWED"),
1028 /*  3*/ DEF_VALS2(NC_CONN_STATE, "CONN_STATE"),
1029 /*  4*/ DEF_VALS2(NC_CONN_STATE_REPLY, "CONN_STATE_REPLY"),
1030 /*  5*/ DEF_VALS2(NC_Q_STATE, "Q_STATE"),
1031 /*  6*/ DEF_VALS2(NC_Q_STATE_REPLY, "Q_STATE_REPLY"),
1032 /*  7*/ DEF_VALS2(NC_QM_QUIESCING, "QM_QUIESCING"),
1033 /*  8*/ DEF_VALS2(NC_TXN_ALLOWED, "TXN_ALLOWED"),
1034 /*  9*/ DEF_VALS2(NC_TXN_REVOKE, "TXN_REVOKE"),
1035 /* 10*/ DEF_VALS2(NC_TXN_REVOKE_REPLY, "TXN_REVOKE_REPLY"),
1036 /* 11*/ DEF_VALS2(NC_CHECK_MSG, "CHECK_MSG"),
1037 /* 12*/ DEF_VALS2(NC_BROWSE_FIRST, "BROWSE_FIRST"),
1038 /* 13*/ DEF_VALS2(NC_MESSAGE_TOO_LARGE, "MESSAGE_TOO_LARGE"),
1039 /* 14*/ DEF_VALS2(NC_STREAMING_FAILURE, "STREAMING_FAILURE"),
1040 /* 15*/ DEF_VALS2(NC_CLIENT_ASYNC_EMPTY, "CLIENT_ASYNC_EMPTY"),
1041 /* 16*/ DEF_VALS2(NC_STREAMING_TXN_PAUSED, "STREAMING_TXN_PAUSED"),
1042 /* 17*/ DEF_VALS2(NC_RECONNECTION_COMPLETE, "RECONNECTION_COMPLETE"),
1043 DEF_VALSE;
1044 
1045 DEF_VALSB(spi_verbs)
1046 /*  1*/ DEF_VALS2(SPI_QUERY, "QUERY"),
1047 /*  2*/ DEF_VALS2(SPI_PUT, "PUT"),
1048 /*  3*/ DEF_VALS2(SPI_GET, "GET"),
1049 /*  4*/ DEF_VALS2(SPI_ACTIVATE, "ACTIVATE"),
1050 /*  5*/ DEF_VALS2(SPI_SYNCHPOINT, "SYNCHPOINT"),
1051 /*  6*/ DEF_VALS2(SPI_RESERVE, "RESERVE"),
1052 /*  7*/ DEF_VALS2(SPI_SUBSCRIBE, "SUBSCRIBE"),
1053 /* 11*/ DEF_VALS2(SPI_NOTIFY, "NOTIFY"),
1054 /* 12*/ DEF_VALS2(SPI_OPEN, "OPEN"),
1055 DEF_VALSE;
1056 
1057 DEF_VALSB(spi_activate)
1058 /* 1*/ DEF_VALS2(SPI_ACTIVATE_ENABLE, "ENABLE"),
1059 /* 2*/ DEF_VALS2(SPI_ACTIVATE_DISABLE, "DISABLE"),
1060 DEF_VALSE;
1061 
1062 DEF_VALSB(status)
1063 /*    1*/ DEF_VALS2(STATUS_ERR_NO_CHANNEL, "NO_CHANNEL"),
1064 /*    2*/ DEF_VALS2(STATUS_ERR_CHANNEL_WRONG_TYPE, "CHANNEL_WRONG_TYPE"),
1065 /*    3*/ DEF_VALS2(STATUS_ERR_QM_UNAVAILABLE, "QM_UNAVAILABLE"),
1066 /*    4*/ DEF_VALS2(STATUS_ERR_MSG_SEQUENCE_ERROR, "MSG_SEQUENCE_ERROR"),
1067 /*    5*/ DEF_VALS2(STATUS_ERR_QM_TERMINATING, "QM_TERMINATING"),
1068 /*    6*/ DEF_VALS2(STATUS_ERR_CAN_NOT_STORE, "CAN_NOT_STORE"),
1069 /*    7*/ DEF_VALS2(STATUS_ERR_USER_CLOSED, "USER_CLOSED"),
1070 /*   10*/ DEF_VALS2(STATUS_ERR_PROTOCOL_SEGMENT_TYPE, "REMOTE_PROTOCOL_ERROR"),
1071 /*   11*/ DEF_VALS2(STATUS_ERR_PROTOCOL_LENGTH_ERROR, "BIND_FAILED"),
1072 /*   12*/ DEF_VALS2(STATUS_ERR_PROTOCOL_INVALID_DATA, "MSGWRAP_DIFFERENT"),
1073 /*   14*/ DEF_VALS2(STATUS_ERR_PROTOCOL_ID_ERROR, "REMOTE_CHANNEL_UNAVAILABLE"),
1074 /*   15*/ DEF_VALS2(STATUS_ERR_PROTOCOL_MSH_ERROR, "TERMINATED_BY_REMOTE_EXIT"),
1075 /*   16*/ DEF_VALS2(STATUS_ERR_PROTOCOL_GENERAL, "PROTOCOL_GENERAL"),
1076 /*   17*/ DEF_VALS2(STATUS_ERR_BATCH_FAILURE, "BATCH_FAILURE"),
1077 /*   18*/ DEF_VALS2(STATUS_ERR_MESSAGE_LENGTH_ERROR, "MESSAGE_LENGTH_ERROR"),
1078 /*   19*/ DEF_VALS2(STATUS_ERR_SEGMENT_NUMBER_ERROR, "SEGMENT_NUMBER_ERROR"),
1079 /*   20*/ DEF_VALS2(STATUS_ERR_SECURITY_FAILURE, "SECURITY_FAILURE"),
1080 /*   21*/ DEF_VALS2(STATUS_ERR_WRAP_VALUE_ERROR, "WRAP_VALUE_ERROR"),
1081 /*   22*/ DEF_VALS2(STATUS_ERR_CHANNEL_UNAVAILABLE, "CHANNEL_UNAVAILABLE"),
1082 /*   23*/ DEF_VALS2(STATUS_ERR_CLOSED_BY_EXIT, "CLOSED_BY_EXIT"),
1083 /*   24*/ DEF_VALS2(STATUS_ERR_CIPHER_SPEC, "CIPHER_SPEC"),
1084 /*   25*/ DEF_VALS2(STATUS_ERR_PEER_NAME, "PEER_NAME"),
1085 /*   26*/ DEF_VALS2(STATUS_ERR_SSL_CLIENT_CERTIFICATE, "SSL_CLIENT_CERTIFICATE"),
1086 /*   27*/ DEF_VALS2(STATUS_ERR_RMT_RSRCS_IN_RECOVERY, "RMT_RSRCS_IN_RECOVERY"),
1087 /*   28*/ DEF_VALS2(STATUS_ERR_SSL_REFRESHING, "SSL_REFRESHING"),
1088 /*   29*/ DEF_VALS2(STATUS_ERR_INVALID_HOBJ, "INVALID_HOBJ"),
1089 /*   30*/ DEF_VALS2(STATUS_ERR_CONV_ID_ERROR, "CONV_ID_ERROR"),
1090 /*   31*/ DEF_VALS2(STATUS_ERR_SOCKET_ACTION_TYPE, "SOCKET_ACTION_TYPE"),
1091 /*   32*/ DEF_VALS2(STATUS_ERR_STANDBY_Q_MGR, "STANDBY_Q_MGR"),
1092 /*  240*/ DEF_VALS2(STATUS_ERR_CCSID_NOT_SUPPORTED, "CCSID_NOT_SUPPORTED"),
1093 /*  241*/ DEF_VALS2(STATUS_ERR_ENCODING_INVALID, "ENCODING_INVALID"),
1094 /*  242*/ DEF_VALS2(STATUS_ERR_FAP_LEVEL, "FAP_LEVEL"),
1095 /*  243*/ DEF_VALS2(STATUS_ERR_NEGOTIATION_FAILED, "NEGOTIATION_FAILED"),
1096 DEF_VALSE;
1097 DEF_VALS_EXTB(status);
1098 
1099 DEF_VALSB(opcode)
1100 /*    1*/ DEF_VALS2(TST_INITIAL, "INITIAL_DATA"),
1101 /*    2*/ DEF_VALS2(TST_RESYNC, "RESYNC_DATA"),
1102 /*    3*/ DEF_VALS2(TST_RESET, "RESET_DATA"),
1103 /*    4*/ DEF_VALS2(TST_MESSAGE, "MESSAGE_DATA"),
1104 /*    5*/ DEF_VALS2(TST_STATUS, "STATUS_DATA"),
1105 /*    6*/ DEF_VALS2(TST_SECURITY, "SECURITY_DATA"),
1106 /*    7*/ DEF_VALS2(TST_PING, "PING_DATA"),
1107 /*    8*/ DEF_VALS2(TST_USERID, "USERID_DATA"),
1108 /*    9*/ DEF_VALS2(TST_HEARTBEAT, "HEARTBEAT"),
1109 /*   10*/ DEF_VALS2(TST_CONAUTH_INFO, "CONAUTH_INFO"),
1110 /*   11*/ DEF_VALS2(TST_RENEGOTIATE_DATA, "RENEGOTIATE_DATA"),
1111 /*   12*/ DEF_VALS2(TST_SOCKET_ACTION, "SOCKET_ACTION"),
1112 /*   13*/ DEF_VALS2(TST_ASYNC_MESSAGE, "ASYNC_MESSAGE"),
1113 /*   14*/ DEF_VALS2(TST_REQUEST_MSGS, "REQUEST_MSGS"),
1114 /*   15*/ DEF_VALS2(TST_NOTIFICATION, "NOTIFICATION"),
1115 /*  129*/ DEF_VALS2(TST_MQCONN, "MQCONN"),
1116 /*  130*/ DEF_VALS2(TST_MQDISC, "MQDISC"),
1117 /*  131*/ DEF_VALS2(TST_MQOPEN, "MQOPEN"),
1118 /*  132*/ DEF_VALS2(TST_MQCLOSE, "MQCLOSE"),
1119 /*  133*/ DEF_VALS2(TST_MQGET, "MQGET"),
1120 /*  134*/ DEF_VALS2(TST_MQPUT, "MQPUT"),
1121 /*  135*/ DEF_VALS2(TST_MQPUT1, "MQPUT1"),
1122 /*  136*/ DEF_VALS2(TST_MQSET, "MQSET"),
1123 /*  137*/ DEF_VALS2(TST_MQINQ, "MQINQ"),
1124 /*  138*/ DEF_VALS2(TST_MQCMIT, "MQCMIT"),
1125 /*  139*/ DEF_VALS2(TST_MQBACK, "MQBACK"),
1126 /*  140*/ DEF_VALS2(TST_SPI, "SPI"),
1127 /*  141*/ DEF_VALS2(TST_MQSTAT, "MQSTAT"),
1128 /*  142*/ DEF_VALS2(TST_MQSUB, "MQSUB"),
1129 /*  143*/ DEF_VALS2(TST_MQSUBRQ, "MQSUBRQ"),
1130 /*  145*/ DEF_VALS2(TST_MQCONN_REPLY, "MQCONN_REPLY"),
1131 /*  146*/ DEF_VALS2(TST_MQDISC_REPLY, "MQDISC_REPLY"),
1132 /*  147*/ DEF_VALS2(TST_MQOPEN_REPLY, "MQOPEN_REPLY"),
1133 /*  148*/ DEF_VALS2(TST_MQCLOSE_REPLY, "MQCLOSE_REPLY"),
1134 /*  149*/ DEF_VALS2(TST_MQGET_REPLY, "MQGET_REPLY"),
1135 /*  150*/ DEF_VALS2(TST_MQPUT_REPLY, "MQPUT_REPLY"),
1136 /*  151*/ DEF_VALS2(TST_MQPUT1_REPLY, "MQPUT1_REPLY"),
1137 /*  152*/ DEF_VALS2(TST_MQSET_REPLY, "MQSET_REPLY"),
1138 /*  153*/ DEF_VALS2(TST_MQINQ_REPLY, "MQINQ_REPLY"),
1139 /*  154*/ DEF_VALS2(TST_MQCMIT_REPLY, "MQCMIT_REPLY"),
1140 /*  155*/ DEF_VALS2(TST_MQBACK_REPLY, "MQBACK_REPLY"),
1141 /*  156*/ DEF_VALS2(TST_SPI_REPLY, "SPI_REPLY"),
1142 /*  157*/ DEF_VALS2(TST_MQSTAT_REPLY, "MQSTAT_REPLY"),
1143 /*  158*/ DEF_VALS2(TST_MQSUB_REPLY, "MQSUB_REPLY"),
1144 /*  159*/ DEF_VALS2(TST_MQSUBRQ_REPLY, "MQSUBRQ_REPLY"),
1145 /*  161*/ DEF_VALS2(TST_XA_START, "XA_START"),
1146 /*  162*/ DEF_VALS2(TST_XA_END, "XA_END"),
1147 /*  163*/ DEF_VALS2(TST_XA_OPEN, "XA_OPEN"),
1148 /*  164*/ DEF_VALS2(TST_XA_CLOSE, "XA_CLOSE"),
1149 /*  165*/ DEF_VALS2(TST_XA_PREPARE, "XA_PREPARE"),
1150 /*  166*/ DEF_VALS2(TST_XA_COMMIT, "XA_COMMIT"),
1151 /*  167*/ DEF_VALS2(TST_XA_ROLLBACK, "XA_ROLLBACK"),
1152 /*  168*/ DEF_VALS2(TST_XA_FORGET, "XA_FORGET"),
1153 /*  169*/ DEF_VALS2(TST_XA_RECOVER, "XA_RECOVER"),
1154 /*  170*/ DEF_VALS2(TST_XA_COMPLETE, "XA_COMPLETE"),
1155 /*  177*/ DEF_VALS2(TST_XA_START_REPLY, "XA_START_REPLY"),
1156 /*  178*/ DEF_VALS2(TST_XA_END_REPLY, "XA_END_REPLY"),
1157 /*  179*/ DEF_VALS2(TST_XA_OPEN_REPLY, "XA_OPEN_REPLY"),
1158 /*  180*/ DEF_VALS2(TST_XA_CLOSE_REPLY, "XA_CLOSE_REPLY"),
1159 /*  181*/ DEF_VALS2(TST_XA_PREPARE_REPLY, "XA_PREPARE_REPLY"),
1160 /*  182*/ DEF_VALS2(TST_XA_COMMIT_REPLY, "XA_COMMIT_REPLY"),
1161 /*  183*/ DEF_VALS2(TST_XA_ROLLBACK_REPLY, "XA_ROLLBACK_REPLY"),
1162 /*  184*/ DEF_VALS2(TST_XA_FORGET_REPLY, "XA_FORGET_REPLY"),
1163 /*  185*/ DEF_VALS2(TST_XA_RECOVER_REPLY, "XA_RECOVER_REPLY"),
1164 /*  186*/ DEF_VALS2(TST_XA_COMPLETE_REPLY, "XA_COMPLETE_REPLY"),
1165 DEF_VALSE;
1166 DEF_VALS_EXTB(opcode);
1167 
1168 DEF_VALSB(xaer)
1169 /*   0*/ DEF_VALS2(XA_OK, "XA_OK"),
1170 /*   3*/ DEF_VALS2(XA_RDONLY, "XA_RDONLY"),
1171 /*   4*/ DEF_VALS2(XA_RETRY, "XA_RETRY"),
1172 /*   5*/ DEF_VALS2(XA_HEURMIX, "XA_HEURMIX"),
1173 /*   6*/ DEF_VALS2(XA_HEURRB, "XA_HEURRB"),
1174 /*   7*/ DEF_VALS2(XA_HEURCOM, "XA_HEURCOM"),
1175 /*   8*/ DEF_VALS2(XA_HEURHAZ, "XA_HEURHAZ"),
1176 /*   9*/ DEF_VALS2(XA_NOMIGRATE, "XA_NOMIGRATE"),
1177 /* 100*/ DEF_VALS2(XA_RBROLLBACK, "XA_RBROLLBACK"),
1178 /* 101*/ DEF_VALS2(XA_RBCOMMFAIL, "XA_RBCOMMFAIL"),
1179 /* 102*/ DEF_VALS2(XA_RBDEADLOCK, "XA_RBDEADLOCK"),
1180 /* 103*/ DEF_VALS2(XA_RBINTEGRITY, "XA_RBINTEGRITY"),
1181 /* 104*/ DEF_VALS2(XA_RBOTHER, "XA_RBOTHER"),
1182 /* 105*/ DEF_VALS2(XA_RBPROTO, "XA_RBPROTO"),
1183 /* 106*/ DEF_VALS2(XA_RBTIMEOUT, "XA_RBTIMEOUT"),
1184 /* 107*/ DEF_VALS2(XA_RBTRANSIENT, "XA_RBTRANSIENT"),
1185 /*  -9*/ DEF_VALS2(XAER_OUTSIDE, "XAER_OUTSIDE"),
1186 /*  -8*/ DEF_VALS2(XAER_DUPID, "XAER_DUPID"),
1187 /*  -7*/ DEF_VALS2(XAER_RMFAIL, "XAER_RMFAIL"),
1188 /*  -6*/ DEF_VALS2(XAER_PROTO, "XAER_PROTO"),
1189 /*  -5*/ DEF_VALS2(XAER_INVAL, "XAER_INVAL"),
1190 /*  -4*/ DEF_VALS2(XAER_NOTA, "XAER_NOTA"),
1191 /*  -3*/ DEF_VALS2(XAER_RMERR, "XAER_RMERR"),
1192 /*  -2*/ DEF_VALS2(XAER_ASYNC, "XAER_ASYNC"),
1193 DEF_VALSE;
1194 
1195 DEF_VALSB(StructID)
1196 /* CAUT*/ DEF_VALS2(STRUCTID_CAUT, MQ_TEXT_CAUT),
1197 /* CIH */ DEF_VALS2(STRUCTID_CIH, MQ_TEXT_CIH),
1198 /* DH  */ DEF_VALS2(STRUCTID_DH, MQ_TEXT_DH),
1199 /* DLH */ DEF_VALS2(STRUCTID_DLH, MQ_TEXT_DLH),
1200 /* FCNO*/ DEF_VALS2(STRUCTID_FCNO, MQ_TEXT_FCNO),
1201 /* FOPA*/ DEF_VALS2(STRUCTID_FOPA, MQ_TEXT_FOPA),
1202 /* GMO */ DEF_VALS2(STRUCTID_GMO, MQ_TEXT_GMO),
1203 /* ID  */ DEF_VALS2(STRUCTID_ID, MQ_TEXT_ID),
1204 /* IIH */ DEF_VALS2(STRUCTID_IIH, MQ_TEXT_IIH),
1205 /* LPOO*/ DEF_VALS2(STRUCTID_LPOO, MQ_TEXT_LPOO),
1206 /* MD  */ DEF_VALS2(STRUCTID_MD, MQ_TEXT_MD),
1207 /* MDE */ DEF_VALS2(STRUCTID_MDE, MQ_TEXT_MDE),
1208 /* MSH */ DEF_VALS2(STRUCTID_MSH, MQ_TEXT_MSH),
1209 /* OD  */ DEF_VALS2(STRUCTID_OD, MQ_TEXT_OD),
1210 /* PMO */ DEF_VALS2(STRUCTID_PMO, MQ_TEXT_PMO),
1211 /* RFH */ DEF_VALS2(STRUCTID_RFH, MQ_TEXT_RFH),
1212 /* RMH */ DEF_VALS2(STRUCTID_RMH, MQ_TEXT_RMH),
1213 /* SPAI*/ DEF_VALS2(STRUCTID_SPAI, MQ_TEXT_SPAI),
1214 /* SPAO*/ DEF_VALS2(STRUCTID_SPAO, MQ_TEXT_SPAO),
1215 /* SPAU*/ DEF_VALS2(STRUCTID_SPAU, MQ_TEXT_SPAU),
1216 /* SPGI*/ DEF_VALS2(STRUCTID_SPGI, MQ_TEXT_SPGI),
1217 /* SPGO*/ DEF_VALS2(STRUCTID_SPGO, MQ_TEXT_SPGO),
1218 /* SPGU*/ DEF_VALS2(STRUCTID_SPGU, MQ_TEXT_SPGU),
1219 /* SPOI*/ DEF_VALS2(STRUCTID_SPOI, MQ_TEXT_SPOI),
1220 /* SPOO*/ DEF_VALS2(STRUCTID_SPOO, MQ_TEXT_SPOO),
1221 /* SPOU*/ DEF_VALS2(STRUCTID_SPOU, MQ_TEXT_SPOU),
1222 /* SPPI*/ DEF_VALS2(STRUCTID_SPPI, MQ_TEXT_SPPI),
1223 /* SPPO*/ DEF_VALS2(STRUCTID_SPPO, MQ_TEXT_SPPO),
1224 /* SPPU*/ DEF_VALS2(STRUCTID_SPPU, MQ_TEXT_SPPU),
1225 /* SPQI*/ DEF_VALS2(STRUCTID_SPQI, MQ_TEXT_SPQI),
1226 /* SPQO*/ DEF_VALS2(STRUCTID_SPQO, MQ_TEXT_SPQO),
1227 /* SPQU*/ DEF_VALS2(STRUCTID_SPQU, MQ_TEXT_SPQU),
1228 /* TM  */ DEF_VALS2(STRUCTID_TM, MQ_TEXT_TM),
1229 /* TMC2*/ DEF_VALS2(STRUCTID_TMC2, MQ_TEXT_TMC2),
1230 /* TSH */ DEF_VALS2(STRUCTID_TSH, MQ_TEXT_TSH),
1231 /* TSHC*/ DEF_VALS2(STRUCTID_TSHC, MQ_TEXT_TSHC),
1232 /* TSHM*/ DEF_VALS2(STRUCTID_TSHM, MQ_TEXT_TSHM),
1233 /* UID */ DEF_VALS2(STRUCTID_UID, MQ_TEXT_UID),
1234 /* WIH */ DEF_VALS2(STRUCTID_WIH, MQ_TEXT_WIH),
1235 /* XQH */ DEF_VALS2(STRUCTID_XQH, MQ_TEXT_XQH),
1236 
1237 /* CAUT*/ DEF_VALS2(STRUCTID_CAUT_EBCDIC, MQ_TEXT_CAUT),
1238 /* CIH */ DEF_VALS2(STRUCTID_CIH_EBCDIC, MQ_TEXT_CIH),
1239 /* DH  */ DEF_VALS2(STRUCTID_DH_EBCDIC, MQ_TEXT_DH),
1240 /* DLH */ DEF_VALS2(STRUCTID_DLH_EBCDIC, MQ_TEXT_DLH),
1241 /* FCNO*/ DEF_VALS2(STRUCTID_FCNO_EBCDIC, MQ_TEXT_FCNO),
1242 /* FOPA*/ DEF_VALS2(STRUCTID_FOPA_EBCDIC, MQ_TEXT_FOPA),
1243 /* GMO */ DEF_VALS2(STRUCTID_GMO_EBCDIC, MQ_TEXT_GMO),
1244 /* ID  */ DEF_VALS2(STRUCTID_ID_EBCDIC, MQ_TEXT_ID),
1245 /* IIH */ DEF_VALS2(STRUCTID_IIH_EBCDIC, MQ_TEXT_IIH),
1246 /* LPOO*/ DEF_VALS2(STRUCTID_LPOO_EBCDIC, MQ_TEXT_LPOO),
1247 /* MD  */ DEF_VALS2(STRUCTID_MD_EBCDIC, MQ_TEXT_MD),
1248 /* MDE */ DEF_VALS2(STRUCTID_MDE_EBCDIC, MQ_TEXT_MDE),
1249 /* OD  */ DEF_VALS2(STRUCTID_OD_EBCDIC, MQ_TEXT_OD),
1250 /* PMO */ DEF_VALS2(STRUCTID_PMO_EBCDIC, MQ_TEXT_PMO),
1251 /* RFH */ DEF_VALS2(STRUCTID_RFH_EBCDIC, MQ_TEXT_RFH),
1252 /* RMH */ DEF_VALS2(STRUCTID_RMH_EBCDIC, MQ_TEXT_RMH),
1253 /* SPAI*/ DEF_VALS2(STRUCTID_SPAI_EBCDIC, MQ_TEXT_SPAI),
1254 /* SPAO*/ DEF_VALS2(STRUCTID_SPAO_EBCDIC, MQ_TEXT_SPAO),
1255 /* SPAU*/ DEF_VALS2(STRUCTID_SPAU_EBCDIC, MQ_TEXT_SPAU),
1256 /* SPGI*/ DEF_VALS2(STRUCTID_SPGI_EBCDIC, MQ_TEXT_SPGI),
1257 /* SPGO*/ DEF_VALS2(STRUCTID_SPGO_EBCDIC, MQ_TEXT_SPGO),
1258 /* SPGU*/ DEF_VALS2(STRUCTID_SPGU_EBCDIC, MQ_TEXT_SPGU),
1259 /* SPOI*/ DEF_VALS2(STRUCTID_SPOI_EBCDIC, MQ_TEXT_SPOI),
1260 /* SPOO*/ DEF_VALS2(STRUCTID_SPOO_EBCDIC, MQ_TEXT_SPOO),
1261 /* SPOU*/ DEF_VALS2(STRUCTID_SPOU_EBCDIC, MQ_TEXT_SPOU),
1262 /* SPPI*/ DEF_VALS2(STRUCTID_SPPI_EBCDIC, MQ_TEXT_SPPI),
1263 /* SPPO*/ DEF_VALS2(STRUCTID_SPPO_EBCDIC, MQ_TEXT_SPPO),
1264 /* SPPU*/ DEF_VALS2(STRUCTID_SPPU_EBCDIC, MQ_TEXT_SPPU),
1265 /* SPQI*/ DEF_VALS2(STRUCTID_SPQI_EBCDIC, MQ_TEXT_SPQI),
1266 /* SPQO*/ DEF_VALS2(STRUCTID_SPQO_EBCDIC, MQ_TEXT_SPQO),
1267 /* SPQU*/ DEF_VALS2(STRUCTID_SPQU_EBCDIC, MQ_TEXT_SPQU),
1268 /* TM  */ DEF_VALS2(STRUCTID_TM_EBCDIC, MQ_TEXT_TM),
1269 /* TMC2*/ DEF_VALS2(STRUCTID_TMC2_EBCDIC, MQ_TEXT_TMC2),
1270 /* TSH */ DEF_VALS2(STRUCTID_TSH_EBCDIC, MQ_TEXT_TSH),
1271 /* TSHC*/ DEF_VALS2(STRUCTID_TSHC_EBCDIC, MQ_TEXT_TSHC),
1272 /* TSHM*/ DEF_VALS2(STRUCTID_TSHM_EBCDIC, MQ_TEXT_TSHM),
1273 /* UID */ DEF_VALS2(STRUCTID_UID_EBCDIC, MQ_TEXT_UID),
1274 /* WIH */ DEF_VALS2(STRUCTID_WIH_EBCDIC, MQ_TEXT_WIH),
1275 /* XQH */ DEF_VALS2(STRUCTID_XQH_EBCDIC, MQ_TEXT_XQH),
1276 DEF_VALSE;
1277 DEF_VALS_EXTB(StructID);
1278 
1279 DEF_VALSB(byteorder)
1280 /* 1*/ DEF_VALS2(BIG_ENDIAN, "Big endian"),
1281 /* 2*/ DEF_VALS2(LITTLE_ENDIAN, "Little endian"),
1282 DEF_VALSE;
1283 
1284 DEF_VALSB(conn_options)
1285 /* 1*/ DEF_VALS2(CONN_OPTION, "MQCONN"),
1286 /* 3*/ DEF_VALS2(CONNX_OPTION, "MQCONNX"),
1287 DEF_VALSE;
1288 
1289 DEF_VALSB(sidtype)
1290 /* 0*/ DEF_VALS1(MQSIDT_NONE),
1291 /* 1*/ DEF_VALS1(MQSIDT_NT_SECURITY_ID),
1292 /* 2*/ DEF_VALS1(MQSIDT_WAS_SECURITY_ID),
1293 DEF_VALSE;
1294 
dissect_mq_encoding(proto_tree * tree,int hfindex,tvbuff_t * tvb,const gint start,gint length,const guint encoding)1295 static gint dissect_mq_encoding(proto_tree* tree, int hfindex, tvbuff_t* tvb, const gint start, gint length, const guint encoding)
1296 {
1297     gchar  sEnc[128] = "";
1298     gchar* pEnc;
1299     guint  uEnc;
1300 
1301     if (length == 2)
1302     {
1303         uEnc = (gint)tvb_get_guint16(tvb, start, encoding);
1304     }
1305     else
1306     {
1307         uEnc = tvb_get_guint32(tvb, start, encoding);
1308     }
1309     pEnc = sEnc;
1310 
1311 #define CHECK_ENC(M, T) ((uEnc & M) == T)
1312 #define DOPRT(A) pEnc += g_snprintf(pEnc, (gulong)(sizeof(sEnc)-1-(pEnc-sEnc)), A);
1313     if (CHECK_ENC(MQ_MQENC_FLOAT_MASK, MQ_MQENC_FLOAT_UNDEFINED))
1314     {
1315         DOPRT("FLT_UNDEFINED");
1316     }
1317     else if (CHECK_ENC(MQ_MQENC_FLOAT_MASK, MQ_MQENC_FLOAT_IEEE_NORMAL))
1318     {
1319         DOPRT("FLT_IEEE_NORMAL");
1320     }
1321     else if (CHECK_ENC(MQ_MQENC_FLOAT_MASK, MQ_MQENC_FLOAT_IEEE_REVERSED))
1322     {
1323         DOPRT("FLT_IEEE_REVERSED");
1324     }
1325     else if (CHECK_ENC(MQ_MQENC_FLOAT_MASK, MQ_MQENC_FLOAT_S390))
1326     {
1327         DOPRT("FLT_S390");
1328     }
1329     else if (CHECK_ENC(MQ_MQENC_FLOAT_MASK, MQ_MQENC_FLOAT_TNS))
1330     {
1331         DOPRT("FLT_TNS");
1332     }
1333     else
1334     {
1335         DOPRT("FLT_UNKNOWN");
1336     }
1337 
1338     DOPRT("/");
1339     if (CHECK_ENC(MQ_MQENC_DECIMAL_MASK, MQ_MQENC_DECIMAL_UNDEFINED))
1340     {
1341         DOPRT("DEC_UNDEFINED");
1342     }
1343     else if (CHECK_ENC(MQ_MQENC_DECIMAL_MASK, MQ_MQENC_DECIMAL_NORMAL))
1344     {
1345         DOPRT("DEC_NORMAL");
1346     }
1347     else if (CHECK_ENC(MQ_MQENC_DECIMAL_MASK, MQ_MQENC_DECIMAL_REVERSED))
1348     {
1349         DOPRT("DEC_REVERSED");
1350     }
1351     else
1352     {
1353         DOPRT("DEC_UNKNOWN");
1354     }
1355 
1356     DOPRT("/");
1357     if (CHECK_ENC(MQ_MQENC_INTEGER_MASK, MQ_MQENC_INTEGER_UNDEFINED))
1358     {
1359         DOPRT("INT_UNDEFINED");
1360     }
1361     else if (CHECK_ENC(MQ_MQENC_INTEGER_MASK, MQ_MQENC_INTEGER_NORMAL))
1362     {
1363         DOPRT("INT_NORMAL");
1364     }
1365     else if (CHECK_ENC(MQ_MQENC_INTEGER_MASK, MQ_MQENC_INTEGER_REVERSED))
1366     {
1367         DOPRT("INT_REVERSED");
1368     }
1369     else
1370     {
1371         DOPRT("INT_UNKNOWN");
1372     }
1373 #undef CHECK_ENC
1374 #undef DOPRT
1375 
1376     proto_tree_add_uint_format_value(tree, hfindex, tvb, start, length, uEnc,
1377         "%8x-%d (%s)", uEnc, uEnc, sEnc);
1378 
1379     return length;
1380 }
1381 
dissect_mq_MQMO(tvbuff_t * tvb,proto_tree * mq_tree,gint offset,gint ett_subtree,mq_parm_t * p_mq_parm)1382 static gint dissect_mq_MQMO(tvbuff_t* tvb, proto_tree* mq_tree, gint offset, gint ett_subtree, mq_parm_t* p_mq_parm)
1383 {
1384     guint        uMoOpt;
1385 
1386     uMoOpt = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
1387 
1388     if (uMoOpt == 0)
1389     {
1390         proto_item* ti;
1391         proto_tree* mq_tree_sub;
1392         ti = proto_tree_add_item(mq_tree, hf_mq_gmo_matchoptions, tvb, offset, 4, p_mq_parm->mq_int_enc); /* ENC_BIG_ENDIAN); */
1393         mq_tree_sub = proto_item_add_subtree(ti, ett_subtree);
1394         proto_tree_add_subtree_format(mq_tree_sub, tvb, offset, 4, ett_subtree, NULL, MQ_TEXT_MQMO_NONE);
1395     }
1396     else
1397     {
1398         proto_tree_add_bitmask(mq_tree, tvb, offset, hf_mq_gmo_matchoptions, ett_subtree, pf_flds_mtchopt, p_mq_parm->mq_int_enc);
1399     }
1400     return 4;
1401 }
dissect_mq_LPOO_LPIOPTS(tvbuff_t * tvb,proto_tree * mq_tree,gint offset,gint ett_subtree,mq_parm_t * p_mq_parm)1402 static gint dissect_mq_LPOO_LPIOPTS(tvbuff_t* tvb, proto_tree* mq_tree, gint offset, gint ett_subtree, mq_parm_t* p_mq_parm)
1403 {
1404     guint        uLpiOpts;
1405 
1406     uLpiOpts = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
1407 
1408     if (uLpiOpts == 0)
1409     {
1410         proto_item* ti;
1411         proto_tree* mq_tree_sub;
1412         ti = proto_tree_add_item(mq_tree, hf_mq_lpoo_lpiopts, tvb, offset, 4, p_mq_parm->mq_int_enc);
1413         mq_tree_sub = proto_item_add_subtree(ti, ett_subtree);
1414         proto_tree_add_subtree_format(mq_tree_sub, tvb, offset, 4, ett_subtree, NULL, MQ_TEXT_LPOOOPT_NONE);
1415     }
1416     else
1417     {
1418         proto_tree_add_bitmask(mq_tree, tvb, offset, hf_mq_lpoo_lpiopts, ett_subtree, pf_flds_lpooopt, p_mq_parm->mq_int_enc);
1419     }
1420     return 4;
1421 }
dissect_mq_MQGMO(tvbuff_t * tvb,proto_tree * mq_tree,gint offset,gint ett_subtree,mq_parm_t * p_mq_parm)1422 static gint dissect_mq_MQGMO(tvbuff_t* tvb, proto_tree* mq_tree, gint offset, gint ett_subtree, mq_parm_t* p_mq_parm)
1423 {
1424     guint        uGmoOpt;
1425 
1426     uGmoOpt = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
1427 
1428     if (uGmoOpt == 0)
1429     {
1430         proto_item* ti;
1431         proto_tree* mq_tree_sub;
1432         ti = proto_tree_add_item(mq_tree, hf_mq_gmo_options, tvb, offset, 4, p_mq_parm->mq_int_enc); /* ENC_BIG_ENDIAN); */
1433         mq_tree_sub = proto_item_add_subtree(ti, ett_subtree);
1434         proto_tree_add_subtree_format(mq_tree_sub, tvb, offset, 4, ett_subtree, NULL, MQ_TEXT_MQGMO_NONE);
1435     }
1436     else
1437     {
1438         proto_tree_add_bitmask(mq_tree, tvb, offset, hf_mq_gmo_options, ett_subtree, pf_flds_gmoopt, p_mq_parm->mq_int_enc);
1439     }
1440     return 4;
1441 }
1442 
dissect_mq_MQPMO(tvbuff_t * tvb,proto_tree * mq_tree,gint offset,gint ett_subtree,mq_parm_t * p_mq_parm)1443 static gint dissect_mq_MQPMO(tvbuff_t* tvb, proto_tree* mq_tree, gint offset, gint ett_subtree, mq_parm_t* p_mq_parm)
1444 {
1445     guint        uPmoOpt;
1446 
1447     uPmoOpt = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
1448 
1449     if (uPmoOpt == 0)
1450     {
1451         proto_item* ti;
1452         proto_tree* mq_tree_sub;
1453         ti = proto_tree_add_item(mq_tree, hf_mq_pmo_options, tvb, offset, 4, p_mq_parm->mq_int_enc); /* ENC_BIG_ENDIAN); */
1454         mq_tree_sub = proto_item_add_subtree(ti, ett_subtree);
1455         proto_tree_add_subtree_format(mq_tree_sub, tvb, offset, 4, ett_subtree, NULL, MQ_TEXT_MQPMO_NONE);
1456     }
1457     else
1458     {
1459         proto_tree_add_bitmask(mq_tree, tvb, offset, hf_mq_pmo_options, ett_subtree, pf_flds_pmoopt, p_mq_parm->mq_int_enc);
1460     }
1461     return 4;
1462 }
1463 
dissect_mq_MQOO(tvbuff_t * tvb,proto_tree * mq_tree,gint offset,gint ett_subtree,gint hfindex,mq_parm_t * p_mq_parm)1464 static gint dissect_mq_MQOO(tvbuff_t* tvb, proto_tree* mq_tree, gint offset, gint ett_subtree, gint hfindex, mq_parm_t* p_mq_parm)
1465 {
1466     guint        uOpenOpt;
1467 
1468     uOpenOpt = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
1469 
1470     if (uOpenOpt == 0)
1471     {
1472         proto_item* ti;
1473         proto_tree* mq_tree_sub;
1474         ti = proto_tree_add_item(mq_tree, hfindex, tvb, offset, 4, p_mq_parm->mq_int_enc);
1475         mq_tree_sub = proto_item_add_subtree(ti, ett_subtree);
1476         proto_tree_add_subtree_format(mq_tree_sub, tvb, offset, 4, ett_subtree, NULL, MQ_TEXT_BIND_READAHEAD_AS_Q_DEF);
1477     }
1478     else
1479     {
1480         proto_tree_add_bitmask(mq_tree, tvb, offset, hfindex, ett_subtree, pf_flds_opnopt, p_mq_parm->mq_int_enc);
1481     }
1482     return 4;
1483 }
dissect_mq_MQCO(tvbuff_t * tvb,proto_tree * mq_tree,gint offset,mq_parm_t * p_mq_parm)1484 static gint dissect_mq_MQCO(tvbuff_t* tvb, proto_tree* mq_tree, gint offset, mq_parm_t* p_mq_parm)
1485 {
1486     guint        iCloseOpt;
1487 
1488     iCloseOpt = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
1489 
1490     if (iCloseOpt == 0)
1491     {
1492         proto_item* ti;
1493         proto_tree* mq_tree_sub;
1494         ti = proto_tree_add_item(mq_tree, hf_mq_close_options, tvb, offset, 4, p_mq_parm->mq_int_enc);
1495         mq_tree_sub = proto_item_add_subtree(ti, ett_mq_close_option);
1496         proto_tree_add_subtree_format(mq_tree_sub, tvb, offset, 4, ett_mq_close_option, NULL, MQ_TEXT_IMMEDIATE_NONE);
1497     }
1498     else
1499     {
1500         proto_tree_add_bitmask(mq_tree, tvb, offset, hf_mq_close_options, ett_mq_close_option, pf_flds_clsopt, p_mq_parm->mq_int_enc);
1501     }
1502     return 4;
1503 }
dissect_mq_charv(tvbuff_t * tvb,proto_tree * tree,gint offset,gint iSize,gint idx,const char * pStr,mq_parm_t * p_mq_parm)1504 static gint dissect_mq_charv(tvbuff_t* tvb, proto_tree* tree, gint offset, gint iSize, gint idx, const char* pStr, mq_parm_t* p_mq_parm)
1505 {
1506     proto_tree* mq_tree_sub;
1507     guint32     lStr;
1508     guint32     oStr;
1509     gint32      eStr;
1510     const char* sStr;
1511 
1512     lStr = tvb_get_guint32(tvb, offset + 12, p_mq_parm->mq_int_enc);
1513     oStr = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
1514     eStr = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
1515     if (lStr && oStr)
1516     {
1517         sStr = (const char*)tvb_get_string_enc(wmem_packet_scope(), tvb, oStr, lStr, p_mq_parm->mq_str_enc);
1518     }
1519     else
1520         sStr = NULL;
1521 
1522     mq_tree_sub = proto_tree_add_subtree_format(tree, tvb, offset, iSize, idx, NULL, "%s - %s", pStr, (sStr) ? sStr : "[Empty]");
1523 
1524     proto_tree_add_item(mq_tree_sub, hf_mq_charv_vsptr, tvb, offset, 4, p_mq_parm->mq_int_enc);
1525     proto_tree_add_item(mq_tree_sub, hf_mq_charv_vsoffset, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
1526     proto_tree_add_item(mq_tree_sub, hf_mq_charv_vsbufsize, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
1527     proto_tree_add_item(mq_tree_sub, hf_mq_charv_vslength, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
1528     proto_tree_add_item(mq_tree_sub, hf_mq_charv_vsccsid, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
1529     proto_tree_add_item(mq_tree_sub, hf_mq_charv_vsvalue, tvb, oStr, lStr, IS_EBCDIC(eStr) ? ENC_EBCDIC : ENC_ASCII);
1530 
1531     return 20;
1532 }
dissect_mq_pmr(tvbuff_t * tvb,proto_tree * tree,gint offset,gint iNbrRecords,gint offsetPMR,guint32 recFlags,mq_parm_t * p_mq_parm)1533 static gint dissect_mq_pmr(tvbuff_t* tvb, proto_tree* tree, gint offset, gint iNbrRecords, gint offsetPMR, guint32 recFlags, mq_parm_t* p_mq_parm)
1534 {
1535     gint iSizePMR1 = 0;
1536     gint iSizePMR = 0;
1537 
1538     iSizePMR1 = ((((recFlags & MQ_PMRF_MSG_ID) != 0) * 24)
1539         + (((recFlags & MQ_PMRF_CORREL_ID) != 0) * 24)
1540         + (((recFlags & MQ_PMRF_GROUP_ID) != 0) * 24)
1541         + (((recFlags & MQ_PMRF_FEEDBACK) != 0) * 4)
1542         + (((recFlags & MQ_PMRF_ACCOUNTING_TOKEN) != 0) * 32));
1543 
1544     if (offsetPMR != 0 && iSizePMR1 != 0)
1545     {
1546         iSizePMR = iNbrRecords * iSizePMR1;
1547         if (tvb_reported_length_remaining(tvb, offset) >= iSizePMR)
1548         {
1549             gint iOffsetPMR = 0;
1550             gint iRecord = 0;
1551             for (iRecord = 0; iRecord < iNbrRecords; iRecord++)
1552             {
1553                 proto_tree* mq_tree = proto_tree_add_subtree(tree, tvb, offset + iOffsetPMR, iSizePMR1, ett_mq_pmr, NULL, MQ_TEXT_PMR);
1554                 if ((recFlags & MQ_PMRF_MSG_ID) != 0)
1555                 {
1556                     proto_tree_add_item(mq_tree, hf_mq_pmr_msgid, tvb, offset + iOffsetPMR, 24, ENC_NA);
1557                     iOffsetPMR += 24;
1558                 }
1559                 if ((recFlags & MQ_PMRF_CORREL_ID) != 0)
1560                 {
1561                     proto_tree_add_item(mq_tree, hf_mq_pmr_correlid, tvb, offset + iOffsetPMR, 24, ENC_NA);
1562                     iOffsetPMR += 24;
1563                 }
1564                 if ((recFlags & MQ_PMRF_GROUP_ID) != 0)
1565                 {
1566                     proto_tree_add_item(mq_tree, hf_mq_pmr_groupid, tvb, offset + iOffsetPMR, 24, ENC_NA);
1567                     iOffsetPMR += 24;
1568                 }
1569                 if ((recFlags & MQ_PMRF_FEEDBACK) != 0)
1570                 {
1571                     proto_tree_add_item(mq_tree, hf_mq_pmr_feedback, tvb, offset + iOffsetPMR, 4, p_mq_parm->mq_int_enc);
1572                     iOffsetPMR += 4;
1573                 }
1574                 if ((recFlags & MQ_PMRF_ACCOUNTING_TOKEN) != 0)
1575                 {
1576                     proto_tree_add_item(mq_tree, hf_mq_pmr_acttoken, tvb, offset + iOffsetPMR, 32, ENC_NA);
1577                     iOffsetPMR += 32;
1578                 }
1579             }
1580         }
1581         else iSizePMR = 0;
1582     }
1583     return iSizePMR;
1584 }
dissect_mq_or(tvbuff_t * tvb,proto_tree * tree,gint offset,gint iNbrRecords,gint offsetOR,mq_parm_t * p_mq_parm)1585 static gint dissect_mq_or(tvbuff_t* tvb, proto_tree* tree, gint offset, gint iNbrRecords, gint offsetOR, mq_parm_t* p_mq_parm)
1586 {
1587     gint iSizeOR = 0;
1588     if (offsetOR != 0)
1589     {
1590         iSizeOR = iNbrRecords * 96;
1591         if (tvb_reported_length_remaining(tvb, offset) >= iSizeOR)
1592         {
1593             gint iOffsetOR = 0;
1594             gint iRecord = 0;
1595             for (iRecord = 0; iRecord < iNbrRecords; iRecord++)
1596             {
1597                 proto_tree* mq_tree = proto_tree_add_subtree(tree, tvb, offset + iOffsetOR, 96, ett_mq_or, NULL, MQ_TEXT_OR);
1598                 proto_tree_add_item(mq_tree, hf_mq_or_objname, tvb, offset + iOffsetOR, 48, p_mq_parm->mq_str_enc);
1599                 proto_tree_add_item(mq_tree, hf_mq_or_objqmgrname, tvb, offset + iOffsetOR + 48, 48, p_mq_parm->mq_str_enc);
1600                 iOffsetOR += 96;
1601             }
1602         }
1603         else iSizeOR = 0;
1604     }
1605     return iSizeOR;
1606 }
dissect_mq_rr(tvbuff_t * tvb,proto_tree * tree,gint offset,gint iNbrRecords,gint offsetRR,mq_parm_t * p_mq_parm)1607 static gint dissect_mq_rr(tvbuff_t* tvb, proto_tree* tree, gint offset, gint iNbrRecords, gint offsetRR, mq_parm_t* p_mq_parm)
1608 {
1609     gint iSizeRR = 0;
1610     if (offsetRR != 0)
1611     {
1612         iSizeRR = iNbrRecords * 8;
1613         if (tvb_reported_length_remaining(tvb, offset) >= iSizeRR)
1614         {
1615             gint iOffsetRR = 0;
1616             gint iRecord = 0;
1617             for (iRecord = 0; iRecord < iNbrRecords; iRecord++)
1618             {
1619                 proto_tree* mq_tree = proto_tree_add_subtree(tree, tvb, offset + iOffsetRR, 8, ett_mq_rr, NULL, MQ_TEXT_RR);
1620                 proto_tree_add_item(mq_tree, hf_mq_rr_compcode, tvb, offset + iOffsetRR, 4, p_mq_parm->mq_int_enc);
1621                 proto_tree_add_item(mq_tree, hf_mq_rr_reascode, tvb, offset + iOffsetRR + 4, 4, p_mq_parm->mq_int_enc);
1622                 iOffsetRR += 8;
1623             }
1624         }
1625         else iSizeRR = 0;
1626     }
1627     return iSizeRR;
1628 }
dissect_mq_gmo(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,mq_parm_t * p_mq_parm)1629 static gint dissect_mq_gmo(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, gint offset, mq_parm_t* p_mq_parm)
1630 {
1631     gint iSize = 0;
1632 
1633     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
1634     if (p_mq_parm->mq_strucID == MQ_STRUCTID_GMO || p_mq_parm->mq_strucID == MQ_STRUCTID_GMO_EBCDIC)
1635     {
1636         guint32 iVersion = 0;
1637         iVersion = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
1638         /* Compute length according to version */
1639         switch (iVersion)
1640         {
1641             case 1: iSize = 72; break;
1642             case 2: iSize = 80; break;
1643             case 3: iSize = 100; break;
1644             case 4: iSize = 112; break;
1645         }
1646 
1647         if (iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
1648         {
1649             guint8* sQueue;
1650             sQueue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 24, 48, p_mq_parm->mq_str_enc);
1651             if (strip_trailing_blanks(sQueue, 48) > 0)
1652             {
1653                 if (pinfo)
1654                     col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
1655             }
1656 
1657             if (tree)
1658             {
1659                 proto_tree* mq_tree;
1660 
1661                 mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSize, ett_mq_gmo, NULL, MQ_TEXT_GMO);
1662 
1663                 proto_tree_add_item(mq_tree, hf_mq_gmo_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
1664                 proto_tree_add_item(mq_tree, hf_mq_gmo_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
1665 
1666                 dissect_mq_MQGMO(tvb, mq_tree, offset + 8, ett_mq_gmo_option, p_mq_parm);
1667 
1668                 proto_tree_add_item(mq_tree, hf_mq_gmo_waitinterval, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
1669                 proto_tree_add_item(mq_tree, hf_mq_gmo_signal1, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
1670                 proto_tree_add_item(mq_tree, hf_mq_gmo_signal2, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
1671                 proto_tree_add_item(mq_tree, hf_mq_gmo_resolvqname, tvb, offset + 24, 48, p_mq_parm->mq_str_enc);
1672 
1673                 if (iVersion >= 2)
1674                 {
1675                     dissect_mq_MQMO(tvb, mq_tree, offset + 72, ett_mq_gmo_matchoption, p_mq_parm);
1676 
1677                     proto_tree_add_item(mq_tree, hf_mq_gmo_groupstatus, tvb, offset + 76, 1, ENC_BIG_ENDIAN);
1678                     proto_tree_add_item(mq_tree, hf_mq_gmo_segmstatus, tvb, offset + 77, 1, ENC_BIG_ENDIAN);
1679                     proto_tree_add_item(mq_tree, hf_mq_gmo_segmentation, tvb, offset + 78, 1, ENC_BIG_ENDIAN);
1680                     proto_tree_add_item(mq_tree, hf_mq_gmo_reserved, tvb, offset + 79, 1, ENC_BIG_ENDIAN);
1681                 }
1682 
1683                 if (iVersion >= 3)
1684                 {
1685                     proto_tree_add_item(mq_tree, hf_mq_gmo_msgtoken, tvb, offset + 80, 16, ENC_NA);
1686                     proto_tree_add_item(mq_tree, hf_mq_gmo_returnedlen, tvb, offset + 96, 4, p_mq_parm->mq_int_enc);
1687                 }
1688                 if (iVersion >= 4)
1689                 {
1690                     proto_tree_add_item(mq_tree, hf_mq_gmo_reserved2, tvb, offset + 100, 4, p_mq_parm->mq_int_enc);
1691                     proto_tree_add_item(mq_tree, hf_mq_gmo_msghandle, tvb, offset + 104, 8, p_mq_parm->mq_int_enc);
1692                 }
1693             }
1694         }
1695     }
1696     return iSize;
1697 }
1698 
dissect_mq_pmo(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,mq_parm_t * p_mq_parm,gint * iDistributionListSize)1699 static gint dissect_mq_pmo(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, gint offset, mq_parm_t* p_mq_parm, gint* iDistributionListSize)
1700 {
1701     gint iSize = 0;
1702     gint iPosV2 = offset + 128;
1703     gint offsetb = offset;
1704 
1705     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
1706     if (p_mq_parm->mq_strucID == MQ_STRUCTID_PMO || p_mq_parm->mq_strucID == MQ_STRUCTID_PMO_EBCDIC)
1707     {
1708         guint32 iVersion = 0;
1709         iVersion = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
1710         /* Compute length according to version */
1711         switch (iVersion)
1712         {
1713             case 1: iSize = 128; break;
1714             case 2: iSize = 152; break;
1715             case 3: iSize = 176; break;
1716         }
1717 
1718         if (iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
1719         {
1720             guint8* sQueue;
1721             guint8* sQueueA;
1722 
1723             sQueueA = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 32, 48, 0);
1724             sQueue = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 32, 48, p_mq_parm->mq_str_enc);
1725             if (strip_trailing_blanks(sQueue, 48) > 0 && strip_trailing_blanks(sQueueA, 48) > 0)
1726             {
1727                 if (pinfo)
1728                     col_append_fstr(pinfo->cinfo, COL_INFO, " Q=%s", sQueue);
1729             }
1730 
1731             if (tree)
1732             {
1733                 proto_tree* mq_tree;
1734 
1735                 mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSize, ett_mq_pmo, NULL, MQ_TEXT_PMO);
1736                 proto_tree_add_item(mq_tree, hf_mq_pmo_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
1737                 proto_tree_add_item(mq_tree, hf_mq_pmo_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
1738 
1739                 dissect_mq_MQPMO(tvb, mq_tree, offset + 8, ett_mq_pmo_option, p_mq_parm);
1740 
1741                 proto_tree_add_item(mq_tree, hf_mq_pmo_timeout, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
1742                 proto_tree_add_item(mq_tree, hf_mq_pmo_context, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
1743                 proto_tree_add_item(mq_tree, hf_mq_pmo_knowndstcnt, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
1744                 proto_tree_add_item(mq_tree, hf_mq_pmo_unkndstcnt, tvb, offset + 24, 4, p_mq_parm->mq_int_enc);
1745                 proto_tree_add_item(mq_tree, hf_mq_pmo_invaldstcnt, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
1746                 proto_tree_add_item(mq_tree, hf_mq_pmo_resolvqname, tvb, offset + 32, 48, p_mq_parm->mq_str_enc);
1747                 proto_tree_add_item(mq_tree, hf_mq_pmo_resolvqmgr, tvb, offset + 80, 48, p_mq_parm->mq_str_enc);
1748                 offset += 128;
1749                 if (iVersion >= 2)
1750                 {
1751                     proto_tree_add_item(mq_tree, hf_mq_pmo_recspresent, tvb, offset, 4, p_mq_parm->mq_int_enc);
1752                     proto_tree_add_item(mq_tree, hf_mq_pmo_putmsgrecfld, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
1753                     proto_tree_add_item(mq_tree, hf_mq_pmo_putmsgrecofs, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
1754                     proto_tree_add_item(mq_tree, hf_mq_pmo_resprecofs, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
1755                     proto_tree_add_item(mq_tree, hf_mq_pmo_putmsgrecptr, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
1756                     proto_tree_add_item(mq_tree, hf_mq_pmo_resprecptr, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
1757                     offset += 24;
1758                 }
1759                 if (iVersion >= 3)
1760                 {
1761                     proto_tree_add_item(mq_tree, hf_mq_pmo_originalmsghandle, tvb, offset, 8, p_mq_parm->mq_int_enc);
1762                     proto_tree_add_item(mq_tree, hf_mq_pmo_newmsghandle, tvb, offset + 8, 8, p_mq_parm->mq_int_enc);
1763                     proto_tree_add_item(mq_tree, hf_mq_pmo_action, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
1764                     proto_tree_add_item(mq_tree, hf_mq_pmo_publevel, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
1765                 }
1766             }
1767             if (iVersion >= 2)
1768             {
1769                 gint iNbrRecords = 0;
1770                 guint32 iRecFlags = 0;
1771 
1772                 iNbrRecords = tvb_get_guint32(tvb, iPosV2, p_mq_parm->mq_int_enc);
1773                 iRecFlags = tvb_get_guint32(tvb, iPosV2 + 4, p_mq_parm->mq_int_enc);
1774 
1775                 if (iNbrRecords > 0)
1776                 {
1777                     gint iOffsetPMR = 0;
1778                     gint iOffsetRR = 0;
1779 
1780                     if (iDistributionListSize)
1781                         *iDistributionListSize = iNbrRecords;
1782                     iOffsetPMR = tvb_get_guint32(tvb, iPosV2 + 8, p_mq_parm->mq_int_enc);
1783                     iOffsetRR = tvb_get_guint32(tvb, iPosV2 + 12, p_mq_parm->mq_int_enc);
1784                     iSize += dissect_mq_pmr(tvb, tree, offsetb + iSize, iNbrRecords, iOffsetPMR, iRecFlags, p_mq_parm);
1785                     iSize += dissect_mq_rr(tvb, tree, offsetb + iSize, iNbrRecords, iOffsetRR, p_mq_parm);
1786                 }
1787             }
1788         }
1789     }
1790     return iSize;
1791 }
1792 
dissect_mq_od(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,mq_parm_t * p_mq_parm,gint * iDistributionListSize)1793 static gint dissect_mq_od(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, gint offset, mq_parm_t* p_mq_parm, gint* iDistributionListSize)
1794 {
1795     gint iSize = 0;
1796 
1797     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
1798     if (p_mq_parm->mq_strucID == MQ_STRUCTID_OD || p_mq_parm->mq_strucID == MQ_STRUCTID_OD_EBCDIC)
1799     {
1800         /* The OD struct can be present in several messages at different levels */
1801         guint32 iVersion = 0;
1802         iVersion = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
1803         /* Compute length according to version */
1804         switch (iVersion)
1805         {
1806             case 1: iSize = 168; break;
1807             case 2: iSize = 200; break;
1808             case 3: iSize = 336; break;
1809             case 4: iSize = 336 + 3 * 20 + 4; break;
1810         }
1811 
1812         if (iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
1813         {
1814             gint     iNbrRecords = 0;
1815             guint8* sObj;
1816             guint32  uTyp;
1817 
1818             if (iVersion >= 2)
1819                 iNbrRecords = tvb_get_guint32(tvb, offset + 168, p_mq_parm->mq_int_enc);
1820 
1821             uTyp = tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
1822             sObj = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 12, 48, p_mq_parm->mq_str_enc);
1823             if (pinfo)
1824                 col_append_fstr(pinfo->cinfo, COL_INFO, " Typ=%s", try_val_to_str_ext(uTyp, GET_VALS_EXTP(objtype)));
1825             if (strip_trailing_blanks(sObj, 48) > 0)
1826             {
1827                 if (pinfo)
1828                     col_append_fstr(pinfo->cinfo, COL_INFO, " Obj=%s", sObj);
1829             }
1830 
1831             if (tree)
1832             {
1833                 proto_tree* mq_tree;
1834 
1835                 mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSize, ett_mq_od, NULL, MQ_TEXT_OD);
1836 
1837                 proto_tree_add_item(mq_tree, hf_mq_od_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
1838                 proto_tree_add_item(mq_tree, hf_mq_od_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
1839                 proto_tree_add_item(mq_tree, hf_mq_od_objecttype, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
1840                 proto_tree_add_item(mq_tree, hf_mq_od_objectname, tvb, offset + 12, 48, p_mq_parm->mq_str_enc);
1841                 proto_tree_add_item(mq_tree, hf_mq_od_objqmgrname, tvb, offset + 60, 48, p_mq_parm->mq_str_enc);
1842                 proto_tree_add_item(mq_tree, hf_mq_od_dynqname, tvb, offset + 108, 48, p_mq_parm->mq_str_enc);
1843                 proto_tree_add_item(mq_tree, hf_mq_od_altuserid, tvb, offset + 156, 12, p_mq_parm->mq_str_enc);
1844 
1845                 if (iVersion >= 2)
1846                 {
1847                     proto_tree_add_item(mq_tree, hf_mq_od_recspresent, tvb, offset + 168, 4, p_mq_parm->mq_int_enc);
1848                     proto_tree_add_item(mq_tree, hf_mq_od_knowndstcnt, tvb, offset + 172, 4, p_mq_parm->mq_int_enc);
1849                     proto_tree_add_item(mq_tree, hf_mq_od_unknowdstcnt, tvb, offset + 176, 4, p_mq_parm->mq_int_enc);
1850                     proto_tree_add_item(mq_tree, hf_mq_od_invaldstcnt, tvb, offset + 180, 4, p_mq_parm->mq_int_enc);
1851                     proto_tree_add_item(mq_tree, hf_mq_od_objrecofs, tvb, offset + 184, 4, p_mq_parm->mq_int_enc);
1852                     proto_tree_add_item(mq_tree, hf_mq_od_resprecofs, tvb, offset + 188, 4, p_mq_parm->mq_int_enc);
1853                     proto_tree_add_item(mq_tree, hf_mq_od_objrecptr, tvb, offset + 192, 4, p_mq_parm->mq_int_enc);
1854                     proto_tree_add_item(mq_tree, hf_mq_od_resprecptr, tvb, offset + 196, 4, p_mq_parm->mq_int_enc);
1855                 }
1856                 if (iVersion >= 3)
1857                 {
1858                     proto_tree_add_item(mq_tree, hf_mq_od_altsecurid, tvb, offset + 200, 40, p_mq_parm->mq_str_enc);
1859                     proto_tree_add_item(mq_tree, hf_mq_od_resolvqname, tvb, offset + 240, 48, p_mq_parm->mq_str_enc);
1860                     proto_tree_add_item(mq_tree, hf_mq_od_resolvqmgrnm, tvb, offset + 288, 48, p_mq_parm->mq_str_enc);
1861                 }
1862                 if (iVersion >= 4)
1863                 {
1864                     dissect_mq_charv(tvb, mq_tree, offset + 336, 20, ett_mq_od_objstr, "Object string", p_mq_parm);
1865                     dissect_mq_charv(tvb, mq_tree, offset + 356, 20, ett_mq_od_selstr, "Selection string", p_mq_parm);
1866                     dissect_mq_charv(tvb, mq_tree, offset + 376, 20, ett_mq_od_resobjstr, "Resolved object string", p_mq_parm);
1867                     proto_tree_add_item(mq_tree, hf_mq_od_resolvobjtyp, tvb, offset + 396, 4, p_mq_parm->mq_int_enc);
1868                 }
1869             }
1870             if (iNbrRecords > 0)
1871             {
1872                 gint iOffsetOR = 0;
1873                 gint iOffsetRR = 0;
1874 
1875                 *iDistributionListSize = iNbrRecords;
1876                 iOffsetOR = tvb_get_guint32(tvb, offset + 184, p_mq_parm->mq_int_enc);
1877                 iOffsetRR = tvb_get_guint32(tvb, offset + 188, p_mq_parm->mq_int_enc);
1878 
1879                 iSize += dissect_mq_or(tvb, tree, offset, iNbrRecords, iOffsetOR, p_mq_parm);
1880                 iSize += dissect_mq_rr(tvb, tree, offset, iNbrRecords, iOffsetRR, p_mq_parm);
1881             }
1882         }
1883     }
1884     return iSize;
1885 }
1886 
dissect_mq_xid(tvbuff_t * tvb,proto_tree * tree,mq_parm_t * p_mq_parm,gint offset)1887 static gint dissect_mq_xid(tvbuff_t* tvb, proto_tree* tree, mq_parm_t* p_mq_parm, gint offset)
1888 {
1889     gint iSizeXid = 0;
1890     if (tvb_reported_length_remaining(tvb, offset) >= 6)
1891     {
1892         guint8 iXidLength = 0;
1893         guint8 iBqLength = 0;
1894 
1895         iXidLength = tvb_get_guint8(tvb, offset + 4);
1896         iBqLength = tvb_get_guint8(tvb, offset + 5);
1897         iSizeXid = 6 + iXidLength + iBqLength;
1898 
1899         if (tvb_reported_length_remaining(tvb, offset) >= iSizeXid)
1900         {
1901             proto_tree* mq_tree;
1902 
1903             mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSizeXid, ett_mq_xa_xid, NULL, MQ_TEXT_XID);
1904 
1905             proto_tree_add_item(mq_tree, hf_mq_xa_xid_formatid, tvb, offset, 4, p_mq_parm->mq_int_enc);
1906             proto_tree_add_item(mq_tree, hf_mq_xa_xid_glbxid_len, tvb, offset + 4, 1, p_mq_parm->mq_int_enc);
1907             proto_tree_add_item(mq_tree, hf_mq_xa_xid_brq_length, tvb, offset + 5, 1, p_mq_parm->mq_int_enc);
1908             proto_tree_add_item(mq_tree, hf_mq_xa_xid_globalxid, tvb, offset + 6, iXidLength, ENC_NA);
1909             proto_tree_add_item(mq_tree, hf_mq_xa_xid_brq, tvb, offset + 6 + iXidLength, iBqLength, ENC_NA);
1910 
1911             iSizeXid += (4 - (iSizeXid % 4)) % 4; /* Pad for alignment with 4 byte word boundary */
1912             if (tvb_reported_length_remaining(tvb, offset) < iSizeXid)
1913                 iSizeXid = 0;
1914         }
1915         else iSizeXid = 0;
1916     }
1917     return iSizeXid;
1918 }
1919 
dissect_mq_sid(tvbuff_t * tvb,proto_tree * tree,mq_parm_t * p_mq_parm,gint offset)1920 static gint dissect_mq_sid(tvbuff_t* tvb, proto_tree* tree, mq_parm_t* p_mq_parm, gint offset)
1921 {
1922     guint8 iSIDL;
1923     guint8 iSID;
1924     char* sid_str;
1925     gint   bOffset = offset;
1926 
1927     iSIDL = tvb_get_guint8(tvb, offset);
1928     proto_tree_add_item(tree, hf_mq_sidlen, tvb, offset, 1, p_mq_parm->mq_int_enc);
1929     offset++;
1930     if (iSIDL > 0)
1931     {
1932         iSID = tvb_get_guint8(tvb, offset);
1933         proto_tree_add_item(tree, hf_mq_sidtyp, tvb, offset, 1, p_mq_parm->mq_int_enc);
1934         offset++;
1935         if (iSID == MQ_MQSIDT_NT_SECURITY_ID)
1936         {
1937             offset = dissect_nt_sid(tvb, offset, tree, "SID", &sid_str, -1);
1938         }
1939         else
1940         {
1941             proto_tree_add_item(tree, hf_mq_securityid, tvb, offset, 40, ENC_NA);
1942             offset += 40;
1943         }
1944     }
1945     return offset - bOffset;
1946 }
dissect_mq_addCR_colinfo(packet_info * pinfo,mq_parm_t * p_mq_parm)1947 static void dissect_mq_addCR_colinfo(packet_info* pinfo, mq_parm_t* p_mq_parm)
1948 {
1949     if (p_mq_parm->mq_convID)
1950         col_append_fstr(pinfo->cinfo, COL_INFO, " C.R=%d.%d", p_mq_parm->mq_convID, p_mq_parm->mq_rqstID);
1951 }
dissect_mq_id(tvbuff_t * tvb,packet_info * pinfo,proto_tree * mqroot_tree,gint offset,mq_parm_t * p_mq_parm)1952 static gint dissect_mq_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* mqroot_tree, gint offset, mq_parm_t* p_mq_parm)
1953 {
1954     guint8 iFAPLvl;
1955     gint   iSize;
1956     gint   iPktSz;
1957 
1958     iPktSz = tvb_reported_length_remaining(tvb, offset);
1959     iFAPLvl = tvb_get_guint8(tvb, offset + 4);
1960 
1961     if (iFAPLvl < 4)
1962         iSize = 44;
1963     else if (iFAPLvl < 9)
1964         iSize = 102;
1965     else if (iFAPLvl < 11)
1966         iSize = 208;
1967     else
1968         iSize = 240;
1969     iSize = MIN(iSize, iPktSz);
1970 
1971     if (iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
1972     {
1973         guint8* sChannel;
1974         sChannel = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 24, 20, p_mq_parm->mq_str_enc);
1975         dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
1976         col_append_fstr(pinfo->cinfo, COL_INFO, " FAPLvl=%d", iFAPLvl);
1977         if (strip_trailing_blanks(sChannel, 20) > 0)
1978         {
1979             col_append_fstr(pinfo->cinfo, COL_INFO, ", CHL=%s", sChannel);
1980         }
1981         if (iSize > 48)
1982         {
1983             guint8* sQMgr;
1984             sQMgr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 48, p_mq_parm->mq_str_enc);
1985             if (strip_trailing_blanks(sQMgr, 48) > 0)
1986             {
1987                 col_append_fstr(pinfo->cinfo, COL_INFO, ", QM=%s", sQMgr);
1988             }
1989             p_mq_parm->mq_id_ccsid.ccsid = (guint32)tvb_get_guint16(tvb, offset + 46, p_mq_parm->mq_int_enc);
1990         }
1991         if (mqroot_tree)
1992         {
1993             proto_tree* mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSize, ett_mq_id, NULL, MQ_TEXT_ID);
1994 
1995             proto_tree_add_item(mq_tree, hf_mq_id_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
1996             proto_tree_add_item(mq_tree, hf_mq_id_FapLevel, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
1997 
1998             /* ID Capability flags 1 */
1999             proto_tree_add_bitmask(mq_tree, tvb, offset + 5, hf_mq_id_cf1, ett_mq_id_cf1, pf_flds_cf1, ENC_BIG_ENDIAN);
2000             proto_tree_add_bitmask(mq_tree, tvb, offset + 6, hf_mq_id_ecf1, ett_mq_id_ecf1, pf_flds_cf1, ENC_BIG_ENDIAN);
2001 
2002             /* Error flags 1*/
2003             proto_tree_add_bitmask(mq_tree, tvb, offset + 7, hf_mq_id_ief1, ett_mq_id_ief1, pf_flds_ef1, ENC_BIG_ENDIAN);
2004 
2005             proto_tree_add_item(mq_tree, hf_mq_id_Reserved, tvb, offset + 8, 2, p_mq_parm->mq_int_enc);
2006             proto_tree_add_item(mq_tree, hf_mq_id_MaxMsgBatch, tvb, offset + 10, 2, p_mq_parm->mq_int_enc);
2007             proto_tree_add_item(mq_tree, hf_mq_id_MaxTrSize, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2008             proto_tree_add_item(mq_tree, hf_mq_id_MaxMsgSize, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2009             proto_tree_add_item(mq_tree, hf_mq_id_SeqWrapVal, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
2010             proto_tree_add_item(mq_tree, hf_mq_id_channel, tvb, offset + 24, 20, p_mq_parm->mq_str_enc);
2011 
2012             if (iSize > 44 || (iPktSz > iSize && iPktSz > 44))
2013             {
2014                 /* ID Capability flags 2 */
2015                 proto_tree_add_bitmask(mq_tree, tvb, offset + 44, hf_mq_id_cf2, ett_mq_id_cf2, pf_flds_cf2, ENC_BIG_ENDIAN);
2016                 proto_tree_add_bitmask(mq_tree, tvb, offset + 45, hf_mq_id_ecf2, ett_mq_id_ecf2, pf_flds_cf2, ENC_BIG_ENDIAN);
2017 
2018                 proto_tree_add_item(mq_tree, hf_mq_id_ccsid, tvb, offset + 46, 2, p_mq_parm->mq_int_enc);
2019                 proto_tree_add_item(mq_tree, hf_mq_id_qmgrname, tvb, offset + 48, 48, p_mq_parm->mq_str_enc);
2020                 proto_tree_add_item(mq_tree, hf_mq_id_HBInterval, tvb, offset + 96, 4, p_mq_parm->mq_int_enc);
2021                 proto_tree_add_item(mq_tree, hf_mq_id_EFLLength, tvb, offset + 100, 2, p_mq_parm->mq_int_enc);
2022                 if (iSize > 102 || (iPktSz > iSize && iPktSz > 102))
2023                 {
2024                     /* Error flags 2*/
2025                     proto_tree_add_bitmask(mq_tree, tvb, offset + 102, hf_mq_id_ief2, ett_mq_id_ief2, pf_flds_ef2, ENC_BIG_ENDIAN);
2026                     proto_tree_add_item(mq_tree, hf_mq_id_Reserved1, tvb, offset + 103, 1, ENC_BIG_ENDIAN);
2027 
2028                     if (iSize > 104 || (iPktSz > iSize && iPktSz > 104))
2029                     {
2030                         proto_tree_add_item(mq_tree, hf_mq_id_HdrCprsLst, tvb, offset + 104, 2, p_mq_parm->mq_int_enc);
2031                         proto_tree_add_item(mq_tree, hf_mq_id_MsgCprsLst, tvb, offset + 106, 16, p_mq_parm->mq_int_enc);
2032                         proto_tree_add_item(mq_tree, hf_mq_id_Reserved2, tvb, offset + 122, 2, p_mq_parm->mq_int_enc);
2033                         proto_tree_add_item(mq_tree, hf_mq_id_SSLKeyRst, tvb, offset + 124, 4, p_mq_parm->mq_int_enc);
2034                         if (iSize > 128 || (iPktSz > iSize && iPktSz > 128))
2035                         {
2036                             proto_tree_add_item(mq_tree, hf_mq_id_ConvBySkt, tvb, offset + 128, 4, p_mq_parm->mq_int_enc);
2037 
2038                             /* ID Capability flags 3 */
2039                             proto_tree_add_bitmask(mq_tree, tvb, offset + 132, hf_mq_id_cf3, ett_mq_id_cf3, pf_flds_cf3, ENC_BIG_ENDIAN);
2040                             proto_tree_add_bitmask(mq_tree, tvb, offset + 133, hf_mq_id_ecf3, ett_mq_id_ecf3, pf_flds_cf3, ENC_BIG_ENDIAN);
2041 
2042                             proto_tree_add_item(mq_tree, hf_mq_id_Reserved3, tvb, offset + 134, 2, p_mq_parm->mq_int_enc);
2043                             proto_tree_add_item(mq_tree, hf_mq_id_ProcessId, tvb, offset + 136, 4, p_mq_parm->mq_int_enc);
2044                             proto_tree_add_item(mq_tree, hf_mq_id_ThreadId, tvb, offset + 140, 4, p_mq_parm->mq_int_enc);
2045                             proto_tree_add_item(mq_tree, hf_mq_id_TraceId, tvb, offset + 144, 4, p_mq_parm->mq_int_enc);
2046                             proto_tree_add_item(mq_tree, hf_mq_id_ProdId, tvb, offset + 148, 12, p_mq_parm->mq_str_enc);
2047                         }
2048                     }
2049                 }
2050                 if (iSize > 160 || (iPktSz > iSize && iPktSz > 160))
2051                 {
2052                     proto_tree_add_item(mq_tree, hf_mq_id_mqmid, tvb, offset + 160, 48, p_mq_parm->mq_str_enc);
2053                 }
2054                 if (iSize > 208 || (iPktSz > iSize && iPktSz > 208))
2055                 {
2056                     proto_tree_add_item(mq_tree, hf_mq_id_pal, tvb, offset + 208, 20, p_mq_parm->mq_str_enc);
2057                     proto_tree_add_item(mq_tree, hf_mq_id_r, tvb, offset + 228, 12, p_mq_parm->mq_str_enc);
2058                 }
2059             }
2060         }
2061     }
2062     return iPktSz;
2063 }
dissect_mq_md(tvbuff_t * tvb,proto_tree * tree,gint offset,mq_parm_t * p_mq_parm,gboolean bDecode)2064 static gint dissect_mq_md(tvbuff_t* tvb, proto_tree* tree, gint offset, mq_parm_t* p_mq_parm, gboolean bDecode)
2065 {
2066     gint iSize = 0;
2067 
2068     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2069     if (p_mq_parm->mq_strucID == MQ_STRUCTID_MD || p_mq_parm->mq_strucID == MQ_STRUCTID_MD_EBCDIC)
2070     {
2071         guint32 iVersion = 0;
2072         iVersion = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2073         /* Compute length according to version */
2074         switch (iVersion)
2075         {
2076             case 1: iSize = 324; break;
2077             case 2: iSize = 364; break;
2078         }
2079 
2080         if (bDecode && iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
2081         {
2082             p_mq_parm->iOfsEnc = offset + 24;
2083             p_mq_parm->iOfsCcs = offset + 28;
2084             p_mq_parm->iOfsFmt = offset + 32;
2085 
2086             p_mq_parm->mq_md_ccsid.encod = tvb_get_guint32(tvb, offset + 24, p_mq_parm->mq_int_enc);
2087             p_mq_parm->mq_md_ccsid.ccsid = tvb_get_guint32(tvb, offset + 28, p_mq_parm->mq_int_enc);
2088             if (tree)
2089             {
2090                 proto_tree* mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSize, ett_mq_md, NULL, MQ_TEXT_MD);
2091 
2092                 proto_tree_add_item(mq_tree, hf_mq_md_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
2093                 proto_tree_add_item(mq_tree, hf_mq_md_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2094                 proto_tree_add_item(mq_tree, hf_mq_md_report, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2095                 proto_tree_add_item(mq_tree, hf_mq_md_msgtype, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2096                 proto_tree_add_item(mq_tree, hf_mq_md_expiry, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2097                 proto_tree_add_item(mq_tree, hf_mq_md_feedback, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
2098                 dissect_mq_encoding(mq_tree, hf_mq_md_encoding, tvb, offset + 24, 4, p_mq_parm->mq_int_enc);
2099                 proto_tree_add_item(mq_tree, hf_mq_md_ccsid, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
2100                 proto_tree_add_item(mq_tree, hf_mq_md_format, tvb, offset + 32, 8, p_mq_parm->mq_str_enc);
2101                 proto_tree_add_item(mq_tree, hf_mq_md_priority, tvb, offset + 40, 4, p_mq_parm->mq_int_enc);
2102                 proto_tree_add_item(mq_tree, hf_mq_md_persistence, tvb, offset + 44, 4, p_mq_parm->mq_int_enc);
2103                 proto_tree_add_item(mq_tree, hf_mq_md_msgid, tvb, offset + 48, 24, ENC_NA);
2104                 proto_tree_add_item(mq_tree, hf_mq_md_correlid, tvb, offset + 72, 24, ENC_NA);
2105                 proto_tree_add_item(mq_tree, hf_mq_md_backoutcnt, tvb, offset + 96, 4, p_mq_parm->mq_int_enc);
2106                 proto_tree_add_item(mq_tree, hf_mq_md_replytoq, tvb, offset + 100, 48, p_mq_parm->mq_str_enc);
2107                 proto_tree_add_item(mq_tree, hf_mq_md_replytoqmgr, tvb, offset + 148, 48, p_mq_parm->mq_str_enc);
2108                 proto_tree_add_item(mq_tree, hf_mq_md_userid, tvb, offset + 196, 12, p_mq_parm->mq_str_enc);
2109                 proto_tree_add_item(mq_tree, hf_mq_md_acttoken, tvb, offset + 208, 32, ENC_NA);
2110                 proto_tree_add_item(mq_tree, hf_mq_md_appliddata, tvb, offset + 240, 32, p_mq_parm->mq_str_enc);
2111                 proto_tree_add_item(mq_tree, hf_mq_md_putappltype, tvb, offset + 272, 4, p_mq_parm->mq_int_enc);
2112                 proto_tree_add_item(mq_tree, hf_mq_md_putapplname, tvb, offset + 276, 28, p_mq_parm->mq_str_enc);
2113                 proto_tree_add_item(mq_tree, hf_mq_md_putdate, tvb, offset + 304, 8, p_mq_parm->mq_str_enc);
2114                 proto_tree_add_item(mq_tree, hf_mq_md_puttime, tvb, offset + 312, 8, p_mq_parm->mq_str_enc);
2115                 proto_tree_add_item(mq_tree, hf_mq_md_apporigdata, tvb, offset + 320, 4, p_mq_parm->mq_str_enc);
2116 
2117                 if (iVersion >= 2)
2118                 {
2119                     proto_tree_add_item(mq_tree, hf_mq_md_groupid, tvb, offset + 324, 24, ENC_NA);
2120                     proto_tree_add_item(mq_tree, hf_mq_md_msgseqnumber, tvb, offset + 348, 4, p_mq_parm->mq_int_enc);
2121                     proto_tree_add_item(mq_tree, hf_mq_md_offset, tvb, offset + 352, 4, p_mq_parm->mq_int_enc);
2122                     proto_tree_add_item(mq_tree, hf_mq_md_msgflags, tvb, offset + 356, 4, p_mq_parm->mq_int_enc);
2123                     proto_tree_add_item(mq_tree, hf_mq_md_origlen, tvb, offset + 360, 4, p_mq_parm->mq_int_enc);
2124                 }
2125             }
2126         }
2127     }
2128     return iSize;
2129 }
dissect_mq_fopa(tvbuff_t * tvb,proto_tree * tree,gint offset,mq_parm_t * p_mq_parm)2130 static gint dissect_mq_fopa(tvbuff_t* tvb, proto_tree* tree, gint offset, mq_parm_t* p_mq_parm)
2131 {
2132     gint iSize = 0;
2133     gint iVers = 0;
2134 
2135     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2136     if (p_mq_parm->mq_strucID == MQ_STRUCTID_FOPA || p_mq_parm->mq_strucID == MQ_STRUCTID_FOPA_EBCDIC)
2137     {
2138         iVers = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2139         iSize = tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
2140         if (iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
2141         {
2142             proto_tree* mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSize, ett_mq_fopa, NULL, MQ_TEXT_FOPA);
2143 
2144             proto_tree_add_item(mq_tree, hf_mq_fopa_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
2145             proto_tree_add_item(mq_tree, hf_mq_fopa_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2146             proto_tree_add_item(mq_tree, hf_mq_fopa_length, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2147 
2148             proto_tree_add_item(mq_tree, hf_mq_fopa_DefPersistence, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2149             proto_tree_add_item(mq_tree, hf_mq_fopa_DefPutRespType, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2150             proto_tree_add_item(mq_tree, hf_mq_fopa_DefReadAhead, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
2151             proto_tree_add_item(mq_tree, hf_mq_fopa_PropertyControl, tvb, offset + 24, 4, p_mq_parm->mq_int_enc);
2152 
2153             if ((iVers > 1) && (iSize > 28))
2154                 proto_tree_add_item(mq_tree, hf_mq_fopa_Unknown, tvb, offset + 28, iSize - 28, p_mq_parm->mq_int_enc);
2155         }
2156     }
2157     return iSize;
2158 }
dissect_mq_fcmi(tvbuff_t * tvb,proto_tree * tree,gint offset,mq_parm_t * p_mq_parm)2159 static gint dissect_mq_fcmi(tvbuff_t* tvb, proto_tree* tree, gint offset, mq_parm_t* p_mq_parm)
2160 {
2161     gint iSize = 0;
2162 
2163     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2164     if (p_mq_parm->mq_strucID == MQ_STRUCTID_FCMI || p_mq_parm->mq_strucID == MQ_STRUCTID_FCMI_EBCDIC)
2165     {
2166         iSize = 8;
2167         if (iSize != 0 && tvb_reported_length_remaining(tvb, offset) >= iSize)
2168         {
2169             proto_tree* mq_tree = proto_tree_add_subtree(tree, tvb, offset, iSize, ett_mq_fcmi, NULL, MQ_TEXT_FCMI);
2170 
2171             proto_tree_add_item(mq_tree, hf_mq_fcmi_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
2172             proto_tree_add_item(mq_tree, hf_mq_fcmi_unknown, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2173         }
2174     }
2175     return iSize;
2176 }
dissect_mq_pdu(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree)2177 static void dissect_mq_pdu(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree)
2178 {
2179     gint       offset = 0;
2180     guint32    iSegmentLength = 0;
2181     guint32    iSizePayload = 0;
2182     gint       iSizeMD = 0;
2183     gboolean   bPayload = FALSE;
2184     gboolean   bEBCDIC = FALSE;
2185     guint      strid_enc;
2186     gint       iDistributionListSize = 0;
2187     gint       capLen;
2188     mq_parm_t* p_mq_parm;
2189     heur_dtbl_entry_t* hdtbl_entry;
2190 
2191     p_mq_parm = wmem_new0(wmem_packet_scope(), mq_parm_t);
2192 
2193     p_mq_parm->mq_strucID = MQ_STRUCTID_NULL;
2194     p_mq_parm->mq_int_enc = ENC_BIG_ENDIAN;
2195     p_mq_parm->mq_str_enc = ENC_UTF_8 | ENC_NA;
2196 
2197     col_set_str(pinfo->cinfo, COL_PROTOCOL, "MQ");
2198 
2199     p_mq_parm->iOfsEnc = 0;
2200     p_mq_parm->iOfsFmt = 0;
2201     p_mq_parm->iOfsCcs = 0;
2202 
2203     if (tvb_reported_length(tvb) >= 4)
2204     {
2205         p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
2206         if (((p_mq_parm->mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx ||
2207             (p_mq_parm->mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC)
2208             && tvb_reported_length_remaining(tvb, offset) >= 28)
2209         {
2210             proto_tree* mq_tree = NULL;
2211             proto_tree* mqroot_tree = NULL;
2212             proto_item* ti = NULL;
2213 
2214             /* An MQ packet always starts with this structure*/
2215             gint iSizeTSH = 28;
2216             gint iSizeMPF = 0;  /* Size Of Multiplexed Field */
2217 
2218             strid_enc = ENC_ASCII | ENC_NA;
2219             if ((p_mq_parm->mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC)
2220             {
2221                 bEBCDIC = TRUE;
2222                 strid_enc = ENC_EBCDIC | ENC_NA;
2223                 p_mq_parm->mq_str_enc = ENC_EBCDIC | ENC_NA;
2224             }
2225 
2226             iSegmentLength = tvb_get_ntohl(tvb, offset + 4);
2227 
2228             if (p_mq_parm->mq_strucID == MQ_STRUCTID_TSHM || p_mq_parm->mq_strucID == MQ_STRUCTID_TSHM_EBCDIC)
2229             {
2230                 if (tvb_reported_length_remaining(tvb, offset) < 36)
2231                     return;
2232                 iSizeMPF += 8;
2233                 iSizeTSH += iSizeMPF;
2234                 p_mq_parm->mq_convID = tvb_get_ntohl(tvb, offset + 8);
2235                 p_mq_parm->mq_rqstID = tvb_get_ntohl(tvb, offset + 12);
2236             }
2237             p_mq_parm->mq_opcode = tvb_get_guint8(tvb, offset + iSizeMPF + 9);
2238 
2239             if (p_mq_parm->mq_opcode == MQ_TST_REQUEST_MSGS || p_mq_parm->mq_opcode == MQ_TST_ASYNC_MESSAGE)
2240             {
2241                 p_mq_parm->iOfsEnc = offset + iSizeMPF + 20;
2242                 p_mq_parm->iOfsCcs = offset + iSizeMPF + 24;
2243                 p_mq_parm->iOfsFmt = offset;
2244             }
2245             p_mq_parm->mq_int_enc = (tvb_get_guint8(tvb, offset + iSizeMPF + 8) == MQ_LITTLE_ENDIAN ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN);
2246             p_mq_parm->mq_ctlf1 = tvb_get_guint8(tvb, offset + iSizeMPF + 10);
2247             p_mq_parm->mq_ctlf2 = tvb_get_guint8(tvb, offset + iSizeMPF + 11);
2248 
2249             p_mq_parm->mq_tsh_ccsid.encod = tvb_get_guint32(tvb, offset + iSizeMPF + 20, p_mq_parm->mq_int_enc);
2250             p_mq_parm->mq_tsh_ccsid.ccsid = tvb_get_guint16(tvb, offset + iSizeMPF + 24, p_mq_parm->mq_int_enc);
2251 
2252             if (IS_EBCDIC(p_mq_parm->mq_tsh_ccsid.ccsid) && !bEBCDIC)
2253             {
2254                 bEBCDIC = TRUE;
2255                 p_mq_parm->mq_str_enc = ENC_EBCDIC | ENC_NA;
2256             }
2257 
2258             if (!mq_in_reassembly)
2259             {
2260                 col_clear_fence(pinfo->cinfo, COL_INFO);
2261                 col_clear(pinfo->cinfo, COL_INFO);
2262                 col_add_fstr(pinfo->cinfo, COL_INFO, "%-17s", val_to_str_ext(p_mq_parm->mq_opcode, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"));
2263             }
2264 
2265             if (tree)
2266             {
2267                 if (p_mq_parm->mq_opcode != MQ_TST_ASYNC_MESSAGE)
2268                 {
2269                     ti = proto_tree_add_item(tree, proto_mq, tvb, offset, -1, ENC_NA);
2270                     proto_item_append_text(ti, " (%s)", val_to_str_ext(p_mq_parm->mq_opcode, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"));
2271                     if (bEBCDIC == TRUE)
2272                         proto_item_append_text(ti, " (EBCDIC)");
2273                     mqroot_tree = proto_item_add_subtree(ti, ett_mq);
2274                 }
2275                 else
2276                 {
2277                     mqroot_tree = tree;
2278                 }
2279 
2280                 mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeTSH, ett_mq_tsh, NULL, MQ_TEXT_TSH);
2281 
2282                 proto_tree_add_item(mq_tree, hf_mq_tsh_StructID, tvb, offset + 0, 4, strid_enc);
2283                 proto_tree_add_item(mq_tree, hf_mq_tsh_mqseglen, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
2284 
2285                 if (iSizeTSH == 36)
2286                 {
2287                     proto_tree_add_item(mq_tree, hf_mq_tsh_convid, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
2288                     proto_tree_add_item(mq_tree, hf_mq_tsh_requestid, tvb, offset + 12, 4, ENC_BIG_ENDIAN);
2289                 }
2290 
2291                 proto_tree_add_item(mq_tree, hf_mq_tsh_byteorder, tvb, offset + iSizeMPF + 8, 1, ENC_BIG_ENDIAN);
2292                 proto_tree_add_item(mq_tree, hf_mq_tsh_opcode, tvb, offset + iSizeMPF + 9, 1, ENC_BIG_ENDIAN);
2293 
2294                 proto_tree_add_bitmask(mq_tree, tvb, offset + iSizeMPF + 10, hf_mq_tsh_ctlflgs1, ett_mq_tsh_tcf, pf_flds_tcf, ENC_BIG_ENDIAN);
2295                 proto_tree_add_bitmask(mq_tree, tvb, offset + iSizeMPF + 11, hf_mq_tsh_ctlflgs2, ett_mq_tsh_tcf2, pf_flds_tcf2, ENC_BIG_ENDIAN);
2296 
2297                 proto_tree_add_item(mq_tree, hf_mq_tsh_luwid, tvb, offset + iSizeMPF + 12, 8, ENC_NA);
2298                 dissect_mq_encoding(mq_tree, hf_mq_tsh_encoding, tvb, offset + iSizeMPF + 20, 4, p_mq_parm->mq_int_enc);
2299                 proto_tree_add_item(mq_tree, hf_mq_tsh_ccsid, tvb, offset + iSizeMPF + 24, 2, p_mq_parm->mq_int_enc);
2300                 proto_tree_add_item(mq_tree, hf_mq_tsh_reserved, tvb, offset + iSizeMPF + 26, 2, p_mq_parm->mq_int_enc);
2301             }
2302             offset += iSizeTSH;
2303 
2304             /* Now dissect the embedded structures */
2305             if (tvb_reported_length_remaining(tvb, offset) >= 4)
2306             {
2307                 p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
2308                 if (((p_mq_parm->mq_ctlf1 & MQ_TCF_FIRST) != 0) || p_mq_parm->mq_opcode < 0x80)
2309                 {
2310                     /* First MQ segment (opcodes below 0x80 never span several TSH) */
2311                     gint iSizeAPI = 16;
2312                     if (p_mq_parm->mq_opcode >= 0x80 && p_mq_parm->mq_opcode <= 0x9F && tvb_reported_length_remaining(tvb, offset) >= 16)
2313                     {
2314                         guint32 iReturnCode = 0;
2315                         guint32 iHdl = 0;
2316                         iReturnCode = tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
2317                         iHdl = tvb_get_guint32(tvb, offset + 12, p_mq_parm->mq_int_enc);
2318                         if (!mq_in_reassembly)
2319                             dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
2320                         if (iHdl != 0 && iHdl != 0xffffffff && !mq_in_reassembly)
2321                             col_append_fstr(pinfo->cinfo, COL_INFO, " Hdl=0x%04x", iHdl);
2322                         if (iReturnCode != 0)
2323                             col_append_fstr(pinfo->cinfo, COL_INFO, " [RC=%d]", iReturnCode);
2324 
2325                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeAPI, ett_mq_api, NULL, MQ_TEXT_API);
2326 
2327                         proto_tree_add_item(mq_tree, hf_mq_api_replylen, tvb, offset, 4, ENC_BIG_ENDIAN);
2328                         proto_tree_add_item(mq_tree, hf_mq_api_compcode, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2329                         proto_tree_add_item(mq_tree, hf_mq_api_reascode, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2330                         proto_tree_add_item(mq_tree, hf_mq_api_objecthdl, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2331 
2332                         offset += iSizeAPI;
2333                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2334                     }
2335                     capLen = tvb_reported_length_remaining(tvb, offset);
2336                     if ((p_mq_parm->mq_strucID == MQ_STRUCTID_MSH || p_mq_parm->mq_strucID == MQ_STRUCTID_MSH_EBCDIC) && capLen >= 20)
2337                     {
2338                         gint iSize = 20;
2339                         iSizePayload = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
2340                         bPayload = TRUE;
2341 
2342                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSize, ett_mq_msh, NULL, MQ_TEXT_MSH);
2343 
2344                         proto_tree_add_item(mq_tree, hf_mq_msh_StructID, tvb, offset + 0, 4, p_mq_parm->mq_str_enc);
2345                         proto_tree_add_item(mq_tree, hf_mq_msh_seqnum, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2346                         proto_tree_add_item(mq_tree, hf_mq_msh_datalength, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2347                         proto_tree_add_item(mq_tree, hf_mq_msh_unknown1, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2348                         proto_tree_add_item(mq_tree, hf_mq_msh_msglength, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2349 
2350                         offset += iSize;
2351                     }
2352                     else if (p_mq_parm->mq_opcode == MQ_TST_CONAUTH_INFO && capLen >= 20)
2353                     {
2354                         gint iSize = 24;
2355                         gint iUsr = 0;
2356                         gint iPsw = 0;
2357 
2358                         iUsr = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
2359                         iPsw = tvb_get_guint32(tvb, offset + 20, p_mq_parm->mq_int_enc);
2360 
2361                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSize, ett_mq_caut, NULL, MQ_TEXT_CAUT);
2362 
2363                         proto_tree_add_item(mq_tree, hf_mq_caut_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
2364                         proto_tree_add_item(mq_tree, hf_mq_caut_AuthType, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2365                         proto_tree_add_item(mq_tree, hf_mq_caut_UsrMaxLen, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2366                         proto_tree_add_item(mq_tree, hf_mq_caut_PwdMaxLen, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2367                         proto_tree_add_item(mq_tree, hf_mq_caut_UsrLength, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2368                         proto_tree_add_item(mq_tree, hf_mq_caut_PwdLength, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
2369 
2370                         if (iUsr)
2371                             proto_tree_add_item(mq_tree, hf_mq_caut_usr, tvb, offset + 24, iUsr, p_mq_parm->mq_str_enc);
2372                         if (iPsw)
2373                             proto_tree_add_item(mq_tree, hf_mq_caut_psw, tvb, offset + 24 + iUsr, iPsw, p_mq_parm->mq_str_enc);
2374 
2375                         offset += iSize + iUsr + iPsw;
2376                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2377                     }
2378                     else if (p_mq_parm->mq_opcode == MQ_TST_SOCKET_ACTION && capLen >= 20)
2379                     {
2380                         gint iSize = 20;
2381                         gint iTy;
2382                         gint iP1;
2383                         gint iP2;
2384 
2385                         p_mq_parm->mq_convID = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
2386                         p_mq_parm->mq_rqstID = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2387                         dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
2388                         iTy = tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
2389                         iP1 = tvb_get_guint32(tvb, offset + 12, p_mq_parm->mq_int_enc);
2390                         iP2 = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
2391                         col_append_fstr(pinfo->cinfo, COL_INFO, " Type=%d, P1=%d, P2=%d", iTy, iP1, iP2);
2392 
2393                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeAPI, ett_mq_socket, NULL, MQ_TEXT_SOCKET);
2394 
2395                         proto_tree_add_item(mq_tree, hf_mq_socket_conversid, tvb, offset, 4, p_mq_parm->mq_int_enc);
2396                         proto_tree_add_item(mq_tree, hf_mq_socket_requestid, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2397                         proto_tree_add_item(mq_tree, hf_mq_socket_type, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2398                         proto_tree_add_item(mq_tree, hf_mq_socket_parm1, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2399                         proto_tree_add_item(mq_tree, hf_mq_socket_parm2, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2400 
2401                         offset += iSize;
2402                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2403                     }
2404                     else if (p_mq_parm->mq_opcode == MQ_TST_STATUS && capLen >= 8)
2405                     {
2406                         /* Some status are 28 bytes long and some are 36 bytes long */
2407                         gint iStatus = 0;
2408                         gint iStatusLength = 0;
2409 
2410                         iStatus = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2411                         iStatusLength = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
2412 
2413                         if (tvb_reported_length_remaining(tvb, offset) >= iStatusLength)
2414                         {
2415                             if (iStatus != 0)
2416                                 col_append_fstr(pinfo->cinfo, COL_INFO, " Code=%s", val_to_str_ext(iStatus, GET_VALS_EXTP(status), "Unknown (0x%08x)"));
2417 
2418                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, 8, ett_mq_status, NULL, MQ_TEXT_STAT);
2419 
2420                             proto_tree_add_item(mq_tree, hf_mq_status_length, tvb, offset, 4, p_mq_parm->mq_int_enc);
2421                             proto_tree_add_item(mq_tree, hf_mq_status_code, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2422 
2423                             if (iStatusLength >= 12)
2424                                 proto_tree_add_item(mq_tree, hf_mq_status_value, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2425 
2426                             offset += iStatusLength;
2427                         }
2428                     }
2429                     else if (p_mq_parm->mq_opcode == MQ_TST_PING && capLen > 4)
2430                     {
2431                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, -1, ett_mq_ping, NULL, MQ_TEXT_PING);
2432 
2433                         proto_tree_add_item(mq_tree, hf_mq_ping_length, tvb, offset, 4, p_mq_parm->mq_int_enc);
2434                         proto_tree_add_item(mq_tree, hf_mq_ping_buffer, tvb, offset + 4, -1, ENC_NA);
2435 
2436                         offset = tvb_reported_length(tvb);
2437                     }
2438                     else if (p_mq_parm->mq_opcode == MQ_TST_RESET && capLen >= 8)
2439                     {
2440                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, -1, ett_mq_reset, NULL, MQ_TEXT_RESET);
2441 
2442                         proto_tree_add_item(mq_tree, hf_mq_reset_length, tvb, offset, 4, p_mq_parm->mq_int_enc);
2443                         proto_tree_add_item(mq_tree, hf_mq_reset_seqnum, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2444 
2445                         offset = tvb_reported_length(tvb);
2446                     }
2447                     else if ((p_mq_parm->mq_opcode == MQ_TST_MQOPEN || p_mq_parm->mq_opcode == MQ_TST_MQCLOSE ||
2448                         p_mq_parm->mq_opcode == MQ_TST_MQOPEN_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQCLOSE_REPLY) && capLen >= 4)
2449                     {
2450                         offset += dissect_mq_od(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
2451                         if (tree)
2452                         {
2453                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, 4, ett_mq_open, NULL, MQ_TEXT_OPEN);
2454                             if (p_mq_parm->mq_opcode == MQ_TST_MQOPEN || p_mq_parm->mq_opcode == MQ_TST_MQOPEN_REPLY)
2455                             {
2456                                 dissect_mq_MQOO(tvb, mq_tree, offset, ett_mq_open_option, hf_mq_open_options, p_mq_parm);
2457                             }
2458                             if (p_mq_parm->mq_opcode == MQ_TST_MQCLOSE || p_mq_parm->mq_opcode == MQ_TST_MQCLOSE_REPLY)
2459                             {
2460                                 dissect_mq_MQCO(tvb, mq_tree, offset, p_mq_parm);
2461                             }
2462                         }
2463                         offset += 4;
2464                         offset += dissect_mq_fopa(tvb, mqroot_tree, offset, p_mq_parm);
2465                         offset += dissect_mq_fcmi(tvb, mqroot_tree, offset, p_mq_parm);
2466                     }
2467                     else if ((p_mq_parm->mq_opcode == MQ_TST_MQCONN || p_mq_parm->mq_opcode == MQ_TST_MQCONN_REPLY) && capLen > 0)
2468                     {
2469                         gint iSizeCONN = 0;
2470 
2471                         /*iSizeCONN = ((iVersionID == 4 || iVersionID == 6) ? 120 : 112);*/ /* guess */
2472                         /* The iVersionID is available in the previous ID segment, we should keep a state
2473                         * Instead we rely on the segment length announced in the TSH */
2474                         /* The MQCONN structure is special because it does not start with a structid */
2475                         iSizeCONN = iSegmentLength - iSizeTSH - iSizeAPI;
2476                         if (iSizeCONN != 120 && /*FAPLvl <= 5 - 6 Version 1 */
2477                             iSizeCONN != 260 && /*FAPLvl == 7 - 11 Version 1 */
2478                             iSizeCONN != 332 && /*FAPLvl == 12 -13 Version 2 */
2479                             iSizeCONN != 460)   /*FAPLvl == 14     Version 3 */
2480                             iSizeCONN = 0;
2481 
2482                         if (iSizeCONN != 0 && tvb_reported_length_remaining(tvb, offset) >= iSizeCONN)
2483                         {
2484                             gchar* sApplicationName;
2485                             gchar* sQMgr;
2486                             guint32 iEnc;
2487                             guint32 iCod;
2488                             guint32 iApp;
2489                             gchar   cChr;
2490 
2491                             /*
2492                             We have to handle the ccsid/coding of the MQCONN REPLY
2493                             on z/OS it is always EBCDIC
2494                             integer are always BIG_ENDIAN
2495                             */
2496                             if (p_mq_parm->mq_opcode == MQ_TST_MQCONN_REPLY)
2497                             {
2498                                 iApp = tvb_get_letohl(tvb, offset + 48 + 28);
2499                                 if (iApp <= 65536)
2500                                     iCod = ENC_LITTLE_ENDIAN;
2501                                 else
2502                                     iCod = ENC_BIG_ENDIAN;
2503                                 cChr = tvb_get_guint8(tvb, offset + 48);
2504                                 if ((cChr >= 'A' && cChr <= 'Z') ||
2505                                     (cChr >= 'a' && cChr <= 'z') ||
2506                                     (cChr >= '0' && cChr <= '9') ||
2507                                     (cChr == '\\'))
2508                                 {
2509                                     iEnc = p_mq_parm->mq_str_enc;
2510                                 }
2511                                 else
2512                                 {
2513                                     iEnc = ENC_EBCDIC;
2514                                 }
2515                             }
2516                             else
2517                             {
2518                                 iCod = p_mq_parm->mq_int_enc;
2519                                 iEnc = p_mq_parm->mq_str_enc;
2520                             }
2521                             iApp = tvb_get_guint32(tvb, offset + 48 + 28, iCod);
2522 
2523                             sApplicationName = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 28, iEnc);
2524                             sApplicationName = format_text_chr(wmem_packet_scope(), sApplicationName, strlen(sApplicationName), '.');
2525                             if (strip_trailing_blanks((guint8*)sApplicationName, (guint32)strlen(sApplicationName)) > 0)
2526                             {
2527                                 col_append_fstr(pinfo->cinfo, COL_INFO, " App=%s", sApplicationName);
2528                             }
2529                             sQMgr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 48, iEnc);
2530                             sQMgr = format_text_chr(wmem_packet_scope(), sQMgr, strlen(sQMgr), '.');
2531                             if (strip_trailing_blanks((guint8*)sQMgr, (guint32)strlen(sQMgr)) > 0)
2532                             {
2533                                 col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQMgr);
2534                             }
2535 
2536                             if (tree)
2537                             {
2538                                 ptvcursor_t* cursor;
2539                                 mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeCONN, ett_mq_conn, NULL, MQ_TEXT_CONN);
2540 
2541                                 cursor = ptvcursor_new(pinfo->pool, mq_tree, tvb, offset);
2542 
2543                                 ptvcursor_add(cursor, hf_mq_conn_QMgr, 48, iEnc);
2544                                 ptvcursor_add(cursor, hf_mq_conn_appname, 28, iEnc);
2545                                 ptvcursor_add(cursor, hf_mq_conn_apptype, 4, iCod);
2546                                 ptvcursor_add(cursor, hf_mq_conn_acttoken, 32, ENC_NA);
2547 
2548                                 ptvcursor_add(cursor, hf_mq_conn_options, 4, iCod);
2549                                 ptvcursor_add(cursor, hf_mq_conn_Xoptions, 4, iCod);
2550                                 if (iSizeCONN == 120)
2551                                 {
2552                                     gint tRemain = tvb_reported_length_remaining(tvb, ptvcursor_current_offset(cursor));
2553                                     if (tRemain > 0)
2554                                     {
2555                                         if (tRemain >= 24 && iApp != MQ_MQAT_JAVA)
2556                                         {
2557                                             ptvcursor_add(cursor, hf_mq_fcno_prodid, 24, iEnc);
2558                                             tRemain -= 24;
2559                                         }
2560                                         if (tRemain >= 48 && iApp != MQ_MQAT_JAVA)
2561                                         {
2562                                             ptvcursor_add(cursor, hf_mq_fcno_mqmid, 48, iEnc);
2563                                             tRemain -= 48;
2564                                         }
2565                                         if (tRemain > 0)
2566                                             ptvcursor_add(cursor, hf_mq_fcno_unknowb01, tRemain, ENC_NA);
2567                                     }
2568                                 }
2569                                 else
2570                                 {
2571                                     proto_tree* mq_tree_sub;
2572                                     gint iOption;
2573                                     gint iVersion;
2574                                     gint nofs = ptvcursor_current_offset(cursor);
2575 
2576                                     iVersion = tvb_get_guint32(tvb, nofs + 4, iCod);
2577                                     iOption = tvb_get_guint32(tvb, nofs + 8, iCod);
2578                                     mq_tree_sub = proto_tree_add_subtree(mq_tree, tvb, nofs, iSizeCONN - nofs, ett_mq_fcno, NULL, MQ_TEXT_FCNO);
2579 
2580                                     ptvcursor_set_tree(cursor, mq_tree_sub);
2581 
2582                                     ptvcursor_add(cursor, hf_mq_fcno_StructID, 4, iEnc);
2583                                     ptvcursor_add(cursor, hf_mq_fcno_version, 4, iCod);
2584                                     ptvcursor_add(cursor, hf_mq_fcno_capflag, 4, iCod);
2585                                     if (iVersion >= 1)
2586                                     {
2587                                         ptvcursor_add(cursor, hf_mq_fcno_conn_tag, 128, ENC_NA);
2588                                     }
2589                                     if (iVersion >= 3)
2590                                     {
2591                                         ptvcursor_add(cursor, hf_mq_fcno_retconn_tag, 128, ENC_NA);
2592                                     }
2593                                     gint tRemain = tvb_reported_length_remaining(tvb, ptvcursor_current_offset(cursor));
2594                                     if (tRemain > 0)
2595                                     {
2596                                         if (tRemain >= 24 && iApp != MQ_MQAT_JAVA)
2597                                         {
2598                                             ptvcursor_add(cursor, hf_mq_fcno_prodid, 24, iEnc);
2599                                             tRemain -= 24;
2600                                         }
2601                                         if (tRemain >= 48 && iApp != MQ_MQAT_JAVA)
2602                                         {
2603                                             ptvcursor_add(cursor, hf_mq_fcno_mqmid, 48, iEnc);
2604                                             tRemain -= 48;
2605                                         }
2606                                         if (tRemain > 0)
2607                                         {
2608                                             if (iOption != 0)
2609                                             {
2610                                                 guint32 tUsed = dissect_mqpcf_parm(tvb, pinfo, mq_tree_sub, ptvcursor_current_offset(cursor), tRemain, iCod, TRUE);
2611                                                 tRemain -= tUsed;
2612                                             }
2613                                             if (tRemain > 0)
2614                                                 ptvcursor_add(cursor, hf_mq_fcno_unknowb01, tRemain, ENC_NA);
2615                                         }
2616                                     }
2617 
2618                                     iSizeCONN = ptvcursor_current_offset(cursor) - offset;
2619                                 }
2620                                 ptvcursor_free(cursor);
2621                             }
2622                             offset += iSizeCONN;
2623                         }
2624                     }
2625                     else if ((p_mq_parm->mq_opcode == MQ_TST_MQINQ || p_mq_parm->mq_opcode == MQ_TST_MQINQ_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQSET) && capLen >= 12)
2626                     {
2627                         /* The MQINQ/MQSET structure is special because it does not start with a structid */
2628                         gint iNbSelectors;
2629                         gint iNbIntegers;
2630                         gint iCharLen;
2631                         gint iOffsetINQ;
2632                         gint iSelector;
2633 
2634                         iNbSelectors = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
2635                         iNbIntegers = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2636                         iCharLen = tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
2637 
2638                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, -1, ett_mq_inq, NULL, MQ_TEXT_INQ);
2639 
2640                         proto_tree_add_item(mq_tree, hf_mq_inq_nbsel, tvb, offset, 4, p_mq_parm->mq_int_enc);
2641                         proto_tree_add_item(mq_tree, hf_mq_inq_nbint, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2642                         proto_tree_add_item(mq_tree, hf_mq_inq_charlen, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2643 
2644                         iOffsetINQ = 12;
2645                         if (tvb_reported_length_remaining(tvb, offset + iOffsetINQ) >= iNbSelectors * 4)
2646                         {
2647                             guint _posSel = offset + iOffsetINQ;
2648                             guint _posSelE = _posSel + iNbSelectors * 4 + 4;
2649                             const guint8* _pVal = NULL;
2650                             for (iSelector = 0; iSelector < iNbSelectors; iSelector++)
2651                             {
2652                                 proto_tree_add_item(mq_tree, hf_mq_inq_sel, tvb, offset + iOffsetINQ + iSelector * 4, 4, p_mq_parm->mq_int_enc);
2653                             }
2654                             iOffsetINQ += iNbSelectors * 4;
2655                             if (p_mq_parm->mq_opcode == MQ_TST_MQINQ_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQSET)
2656                             {
2657                                 gint iSizeINQValues;
2658                                 iSizeINQValues = iNbIntegers * 4 + iCharLen;
2659                                 if (tvb_reported_length_remaining(tvb, offset + iOffsetINQ) >= iSizeINQValues)
2660                                 {
2661                                     gint iInteger;
2662                                     guint _lVal;
2663                                     guint _lSel;
2664                                     for (iInteger = 0; iInteger < iNbIntegers; iInteger++)
2665                                     {
2666                                         _lSel = tvb_get_guint32(tvb, _posSel, p_mq_parm->mq_int_enc);
2667                                         while (_posSel < _posSelE && (_lSel < MQ_MQIA_FIRST || _lSel > MQ_MQIA_LAST))
2668                                         {
2669                                             _posSel += 4;
2670                                             _lSel = tvb_get_guint32(tvb, _posSel, p_mq_parm->mq_int_enc);
2671                                         }
2672                                         _lVal = tvb_get_guint32(tvb, offset + iOffsetINQ + iInteger * 4, p_mq_parm->mq_int_enc);
2673                                         _pVal = dissect_mqpcf_parm_getintval(_lSel, _lVal);
2674                                         _posSel += 4;
2675                                         if (_pVal)
2676                                             proto_tree_add_uint_format(mq_tree, hf_mq_inq_intvalue, tvb, offset + iOffsetINQ + iInteger * 4, 4, 0,
2677                                                 "Integer value...: %s (%d)", _pVal, _lVal);
2678                                         else
2679                                             proto_tree_add_item(mq_tree, hf_mq_inq_intvalue, tvb, offset + iOffsetINQ + iInteger * 4, 4, p_mq_parm->mq_int_enc);
2680                                     }
2681                                     iOffsetINQ += iNbIntegers * 4;
2682                                     if (iCharLen != 0)
2683                                     {
2684                                         proto_tree_add_item(mq_tree, hf_mq_inq_charvalues, tvb, offset + iOffsetINQ, iCharLen, p_mq_parm->mq_str_enc);
2685                                     }
2686                                 }
2687                             }
2688                         }
2689                         offset += tvb_reported_length(tvb);
2690                     }
2691                     else if (p_mq_parm->mq_opcode == MQ_TST_NOTIFICATION)
2692                     {
2693                         guint uHdl;
2694                         guint uCod;
2695 
2696                         uHdl = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2697                         uCod = tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
2698 
2699                         dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
2700                         col_append_fstr(pinfo->cinfo, COL_INFO, " Hdl=0x%04x Cod=%s(0x%x)",
2701                             uHdl, try_val_to_str(uCod, GET_VALSV(notifcode)), uCod);
2702 
2703                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, -1, ett_mq_notif, NULL, MQ_TEXT_NOTIFICATION);
2704 
2705                         proto_tree_add_item(mq_tree, hf_mq_notif_vers, tvb, offset, 4, p_mq_parm->mq_int_enc);
2706                         proto_tree_add_item(mq_tree, hf_mq_notif_handle, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2707                         proto_tree_add_item(mq_tree, hf_mq_notif_code, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2708                         proto_tree_add_item(mq_tree, hf_mq_notif_value, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2709 
2710                         offset += 16;
2711                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2712                     }
2713                     else if (p_mq_parm->mq_opcode == MQ_TST_REQUEST_MSGS)
2714                     {
2715                         gint iHdl;
2716                         gint iFlags;
2717                         gint iGlbMsgIdx;
2718                         gint iMaxMsgLen;
2719                         gint iOpt;
2720 
2721                         iHdl = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2722                         iMaxMsgLen = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
2723                         iFlags = tvb_get_guint32(tvb, offset + 32, p_mq_parm->mq_int_enc);
2724                         iGlbMsgIdx = tvb_get_guint32(tvb, offset + 36, p_mq_parm->mq_int_enc);
2725                         if (iFlags & MQ_REQUEST_MSG_SELECTION)
2726                         {
2727                             p_mq_parm->mq_msgreq_ccsid.encod = tvb_get_guint32(tvb, offset + 44, p_mq_parm->mq_int_enc);
2728                             p_mq_parm->mq_msgreq_ccsid.ccsid = tvb_get_guint32(tvb, offset + 48, p_mq_parm->mq_int_enc);
2729                         }
2730                         dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
2731                         col_append_fstr(pinfo->cinfo, COL_INFO, " Hdl=0x%04x RqstFlags=%08x GlbMsgIdx=%d MaxLen=%d ",
2732                             iHdl, iFlags, iGlbMsgIdx, iMaxMsgLen);
2733 
2734                         if (tree)
2735                         {
2736                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, -1, ett_mq_msg, NULL, MQ_TEXT_REQMSG);
2737 
2738                             proto_tree_add_item(mq_tree, hf_mq_msgreq_version, tvb, offset, 4, p_mq_parm->mq_int_enc);
2739                             proto_tree_add_item(mq_tree, hf_mq_msgreq_handle, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2740                             proto_tree_add_item(mq_tree, hf_mq_msgreq_RecvBytes, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2741                             proto_tree_add_item(mq_tree, hf_mq_msgreq_RqstBytes, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2742                             proto_tree_add_item(mq_tree, hf_mq_msgreq_MaxMsgLen, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2743                             dissect_mq_MQGMO(tvb, mq_tree, offset + 20, ett_mq_gmo_option, p_mq_parm);
2744 
2745                             proto_tree_add_item(mq_tree, hf_mq_msgreq_WaitIntrv, tvb, offset + 24, 4, p_mq_parm->mq_int_enc);
2746                             proto_tree_add_item(mq_tree, hf_mq_msgreq_QueStatus, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
2747                             proto_tree_add_bitmask(mq_tree, tvb, offset + 32, hf_mq_msgreq_RqstFlags, ett_mq_msgreq_RqstFlags, pf_flds_msgreq_flags, p_mq_parm->mq_int_enc);
2748 
2749                             proto_tree_add_item(mq_tree, hf_mq_msgreq_GlbMsgIdx, tvb, offset + 36, 4, p_mq_parm->mq_int_enc);
2750 
2751                             if (iFlags & MQ_REQUEST_MSG_SELECTION)
2752                             {
2753                                 proto_tree_add_item(mq_tree, hf_mq_msgreq_SelectIdx, tvb, offset + 40, 2, p_mq_parm->mq_int_enc);
2754                                 proto_tree_add_item(mq_tree, hf_mq_msgreq_MQMDVers, tvb, offset + 42, 2, p_mq_parm->mq_int_enc);
2755                                 proto_tree_add_item(mq_tree, hf_mq_msgreq_ccsid, tvb, offset + 44, 4, p_mq_parm->mq_int_enc);
2756                                 dissect_mq_encoding(mq_tree, hf_mq_msgreq_encoding, tvb, offset + 48, 4, p_mq_parm->mq_int_enc);
2757                                 proto_tree_add_item(mq_tree, hf_mq_msgreq_MsgSeqNum, tvb, offset + 52, 4, p_mq_parm->mq_int_enc);
2758                                 proto_tree_add_item(mq_tree, hf_mq_msgreq_offset, tvb, offset + 56, 4, p_mq_parm->mq_int_enc);
2759                                 dissect_mq_MQMO(tvb, mq_tree, offset + 60, ett_mq_gmo_matchoption, p_mq_parm);
2760                                 iOpt = tvb_get_guint32(tvb, offset + 60, p_mq_parm->mq_int_enc);
2761 
2762                                 offset += MQ_REQUEST_MSG_SIZE_V1_SELECTION_FIXED_PART;
2763                                 if (iOpt & MQ_MQMO_MATCH_MSG_ID)
2764                                 {
2765                                     proto_tree_add_item(mq_tree, hf_mq_msgreq_mtchMsgId, tvb, offset, 24, p_mq_parm->mq_str_enc);
2766                                     offset += 24;
2767                                 }
2768                                 if (iOpt & MQ_MQMO_MATCH_CORREL_ID)
2769                                 {
2770                                     proto_tree_add_item(mq_tree, hf_mq_msgreq_mtchCorId, tvb, offset, 24, p_mq_parm->mq_str_enc);
2771                                     offset += 24;
2772                                 }
2773                                 if (iOpt & MQ_MQMO_MATCH_GROUP_ID)
2774                                 {
2775                                     proto_tree_add_item(mq_tree, hf_mq_msgreq_mtchGrpid, tvb, offset, 24, p_mq_parm->mq_str_enc);
2776                                     offset += 24;
2777                                 }
2778                                 if (iOpt & MQ_MQMO_MATCH_MSG_TOKEN)
2779                                 {
2780                                     proto_tree_add_item(mq_tree, hf_mq_msgreq_mtchMsgTk, tvb, offset, 16, p_mq_parm->mq_str_enc);
2781                                     offset += 16;
2782                                 }
2783                             }
2784                             else
2785                             {
2786                                 offset += MQ_REQUEST_MSG_SIZE_V1_NO_SELECTION;
2787                             }
2788                         }
2789                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2790                     }
2791                     else if (p_mq_parm->mq_opcode == MQ_TST_ASYNC_MESSAGE)
2792                     {
2793                         gint  iReasnCode = 0;
2794                         gint  iSegmIndex;
2795                         gint  iGlbMsgIdx;
2796                         gint  iPadLen;
2797 
2798                         gint8 iStrLen;
2799                         gint  iHdl;
2800                         gint  iHdrL;
2801 
2802                         iHdl = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
2803                         iGlbMsgIdx = tvb_get_guint32(tvb, offset + 12, p_mq_parm->mq_int_enc);
2804                         iSegmIndex = tvb_get_guint16(tvb, offset + 20, p_mq_parm->mq_int_enc);
2805 
2806                         if (p_mq_parm->mq_ctlf1 & MQ_TCF_FIRST)
2807                         {
2808                             iReasnCode = tvb_get_guint32(tvb, offset + 24, p_mq_parm->mq_int_enc);
2809                         }
2810 
2811                         if (iSegmIndex == 0)
2812                         {
2813                             iStrLen = tvb_get_guint8(tvb, offset + 54);
2814                             iPadLen = (2 + 1 + iStrLen) % 4;
2815                             iPadLen = (iPadLen) ? 4 - iPadLen : 0;
2816                         }
2817                         else
2818                         {
2819                             iPadLen = 0;
2820                             iStrLen = 0;
2821                         }
2822 
2823                         iHdrL = (iSegmIndex == 0) ? (54 + 1 + iStrLen + iPadLen) : 24;
2824 
2825                         if (!mq_in_reassembly)
2826                         {
2827                             dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
2828                             col_append_fstr(pinfo->cinfo, COL_INFO,
2829                                 " Hdl=0x%04x GlbMsgIdx=%d, Full Message",
2830                                 iHdl, iGlbMsgIdx);
2831                             if (iReasnCode != MQ_MQRC_NONE)
2832                                 col_append_fstr(pinfo->cinfo, COL_INFO,
2833                                     ", RC=%d(0x%x) - %s",
2834                                     iReasnCode, iReasnCode,
2835                                     val_to_str_ext(iReasnCode, GET_VALS_EXTP(MQRC), "Unknown (0x%02x)"));
2836                         }
2837 
2838                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iHdrL, ett_mq_msg, NULL, MQ_TEXT_ASYMSG);
2839 
2840                         proto_tree_add_item(mq_tree, hf_mq_msgasy_version, tvb, offset, 4, p_mq_parm->mq_int_enc);
2841                         proto_tree_add_item(mq_tree, hf_mq_msgasy_handle, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2842                         proto_tree_add_item(mq_tree, hf_mq_msgasy_MsgIndex, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2843                         proto_tree_add_item(mq_tree, hf_mq_msgasy_GlbMsgIdx, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2844                         proto_tree_add_item(mq_tree, hf_mq_msgasy_SegLength, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2845                         proto_tree_add_item(mq_tree, hf_mq_msgasy_SegmIndex, tvb, offset + 20, 2, p_mq_parm->mq_int_enc);
2846                         proto_tree_add_item(mq_tree, hf_mq_msgasy_SeleIndex, tvb, offset + 22, 2, p_mq_parm->mq_int_enc);
2847                         if (p_mq_parm->mq_ctlf1 & MQ_TCF_FIRST)
2848                         {
2849                             proto_tree_add_item(mq_tree, hf_mq_msgasy_ReasonCod, tvb, offset + 24, 4, p_mq_parm->mq_int_enc);
2850                             proto_tree_add_item(mq_tree, hf_mq_msgasy_TotMsgLen, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
2851                             proto_tree_add_item(mq_tree, hf_mq_msgasy_ActMsgLen, tvb, offset + 32, 4, p_mq_parm->mq_int_enc);
2852                             proto_tree_add_item(mq_tree, hf_mq_msgasy_MsgToken, tvb, offset + 36, 16, p_mq_parm->mq_int_enc);
2853                             proto_tree_add_item(mq_tree, hf_mq_msgasy_Status, tvb, offset + 52, 2, p_mq_parm->mq_int_enc);
2854                             proto_tree_add_item(mq_tree, hf_mq_msgasy_resolQNLn, tvb, offset + 54, 1, ENC_NA);
2855                             proto_tree_add_item(mq_tree, hf_mq_msgasy_resolQNme, tvb, offset + 55, iStrLen, p_mq_parm->mq_str_enc);
2856                             if (iPadLen)
2857                                 proto_tree_add_item(mq_tree, hf_mq_msgasy_padding, tvb, offset + 55 + iStrLen, iPadLen, p_mq_parm->mq_str_enc);
2858                         }
2859                         offset += iHdrL;
2860                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2861 
2862                         iSizePayload = tvb_reported_length_remaining(tvb, offset);
2863                         bPayload = (iSizePayload > 0);
2864                     }
2865                     else if ((p_mq_parm->mq_opcode == MQ_TST_SPI || p_mq_parm->mq_opcode == MQ_TST_SPI_REPLY) && capLen >= 12)
2866                     {
2867                         gint    iOffsetSPI = 0;
2868                         guint32 iSpiVerb = 0;
2869 
2870                         p_mq_parm->iOfsEnc = offset + 12;
2871                         p_mq_parm->iOfsCcs = offset + 16;
2872                         p_mq_parm->iOfsFmt = offset + 20;
2873 
2874                         iSpiVerb = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
2875                         col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str(iSpiVerb, mq_spi_verbs_vals, "Unknown (0x%08x)"));
2876 
2877                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, 12, ett_mq_spi, NULL, MQ_TEXT_SPI);
2878 
2879                         proto_tree_add_item(mq_tree, hf_mq_spi_verb, tvb, offset, 4, p_mq_parm->mq_int_enc);
2880                         proto_tree_add_item(mq_tree, hf_mq_spi_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2881                         proto_tree_add_item(mq_tree, hf_mq_spi_length, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2882 
2883                         offset += 12;
2884                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2885                         if (((p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxU ||
2886                             (p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxU_EBCDIC)
2887                             && tvb_reported_length_remaining(tvb, offset) >= 12)
2888                         {
2889                             gint iSizeSPIMD = 0;
2890                             guint8* sStructId;
2891 
2892                             if ((p_mq_parm->mq_strucID & MQ_MASK_SPxx) == MQ_STRUCTID_SPxx)
2893                             {
2894                                 strid_enc = ENC_ASCII | ENC_NA;
2895                             }
2896                             else
2897                             {
2898                                 strid_enc = ENC_EBCDIC | ENC_NA;
2899                             }
2900                             sStructId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, strid_enc);
2901                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, 12, ett_mq_spi_base, NULL, (const char*)sStructId);
2902 
2903                             proto_tree_add_item(mq_tree, hf_mq_spi_base_StructID, tvb, offset, 4, strid_enc);
2904                             proto_tree_add_item(mq_tree, hf_mq_spi_base_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2905                             proto_tree_add_item(mq_tree, hf_mq_spi_base_length, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2906 
2907                             offset += 12;
2908                             p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2909 
2910                             if ((iSizeSPIMD = dissect_mq_md(tvb, mqroot_tree, offset, p_mq_parm, TRUE)) != 0)
2911                             {
2912                                 offset += iSizeSPIMD;
2913                                 offset += dissect_mq_gmo(tvb, pinfo, mqroot_tree, offset, p_mq_parm);
2914                                 offset += dissect_mq_pmo(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
2915                                 p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
2916                             }
2917 
2918                             offset += dissect_mq_od(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
2919 
2920                             if (((p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxO ||
2921                                 (p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxO_EBCDIC ||
2922                                 (p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxI ||
2923                                 (p_mq_parm->mq_strucID & MQ_MASK_SPxZ) == MQ_STRUCTID_SPxI_EBCDIC)
2924                                 && tvb_reported_length_remaining(tvb, offset) >= 12)
2925                             {
2926                                 /* Dissect the common part of these structures */
2927                                 if ((p_mq_parm->mq_strucID & MQ_MASK_SPxx) == MQ_STRUCTID_SPxx)
2928                                 {
2929                                     strid_enc = ENC_ASCII | ENC_NA;
2930                                 }
2931                                 else
2932                                 {
2933                                     strid_enc = ENC_EBCDIC | ENC_NA;
2934                                 }
2935                                 sStructId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, strid_enc);
2936                                 mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, -1, ett_mq_spi_base, NULL, (const char*)sStructId);
2937 
2938                                 proto_tree_add_item(mq_tree, hf_mq_spi_base_StructID, tvb, offset, 4, strid_enc);
2939                                 proto_tree_add_item(mq_tree, hf_mq_spi_base_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
2940                                 proto_tree_add_item(mq_tree, hf_mq_spi_base_length, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
2941 
2942                                 if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPQO || p_mq_parm->mq_strucID == MQ_STRUCTID_SPQO_EBCDIC)
2943                                     && tvb_reported_length_remaining(tvb, offset) >= 16)
2944                                 {
2945                                     if (tree)
2946                                     {
2947                                         gint iVerbNumber = 0;
2948                                         proto_tree_add_item(mq_tree, hf_mq_spi_spqo_nbverb, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2949                                         iVerbNumber = tvb_get_guint32(tvb, offset + 12, p_mq_parm->mq_int_enc);
2950 
2951                                         if (tvb_reported_length_remaining(tvb, offset) >= iVerbNumber * 20 + 16)
2952                                         {
2953                                             gint iVerb = 0;
2954                                             iOffsetSPI = offset + 16;
2955                                             for (iVerb = 0; iVerb < iVerbNumber; iVerb++)
2956                                             {
2957                                                 proto_tree_add_item(mq_tree, hf_mq_spi_spqo_verbid, tvb, iOffsetSPI, 4, p_mq_parm->mq_int_enc);
2958                                                 proto_tree_add_item(mq_tree, hf_mq_spi_spqo_maxiover, tvb, iOffsetSPI + 4, 4, p_mq_parm->mq_int_enc);
2959                                                 proto_tree_add_item(mq_tree, hf_mq_spi_spqo_maxinver, tvb, iOffsetSPI + 8, 4, p_mq_parm->mq_int_enc);
2960                                                 proto_tree_add_item(mq_tree, hf_mq_spi_spqo_maxouver, tvb, iOffsetSPI + 12, 4, p_mq_parm->mq_int_enc);
2961                                                 proto_tree_add_item(mq_tree, hf_mq_spi_spqo_flags, tvb, iOffsetSPI + 16, 4, p_mq_parm->mq_int_enc);
2962                                                 iOffsetSPI += 20;
2963                                             }
2964                                             offset += iVerbNumber * 20 + 16;
2965                                         }
2966                                     }
2967                                 }
2968                                 else if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPAI || p_mq_parm->mq_strucID == MQ_STRUCTID_SPAI_EBCDIC)
2969                                     && tvb_reported_length_remaining(tvb, offset) >= 136)
2970                                 {
2971                                     proto_tree_add_item(mq_tree, hf_mq_spi_spai_mode, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2972                                     proto_tree_add_item(mq_tree, hf_mq_spi_spai_unknown1, tvb, offset + 16, 48, p_mq_parm->mq_str_enc);
2973                                     proto_tree_add_item(mq_tree, hf_mq_spi_spai_unknown2, tvb, offset + 64, 48, p_mq_parm->mq_str_enc);
2974                                     proto_tree_add_item(mq_tree, hf_mq_spi_spai_msgid, tvb, offset + 112, 24, p_mq_parm->mq_str_enc);
2975                                     offset += 136;
2976                                 }
2977                                 else if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPGI || p_mq_parm->mq_strucID == MQ_STRUCTID_SPGI_EBCDIC)
2978                                     && tvb_reported_length_remaining(tvb, offset) >= 24)
2979                                 {
2980                                     proto_tree_add_item(mq_tree, hf_mq_spi_spgi_batchsz, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
2981                                     proto_tree_add_item(mq_tree, hf_mq_spi_spgi_batchint, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2982                                     proto_tree_add_item(mq_tree, hf_mq_spi_spgi_maxmsgsz, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
2983                                     offset += 24;
2984                                 }
2985                                 else if ((p_mq_parm->mq_strucID == MQ_STRUCTID_SPGO || p_mq_parm->mq_strucID == MQ_STRUCTID_SPPI ||
2986                                     p_mq_parm->mq_strucID == MQ_STRUCTID_SPGO_EBCDIC || p_mq_parm->mq_strucID == MQ_STRUCTID_SPPI_EBCDIC)
2987                                     && tvb_reported_length_remaining(tvb, offset) >= 20)
2988                                 {
2989                                     proto_tree_add_bitmask(mq_tree, tvb, offset + 12, hf_mq_spi_spgo_options, ett_mq_spi_options, pf_flds_spiopt, ENC_BIG_ENDIAN);
2990                                     proto_tree_add_item(mq_tree, hf_mq_spi_spgo_size, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
2991                                     iSizePayload = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
2992                                     offset += 20;
2993                                     bPayload = TRUE;
2994                                 }
2995                                 else
2996                                 {
2997                                     offset += 12;
2998                                 }
2999                                 p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3000                             }
3001                         }
3002                     }
3003                     else if ((p_mq_parm->mq_opcode >= 0xA0 && p_mq_parm->mq_opcode <= 0xB9) && capLen >= 16)
3004                     {
3005                         /* The XA structures are special because they do not start with a structid */
3006                         mq_tree = proto_tree_add_subtree_format(mqroot_tree, tvb, offset, 16, ett_mq_xa, NULL,
3007                             "%s (%s)", MQ_TEXT_XA, val_to_str_ext(p_mq_parm->mq_opcode, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"));
3008 
3009                         proto_tree_add_item(mq_tree, hf_mq_xa_length, tvb, offset, 4, ENC_BIG_ENDIAN);
3010                         proto_tree_add_item(mq_tree, hf_mq_xa_returnvalue, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
3011 
3012                         proto_tree_add_bitmask(mq_tree, tvb, offset + 8, hf_mq_xa_tmflags, ett_mq_xa_tmflags, pf_flds_tmflags, ENC_BIG_ENDIAN);
3013 
3014                         proto_tree_add_item(mq_tree, hf_mq_xa_rmid, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
3015                         offset += 16;
3016                         if (p_mq_parm->mq_opcode == MQ_TST_XA_START || p_mq_parm->mq_opcode == MQ_TST_XA_END || p_mq_parm->mq_opcode == MQ_TST_XA_PREPARE
3017                             || p_mq_parm->mq_opcode == MQ_TST_XA_COMMIT || p_mq_parm->mq_opcode == MQ_TST_XA_ROLLBACK || p_mq_parm->mq_opcode == MQ_TST_XA_FORGET
3018                             || p_mq_parm->mq_opcode == MQ_TST_XA_COMPLETE)
3019                         {
3020                             gint iSizeXid = 0;
3021                             if ((iSizeXid = dissect_mq_xid(tvb, mqroot_tree, p_mq_parm, offset)) != 0)
3022                                 offset += iSizeXid;
3023                         }
3024                         else if ((p_mq_parm->mq_opcode == MQ_TST_XA_OPEN || p_mq_parm->mq_opcode == MQ_TST_XA_CLOSE)
3025                             && tvb_reported_length_remaining(tvb, offset) >= 1)
3026                         {
3027                             guint8 iXAInfoLength = 0;
3028                             iXAInfoLength = tvb_get_guint8(tvb, offset);
3029                             if (tvb_reported_length_remaining(tvb, offset) >= iXAInfoLength + 1)
3030                             {
3031                                 mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iXAInfoLength + 1, ett_mq_xa_info, NULL, MQ_TEXT_XINF);
3032 
3033                                 proto_tree_add_item(mq_tree, hf_mq_xa_xainfo_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3034                                 proto_tree_add_item(mq_tree, hf_mq_xa_xainfo_value, tvb, offset + 1, iXAInfoLength, p_mq_parm->mq_str_enc);
3035                             }
3036                             offset += 1 + iXAInfoLength;
3037                         }
3038                         else if ((p_mq_parm->mq_opcode == MQ_TST_XA_RECOVER || p_mq_parm->mq_opcode == MQ_TST_XA_RECOVER_REPLY)
3039                             && tvb_reported_length_remaining(tvb, offset) >= 4)
3040                         {
3041                             gint iNbXid = 0;
3042                             iNbXid = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
3043                             proto_tree_add_item(mq_tree, hf_mq_xa_count, tvb, offset, 4, p_mq_parm->mq_int_enc);
3044                             offset += 4;
3045                             if (p_mq_parm->mq_opcode == MQ_TST_XA_RECOVER_REPLY)
3046                             {
3047                                 gint iXid = 0;
3048                                 for (iXid = 0; iXid < iNbXid; iXid++)
3049                                 {
3050                                     gint iSizeXid = 0;
3051                                     if ((iSizeXid = dissect_mq_xid(tvb, mqroot_tree, p_mq_parm, offset)) != 0)
3052                                         offset += iSizeXid;
3053                                     else
3054                                         break;
3055                                 }
3056                             }
3057                         }
3058                     }
3059                     /* LPOO seems to be a bug for SPOO */
3060                     if ((p_mq_parm->mq_strucID == MQ_STRUCTID_LPOO || p_mq_parm->mq_strucID == MQ_STRUCTID_LPOO_EBCDIC) && tvb_reported_length_remaining(tvb, offset) >= 32)
3061                     {
3062                         guint iVersion;
3063                         guint iXtraData = 0;
3064                         gint  iSize = 32;
3065                         gint  iPos = 0;
3066                         gint  iSegSize = tvb_reported_length_remaining(tvb, offset);
3067                         iVersion = tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
3068                         if (iSegSize >= 488)
3069                         {
3070                             iSize += 56;
3071                             iXtraData = tvb_get_guint32(tvb, offset + 84, p_mq_parm->mq_int_enc);
3072                         }
3073 
3074                         if (iSize != 0 && iSegSize >= iSize)
3075                         {
3076                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSize, ett_mq_lpoo, NULL, MQ_TEXT_LPOO);
3077 
3078                             proto_tree_add_item(mq_tree, hf_mq_lpoo_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
3079                             proto_tree_add_item(mq_tree, hf_mq_lpoo_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
3080                             dissect_mq_MQOO(tvb, mq_tree, offset + 8, ett_mq_open_option, hf_mq_open_options, p_mq_parm);
3081                             dissect_mq_LPOO_LPIOPTS(tvb, mq_tree, offset + 12, ett_mq_lpoo_lpiopts, p_mq_parm);
3082 
3083                             proto_tree_add_item(mq_tree, hf_mq_lpoo_defpersist, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
3084                             proto_tree_add_item(mq_tree, hf_mq_lpoo_defputresptype, tvb, offset + 20, 4, p_mq_parm->mq_int_enc);
3085                             proto_tree_add_item(mq_tree, hf_mq_lpoo_defreadahead, tvb, offset + 24, 4, p_mq_parm->mq_int_enc);
3086                             proto_tree_add_item(mq_tree, hf_mq_lpoo_propertyctl, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
3087                             iPos += 32;
3088                             if (iSize == 88)
3089                             {
3090                                 proto_tree_add_item(mq_tree, hf_mq_lpoo_qprotect, tvb, offset + iPos, 48, p_mq_parm->mq_str_enc);
3091                                 proto_tree_add_item(mq_tree, hf_mq_lpoo_qprotect_val1, tvb, offset + iPos + 48, 4, p_mq_parm->mq_str_enc);
3092                                 proto_tree_add_item(mq_tree, hf_mq_lpoo_qprotect_val2, tvb, offset + iPos + 52, 4, p_mq_parm->mq_str_enc);
3093                                 iPos += 56;
3094                             }
3095                             if (iVersion >= 1)
3096                             {
3097                                 guint iDistributionListSize2;
3098                                 iSize = dissect_mq_od(tvb, pinfo, mqroot_tree, offset + iPos, p_mq_parm, &iDistributionListSize2);
3099                             }
3100                             offset += iPos + iSize;
3101                             p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3102                             if (iXtraData > 0)
3103                             {
3104                                 if (p_mq_parm->mq_opcode == MQ_TST_SPI_REPLY)
3105                                 {
3106                                     bPayload = TRUE;
3107                                     iSizePayload = iXtraData;
3108                                     p_mq_parm->iOfsFmt = (offset - iSize);
3109                                 }
3110                             }
3111                         }
3112                     }
3113                     if ((p_mq_parm->mq_strucID == MQ_STRUCTID_ID || p_mq_parm->mq_strucID == MQ_STRUCTID_ID_EBCDIC) && tvb_reported_length_remaining(tvb, offset) >= 5)
3114                     {
3115                         offset += dissect_mq_id(tvb, pinfo, mqroot_tree, offset, p_mq_parm);
3116                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3117                     }
3118                     if ((p_mq_parm->mq_strucID == MQ_STRUCTID_UID || p_mq_parm->mq_strucID == MQ_STRUCTID_UID_EBCDIC) && tvb_reported_length_remaining(tvb, offset) > 0)
3119                     {
3120                         gint iSizeUID;
3121                         /* iSizeUID = (iVersionID < 5 ? 28 : 132);  guess */
3122                         /* The iVersionID is available in the previous ID segment, we should keep a state *
3123                          * Instead we rely on the segment length announced in the TSH */
3124                         iSizeUID = iSegmentLength - iSizeTSH;
3125                         if (iSizeUID != 28 && iSizeUID != 132)
3126                             iSizeUID = 0;
3127 
3128                         if (iSizeUID != 0 && tvb_reported_length_remaining(tvb, offset) >= iSizeUID)
3129                         {
3130                             guint8* sUserId;
3131                             sUserId = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, 12, p_mq_parm->mq_str_enc);
3132                             dissect_mq_addCR_colinfo(pinfo, p_mq_parm);
3133                             if (strip_trailing_blanks(sUserId, 12) > 0)
3134                             {
3135                                 col_append_fstr(pinfo->cinfo, COL_INFO, " User=%s", sUserId);
3136                             }
3137 
3138                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeUID, ett_mq_uid, NULL, MQ_TEXT_UID);
3139 
3140                             proto_tree_add_item(mq_tree, hf_mq_uid_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
3141                             proto_tree_add_item(mq_tree, hf_mq_uid_userid, tvb, offset + 4, 12, p_mq_parm->mq_str_enc);
3142                             proto_tree_add_item(mq_tree, hf_mq_uid_password, tvb, offset + 16, 12, p_mq_parm->mq_str_enc);
3143 
3144                             if (iSizeUID == 132)
3145                             {
3146                                 proto_tree_add_item(mq_tree, hf_mq_uid_longuserid, tvb, offset + 28, 64, p_mq_parm->mq_str_enc);
3147                                 dissect_mq_sid(tvb, mq_tree, p_mq_parm, offset + 92);
3148                             }
3149                         }
3150                         offset += iSizeUID;
3151                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3152                     }
3153 
3154                     offset += dissect_mq_od(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize);
3155 
3156                     if ((iSizeMD = dissect_mq_md(tvb, mqroot_tree, offset, p_mq_parm, TRUE)) != 0)
3157                     {
3158                         gint iSizeGMO = 0;
3159                         gint iSizePMO = 0;
3160                         offset += iSizeMD;
3161 
3162                         if ((iSizeGMO = dissect_mq_gmo(tvb, pinfo, mqroot_tree, offset, p_mq_parm)) != 0)
3163                         {
3164                             offset += iSizeGMO;
3165                             bPayload = TRUE;
3166                         }
3167                         else if ((iSizePMO = dissect_mq_pmo(tvb, pinfo, mqroot_tree, offset, p_mq_parm, &iDistributionListSize)) != 0)
3168                         {
3169                             offset += iSizePMO;
3170                             bPayload = TRUE;
3171                         }
3172                         if (tvb_reported_length_remaining(tvb, offset) >= 4)
3173                         {
3174                             if (bPayload == TRUE && (p_mq_parm->mq_opcode != MQ_TST_ASYNC_MESSAGE))
3175                             {
3176                                 iSizePayload = tvb_get_guint32(tvb, offset, p_mq_parm->mq_int_enc);
3177                                 if (tree)
3178                                 {
3179                                     mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, 4, ett_mq_put, NULL, MQ_TEXT_PUT);
3180                                     proto_tree_add_item(mq_tree, hf_mq_put_length, tvb, offset, 4, p_mq_parm->mq_int_enc);
3181                                 }
3182                                 offset += 4;
3183                             }
3184                         }
3185                     }
3186                     if (iDistributionListSize > 0)
3187                     {
3188                         col_append_fstr(pinfo->cinfo, COL_INFO, " (Distribution List, Size=%d)", iDistributionListSize);
3189                     }
3190                     if (bPayload == TRUE)
3191                     {
3192                         if (iSizePayload != 0 && tvb_reported_length_remaining(tvb, offset) > 0)
3193                         {
3194                             /* For the following header structures, each structure has a "format" field
3195                             which announces the type of the following structure.  For dissection we
3196                             do not use it and rely on the structid instead. */
3197                             guint32 iHeadersLength = 0;
3198                             if (tvb_reported_length_remaining(tvb, offset) >= 4)
3199                             {
3200                                 gint iSizeMD2 = 0;
3201                                 p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
3202 
3203                                 if ((p_mq_parm->mq_strucID == MQ_STRUCTID_XQH || p_mq_parm->mq_strucID == MQ_STRUCTID_XQH_EBCDIC) && tvb_reported_length_remaining(tvb, offset) >= 104)
3204                                 {
3205                                     /* if MD.format == MQXMIT */
3206                                     gint iSizeXQH = 104;
3207                                     if (tree)
3208                                     {
3209                                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeXQH, ett_mq_xqh, NULL, MQ_TEXT_XQH);
3210 
3211                                         proto_tree_add_item(mq_tree, hf_mq_xqh_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
3212                                         proto_tree_add_item(mq_tree, hf_mq_xqh_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
3213                                         proto_tree_add_item(mq_tree, hf_mq_xqh_remoteq, tvb, offset + 8, 48, p_mq_parm->mq_str_enc);
3214                                         proto_tree_add_item(mq_tree, hf_mq_xqh_remoteqmgr, tvb, offset + 56, 48, p_mq_parm->mq_str_enc);
3215                                     }
3216                                     offset += iSizeXQH;
3217                                     iHeadersLength += iSizeXQH;
3218 
3219                                     if ((iSizeMD2 = dissect_mq_md(tvb, mqroot_tree, offset, p_mq_parm, TRUE)) != 0)
3220                                     {
3221                                         offset += iSizeMD2;
3222                                         iHeadersLength += iSizeMD2;
3223                                     }
3224 
3225                                     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3226                                 }
3227                                 if ((p_mq_parm->mq_strucID == MQ_STRUCTID_DLH || p_mq_parm->mq_strucID == MQ_STRUCTID_DLH_EBCDIC) && tvb_reported_length_remaining(tvb, offset) >= 172)
3228                                 {
3229                                     /* if MD.format == MQDEAD */
3230                                     gint iSizeDLH = 172;
3231                                     p_mq_parm->iOfsEnc = offset + 108;
3232                                     p_mq_parm->iOfsCcs = offset + 112;
3233                                     p_mq_parm->iOfsFmt = offset + 116;
3234 
3235                                     p_mq_parm->mq_dlh_ccsid.encod = tvb_get_guint32(tvb, offset + 108, p_mq_parm->mq_int_enc);
3236                                     p_mq_parm->mq_dlh_ccsid.ccsid = tvb_get_guint32(tvb, offset + 112, p_mq_parm->mq_int_enc);
3237 
3238                                     if (tree)
3239                                     {
3240                                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeDLH, ett_mq_dlh, NULL, MQ_TEXT_DLH);
3241 
3242                                         proto_tree_add_item(mq_tree, hf_mq_dlh_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
3243                                         proto_tree_add_item(mq_tree, hf_mq_dlh_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
3244                                         proto_tree_add_item(mq_tree, hf_mq_dlh_reason, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
3245                                         proto_tree_add_item(mq_tree, hf_mq_dlh_destq, tvb, offset + 12, 48, p_mq_parm->mq_str_enc);
3246                                         proto_tree_add_item(mq_tree, hf_mq_dlh_destqmgr, tvb, offset + 60, 48, p_mq_parm->mq_str_enc);
3247                                         dissect_mq_encoding(mq_tree, hf_mq_dlh_encoding, tvb, offset + 108, 4, p_mq_parm->mq_int_enc);
3248                                         proto_tree_add_item(mq_tree, hf_mq_dlh_ccsid, tvb, offset + 112, 4, p_mq_parm->mq_int_enc);
3249                                         proto_tree_add_item(mq_tree, hf_mq_dlh_format, tvb, offset + 116, 8, p_mq_parm->mq_str_enc);
3250                                         proto_tree_add_item(mq_tree, hf_mq_dlh_putappltype, tvb, offset + 124, 4, p_mq_parm->mq_int_enc);
3251                                         proto_tree_add_item(mq_tree, hf_mq_dlh_putapplname, tvb, offset + 128, 28, p_mq_parm->mq_str_enc);
3252                                         proto_tree_add_item(mq_tree, hf_mq_dlh_putdate, tvb, offset + 156, 8, p_mq_parm->mq_str_enc);
3253                                         proto_tree_add_item(mq_tree, hf_mq_dlh_puttime, tvb, offset + 164, 8, p_mq_parm->mq_str_enc);
3254                                     }
3255                                     offset += iSizeDLH;
3256                                     iHeadersLength += iSizeDLH;
3257                                     p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3258                                 }
3259                                 if ((p_mq_parm->mq_strucID == MQ_STRUCTID_TM || p_mq_parm->mq_strucID == MQ_STRUCTID_TM_EBCDIC)
3260                                     && tvb_reported_length_remaining(tvb, offset) >= 8)
3261                                 {
3262 
3263                                     if (tree)
3264                                     {
3265                                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), ett_mq_head, NULL,
3266                                             val_to_str_ext(p_mq_parm->mq_strucID, GET_VALS_EXTP(StructID), "Unknown (0x%08x)"));
3267                                     }
3268                                     proto_tree_add_item(mq_tree, hf_mq_tm_StructID, tvb, offset + 0, 4, p_mq_parm->mq_str_enc);
3269                                     proto_tree_add_item(mq_tree, hf_mq_tm_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
3270                                     proto_tree_add_item(mq_tree, hf_mq_tm_QName, tvb, offset + 8, 48, p_mq_parm->mq_str_enc);
3271                                     proto_tree_add_item(mq_tree, hf_mq_tm_ProcessNme, tvb, offset + 56, 48, p_mq_parm->mq_str_enc);
3272                                     proto_tree_add_item(mq_tree, hf_mq_tm_TriggerData, tvb, offset + 104, 64, p_mq_parm->mq_str_enc);
3273                                     proto_tree_add_item(mq_tree, hf_mq_tm_ApplType, tvb, offset + 168, 4, p_mq_parm->mq_int_enc);
3274                                     proto_tree_add_item(mq_tree, hf_mq_tm_ApplId, tvb, offset + 172, 256, p_mq_parm->mq_str_enc);
3275                                     proto_tree_add_item(mq_tree, hf_mq_tm_EnvData, tvb, offset + 428, 128, p_mq_parm->mq_str_enc);
3276                                     proto_tree_add_item(mq_tree, hf_mq_tm_UserData, tvb, offset + 556, 128, p_mq_parm->mq_str_enc);
3277                                     offset += 684;
3278                                 }
3279                                 if ((p_mq_parm->mq_strucID == MQ_STRUCTID_TMC2 || p_mq_parm->mq_strucID == MQ_STRUCTID_TMC2_EBCDIC)
3280                                     && tvb_reported_length_remaining(tvb, offset) >= 8)
3281                                 {
3282                                     if (tree)
3283                                     {
3284                                         mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, tvb_reported_length_remaining(tvb, offset), ett_mq_head, NULL,
3285                                             val_to_str_ext(p_mq_parm->mq_strucID, GET_VALS_EXTP(StructID), "Unknown (0x%08x)"));
3286                                     }
3287                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_StructID, tvb, offset + 0, 4, p_mq_parm->mq_str_enc);
3288                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_version, tvb, offset + 4, 4, p_mq_parm->mq_str_enc);
3289                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_QName, tvb, offset + 8, 48, p_mq_parm->mq_str_enc);
3290                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_ProcessNme, tvb, offset + 56, 48, p_mq_parm->mq_str_enc);
3291                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_TriggerData, tvb, offset + 104, 64, p_mq_parm->mq_str_enc);
3292                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_ApplType, tvb, offset + 168, 4, p_mq_parm->mq_str_enc);
3293                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_ApplId, tvb, offset + 172, 256, p_mq_parm->mq_str_enc);
3294                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_EnvData, tvb, offset + 428, 128, p_mq_parm->mq_str_enc);
3295                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_UserData, tvb, offset + 556, 128, p_mq_parm->mq_str_enc);
3296                                     proto_tree_add_item(mq_tree, hf_mq_tmc2_QMgrName, tvb, offset + 684, 48, p_mq_parm->mq_str_enc);
3297                                     offset += 732;
3298                                 }
3299                                 if ((p_mq_parm->mq_strucID == MQ_STRUCTID_MDE || p_mq_parm->mq_strucID == MQ_STRUCTID_MDE_EBCDIC
3300                                     || p_mq_parm->mq_strucID == MQ_STRUCTID_CIH || p_mq_parm->mq_strucID == MQ_STRUCTID_CIH_EBCDIC
3301                                     || p_mq_parm->mq_strucID == MQ_STRUCTID_IIH || p_mq_parm->mq_strucID == MQ_STRUCTID_IIH_EBCDIC
3302                                     || p_mq_parm->mq_strucID == MQ_STRUCTID_RFH || p_mq_parm->mq_strucID == MQ_STRUCTID_RFH_EBCDIC
3303                                     || p_mq_parm->mq_strucID == MQ_STRUCTID_RMH || p_mq_parm->mq_strucID == MQ_STRUCTID_RMH_EBCDIC
3304                                     || p_mq_parm->mq_strucID == MQ_STRUCTID_WIH || p_mq_parm->mq_strucID == MQ_STRUCTID_WIH_EBCDIC
3305                                     )
3306                                     && tvb_reported_length_remaining(tvb, offset) >= 12)
3307                                 {
3308                                     /* Dissect the generic part of the other pre-defined headers */
3309                                     /* We assume that only one such header is present */
3310                                     gint iSizeHeader;
3311                                     gint oIntEnc = p_mq_parm->mq_int_enc;
3312                                     /* Use MD encoding */
3313                                     p_mq_parm->mq_int_enc = ((p_mq_parm->mq_md_ccsid.encod & MQ_MQENC_INTEGER_MASK) == MQ_MQENC_INTEGER_NORMAL) ? ENC_BIG_ENDIAN : ENC_LITTLE_ENDIAN;
3314                                     iSizeHeader = (gint)tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
3315                                     /* XXX - 32 is inferred from the code below.  What's the
3316                                     * correct minimum? */
3317                                     if (iSizeHeader <= 32)
3318                                         return;
3319 
3320                                     p_mq_parm->mq_head_ccsid.encod = tvb_get_guint32(tvb, offset + 12, p_mq_parm->mq_int_enc);
3321                                     p_mq_parm->mq_head_ccsid.ccsid = tvb_get_guint32(tvb, offset + 16, p_mq_parm->mq_int_enc);
3322 
3323                                     if (tvb_reported_length_remaining(tvb, offset) >= iSizeHeader)
3324                                     {
3325                                         gint iTmp;
3326                                         gint iVer;
3327                                         gint iLen;
3328                                         gint oStrEnc = p_mq_parm->mq_str_enc;
3329 
3330                                         p_mq_parm->iOfsEnc = offset + 12;
3331                                         p_mq_parm->iOfsCcs = offset + 16;
3332                                         p_mq_parm->iOfsFmt = offset + 20;
3333 
3334                                         iVer = (gint)tvb_get_guint32(tvb, offset + 4, p_mq_parm->mq_int_enc);
3335                                         iLen = (gint)tvb_get_guint32(tvb, offset + 8, p_mq_parm->mq_int_enc);
3336                                         iTmp = p_mq_parm->mq_head_ccsid.ccsid;
3337                                         if (iTmp == 0)
3338                                             iTmp = p_mq_parm->mq_md_ccsid.ccsid;
3339 
3340                                         if (IS_EBCDIC(iTmp))
3341                                             p_mq_parm->mq_str_enc = ENC_EBCDIC | ENC_NA;
3342                                         else
3343                                             p_mq_parm->mq_str_enc = ENC_UTF_8 | ENC_NA;
3344 
3345                                         if (tree)
3346                                         {
3347                                             mq_tree = proto_tree_add_subtree(mqroot_tree, tvb, offset, iSizeHeader, ett_mq_head, NULL,
3348                                                 val_to_str_ext(p_mq_parm->mq_strucID, GET_VALS_EXTP(StructID), "Unknown (0x%08x)"));
3349 
3350                                             proto_tree_add_item(mq_tree, hf_mq_head_StructID, tvb, offset, 4, p_mq_parm->mq_str_enc);
3351                                             proto_tree_add_item(mq_tree, hf_mq_head_version, tvb, offset + 4, 4, p_mq_parm->mq_int_enc);
3352                                             proto_tree_add_item(mq_tree, hf_mq_head_length, tvb, offset + 8, 4, p_mq_parm->mq_int_enc);
3353                                             dissect_mq_encoding(mq_tree, hf_mq_head_encoding, tvb, offset + 12, 4, p_mq_parm->mq_int_enc);
3354                                             proto_tree_add_item(mq_tree, hf_mq_head_ccsid, tvb, offset + 16, 4, p_mq_parm->mq_int_enc);
3355                                             proto_tree_add_item(mq_tree, hf_mq_head_format, tvb, offset + 20, 8, p_mq_parm->mq_str_enc);
3356 
3357                                             if (p_mq_parm->mq_strucID == MQ_STRUCTID_DH || p_mq_parm->mq_strucID == MQ_STRUCTID_DH_EBCDIC)
3358                                             {
3359                                                 gint iRec;
3360                                                 iRec = tvb_get_guint32(tvb, offset + 36, p_mq_parm->mq_int_enc);
3361 
3362                                                 proto_tree_add_bitmask(mq_tree, tvb, offset + 28, hf_mq_head_flags, ett_mq_head_flags, pf_flds_dh_flags, ENC_BIG_ENDIAN);
3363                                                 proto_tree_add_item(mq_tree, hf_mq_dh_putmsgrecfld, tvb, offset + 32, 4, p_mq_parm->mq_int_enc);
3364                                                 proto_tree_add_item(mq_tree, hf_mq_dh_recspresent, tvb, offset + 36, 4, p_mq_parm->mq_int_enc);
3365                                                 proto_tree_add_item(mq_tree, hf_mq_dh_objrecofs, tvb, offset + 40, 4, p_mq_parm->mq_int_enc);
3366                                                 proto_tree_add_item(mq_tree, hf_mq_dh_putmsgrecofs, tvb, offset + 44, 4, p_mq_parm->mq_int_enc);
3367 
3368                                                 if (iRec)
3369                                                 {
3370                                                     gint iOfs1;
3371                                                     gint iOfs2;
3372                                                     gint iFlgs;
3373                                                     gint iSize;
3374 
3375                                                     iFlgs = (gint)tvb_get_guint32(tvb, offset + 32, p_mq_parm->mq_int_enc);
3376                                                     iOfs1 = (gint)tvb_get_guint32(tvb, offset + 40, p_mq_parm->mq_int_enc);
3377                                                     iOfs2 = (gint)tvb_get_guint32(tvb, offset + 44, p_mq_parm->mq_int_enc);
3378 
3379                                                     iSize = dissect_mq_or(tvb, mq_tree, offset + 48, iRec, iOfs1, p_mq_parm);
3380                                                     /*iSize = */dissect_mq_pmr(tvb, mqroot_tree, offset + 48 + iSize, iRec, iOfs2, iFlgs, p_mq_parm);
3381                                                 }
3382                                             }
3383                                             else if (p_mq_parm->mq_strucID == MQ_STRUCTID_MDE || p_mq_parm->mq_strucID == MQ_STRUCTID_MDE_EBCDIC)
3384                                             {
3385                                                 proto_tree_add_item(mq_tree, hf_mq_head_flags, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
3386                                                 proto_tree_add_item(mq_tree, hf_mq_md_groupid, tvb, offset + 32, 24, ENC_NA);
3387                                                 proto_tree_add_item(mq_tree, hf_mq_md_msgseqnumber, tvb, offset + 56, 4, p_mq_parm->mq_int_enc);
3388                                                 proto_tree_add_item(mq_tree, hf_mq_md_offset, tvb, offset + 60, 4, p_mq_parm->mq_int_enc);
3389                                                 proto_tree_add_item(mq_tree, hf_mq_md_msgflags, tvb, offset + 64, 4, p_mq_parm->mq_int_enc);
3390                                                 proto_tree_add_item(mq_tree, hf_mq_md_origlen, tvb, offset + 68, 4, p_mq_parm->mq_int_enc);
3391                                             }
3392                                             else if (p_mq_parm->mq_strucID == MQ_STRUCTID_IIH || p_mq_parm->mq_strucID == MQ_STRUCTID_IIH_EBCDIC)
3393                                             {
3394                                                 gint16 sLen;
3395                                                 gint32 iPos;
3396                                                 proto_tree* mq_ims;
3397 
3398                                                 proto_tree_add_bitmask(mq_tree, tvb, offset + 28, hf_mq_head_flags, ett_mq_head_flags, pf_flds_iih_flags, ENC_BIG_ENDIAN);
3399                                                 proto_tree_add_item(mq_tree, hf_mq_iih_ltermoverride, tvb, offset + 32, 8, p_mq_parm->mq_str_enc);
3400                                                 proto_tree_add_item(mq_tree, hf_mq_iih_mfsmapname, tvb, offset + 40, 8, p_mq_parm->mq_str_enc);
3401                                                 proto_tree_add_item(mq_tree, hf_mq_iih_replytofmt, tvb, offset + 48, 8, p_mq_parm->mq_str_enc);
3402                                                 proto_tree_add_item(mq_tree, hf_mq_iih_authenticator, tvb, offset + 56, 8, p_mq_parm->mq_str_enc);
3403                                                 proto_tree_add_item(mq_tree, hf_mq_iih_transinstid, tvb, offset + 64, 16, ENC_NA);
3404                                                 proto_tree_add_item(mq_tree, hf_mq_iih_transstate, tvb, offset + 80, 1, p_mq_parm->mq_str_enc);
3405                                                 proto_tree_add_item(mq_tree, hf_mq_iih_commimode, tvb, offset + 81, 1, p_mq_parm->mq_str_enc);
3406                                                 proto_tree_add_item(mq_tree, hf_mq_iih_securityscope, tvb, offset + 82, 1, p_mq_parm->mq_str_enc);
3407                                                 proto_tree_add_item(mq_tree, hf_mq_iih_reserved, tvb, offset + 83, 1, p_mq_parm->mq_str_enc);
3408 
3409                                                 iPos = offset + iSizeHeader;
3410                                                 sLen = tvb_get_guint16(tvb, iPos, p_mq_parm->mq_int_enc);
3411                                                 mq_ims = proto_tree_add_subtree(mq_tree, tvb, iPos, sLen, ett_mq_ims, NULL, "IMS Message");
3412                                                 proto_tree_add_item(mq_ims, hf_mq_ims_ll, tvb, iPos + 0, 2, p_mq_parm->mq_int_enc);
3413                                                 proto_tree_add_item(mq_ims, hf_mq_ims_zz, tvb, iPos + 2, 2, p_mq_parm->mq_int_enc);
3414                                                 proto_tree_add_item(mq_ims, hf_mq_ims_trx, tvb, iPos + 4, 8, p_mq_parm->mq_str_enc);
3415                                                 proto_tree_add_item(mq_ims, hf_mq_ims_data, tvb, iPos + 12, sLen - 12, ENC_NA);
3416                                                 offset += sLen;
3417                                             }
3418                                             else if (p_mq_parm->mq_strucID == MQ_STRUCTID_CIH || p_mq_parm->mq_strucID == MQ_STRUCTID_CIH_EBCDIC)
3419                                             {
3420                                                 proto_tree_add_bitmask(mq_tree, tvb, offset + 28, hf_mq_head_flags, ett_mq_head_flags, pf_flds_cih_flags, ENC_BIG_ENDIAN);
3421                                                 proto_tree_add_item(mq_tree, hf_mq_cih_returncode, tvb, offset + 32, 4, p_mq_parm->mq_int_enc);
3422                                                 proto_tree_add_item(mq_tree, hf_mq_cih_compcode, tvb, offset + 36, 4, p_mq_parm->mq_int_enc);
3423                                                 proto_tree_add_item(mq_tree, hf_mq_cih_reasoncode, tvb, offset + 40, 4, p_mq_parm->mq_int_enc);
3424                                                 proto_tree_add_item(mq_tree, hf_mq_cih_uowcontrols, tvb, offset + 44, 4, p_mq_parm->mq_int_enc);
3425                                                 proto_tree_add_item(mq_tree, hf_mq_cih_getwaitintv, tvb, offset + 48, 4, p_mq_parm->mq_int_enc);
3426                                                 proto_tree_add_item(mq_tree, hf_mq_cih_linktype, tvb, offset + 52, 4, p_mq_parm->mq_int_enc);
3427                                                 proto_tree_add_item(mq_tree, hf_mq_cih_outdatalen, tvb, offset + 56, 4, p_mq_parm->mq_int_enc);
3428                                                 proto_tree_add_item(mq_tree, hf_mq_cih_facilkeeptime, tvb, offset + 60, 4, p_mq_parm->mq_int_enc);
3429                                                 proto_tree_add_item(mq_tree, hf_mq_cih_adsdescriptor, tvb, offset + 64, 4, p_mq_parm->mq_int_enc);
3430                                                 proto_tree_add_item(mq_tree, hf_mq_cih_converstask, tvb, offset + 68, 4, p_mq_parm->mq_int_enc);
3431                                                 proto_tree_add_item(mq_tree, hf_mq_cih_taskendstatus, tvb, offset + 72, 4, p_mq_parm->mq_int_enc);
3432                                                 proto_tree_add_item(mq_tree, hf_mq_cih_bridgefactokn, tvb, offset + 76, 8, ENC_NA);
3433                                                 proto_tree_add_item(mq_tree, hf_mq_cih_function, tvb, offset + 84, 4, p_mq_parm->mq_str_enc);
3434                                                 proto_tree_add_item(mq_tree, hf_mq_cih_abendcode, tvb, offset + 88, 4, p_mq_parm->mq_str_enc);
3435                                                 proto_tree_add_item(mq_tree, hf_mq_cih_authenticator, tvb, offset + 92, 8, p_mq_parm->mq_str_enc);
3436                                                 proto_tree_add_item(mq_tree, hf_mq_cih_reserved, tvb, offset + 100, 8, p_mq_parm->mq_str_enc);
3437                                                 proto_tree_add_item(mq_tree, hf_mq_cih_replytofmt, tvb, offset + 108, 8, p_mq_parm->mq_str_enc);
3438                                                 proto_tree_add_item(mq_tree, hf_mq_cih_remotesysid, tvb, offset + 116, 4, p_mq_parm->mq_str_enc);
3439                                                 proto_tree_add_item(mq_tree, hf_mq_cih_remotetransid, tvb, offset + 120, 4, p_mq_parm->mq_str_enc);
3440                                                 proto_tree_add_item(mq_tree, hf_mq_cih_transactionid, tvb, offset + 124, 4, p_mq_parm->mq_str_enc);
3441                                                 proto_tree_add_item(mq_tree, hf_mq_cih_facilitylike, tvb, offset + 128, 4, p_mq_parm->mq_str_enc);
3442                                                 proto_tree_add_item(mq_tree, hf_mq_cih_attentionid, tvb, offset + 132, 4, p_mq_parm->mq_str_enc);
3443                                                 proto_tree_add_item(mq_tree, hf_mq_cih_startcode, tvb, offset + 136, 4, p_mq_parm->mq_str_enc);
3444                                                 proto_tree_add_item(mq_tree, hf_mq_cih_cancelcode, tvb, offset + 140, 4, p_mq_parm->mq_str_enc);
3445                                                 proto_tree_add_item(mq_tree, hf_mq_cih_nexttransid, tvb, offset + 144, 4, p_mq_parm->mq_str_enc);
3446                                                 proto_tree_add_item(mq_tree, hf_mq_cih_reserved2, tvb, offset + 148, 8, p_mq_parm->mq_str_enc);
3447                                                 proto_tree_add_item(mq_tree, hf_mq_cih_reserved3, tvb, offset + 156, 8, p_mq_parm->mq_str_enc);
3448                                                 if (iVer == 2)
3449                                                 {
3450                                                     proto_tree_add_item(mq_tree, hf_mq_cih_cursorpos, tvb, offset + 164, 4, p_mq_parm->mq_int_enc);
3451                                                     proto_tree_add_item(mq_tree, hf_mq_cih_erroroffset, tvb, offset + 168, 4, p_mq_parm->mq_int_enc);
3452                                                     proto_tree_add_item(mq_tree, hf_mq_cih_inputitem, tvb, offset + 172, 4, p_mq_parm->mq_int_enc);
3453                                                     proto_tree_add_item(mq_tree, hf_mq_cih_reserved4, tvb, offset + 176, 4, p_mq_parm->mq_int_enc);
3454                                                 }
3455                                             }
3456                                             else if (p_mq_parm->mq_strucID == MQ_STRUCTID_RMH || p_mq_parm->mq_strucID == MQ_STRUCTID_RMH_EBCDIC)
3457                                             {
3458                                                 proto_tree_add_bitmask(mq_tree, tvb, offset + 28, hf_mq_head_flags, ett_mq_head_flags, pf_flds_rmh_flags, ENC_BIG_ENDIAN);
3459                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_objecttype, tvb, offset + 32, 8, p_mq_parm->mq_str_enc);
3460                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_objectinstid, tvb, offset + 36, 24, ENC_NA);
3461                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_srcenvlen, tvb, offset + 60, 4, p_mq_parm->mq_int_enc);
3462                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_srcenvofs, tvb, offset + 64, 4, p_mq_parm->mq_int_enc);
3463                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_srcnamelen, tvb, offset + 68, 4, p_mq_parm->mq_int_enc);
3464                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_srcnameofs, tvb, offset + 72, 4, p_mq_parm->mq_int_enc);
3465                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_dstenvlen, tvb, offset + 76, 4, p_mq_parm->mq_int_enc);
3466                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_dstenvofs, tvb, offset + 80, 4, p_mq_parm->mq_int_enc);
3467                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_dstnamelen, tvb, offset + 84, 4, p_mq_parm->mq_int_enc);
3468                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_dstnameofs, tvb, offset + 88, 4, p_mq_parm->mq_int_enc);
3469                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_datalogiclen, tvb, offset + 92, 4, p_mq_parm->mq_int_enc);
3470                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_datalogicofsl, tvb, offset + 96, 4, p_mq_parm->mq_int_enc);
3471                                                 proto_tree_add_item(mq_tree, hf_mq_rmh_datalogicofsh, tvb, offset + 100, 4, p_mq_parm->mq_int_enc);
3472                                             }
3473                                             else if (p_mq_parm->mq_strucID == MQ_STRUCTID_WIH || p_mq_parm->mq_strucID == MQ_STRUCTID_WIH_EBCDIC)
3474                                             {
3475                                                 proto_tree_add_item(mq_tree, hf_mq_head_flags, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
3476                                                 proto_tree_add_item(mq_tree, hf_mq_wih_servicename, tvb, offset + 32, 32, p_mq_parm->mq_str_enc);
3477                                                 proto_tree_add_item(mq_tree, hf_mq_wih_servicestep, tvb, offset + 64, 8, p_mq_parm->mq_str_enc);
3478                                                 proto_tree_add_item(mq_tree, hf_mq_wih_msgtoken, tvb, offset + 72, 16, ENC_NA);
3479                                                 proto_tree_add_item(mq_tree, hf_mq_wih_reserved, tvb, offset + 88, 32, p_mq_parm->mq_str_enc);
3480                                             }
3481                                             else if (p_mq_parm->mq_strucID == MQ_STRUCTID_RFH || p_mq_parm->mq_strucID == MQ_STRUCTID_RFH_EBCDIC)
3482                                             {
3483                                                 int iPos, iEnd, iCCSID;
3484                                                 int iLenStr;
3485                                                 guint8* sStr;
3486 
3487                                                 proto_tree* rfh_tree;
3488 
3489                                                 proto_tree_add_item(mq_tree, hf_mq_head_flags, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
3490                                                 iPos = offset + 32;
3491                                                 iEnd = offset + iLen;
3492                                                 if (iVer > 1)
3493                                                 {
3494                                                     iCCSID = (int)tvb_get_guint32(tvb, iPos, p_mq_parm->mq_int_enc);
3495                                                     proto_tree_add_item(mq_tree, hf_mq_rfh_ccsid, tvb, iPos, 4, p_mq_parm->mq_int_enc);
3496                                                     iPos += 4;
3497                                                 }
3498                                                 else
3499                                                     iCCSID = iTmp;
3500 
3501                                                 while (iPos < iEnd)
3502                                                 {
3503                                                     iLenStr = (int)tvb_get_guint32(tvb, iPos, p_mq_parm->mq_int_enc);
3504                                                     sStr = tvb_get_string_enc(wmem_packet_scope(), tvb, iPos + 4, iLenStr, IS_EBCDIC(iCCSID) ? ENC_EBCDIC : ENC_ASCII);
3505                                                     if (*sStr)
3506                                                         strip_trailing_blanks(sStr, iLenStr);
3507                                                     if (*sStr)
3508                                                         sStr = (guint8*)format_text_chr(wmem_packet_scope(), sStr, strlen((const char*)sStr), '.');
3509 
3510                                                     rfh_tree = proto_tree_add_subtree_format(mq_tree, tvb, iPos, iLenStr + 4, ett_mq_rfh_ValueName, NULL, "NameValue: %s", sStr);
3511 
3512                                                     proto_tree_add_item(rfh_tree, hf_mq_rfh_length, tvb, iPos, 4, p_mq_parm->mq_int_enc);
3513                                                     proto_tree_add_item(rfh_tree, hf_mq_rfh_string, tvb, iPos + 4, iLenStr, p_mq_parm->mq_str_enc);
3514                                                     iPos += (iLenStr + 4);
3515                                                 }
3516                                             }
3517                                             else
3518                                             {
3519                                                 proto_tree_add_item(mq_tree, hf_mq_head_flags, tvb, offset + 28, 4, p_mq_parm->mq_int_enc);
3520                                                 proto_tree_add_item(mq_tree, hf_mq_head_struct, tvb, offset + 32, iSizeHeader - 32, ENC_NA);
3521                                             }
3522                                         }
3523                                         offset += iSizeHeader;
3524                                         iHeadersLength += iSizeHeader;
3525                                         p_mq_parm->mq_strucID = (tvb_reported_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
3526                                         p_mq_parm->mq_str_enc = oStrEnc;
3527                                     }
3528                                     p_mq_parm->mq_int_enc = oIntEnc;
3529                                 }
3530                             }
3531 
3532                             if (!mq_in_reassembly)
3533                             {
3534                                 col_append_fstr(pinfo->cinfo, COL_INFO, " (Data %d bytes)", iSizePayload - iHeadersLength);
3535 
3536                                 /* Call subdissector for the payload */
3537                                 tvbuff_t* next_tvb;
3538                                 p_mq_parm->mq_cur_ccsid.encod = tvb_get_guint32(tvb, p_mq_parm->iOfsEnc, p_mq_parm->mq_int_enc);
3539                                 p_mq_parm->mq_cur_ccsid.ccsid = tvb_get_guint32(tvb, p_mq_parm->iOfsCcs, p_mq_parm->mq_int_enc);
3540                                 memcpy(p_mq_parm->mq_format,
3541                                     tvb_get_string_enc(wmem_packet_scope(), tvb, p_mq_parm->iOfsFmt, sizeof(p_mq_parm->mq_format), p_mq_parm->mq_str_enc),
3542                                     sizeof(p_mq_parm->mq_format));
3543 
3544                                 next_tvb = tvb_new_subset_remaining(tvb, offset);
3545                                 if (!dissector_try_heuristic(mq_heur_subdissector_list, next_tvb, pinfo, mqroot_tree, &hdtbl_entry, p_mq_parm))
3546                                     call_data_dissector(next_tvb, pinfo, mqroot_tree);
3547                             }
3548                             else
3549                             {
3550                                 tvbuff_t* next_tvb;
3551                                 next_tvb = tvb_new_subset_remaining(tvb, offset);
3552                                 call_data_dissector(next_tvb, pinfo, mqroot_tree);
3553                             }
3554                         }
3555                         offset = tvb_reported_length(tvb);
3556                     }
3557                     /* After all recognised structures have been dissected, process remaining structure*/
3558                     if (tvb_reported_length_remaining(tvb, offset) >= 4)
3559                     {
3560                         p_mq_parm->mq_strucID = tvb_get_ntohl(tvb, offset);
3561                         proto_tree_add_subtree_format(mqroot_tree, tvb, offset, -1, ett_mq_structid, NULL,
3562                             "%s", val_to_str_ext(p_mq_parm->mq_strucID, GET_VALS_EXTP(StructID), "Unknown (0x%08x)"));
3563                     }
3564                 }
3565                 else
3566                 {
3567                     /* This is a MQ segment continuation (if MQ reassembly is not enabled) */
3568                     if (!mq_in_reassembly)
3569                         col_append_str(pinfo->cinfo, COL_INFO, " [Unreassembled MQ]");
3570                     call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, (mqroot_tree) ? mqroot_tree : tree);
3571                 }
3572             }
3573         }
3574         else
3575         {
3576             /* This packet is a TCP continuation of a segment (if desegmentation is not enabled) */
3577             col_append_str(pinfo->cinfo, COL_INFO, " [Undesegmented]");
3578             if (tree)
3579             {
3580                 proto_tree_add_item(tree, proto_mq, tvb, offset, -1, ENC_NA);
3581             }
3582             call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
3583         }
3584     }
3585 }
3586 
reassemble_mq(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)3587 static int reassemble_mq(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
3588 {
3589     mq_parm_t mq_parm;
3590 
3591     /* Reassembly of the MQ messages that span several PDU (several TSH) */
3592     /* Typically a TCP PDU is 1460 bytes and a MQ PDU is 32766 bytes */
3593     if (tvb_reported_length(tvb) < 28)
3594         return 0;
3595 
3596     memset(&mq_parm, 0, sizeof(mq_parm_t));
3597     mq_parm.mq_strucID = tvb_get_ntohl(tvb, 0);
3598 
3599     if ((mq_parm.mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx || (mq_parm.mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC)
3600     {
3601         guint8   iCtlF = 0;
3602         gint32   iSegL = 0;
3603         gint32   iBegL = 0;
3604         gint32   iEnco = 0;
3605         gint32   iMulS = 0;
3606         gint32   iHdrL = 0;
3607         gint32   iNxtP = 0;
3608         guint8   iOpcd = 0;
3609         gboolean bSeg1st = FALSE;
3610         gboolean bSegLst = FALSE;
3611         gboolean bMore = FALSE;
3612 
3613         gint32   iHdl = 0;
3614         gint32   iGlbMsgIdx = 0;
3615         gint32   iSegLength = 0;
3616         gint16   iSegmIndex = 0;
3617 
3618         guint32  uStrL = 0;
3619         guint32  uPadL = 0;
3620 
3621         /* TSHM structure as 8 bytes more after the length (convid/requestid) */
3622         if (mq_parm.mq_strucID == MQ_STRUCTID_TSHM || mq_parm.mq_strucID == MQ_STRUCTID_TSHM_EBCDIC)
3623             iMulS = 8;
3624 
3625         /* Get the Semgnet Length */
3626         iSegL = tvb_get_ntohl(tvb, 4);
3627         if (iMulS == 8)
3628         {
3629             mq_parm.mq_convID = tvb_get_ntohl(tvb, 8);
3630             mq_parm.mq_rqstID = tvb_get_ntohl(tvb, 12);
3631         }
3632         else
3633         {
3634             mq_parm.mq_convID = 0;
3635             mq_parm.mq_rqstID = 0;
3636         }
3637 
3638         /* Get the Encoding scheme */
3639         iEnco = (tvb_get_guint8(tvb, 8 + iMulS) == MQ_LITTLE_ENDIAN ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN);
3640         mq_parm.mq_int_enc = iEnco;
3641         /* Get the Operation Code */
3642         iOpcd = tvb_get_guint8(tvb, 9 + iMulS);
3643         mq_parm.mq_opcode = iOpcd;
3644         /* Get the Control Flag */
3645         iCtlF = tvb_get_guint8(tvb, 10 + iMulS);
3646         mq_parm.mq_ctlf1 = iCtlF;
3647         /* First Segment ? */
3648         bSeg1st = ((iCtlF & MQ_TCF_FIRST) != 0);
3649         /* Last Segment */
3650         bSegLst = ((iCtlF & MQ_TCF_LAST) != 0);
3651 
3652         mq_in_reassembly = FALSE;
3653 
3654         if ((iOpcd > 0x80 && !(bSeg1st && bSegLst)) || iOpcd == MQ_TST_ASYNC_MESSAGE)
3655         {
3656             proto_tree* mq_tree = NULL;
3657 
3658             /* Optimisation : only fragmented segments go through the reassembly process */
3659             /*
3660               It seems that after a PUT on a Queue, when doing a GET, MQ first get
3661               a small part of the response (4096 bytes)
3662               The response contain the number of bytes returned for this request (ActMsgLen)
3663               and the total number of bytes of this reply    (TotMsgLen)
3664 
3665               this mean the flow seems to be :
3666 
3667               PUT
3668               REQUEST_MSG (MaxLen=4096)
3669               ASYNC_MSG (1st/Lst Segment, ActMsgLen=4096, TotMsgLen=279420)
3670               as ActMsgLen!=TotMsgLen, this mean the MSG is not complete, we only receive some of 279420 bytes
3671               REQUEST_MSG (MaxLen=279420)
3672               ASYNC_MSG (1st Segment, SegIndex=0 ActMsgLen=279420, TotMsgLen=279420)
3673               ASYNC_MSG (Mid Segment, SegIndex=1)
3674               ASYNC_MSG (Mid Segment, SegIndex=2)
3675               .
3676               ASYNC_MSG (Lst Segment, SegIndex=n)
3677               End of reassembling (we have 279420 bytes to decode)
3678 
3679               PUT with Reassembly
3680               GET with Reassembly not using ASYNC_MSG
3681             */
3682 
3683             if (mq_reassembly)
3684             {
3685                 fragment_head* fd_head;
3686                 guint32 iConnectionId = ((pinfo->srcport << 16) + pinfo->destport);
3687                 gboolean reassembly_error = FALSE;
3688                 guint8* pTmp = "Full";
3689                 if (bSeg1st && !bSegLst)
3690                     pTmp = "First ";
3691                 if (!bSeg1st && bSegLst)
3692                     pTmp = "Last  ";
3693                 if (!bSeg1st && !bSegLst)
3694                     pTmp = "Middle";
3695 
3696                 iHdrL = 28 + iMulS;
3697 
3698                 if (iOpcd == MQ_TST_ASYNC_MESSAGE)
3699                 {
3700                     /* Get the MQ Handle of the Object */
3701                     iHdl = tvb_get_guint32(tvb, iHdrL + 4, iEnco);
3702                     /* Get the Global Message Index */
3703                     iGlbMsgIdx = tvb_get_guint32(tvb, iHdrL + 12, iEnco);
3704                     /* Get the Segment Length */
3705                     iSegLength = tvb_get_guint32(tvb, iHdrL + 16, iEnco);
3706                     /* Get the Segment Index */
3707                     iSegmIndex = tvb_get_guint16(tvb, iHdrL + 20, iEnco);
3708 
3709                     /*
3710                       if SegmIndex == 0, it has 54 bytes + the length and padding
3711                       of a variable string at the end of the Header
3712                     */
3713 
3714                     if (iSegmIndex == 0)
3715                     {
3716                         mq_parm.mq_AsyMsgRsn = tvb_get_guint32(tvb, iHdrL + 24, iEnco);
3717                         mq_parm.mq_MsgActLen = tvb_get_guint32(tvb, iHdrL + 28, iEnco);
3718                         mq_parm.mq_MsgTotLen = tvb_get_guint32(tvb, iHdrL + 32, iEnco);
3719                         uStrL = tvb_get_guint8(tvb, iHdrL + 54);
3720                         uPadL = ((((2 + 1 + uStrL) / 4) + 1) * 4) - (2 + 1 + uStrL);
3721                         mq_parm.mq_MsgActLen = iSegL - iHdrL;
3722                     }
3723                     /*
3724                       First segment has a longer header
3725                     */
3726                     iNxtP = iHdrL + ((bSeg1st) ? (54 + 1 + uStrL + uPadL) : (24));
3727                     mq_parm.mq_MsgActLen -= ((bSeg1st) ? (54 + 1 + uStrL + uPadL) : (24));
3728                 }
3729                 else
3730                 {
3731                     if (bSeg1st)
3732                     {
3733                         uStrL = mq_parm.mq_API_Len = tvb_get_guint32(tvb, iHdrL, ENC_BIG_ENDIAN);
3734                         mq_parm.mq_API_CC = tvb_get_guint32(tvb, iHdrL + 4, iEnco);
3735                         mq_parm.mq_API_RC = tvb_get_guint32(tvb, iHdrL + 8, iEnco);
3736                         iHdl = mq_parm.mq_API_Hdl = tvb_get_guint32(tvb, iHdrL + 12, iEnco);
3737                         mq_parm.mq_MsgTotLen = uStrL;
3738                         mq_parm.mq_MsgActLen = iSegL - iHdrL;
3739                         mq_parm.mq_MsgActLen -= 16; /* API */
3740                     }
3741                     else
3742                     {
3743                         fragment_head* _head = fragment_get_reassembled_id(&mq_reassembly_table, pinfo, iConnectionId);
3744                         if (_head)
3745                         {
3746                             uStrL = mq_parm.mq_API_Len = tvb_get_guint32(_head->tvb_data, iHdrL, ENC_BIG_ENDIAN);
3747                             mq_parm.mq_API_CC = tvb_get_guint32(_head->tvb_data, iHdrL + 4, iEnco);
3748                             mq_parm.mq_API_RC = tvb_get_guint32(_head->tvb_data, iHdrL + 8, iEnco);
3749                             iHdl = mq_parm.mq_API_Hdl = tvb_get_guint32(_head->tvb_data, iHdrL + 12, iEnco);
3750                             mq_parm.mq_MsgTotLen = uStrL;
3751                         }
3752                     }
3753 
3754                     iNxtP = iHdrL + ((bSeg1st) ? 16 : 0);
3755                 }
3756                 bMore = !bSegLst;
3757                 /*
3758                   First segment has a longer header (API Header)
3759 
3760                   If it is a PUT1 Message Type TSHx + API + OD + MD + PMO
3761                   If it is a PUT  Message Type TSHx + API + MD + PMO
3762                   If it is a GET  Message Type TSHx + API + MD + GMO
3763                 */
3764                 if (bSeg1st)
3765                 {
3766                     guint32 _iLen;
3767                     if (iOpcd == MQ_TST_MQPUT1 || iOpcd == MQ_TST_MQPUT1_REPLY)
3768                     {
3769                         guint iDistributionListSize2;
3770                         _iLen = dissect_mq_od(tvb, NULL, NULL, iNxtP, &mq_parm, &iDistributionListSize2);
3771                         iNxtP += _iLen;
3772                         mq_parm.mq_MsgActLen -= _iLen;
3773                     }
3774 
3775                     _iLen = dissect_mq_md(tvb, NULL, iNxtP, &mq_parm, FALSE);
3776                     iNxtP += _iLen;
3777                     mq_parm.mq_MsgActLen -= _iLen;
3778 
3779                     if (iOpcd == MQ_TST_MQGET || iOpcd == MQ_TST_MQGET_REPLY)
3780                         _iLen = dissect_mq_gmo(tvb, NULL, NULL, iNxtP, &mq_parm);
3781                     else
3782                         _iLen = dissect_mq_pmo(tvb, NULL, NULL, iNxtP, &mq_parm, NULL);
3783                     iNxtP += _iLen;
3784                     mq_parm.mq_MsgActLen -= _iLen;
3785                 }
3786 
3787                 /*
3788                   if it is the 1st Segment, it means we are
3789                   of the beginning of a reassembling. We must take the whole segment (with TSHM, and headers)
3790                 */
3791                 iBegL = (bSeg1st) ? 0 : iNxtP;
3792 
3793                 if (iSegL <= iBegL)
3794                 {
3795                     /* negative or null fragment length - something is wrong; skip reassembly */
3796                     fd_head = NULL;
3797                     reassembly_error = TRUE;
3798                 }
3799                 else
3800                 {
3801                     fd_head = fragment_add_seq_next(&mq_reassembly_table,
3802                         tvb, iBegL,
3803                         pinfo, iConnectionId, NULL,
3804                         iSegL - iBegL, bMore);
3805                 }
3806 
3807                 if (tree)
3808                 {
3809                     proto_item* ti = proto_tree_add_item(tree, proto_mq, tvb, 0, -1, ENC_NA);
3810 
3811                     if (fd_head && !fd_head->next && mq_parm.mq_MsgActLen == mq_parm.mq_MsgTotLen)
3812                     {
3813                         proto_item_append_text(ti, " %s %s Segment",
3814                             val_to_str_ext(iOpcd, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"),
3815                             pTmp);
3816                         if (mq_parm.mq_API_RC != MQ_MQRC_NONE)
3817                             proto_item_append_text(ti, ", Reason=%d(0x%x) - %s",
3818                                 mq_parm.mq_API_RC, mq_parm.mq_API_RC,
3819                                 val_to_str_ext(mq_parm.mq_API_RC, GET_VALS_EXTP(MQRC), "Unknown (0x%02x)"));
3820                     }
3821                     else
3822                     {
3823                         proto_item_append_text(ti, " [%s %s Segment]",
3824                             val_to_str_ext(iOpcd, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"),
3825                             pTmp);
3826                     }
3827                     if (iOpcd == MQ_TST_ASYNC_MESSAGE)
3828                         proto_item_append_text(ti, ", Hdl=0x%04x, GlbMsgIdx=%d, SegIdx=%d, SegLen=%d",
3829                             iHdl, iGlbMsgIdx, iSegmIndex, iSegLength);
3830                     else
3831                         proto_item_append_text(ti, ", Hdl=0x%04x, Len=%d",
3832                             mq_parm.mq_API_Hdl, mq_parm.mq_MsgTotLen);
3833                     if (reassembly_error)
3834                     {
3835                         expert_add_info_format(pinfo, ti, &ei_mq_reassembly_error,
3836                             "Wrong fragment length (%d) - skipping reassembly", iSegL - iBegL);
3837                     }
3838                     mq_tree = proto_item_add_subtree(ti, ett_mq_reassemb);
3839                 }
3840                 else
3841                 {
3842                     mq_tree = tree;
3843                 }
3844 
3845                 if (fd_head != NULL && pinfo->num == fd_head->reassembled_in && !bMore)
3846                 {
3847                     tvbuff_t* next_tvb;
3848 
3849                     /* Reassembly finished */
3850                     if (fd_head->next != NULL)
3851                     {
3852                         proto_item* ti;
3853 
3854                         /* dissect the last(s) MQ segment received */
3855                         /* Reassembly in progress, so no decode */
3856 
3857                         mq_in_reassembly = TRUE;
3858                         dissect_mq_pdu(tvb, pinfo, mq_tree);
3859                         mq_in_reassembly = FALSE;
3860 
3861                         /*
3862                         2 or more fragments.
3863                         Build Up the full pdu to be dissected correwctly
3864                         */
3865                         next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
3866                         add_new_data_source(pinfo, next_tvb, "Reassembled MQ");
3867 
3868                         /* Create the tree element for the full reassembled MQ Msg */
3869                         ti = proto_tree_add_item(tree, proto_mq, tvb, 0, -1, ENC_NA);
3870                         proto_item_append_text(ti, " %s Full Segment",
3871                             val_to_str_ext(iOpcd, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"));
3872                         if (iOpcd == MQ_TST_ASYNC_MESSAGE)
3873                         {
3874                             proto_item_append_text(ti, ", Hdl=0x%04x, GlbMsgIdx=%d, Len=%d",
3875                                 iHdl, iGlbMsgIdx,
3876                                 tvb_reported_length_remaining(next_tvb, 0));
3877                             if (mq_parm.mq_AsyMsgRsn != MQ_MQRC_NONE)
3878                                 proto_item_append_text(ti, ", Reason=%d(0x%x) - %s",
3879                                     mq_parm.mq_AsyMsgRsn, mq_parm.mq_AsyMsgRsn,
3880                                     val_to_str_ext(mq_parm.mq_AsyMsgRsn, GET_VALS_EXTP(MQRC), "Unknown (0x%02x)"));
3881                         }
3882                         else
3883                         {
3884                             proto_item_append_text(ti, ", Hdl=0x%04x, Len=%d",
3885                                 mq_parm.mq_API_Hdl,
3886                                 tvb_reported_length_remaining(next_tvb, 0));
3887                             if (mq_parm.mq_API_RC != MQ_MQRC_NONE)
3888                                 proto_item_append_text(ti, ", RC=%d(0x%x) - %s",
3889                                     mq_parm.mq_API_RC, mq_parm.mq_API_RC,
3890                                     val_to_str_ext(mq_parm.mq_API_RC, GET_VALS_EXTP(MQRC), "Unknown (0x%02x)"));
3891                         }
3892                         mq_tree = proto_item_add_subtree(ti, ett_mq_reassemb);
3893                     }
3894                     else
3895                     {
3896                         /* Only 1 fragment */
3897                         next_tvb = tvb;
3898                     }
3899                     dissect_mq_pdu(next_tvb, pinfo, mq_tree);
3900                     return tvb_reported_length(tvb);
3901                 }
3902                 else
3903                 {
3904                     mq_in_reassembly = TRUE;
3905                     /* Reassembly in progress */
3906 
3907                     col_add_fstr(pinfo->cinfo, COL_INFO, "[%s %s Segment]",
3908                         val_to_str_ext(iOpcd, GET_VALS_EXTP(opcode), "Unknown (0x%02x)"),
3909                         pTmp);
3910                     dissect_mq_addCR_colinfo(pinfo, &mq_parm);
3911                     if (iOpcd == MQ_TST_ASYNC_MESSAGE)
3912                         col_append_fstr(pinfo->cinfo, COL_INFO, " Hdl=0x%04x, GlbMsgIdx=%d, SegIdx=%d, SegLen=%d",
3913                             iHdl, iGlbMsgIdx, iSegmIndex, iSegLength);
3914                     else
3915                         col_append_fstr(pinfo->cinfo, COL_INFO, " Hdl=0x%04x, Len=%d",
3916                             mq_parm.mq_API_Hdl, mq_parm.mq_MsgTotLen);
3917                     dissect_mq_pdu(tvb, pinfo, mq_tree);
3918                     return tvb_reported_length(tvb);
3919                 }
3920             }
3921             else
3922             {
3923                 dissect_mq_pdu(tvb, pinfo, tree);
3924                 if (bSeg1st)
3925                 {
3926                     /* MQ segment is the first of a unreassembled series */
3927                     col_append_str(pinfo->cinfo, COL_INFO, " [Unreassembled MQ]");
3928                 }
3929                 return tvb_reported_length(tvb);
3930             }
3931         }
3932         /* Reassembly not enabled or non-fragmented message */
3933         dissect_mq_pdu(tvb, pinfo, tree);
3934     }
3935 
3936     return tvb_reported_length(tvb);
3937 }
3938 
get_mq_pdu_len(packet_info * pinfo _U_,tvbuff_t * tvb,int offset,void * data _U_)3939 static guint get_mq_pdu_len(packet_info* pinfo _U_, tvbuff_t* tvb,
3940     int offset, void* data _U_)
3941 {
3942     guint uLen = tvb_reported_length_remaining(tvb, offset);
3943     if (uLen >= 8)
3944     {
3945         guint32 mq_strucID = tvb_get_ntohl(tvb, offset + 0);
3946         if ((mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx || (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC)
3947         {
3948             uLen = tvb_get_ntohl(tvb, offset + 4);
3949         }
3950     }
3951     return uLen;
3952 }
3953 
dissect_mq_tcp(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)3954 static int dissect_mq_tcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data)
3955 {
3956     tcp_dissect_pdus(tvb, pinfo, tree, mq_desegment, 28, get_mq_pdu_len, reassemble_mq, data);
3957     return tvb_captured_length(tvb);
3958 }
3959 
dissect_mq_spx(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)3960 static int dissect_mq_spx(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
3961 {
3962     /* Since SPX has no standard desegmentation, MQ cannot be performed as well */
3963     dissect_mq_pdu(tvb, pinfo, tree);
3964     return tvb_captured_length(tvb);
3965 }
3966 
dissect_mq_heur(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gboolean is_tcp,dissector_handle_t * ssl_app_handle)3967 static gboolean dissect_mq_heur(tvbuff_t* tvb, packet_info* pinfo,
3968     proto_tree* tree, gboolean is_tcp, dissector_handle_t* ssl_app_handle)
3969 {
3970     if ((tvb_captured_length(tvb) >= 4) && (tvb_reported_length(tvb) >= 28))
3971     {
3972         guint32 mq_strucID = tvb_get_ntohl(tvb, 0);
3973         if ((mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx || (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC)
3974         {
3975             /* Register this dissector for this conversation */
3976             conversation_t* conversation;
3977 
3978             conversation = find_or_create_conversation(pinfo);
3979             if (is_tcp)
3980                 conversation_set_dissector(conversation, mq_handle);
3981             else if (ssl_app_handle)
3982                 *ssl_app_handle = mq_handle;
3983 
3984             /* Dissect the packet */
3985             reassemble_mq(tvb, pinfo, tree, NULL);
3986             return TRUE;
3987         }
3988     }
3989     return FALSE;
3990 }
3991 
dissect_mq_heur_tcp(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)3992 static gboolean    dissect_mq_heur_tcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
3993 {
3994     return dissect_mq_heur(tvb, pinfo, tree, TRUE, NULL);
3995 }
3996 
dissect_mq_heur_nontcp(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)3997 static gboolean    dissect_mq_heur_nontcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
3998 {
3999     return dissect_mq_heur(tvb, pinfo, tree, FALSE, NULL);
4000 }
4001 
dissect_mq_heur_ssl(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)4002 static gboolean    dissect_mq_heur_ssl(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data)
4003 {
4004     dissector_handle_t* app_handle = (dissector_handle_t*)data;
4005     return dissect_mq_heur(tvb, pinfo, tree, FALSE, app_handle);
4006 }
4007 
proto_register_mq(void)4008 void proto_register_mq(void)
4009 {
4010     static hf_register_info hf[] =
4011     {
4012         {&hf_mq_tsh_StructID, {"StructID..", "mq.tsh.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4013         {&hf_mq_tsh_mqseglen, {"MQSegmLen.", "mq.tsh.seglength", FT_UINT32, BASE_DEC, NULL, 0x0, "TSH MQ Segment length", HFILL}},
4014         {&hf_mq_tsh_convid, {"Convers ID", "mq.tsh.convid", FT_UINT32, BASE_DEC, NULL, 0x0, "TSH Conversation ID", HFILL}},
4015         {&hf_mq_tsh_requestid, {"Request ID", "mq.tsh.requestid", FT_UINT32, BASE_DEC, NULL, 0x0, "TSH Request ID", HFILL}},
4016         {&hf_mq_tsh_byteorder, {"Byte order", "mq.tsh.byteorder", FT_UINT8, BASE_HEX, VALS(GET_VALSV(byteorder)), 0x0, "TSH Byte order", HFILL}},
4017         {&hf_mq_tsh_opcode, {"SegmType..", "mq.tsh.type", FT_UINT8, BASE_HEX | BASE_EXT_STRING, GET_VALS_EXTP(opcode), 0x0, "TSH MQ segment type", HFILL}},
4018         {&hf_mq_tsh_ctlflgs1, {"Ctl Flag 1", "mq.tsh.cflags1", FT_UINT8, BASE_HEX, NULL, 0x0, "TSH Control flags 1", HFILL}},
4019         {&hf_mq_tsh_ctlflgs2, {"Ctl Flag 2", "mq.tsh.cflags2", FT_UINT8, BASE_HEX, NULL, 0x0, "TSH Control flags 2", HFILL}},
4020         {&hf_mq_tsh_luwid, {"LUW Ident.", "mq.tsh.luwid", FT_BYTES, BASE_NONE, NULL, 0x0, "TSH logical unit of work identifier", HFILL}},
4021         {&hf_mq_tsh_encoding, {"Encoding..", "mq.tsh.encoding", FT_UINT32, BASE_DEC, NULL, 0x0, "TSH Encoding", HFILL}},
4022         {&hf_mq_tsh_ccsid, {"CCSID.....", "mq.tsh.ccsid", FT_INT16, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "TSH CCSID", HFILL}},
4023         {&hf_mq_tsh_reserved, {"Reserved..", "mq.tsh.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, "TSH Reserved", HFILL}},
4024 
4025         {&hf_mq_tsh_tcf_confirmreq, {"Confirm Req", "mq.tsh.tcf.confirmreq", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_CONFIRM_REQUEST, "TSH TCF Confirm request", HFILL}},
4026         {&hf_mq_tsh_tcf_error, {"Error", "mq.tsh.tcf.error", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_ERROR, "TSH TCF Error", HFILL}},
4027         {&hf_mq_tsh_tcf_reqclose, {"Req close", "mq.tsh.tcf.reqclose", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_REQUEST_CLOSE, "TSH TCF Request close", HFILL}},
4028         {&hf_mq_tsh_tcf_closechann, {"Close Chnl", "mq.tsh.tcf.closechann", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_CLOSE_CHANNEL, "TSH TCF Close channel", HFILL}},
4029         {&hf_mq_tsh_tcf_first, {"First Seg", "mq.tsh.tcf.first", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_FIRST, "TSH TCF First", HFILL}},
4030         {&hf_mq_tsh_tcf_last, {"Last Seg", "mq.tsh.tcf.last", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_LAST, "TSH TCF Last", HFILL}},
4031         {&hf_mq_tsh_tcf_reqacc, {"Req accept", "mq.tsh.tcf.reqacc", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_REQUEST_ACCEPTED, "TSH TCF Request accepted", HFILL}},
4032         {&hf_mq_tsh_tcf_dlq, {"DLQ used", "mq.tsh.tcf.dlq", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF_DLQ_USED, "TSH TCF DLQ used", HFILL}},
4033 
4034         {&hf_mq_tsh_tcf2_HdrComp, {"HDR Comp", "mq.tsh.tcf2.hdrcomp", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF2_HDRCOMP, "TSH TCF2 Header Compressed", HFILL}},
4035         {&hf_mq_tsh_tcf2_MsgComp, {"MSG Comp", "mq.tsh.tcf2.msgcomp", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF2_MSGCOMP, "TSH TCF2 Message Compressed", HFILL}},
4036         {&hf_mq_tsh_tcf2_CSH, {"CSH", "mq.tsh.tcf2.csh", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF2_CSH, "TSH TCF2 CSH", HFILL}},
4037         {&hf_mq_tsh_tcf2_CmitIntv, {"CommitIntvl", "mq.tsh.tcf.cmitintv", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_TCF2_CMIT_INTERVAL, "TSH TCF2 Commit Interval", HFILL}},
4038 
4039         {&hf_mq_api_replylen, {"Reply len..", "mq.api.replylength", FT_UINT32, BASE_DEC, NULL, 0x0, "API Reply length", HFILL}},
4040         {&hf_mq_api_compcode, {"Compl Code.", "mq.api.completioncode", FT_UINT32, BASE_DEC, VALS(GET_VALSV(mqcc)), 0x0, "API Completion code", HFILL}},
4041         {&hf_mq_api_reascode, {"Reason Code", "mq.api.reasoncode", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(MQRC), 0x0, "API Reason code", HFILL}},
4042         {&hf_mq_api_objecthdl, {"Object Hdl.", "mq.api.hobj", FT_UINT32, BASE_HEX, NULL, 0x0, "API Object handle", HFILL}},
4043 
4044         {&hf_mq_socket_conversid, {"ConversId", "mq.socket.conversid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Socket Conversation Id", HFILL}},
4045         {&hf_mq_socket_requestid, {"RequestId", "mq.socket.requestid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Socket Request Id", HFILL}},
4046         {&hf_mq_socket_type, {"Type.....", "mq.socket.type", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Socket Type", HFILL}},
4047         {&hf_mq_socket_parm1, {"Parm1....", "mq.socket.parm1", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Socket Parameter 1", HFILL}},
4048         {&hf_mq_socket_parm2, {"Parm2....", "mq.socket.parm2", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Socket Parameter 2", HFILL}},
4049 
4050         {&hf_mq_caut_StructID, {"StructID.", "mq.caut.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4051         {&hf_mq_caut_AuthType, {"AuthType.", "mq.caut.authtype", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "CAUT Authority Type", HFILL}},
4052         {&hf_mq_caut_UsrMaxLen, {"UsrMaxLen", "mq.caut.usrmaxlen", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "CAUT userid Maximum length", HFILL}},
4053         {&hf_mq_caut_PwdMaxLen, {"PwdMaxLen", "mq.caut.pwdmaxlen", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "CAUT password Maximum length", HFILL}},
4054         {&hf_mq_caut_UsrLength, {"UsrLength", "mq.caut.usrlength", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "CAUT userid length", HFILL}},
4055         {&hf_mq_caut_PwdLength, {"PwdLength", "mq.caut.pswlength", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "CAUT password length", HFILL}},
4056         {&hf_mq_caut_usr, {"userid...", "mq.msh.userid", FT_STRING, STR_UNICODE, NULL, 0x0, "CAUT UserId", HFILL}},
4057         {&hf_mq_caut_psw, {"password.", "mq.msh.password", FT_STRING, STR_UNICODE, NULL, 0x0, "CAUT Password", HFILL}},
4058 
4059         {&hf_mq_msh_StructID, {"StructID", "mq.msh.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4060         {&hf_mq_msh_seqnum, {"Seq Numb", "mq.msh.seqnum", FT_UINT32, BASE_DEC, NULL, 0x0, "MSH sequence number", HFILL}},
4061         {&hf_mq_msh_datalength, {"Buf len.", "mq.msh.buflength", FT_UINT32, BASE_DEC, NULL, 0x0, "MSH buffer length", HFILL}},
4062         {&hf_mq_msh_unknown1, {"Unknown1", "mq.msh.unknown1", FT_UINT32, BASE_HEX, NULL, 0x0, "MSH unknown1", HFILL}},
4063         {&hf_mq_msh_msglength, {"Msg len.", "mq.msh.msglength", FT_UINT32, BASE_DEC, NULL, 0x0, "MSH message length", HFILL}},
4064 
4065         {&hf_mq_xqh_StructID, {"StructID", "mq.xqh.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4066         {&hf_mq_xqh_version, {"Version.", "mq.xqh.version", FT_UINT32, BASE_DEC, NULL, 0x0, "XQH version", HFILL}},
4067         {&hf_mq_xqh_remoteq, {"Remote Q", "mq.xqh.remoteq", FT_STRING, STR_UNICODE, NULL, 0x0, "XQH remote queue", HFILL}},
4068         {&hf_mq_xqh_remoteqmgr, {"Rmt QMgr", "mq.xqh.remoteqmgr", FT_STRING, STR_UNICODE, NULL, 0x0, "XQH remote queue manager", HFILL}},
4069 
4070         {&hf_mq_id_StructID, {"Structid..", "mq.id.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4071         {&hf_mq_id_FapLevel, {"FAP level.", "mq.id.faplevel", FT_UINT8, BASE_DEC, NULL, 0x0, "ID Formats And Protocols level", HFILL}},
4072         {&hf_mq_id_cf1, {"CapFlag1..", "mq.id.cflags", FT_UINT8, BASE_HEX, NULL, 0x0, "ID Capability Flags 1", HFILL}},
4073         {&hf_mq_id_ecf1, {"ECapFlag1.", "mq.id.ecflags", FT_UINT8, BASE_HEX, NULL, 0x0, "ID E Capability Flags 1", HFILL}},
4074         {&hf_mq_id_ief1, {"IniErrFlg1", "mq.id.inierrflg1", FT_UINT8, BASE_HEX, NULL, 0x0, "ID Initial Error Flags 1", HFILL}},
4075         {&hf_mq_id_Reserved, {"Reserved..", "mq.id.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, "ID Reserved", HFILL}},
4076         {&hf_mq_id_MaxMsgBatch, {"MaxMsgBtch", "mq.id.maxmsgbatch", FT_UINT16, BASE_DEC, NULL, 0x0, "ID max msg per batch", HFILL}},
4077         {&hf_mq_id_MaxTrSize, {"MaxTrSize.", "mq.id.maxtrsize", FT_UINT32, BASE_DEC, NULL, 0x0, "ID max trans size", HFILL}},
4078         {&hf_mq_id_MaxMsgSize, {"MaxMsgSize", "mq.id.maxmsgsize", FT_UINT32, BASE_DEC, NULL, 0x0, "ID max msg size", HFILL}},
4079         {&hf_mq_id_SeqWrapVal, {"SeqWrapVal", "mq.id.seqwrap", FT_UINT32, BASE_DEC, NULL, 0x0, "ID seq wrap value", HFILL}},
4080         {&hf_mq_id_channel, {"ChannelNme", "mq.id.channelname", FT_STRING, STR_UNICODE, NULL, 0x0, "ID channel name", HFILL}},
4081         {&hf_mq_id_cf2, {"CapFlag2..", "mq.id.cflags2", FT_UINT8, BASE_HEX, NULL, 0x0, "ID Capability flags 2", HFILL}},
4082         {&hf_mq_id_ecf2, {"ECapFlag2.", "mq.id.ecflags2", FT_UINT8, BASE_HEX, NULL, 0x0, "ID E Capability flags 2", HFILL}},
4083         {&hf_mq_id_ccsid, {"ccsid.....", "mq.id.ccsid", FT_INT16, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "ID Coded Character Set ID", HFILL}},
4084         {&hf_mq_id_qmgrname, {"QMgrName..", "mq.id.qm", FT_STRING, STR_UNICODE, NULL, 0x0, "ID Queue Manager Name", HFILL}},
4085         {&hf_mq_id_HBInterval, {"HBInterval", "mq.id.hbint", FT_UINT32, BASE_DEC, NULL, 0x0, "ID Heartbeat interval", HFILL}},
4086         {&hf_mq_id_EFLLength, {"EFLLength.", "mq.id.efllength", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "ID EFL Length", HFILL}},
4087         {&hf_mq_id_ief2, {"IniErrFlg2", "mq.id.inierrflg2", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, "ID Initial Error Flags 2", HFILL}},
4088         {&hf_mq_id_Reserved1, {"Reserved1.", "mq.id.reserved1", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, "ID Reserved 1", HFILL}},
4089         {&hf_mq_id_HdrCprsLst, {"HdrCprsLst", "mq.id.hdrcprslst", FT_BYTES, BASE_NONE, NULL, 0x0, "ID Hdr Cprs Lst", HFILL}},
4090         {&hf_mq_id_MsgCprsLst, {"MsgCprsLst", "mq.id.msgcprslst", FT_BYTES, BASE_NONE, NULL, 0x0, "ID Msg Cprs Lst", HFILL}},
4091         {&hf_mq_id_Reserved2, {"Reserved2.", "mq.id.reserved2", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "ID Reserved 2", HFILL}},
4092         {&hf_mq_id_SSLKeyRst, {"SSLKeyRst.", "mq.id.sslkeyrst", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "ID SSL Key Reset", HFILL}},
4093         {&hf_mq_id_ConvBySkt, {"ConvBySkt.", "mq.id.convbyskt", FT_INT32, BASE_DEC, NULL, 0x0, "ID Conv Per Socket", HFILL}},
4094         {&hf_mq_id_cf3, {"CapFlag3..", "mq.id.cflags3", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, "ID Capability flags 3", HFILL}},
4095         {&hf_mq_id_ecf3, {"ECapFlag3.", "mq.id.ecflags3", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, "ID E Capability flags 3", HFILL}},
4096         {&hf_mq_id_Reserved3, {"Reserved3.", "mq.id.reserved3", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "ID Reserved 3", HFILL}},
4097         {&hf_mq_id_ProcessId, {"ProcessId.", "mq.id.processid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "ID Process Identifier", HFILL}},
4098         {&hf_mq_id_ThreadId, {"ThreadId..", "mq.id.threadid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "ID Thread Identifier", HFILL}},
4099         {&hf_mq_id_TraceId, {"TraceId...", "mq.id.traceid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "ID Trace Identifier", HFILL}},
4100         {&hf_mq_id_ProdId, {"ProdId....", "mq.id.prodid", FT_STRING, STR_UNICODE, NULL, 0x0, "ID Product Identifier", HFILL}},
4101         {&hf_mq_id_mqmid, {"MQM ID....", "mq.id.mqmid", FT_STRING, STR_UNICODE, NULL, 0x0, "ID MQM ID", HFILL}},
4102         {&hf_mq_id_pal, {"PAL.......", "mq.id.pal", FT_BYTES, BASE_NONE, NULL, 0x0, "ID PAL", HFILL}},
4103         {&hf_mq_id_r, {"R.........", "mq.id.r", FT_BYTES, BASE_NONE, NULL, 0x0, "ID R", HFILL}},
4104 
4105         {&hf_mq_id_cf1_msgseq, {"Message sequence", "mq.id.icf.msgseq", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_MSG_SEQ, "ID ICF Message sequence", HFILL}},
4106         {&hf_mq_id_cf1_convcap, {"Conversion capable", "mq.id.icf.convcap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_CONVERSION_CAPABLE, "ID ICF Conversion capable", HFILL}},
4107         {&hf_mq_id_cf1_splitmsg, {"Split messages", "mq.id.icf.splitmsg", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_SPLIT_MESSAGE, "ID ICF Split message", HFILL}},
4108         {&hf_mq_id_cf1_RqstInit, {"Request Initiation", "mq.id.icf.rqstinit", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_REQUEST_INITIATION, "ID ICF Request Initiation", HFILL}},
4109         {&hf_mq_id_cf1_RqstSecu, {"Request Security", "mq.id.icf.rqstsecu", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_REQUEST_SECURITY, "ID ICF Request Security", HFILL}},
4110         {&hf_mq_id_cf1_mqreq, {"MQ request", "mq.id.icf.mqreq", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_MQREQUEST, "ID ICF MQ request", HFILL}},
4111         {&hf_mq_id_cf1_svrsec, {"Srvr Con security", "mq.id.icf.svrsec", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_SVRCONN_SECURITY, "ID ICF Server connection security", HFILL}},
4112         {&hf_mq_id_cf1_runtime, {"Runtime applic", "mq.id.icf.runtime", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF1_RUNTIME, "ID ICF Runtime application", HFILL}},
4113 
4114         {&hf_mq_id_cf2_CanDstLst, {"DistListCapable", "mq.id.icf2.distlistcap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_DIST_LIST_CAPABLE, "ID ICF2 Distribution List Capable", HFILL}},
4115         {&hf_mq_id_cf2_FstMsgReq, {"Fast Msg Reqrd", "mq.id.icf2.fastmsgrqrd", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_FAST_MESSAGES_REQUIRED, "ID ICF2 Fast Message Required", HFILL}},
4116         {&hf_mq_id_cf2_RespConv, {"RspndrConversion", "mq.id.icf2.respndrconvers", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_RESPONDER_CONVERSION, "ID ICF2 Responder Conversion", HFILL}},
4117         {&hf_mq_id_cf2_XARequest, {"XARequest", "mq.id.icf2.xarequest", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_XAREQUEST, "ID ICF2 XA Request", HFILL}},
4118         {&hf_mq_id_cf2_XARunTApp, {"XARunTypApp", "mq.id.icf2.xaruntypapp", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_XARUNTIME_APP, "ID ICF2 XA Runtime App", HFILL}},
4119         {&hf_mq_id_cf2_SPIRqst, {"SPIRequest", "mq.id.icf2.spirequest", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_SPIREQUEST, "ID ICF2 SPI Request", HFILL}},
4120         {&hf_mq_id_cf2_DualUOW, {"DualUOW", "mq.id.icf2.dualuow", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_DUAL_UOW, "ID ICF2 Dual UOW", HFILL}},
4121         {&hf_mq_id_cf2_CanTrcRte, {"Trace Rte Capab", "mq.id.icf2.cantraceroute", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF2_TRACE_ROUTE_CAPABLE, "ID ICF2 Trace Route Capable", HFILL}},
4122 
4123         {&hf_mq_id_cf3_CanMsgPrp, {"Msg Property Cap", "mq.id.ief3.msgpropertycap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF3_MSG_PROP_CAPABLE, "ID ICF3 Message PropertyCapable", HFILL}},
4124         {&hf_mq_id_cf3_CanMulticast, {"Multicast Cap", "mq.id.ief3.multicastcap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF3_MULTICAST_CAPABLE, "ID ICF3 Mutlicast Capabilities", HFILL}},
4125         {&hf_mq_id_cf3_PropIntSep, {"Prop Int Separate", "mq.id.ief3.propintseparate", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF3_MSG_PROP_INT_SEPARATE, "ID ICF3 Property Int Separate", HFILL}},
4126         {&hf_mq_id_cf3_MPlxSyGet, {"Multiplex_synchget", "mq.id.ief3.multiplexsynchget", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF3_MULTIPLEX_SYNCGET, "ID ICF3 MULTIPLEX_SYNCGET", HFILL}},
4127         {&hf_mq_id_cf3_ProtAlgorit, {"Prot Algorithms", "mq.id.ief3.protalgorithms", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF3_PROT_ALGORITHMS, "ID ICF3 Prot Algorithms", HFILL}},
4128         {&hf_mq_id_cf3_CanGenConnTag, {"Gen ConnTag Cap", "mq.id.ief3.genconntagcap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_CF3_GEN_CONNTAG_CAP, "ID ICF3 Generate ConnTag Capable", HFILL}},
4129 
4130         {&hf_mq_id_ief1_ccsid, {"Invalid CCSID", "mq.id.ief1.ccsid", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_CCSID_NOT_SUPPORTED, "ID invalid CCSID", HFILL}},
4131         {&hf_mq_id_ief1_enc, {"Invalid encoding", "mq.id.ief1.enc", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_ENCODING_INVALID, "ID invalid encoding", HFILL}},
4132         {&hf_mq_id_ief1_mxtrsz, {"Invalid Max Trans Size", "mq.id.ief1.mxtrsz", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_MAX_TRANSMISSION_SIZE, "ID invalid maximum transmission size", HFILL}},
4133         {&hf_mq_id_ief1_fap, {"Invalid FAP level", "mq.id.ief1.fap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_FAP_LEVEL, "ID invalid FAP level", HFILL}},
4134         {&hf_mq_id_ief1_mxmsgsz, {"Invalid message size", "mq.id.ief1.mxmsgsz", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_MAX_MSG_SIZE, "ID invalid message size", HFILL}},
4135         {&hf_mq_id_ief1_mxmsgpb, {"Invalid Max Msg batch", "mq.id.ief1.mxmsgpb", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_MAX_MSG_PER_BATCH, "ID maximum message per batch", HFILL}},
4136         {&hf_mq_id_ief1_seqwrap, {"Invalid Seq Wrap Value", "mq.id.ief1.seqwrap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_SEQ_WRAP_VALUE, "ID invalid sequence wrap value", HFILL}},
4137         {&hf_mq_id_ief1_hbint, {"Invalid HB interval", "mq.id.ief1.hbint", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF1_HEARTBEAT_INTERVAL, "ID invalid heartbeat interval", HFILL}},
4138 
4139         {&hf_mq_id_ief2_HdrCmpLst, {"Invalid HDR CompLst", "mq.id.ief2.hdrcomplst", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF2_HDRCOMPLIST, "ID invalid Header Compression List", HFILL}},
4140         {&hf_mq_id_ief2_MsgCmpLst, {"Invalid Msg CompLst", "mq.id.ief2.msgcomplst", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF2_MSGCOMPLIST, "ID invalid Message Compression List", HFILL}},
4141         {&hf_mq_id_ief2_SSLReset, {"Invalid SSL Reset", "mq.id.ief2.sslreset", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_IEF2_SSL_RESET, "ID invalid SSL Reset", HFILL}},
4142 
4143         {&hf_mq_uid_StructID, {"Structid", "mq.uid.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4144         {&hf_mq_uid_userid, {"User ID.", "mq.uid.userid", FT_STRING, STR_UNICODE, NULL, 0x0, "UID structid", HFILL}},
4145         {&hf_mq_uid_password, {"Password", "mq.uid.password", FT_STRING, STR_UNICODE, NULL, 0x0, "UID password", HFILL}},
4146         {&hf_mq_uid_longuserid, {"Long UID", "mq.uid.longuserid", FT_STRING, STR_UNICODE, NULL, 0x0, "UID long user id", HFILL}},
4147 
4148         {&hf_mq_sidlen, {"SID Len.", "mq.uid.sidlen", FT_UINT8, BASE_DEC, NULL, 0x0, "Sid Len", HFILL}},
4149         {&hf_mq_sidtyp, {"SIDType.", "mq.uid.sidtyp", FT_UINT8, BASE_DEC, VALS(GET_VALSV(sidtype)), 0x0, "Sid Typ", HFILL}},
4150         {&hf_mq_securityid, {"SecurID.", "mq.uid.securityid", FT_BYTES, BASE_NONE, NULL, 0x0, "Security ID", HFILL}},
4151 
4152         {&hf_mq_conn_QMgr, {"QMgr....", "mq.conn.qm", FT_STRING, STR_UNICODE, NULL, 0x0, "CONN queue manager", HFILL}},
4153         {&hf_mq_conn_appname, {"ApplName", "mq.conn.appname", FT_STRING, STR_UNICODE, NULL, 0x0, "CONN application name", HFILL}},
4154         {&hf_mq_conn_apptype, {"ApplType", "mq.conn.apptype", FT_INT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(MQAT), 0x0, "CONN application type", HFILL}},
4155         {&hf_mq_conn_acttoken, {"AccntTok", "mq.conn.acttoken", FT_BYTES, BASE_NONE, NULL, 0x0, "CONN accounting token", HFILL}},
4156         {&hf_mq_conn_options, {"Options.", "mq.conn.options", FT_UINT32, BASE_DEC, VALS(mq_conn_options_vals), 0x0, "CONN options", HFILL}},
4157         {&hf_mq_conn_Xoptions, {"XOptions", "mq.conn.xoptions", FT_UINT32, BASE_HEX, NULL, 0x0, "CONN Xoptions", HFILL}},
4158 
4159         {&hf_mq_fcno_StructID, {"StructId..", "mq.fcno.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4160         {&hf_mq_fcno_version, {"version...", "mq.fcno.version", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "FCNO version", HFILL}},
4161         {&hf_mq_fcno_capflag, {"CapFlag...", "mq.fcno.capflag", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "FCNO Capability Flag", HFILL}},
4162 
4163         {&hf_mq_fcno_prodid, {"prodid....", "mq.fcno.prodid", FT_STRING, STR_UNICODE, NULL, 0x0, "FCNO Product Id", HFILL}},
4164         {&hf_mq_fcno_mqmid, {"MqmId.....", "mq.fcno.mqmid", FT_STRING, STR_UNICODE, NULL, 0x0, "FCNO Mqm ID", HFILL}},
4165 
4166         {&hf_mq_fcno_conn_tag, {"conntag...", "mq.fcno.conntag", FT_BYTES, BASE_NONE, NULL, 0x0, "FCNO Connection Tag", HFILL}},
4167         {&hf_mq_fcno_retconn_tag, {"retconntag", "mq.fcno.retconntag", FT_BYTES, BASE_NONE, NULL, 0x0, "FCNO Retry Connection Tag", HFILL}},
4168         {&hf_mq_fcno_unknowb01, {"unknowb01.", "mq.fcno.unknowb01", FT_BYTES, BASE_NONE, NULL, 0x0, "FCNO unknown bytes 01", HFILL}},
4169 
4170 
4171         {&hf_mq_inq_nbsel, {"Selector count..", "mq.inq.nbsel", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Selector count", HFILL}},
4172         {&hf_mq_inq_nbint, {"Integer count...", "mq.inq.nbint", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Integer count", HFILL}},
4173         {&hf_mq_inq_charlen, {"Character length", "mq.inq.charlen", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Character length", HFILL}},
4174         {&hf_mq_inq_sel, {"Selector........", "mq.inq.sel", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(selector), 0x0, "INQ Selector", HFILL}},
4175         {&hf_mq_inq_intvalue, {"Integer value...", "mq.inq.intvalue", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Integer value", HFILL}},
4176         {&hf_mq_inq_charvalues, {"Char values.....", "mq.inq.charvalues", FT_STRING, STR_UNICODE, NULL, 0x0, "INQ Character values", HFILL}},
4177 
4178         {&hf_mq_spi_verb, {"SPI Verb", "mq.spi.verb", FT_UINT32, BASE_DEC, VALS(GET_VALSV(spi_verbs)), 0x0, NULL, HFILL}},
4179         {&hf_mq_spi_version, {"Version", "mq.spi.version", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Version", HFILL}},
4180         {&hf_mq_spi_length, {"Max reply size", "mq.spi.replength", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Max reply size", HFILL}},
4181 
4182         {&hf_mq_spi_base_StructID, {"SPI Structid", "mq.spib.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4183         {&hf_mq_spi_base_version, {"Version", "mq.spib.version", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Base Version", HFILL}},
4184         {&hf_mq_spi_base_length, {"Length", "mq.spib.length", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Base Length", HFILL}},
4185 
4186         {&hf_mq_spi_spqo_nbverb, {"Number of verbs", "mq.spqo.nbverb", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Query Output Number of verbs", HFILL}},
4187         {&hf_mq_spi_spqo_verbid, {"Verb", "mq.spqo.verb", FT_UINT32, BASE_DEC, VALS(GET_VALSV(spi_verbs)), 0x0, "SPI Query Output VerbId", HFILL}},
4188         {&hf_mq_spi_spqo_maxiover, {"Max InOut Version", "mq.spqo.maxiov", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Query Output Max InOut Version", HFILL}},
4189         {&hf_mq_spi_spqo_maxinver, {"Max In Version", "mq.spqo.maxiv", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Query Output Max In Version", HFILL}},
4190         {&hf_mq_spi_spqo_maxouver, {"Max Out Version", "mq.spqo.maxov", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Query Output Max Out Version", HFILL}},
4191         {&hf_mq_spi_spqo_flags, {"Flags", "mq.spqo.flags", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Query Output flags", HFILL}},
4192 
4193         {&hf_mq_spi_spai_mode, {"Mode", "mq.spai.mode", FT_UINT32, BASE_DEC, VALS(GET_VALSV(spi_activate)), 0x0, "SPI Activate Input mode", HFILL}},
4194         {&hf_mq_spi_spai_unknown1, {"Unknown1", "mq.spai.unknown1", FT_STRING, STR_UNICODE, NULL, 0x0, "SPI Activate Input unknown1", HFILL}},
4195         {&hf_mq_spi_spai_unknown2, {"Unknown2", "mq.spai.unknown2", FT_STRING, STR_UNICODE, NULL, 0x0, "SPI Activate Input unknown2", HFILL}},
4196         {&hf_mq_spi_spai_msgid, {"Message Id", "mq.spai.msgid", FT_STRING, STR_UNICODE, NULL, 0x0, "SPI Activate Input message id", HFILL}},
4197         {&hf_mq_spi_spgi_batchsz, {"Batch size", "mq.spgi.batchsize", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Get Input batch size", HFILL}},
4198         {&hf_mq_spi_spgi_batchint, {"Batch interval", "mq.spgi.batchint", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Get Input batch interval", HFILL}},
4199         {&hf_mq_spi_spgi_maxmsgsz, {"Max message size", "mq.spgi.maxmsgsize", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Get Input max message size", HFILL}},
4200 
4201         {&hf_mq_spi_spgo_options, {"Options", "mq.spgo.options", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Get Output options", HFILL}},
4202         {&hf_mq_spi_spgo_size, {"Size", "mq.spgo.size", FT_UINT32, BASE_DEC, NULL, 0x0, "SPI Get Output size", HFILL}},
4203         {&hf_mq_spi_opt_blank, {"Blank padded", "mq.spi.options.blank", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_SPI_OPTIONS_BLANK_PADDED, "SPI Options blank padded", HFILL}},
4204         {&hf_mq_spi_opt_syncp, {"Syncpoint", "mq.spi.options.sync", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_SPI_OPTIONS_SYNCPOINT, "SPI Options syncpoint", HFILL}},
4205         {&hf_mq_spi_opt_deferred, {"Deferred", "mq.spi.options.deferred", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQ_SPI_OPTIONS_DEFERRED, "SPI Options deferred", HFILL}},
4206 
4207         {&hf_mq_put_length, {"Data length", "mq.put.length", FT_UINT32, BASE_DEC, NULL, 0x0, "PUT Data length", HFILL}},
4208 
4209         {&hf_mq_close_options, {"Options", "mq.close.options", FT_UINT32, BASE_HEX, NULL, 0x0, "CLOSE options", HFILL}},
4210         {&hf_mq_close_options_DELETE, {"DELETE", "mq.close.options.Delete", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCO_DELETE, "CLOSE options DELETE", HFILL}},
4211         {&hf_mq_close_options_DELETE_PURGE, {"DELETE_PURGE", "mq.close.options.DeletePurge", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCO_DELETE_PURGE, "CLOSE options DELETE_PURGE", HFILL}},
4212         {&hf_mq_close_options_KEEP_SUB, {"KEEPSUB", "mq.close.options.KeepSub", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCO_KEEP_SUB, "CLOSE options KEEP_SUB", HFILL}},
4213         {&hf_mq_close_options_REMOVE_SUB, {"REMOVE_SUB", "mq.close.options.RemoveSub", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCO_REMOVE_SUB, "CLOSE options REMOVE_SUB", HFILL}},
4214         {&hf_mq_close_options_QUIESCE, {"QUIESCE", "mq.close.options.Quiesce", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCO_QUIESCE, "CLOSE options QUIESCE", HFILL}},
4215 
4216         {&hf_mq_open_options, {"Options", "mq.open.options", FT_UINT32, BASE_HEX, NULL, 0x0, "OPEN options", HFILL}},
4217         {&hf_mq_open_options_INPUT_AS_Q_DEF, {"INPUT_AS_Q_DEF", "mq.open.options.InputAsQDef", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_INPUT_AS_Q_DEF, "OPEN options INPUT_AS_Q_DEF", HFILL}},
4218         {&hf_mq_open_options_INPUT_SHARED, {"INPUT_SHARED", "mq.open.options.InputShared", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_INPUT_SHARED, "OPEN options INPUT_SHARED", HFILL}},
4219         {&hf_mq_open_options_INPUT_EXCLUSIVE, {"INPUT_EXCLUSIVE", "mq.open.options.InputExclusive", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_INPUT_EXCLUSIVE, "OPEN options INPUT_EXCLUSIVE", HFILL}},
4220         {&hf_mq_open_options_BROWSE, {"BROWSE", "mq.open.options.Browse", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_BROWSE, "OPEN options BROWSE", HFILL}},
4221         {&hf_mq_open_options_OUTPUT, {"OUTPUT", "mq.open.options.Output", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_OUTPUT, "OPEN options OUTPUT", HFILL}},
4222         {&hf_mq_open_options_INQUIRE, {"INQUIRE", "mq.open.options.Inquire", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_INQUIRE, "OPEN options INQUIRE", HFILL}},
4223         {&hf_mq_open_options_SET, {"SET", "mq.open.options.Set", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_SET, "OPEN options SET", HFILL}},
4224         {&hf_mq_open_options_SAVE_ALL_CTX, {"SAVE_ALL_CONTEXT", "mq.open.options.SaveAllContext", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_SAVE_ALL_CONTEXT, "OPEN options SAVE_ALL_CONTEXT", HFILL}},
4225         {&hf_mq_open_options_PASS_IDENT_CTX, {"PASS_IDENTITY_CONTEXT", "mq.open.options.PassIdentityContext", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_PASS_IDENTITY_CONTEXT, "OPEN options PASS_IDENTITY_CONTEXT", HFILL}},
4226         {&hf_mq_open_options_PASS_ALL_CTX, {"PASS_ALL_CONTEXT", "mq.open.options.PassAllContext", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_PASS_ALL_CONTEXT, "OPEN options PASS_ALL_CONTEXT", HFILL}},
4227         {&hf_mq_open_options_SET_IDENT_CTX, {"SET_IDENTITY_CONTEXT", "mq.open.options.SetIdentityContext", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_SET_IDENTITY_CONTEXT, "OPEN options SET_IDENTITY_CONTEXT", HFILL}},
4228         {&hf_mq_open_options_SET_ALL_CONTEXT, {"SET_ALL_CONTEXT", "mq.open.options.SetAllContext", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_SET_ALL_CONTEXT, "OPEN options SET_ALL_CONTEXT", HFILL}},
4229         {&hf_mq_open_options_ALT_USER_AUTH, {"ALTERNATE_USER_AUTHORITY", "mq.open.options.AlternateUserAuthority", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_ALTERNATE_USER_AUTHORITY, "OPEN options ALTERNATE_USER_AUTHORITY", HFILL}},
4230         {&hf_mq_open_options_FAIL_IF_QUIESC, {"FAIL_IF_QUIESCING", "mq.open.options.FailIfQuiescing", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_FAIL_IF_QUIESCING, "OPEN options FAIL_IF_QUIESCING", HFILL}},
4231         {&hf_mq_open_options_BIND_ON_OPEN, {"BIND_ON_OPEN", "mq.open.options.BindOnOpen", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_BIND_ON_OPEN, "OPEN options BIND_ON_OPEN", HFILL}},
4232         {&hf_mq_open_options_BIND_NOT_FIXED, {"BIND_NOT_FIXED", "mq.open.options.BindNotFixed", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_BIND_NOT_FIXED, "OPEN options BIND_NOT_FIXED", HFILL}},
4233         {&hf_mq_open_options_RESOLVE_NAMES, {"RESOLVE_NAMES", "mq.open.options.ResolveNames", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_RESOLVE_NAMES, "OPEN options RESOLVE_NAMES", HFILL}},
4234         {&hf_mq_open_options_CO_OP, {"CO_OP", "mq.open.options.CoOp", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_CO_OP, "OPEN options CO_OP", HFILL}},
4235         {&hf_mq_open_options_RESOLVE_LOCAL_Q, {"RESOLVE_LOCAL_Q", "mq.open.options.ResolveLocalQueueOrTopic", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_RESOLVE_LOCAL_Q, "OPEN options RESOLVE_LOCAL_Q", HFILL}},
4236         {&hf_mq_open_options_NO_READ_AHEAD, {"NO_READ_AHEAD", "mq.open.options.NoReadAhead", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_NO_READ_AHEAD, "OPEN options NO_READ_AHEAD", HFILL}},
4237         {&hf_mq_open_options_READ_AHEAD, {"READ_AHEAD", "mq.open.options.ReadAhead", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_READ_AHEAD, "OPEN options READ_AHEAD", HFILL}},
4238         {&hf_mq_open_options_NO_MULTICAST, {"NO_MULTICAST", "mq.open.options.NoMulticast", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_NO_MULTICAST, "OPEN options NO_MULTICAST", HFILL}},
4239         {&hf_mq_open_options_BIND_ON_GROUP, {"BIND_ON_GROUP", "mq.open.options.BindOnGroup", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQOO_BIND_ON_GROUP, "OPEN options BIND_ON_GROUP", HFILL}},
4240 
4241         {&hf_mq_fopa_StructID, {"StructId.......", "mq.fopa.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4242         {&hf_mq_fopa_version, {"Version........", "mq.fopa.version", FT_UINT32, BASE_DEC, NULL, 0x0, "FOPA Version", HFILL}},
4243         {&hf_mq_fopa_length, {"Length.........", "mq.fopa.length", FT_UINT32, BASE_DEC, NULL, 0x0, "FOPA Length", HFILL}},
4244         {&hf_mq_fopa_DefPersistence, {"DefPersistence.", "mq.fopa.defpersistence", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQPER)), 0x0, "FOPA DefPersistence", HFILL}},
4245         {&hf_mq_fopa_DefPutRespType, {"DefPutRespType.", "mq.fopa.defputresponsetype", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQPRT)), 0x0, "FOPA DefPutRespType", HFILL}},
4246         {&hf_mq_fopa_DefReadAhead, {"DefReadAhead...", "mq.fopa.defreadahaed", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQREADA)), 0x0, "FOPA DefReadAhead", HFILL}},
4247         {&hf_mq_fopa_PropertyControl, {"PropertyControl", "mq.fopa.propertycontrol", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQPROP)), 0x0, "FOPA PropertyControl", HFILL}},
4248         {&hf_mq_fopa_Unknown, {"Unknown........", "mq.fopa.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, "FOPA Unknown", HFILL}},
4249 
4250         {&hf_mq_fcmi_StructID, {"StructId.......", "mq.fcmi.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4251         {&hf_mq_fcmi_unknown, {"Unknown........", "mq.fcmi.unknown", FT_UINT32, BASE_DEC, NULL, 0x0, "FCMI Unknown", HFILL}},
4252 
4253         {&hf_mq_msgreq_version, {"version..", "mq.msgreq.version", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ version", HFILL}},
4254         {&hf_mq_msgreq_handle, {"handle...", "mq.msgreq.handle", FT_UINT32, BASE_HEX, NULL, 0x0, "MSGREQ handle", HFILL}},
4255         {&hf_mq_msgreq_RecvBytes, {"RecvBytes", "mq.msgreq.unknown1", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Received Bytes", HFILL}},
4256         {&hf_mq_msgreq_RqstBytes, {"RqstBytes", "mq.msgreq.rqstbytes", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Requesed Bytes", HFILL}},
4257         {&hf_mq_msgreq_MaxMsgLen, {"MaxMsgLen", "mq.msgreq.maxmsglen", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Maximum Msg Length", HFILL}},
4258         {&hf_mq_msgreq_WaitIntrv, {"WaitIntrv", "mq.msgreq.waitintrv", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Wait Interval", HFILL}},
4259         {&hf_mq_msgreq_QueStatus, {"QueStatus", "mq.msgreq.questatus", FT_UINT32, BASE_HEX, NULL, 0x0, "MSGREQ Queue Status", HFILL}},
4260         {&hf_mq_msgreq_RqstFlags, {"RqstFlags", "mq.msgreq.rqstflags", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Request Flags", HFILL}},
4261         {&hf_mq_msgreq_flags_selection, {"REQ_MSG_SELECTION", "mq.msgreq.rqstflags.SELECTION", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_REQUEST_MSG_SELECTION, "Request Message flag SELECTION", HFILL}},
4262         {&hf_mq_msgreq_flags_F00000008, {"REQ_MSG_F00000008", "mq.msgreq.rqstflags.F00000008", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_REQUEST_MSG_F00000008, "Request Message flag F00000008", HFILL}},
4263         {&hf_mq_msgreq_flags_F00000004, {"REQ_MSG_F00000004", "mq.msgreq.rqstflags.F00000004", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_REQUEST_MSG_F00000004, "Request Message flag F00000004", HFILL}},
4264         {&hf_mq_msgreq_flags_F00000002, {"REQ_MSG_F00000002", "mq.msgreq.rqstflags.F00000002", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_REQUEST_MSG_F00000002, "Request Message flag F00000002", HFILL}},
4265 
4266         {&hf_mq_msgreq_GlbMsgIdx, {"GlbMsgIdx", "mq.msgreq.glbmsgidx", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Global Message Index", HFILL}},
4267         {&hf_mq_msgreq_SelectIdx, {"SelectIdx", "mq.msgreq.selectIdx", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Selection Index", HFILL}},
4268         {&hf_mq_msgreq_MQMDVers, {"MQMDVers.", "mq.msgreq.mqmdvers", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "MSGREQ MQMD Version", HFILL}},
4269         {&hf_mq_msgreq_ccsid, {"CCSID....", "mq.msgreq.ccsid", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "MSGREQ ccsid", HFILL}},
4270         {&hf_mq_msgreq_encoding, {"Encoding.", "mq.msgreq.encoding", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ encoding", HFILL}},
4271         {&hf_mq_msgreq_MsgSeqNum, {"MsgSeqNum", "mq.msgreq.msgseqnum", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Message Sequence Number", HFILL}},
4272         {&hf_mq_msgreq_offset, {"Offset...", "mq.msgreq.offset", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGREQ Offset", HFILL}},
4273         {&hf_mq_msgreq_mtchMsgId, {"mtchMsgId", "mq.msgreq.mtchMsgId", FT_BYTES, BASE_NONE, NULL, 0x0, "MSGREQ match MsgID", HFILL}},
4274         {&hf_mq_msgreq_mtchCorId, {"mtchCorID", "mq.msgreq.mtchcorid", FT_BYTES, BASE_NONE, NULL, 0x0, "MSGREQ match Correlation Id", HFILL}},
4275         {&hf_mq_msgreq_mtchGrpid, {"mtchGrpID", "mq.msgreq.mtchgrpid", FT_BYTES, BASE_NONE, NULL, 0x0, "MSGREQ match Group ID", HFILL}},
4276         {&hf_mq_msgreq_mtchMsgTk, {"mtchMsgTk", "mq.msgreq.mtchmsgtk", FT_BYTES, BASE_NONE, NULL, 0x0, "MSGREQ match Message Token", HFILL}},
4277 
4278         {&hf_mq_msgasy_version, {"version..", "mq.msgasy.version", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC version", HFILL}},
4279         {&hf_mq_msgasy_handle, {"handle...", "mq.msgasy.handle", FT_UINT32, BASE_HEX, NULL, 0x0, "MSGASYNC handle", HFILL}},
4280         {&hf_mq_msgasy_MsgIndex, {"MsgIndex.", "mq.msgasy.msgindex", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Message Index", HFILL}},
4281         {&hf_mq_msgasy_GlbMsgIdx, {"GlbMsgIdx", "mq.msgasy.glbmsgidx", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Global Message Index", HFILL}},
4282         {&hf_mq_msgasy_SegLength, {"SegLength", "mq.msgasy.seglength", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Segment Length", HFILL}},
4283         {&hf_mq_msgasy_SegmIndex, {"SegmIndex", "mq.msgasy.segmindex", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Segment Index", HFILL}},
4284         {&hf_mq_msgasy_SeleIndex, {"SeleIndex", "mq.msgasy.seleindex", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Selection Index", HFILL}},
4285         {&hf_mq_msgasy_ReasonCod, {"ReasonCod", "mq.msgasy.reasoncod", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(MQRC), 0x0, "MSGASYNC Reason Code", HFILL}},
4286         {&hf_mq_msgasy_ActMsgLen, {"ActMsgLen", "mq.msgasy.actmsglen", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Actual Message Length", HFILL}},
4287         {&hf_mq_msgasy_TotMsgLen, {"TotMsgLen", "mq.msgasy.totmsglen", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "MSGASYNC Total Message Length", HFILL}},
4288         {&hf_mq_msgasy_MsgToken, {"MsgToken.", "mq.msgasy.msgtoken", FT_BYTES, BASE_NONE, NULL, 0x0, "MSGASYNC Mesasage Token", HFILL}},
4289         {&hf_mq_msgasy_Status, {"status...", "mq.msgasy.status", FT_UINT16, BASE_HEX, NULL, 0x0, "MSGASYNC Status", HFILL}},
4290         {&hf_mq_msgasy_resolQNLn, {"resolQNLn", "mq.msgasy.resolqnln", FT_UINT8, BASE_DEC, NULL, 0x0, "MSGASYNC Resolved Queue Name Length", HFILL}},
4291         {&hf_mq_msgasy_resolQNme, {"resolQNme", "mq.msgasy.resolqnme", FT_STRING, STR_UNICODE, NULL, 0x0, "MSGASYNC Resolved Queue Name", HFILL}},
4292         {&hf_mq_msgasy_padding, {"Padding..", "mq.msgasy.padding", FT_BYTES, BASE_NONE, NULL, 0x0, "MSGASYNC Padding", HFILL}},
4293 
4294         {&hf_mq_notif_vers, {"version.", "mq.notif.vers", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "NOTIFICATION version", HFILL}},
4295         {&hf_mq_notif_handle, {"handle..", "mq.notif.handle", FT_UINT32, BASE_HEX, NULL, 0x0, "NOTIFICATION handle", HFILL}},
4296         {&hf_mq_notif_code, {"code....", "mq.notif.code", FT_UINT32, BASE_HEX_DEC, VALS(GET_VALSV(notifcode)), 0x0, "NOTIFICATION code", HFILL}},
4297         {&hf_mq_notif_value, {"value...", "mq.notif.value", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "NOTIFICATION MQRC", HFILL}},
4298 
4299         {&hf_mq_ping_length, {"Length", "mq.ping.length", FT_UINT32, BASE_DEC, NULL, 0x0, "PING length", HFILL}},
4300         {&hf_mq_ping_buffer, {"Buffer", "mq.ping.buffer", FT_BYTES, BASE_NONE, NULL, 0x0, "PING buffer", HFILL}},
4301 
4302         {&hf_mq_reset_length, {"Length", "mq.reset.length", FT_UINT32, BASE_DEC, NULL, 0x0, "RESET length", HFILL}},
4303         {&hf_mq_reset_seqnum, {"SeqNum", "mq.reset.seqnum", FT_UINT32, BASE_DEC, NULL, 0x0, "RESET sequence number", HFILL}},
4304 
4305         {&hf_mq_status_length, {"Length", "mq.status.length", FT_UINT32, BASE_DEC, NULL, 0x0, "STATUS length", HFILL}},
4306         {&hf_mq_status_code, {"Code..", "mq.status.code", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(status), 0x0, "STATUS code", HFILL}},
4307         {&hf_mq_status_value, {"Value.", "mq.status.value", FT_UINT32, BASE_DEC, NULL, 0x0, "STATUS value", HFILL}},
4308 
4309         {&hf_mq_od_StructID, {"StructID.........", "mq.od.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4310         {&hf_mq_od_version, {"version..........", "mq.od.version", FT_UINT32, BASE_DEC, NULL, 0x0, "OD version", HFILL}},
4311         {&hf_mq_od_objecttype, {"ObjType..........", "mq.od.objtype", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(objtype), 0x0, "OD object type", HFILL}},
4312         {&hf_mq_od_objectname, {"ObjName..........", "mq.od.objname", FT_STRING, STR_UNICODE, NULL, 0x0, "OD object name", HFILL}},
4313         {&hf_mq_od_objqmgrname, {"ObjQMgr..........", "mq.od.objqmgrname", FT_STRING, STR_UNICODE, NULL, 0x0, "OD object queue manager name", HFILL}},
4314         {&hf_mq_od_dynqname, {"DynQName.........", "mq.od.dynqname", FT_STRING, STR_UNICODE, NULL, 0x0, "OD dynamic queue name", HFILL}},
4315         {&hf_mq_od_altuserid, {"AltUserID........", "mq.od.altuserid", FT_STRING, STR_UNICODE, NULL, 0x0, "OD alternate userid", HFILL}},
4316         {&hf_mq_od_recspresent, {"NbrRecord........", "mq.od.nbrrec", FT_UINT32, BASE_DEC, NULL, 0x0, "OD number of records", HFILL}},
4317         {&hf_mq_od_knowndstcnt, {"Known Dest Count.", "mq.od.kdestcount", FT_UINT32, BASE_DEC, NULL, 0x0, "OD known destination count", HFILL}},
4318         {&hf_mq_od_unknowdstcnt, {"Unknown Dest Cnt.", "mq.od.udestcount", FT_UINT32, BASE_DEC, NULL, 0x0, "OD unknown destination count", HFILL}},
4319         {&hf_mq_od_invaldstcnt, {"Invalid Dest Cnt.", "mq.od.idestcount", FT_UINT32, BASE_DEC, NULL, 0x0, "OD invalid destination count", HFILL}},
4320         {&hf_mq_od_objrecofs, {"Offset of 1st OR.", "mq.od.offsetor", FT_UINT32, BASE_DEC, NULL, 0x0, "OD offset of first OR", HFILL}},
4321         {&hf_mq_od_resprecofs, {"Offset of 1st RR.", "mq.od.offsetrr", FT_UINT32, BASE_DEC, NULL, 0x0, "OD offset of first RR", HFILL}},
4322         {&hf_mq_od_objrecptr, {"Addr   of 1st OR.", "mq.od.addror", FT_UINT32, BASE_HEX, NULL, 0x0, "OD address of first OR", HFILL}},
4323         {&hf_mq_od_resprecptr, {"Addr   of 1st RR.", "mq.od.addrrr", FT_UINT32, BASE_HEX, NULL, 0x0, "OD address of first RR", HFILL}},
4324         {&hf_mq_od_altsecurid, {"Alt security id..", "mq.od.altsecid", FT_STRING, STR_UNICODE, NULL, 0x0, "OD alternate security id", HFILL}},
4325         {&hf_mq_od_resolvqname, {"Resolved Q Name..", "mq.od.resolvq", FT_STRING, STR_UNICODE, NULL, 0x0, "OD resolved queue name", HFILL}},
4326         {&hf_mq_od_resolvqmgrnm, {"Resolved QMgrName", "mq.od.resolvqmgr", FT_STRING, STR_UNICODE, NULL, 0x0, "OD resolved queue manager name", HFILL}},
4327         {&hf_mq_od_resolvobjtyp, {"Resolv Obj Type..", "mq.od.resolvedobjtype", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(objtype), 0x0, "OD resolved object type", HFILL}},
4328 
4329         {&hf_mq_or_objname, {"Object name...", "mq.or.objname", FT_STRING, STR_UNICODE, NULL, 0x0, "OR object name", HFILL}},
4330         {&hf_mq_or_objqmgrname, {"Object QMgr Nm", "mq.or.objqmgrname", FT_STRING, STR_UNICODE, NULL, 0x0, "OR object queue manager name", HFILL}},
4331 
4332         {&hf_mq_rr_compcode, {"Comp Code", "mq.rr.completioncode", FT_UINT32, BASE_DEC, NULL, 0x0, "OR completion code", HFILL}},
4333         {&hf_mq_rr_reascode, {"Reas Code", "mq.rr.reasoncode", FT_UINT32, BASE_DEC, NULL, 0x0, "OR reason code", HFILL}},
4334 
4335         {&hf_mq_pmr_msgid, {"Message Id", "mq.pmr.msgid", FT_BYTES, BASE_NONE, NULL, 0x0, "PMR Message Id", HFILL}},
4336         {&hf_mq_pmr_correlid, {"Correlation Id", "mq.pmr.correlid", FT_BYTES, BASE_NONE, NULL, 0x0, "PMR Correlation Id", HFILL}},
4337         {&hf_mq_pmr_groupid, {"GroupId", "mq.pmr.groupid", FT_BYTES, BASE_NONE, NULL, 0x0, "PMR GroupId", HFILL}},
4338         {&hf_mq_pmr_feedback, {"Feedback", "mq.pmr.feedback", FT_UINT32, BASE_DEC, NULL, 0x0, "PMR Feedback", HFILL}},
4339         {&hf_mq_pmr_acttoken, {"Accounting token", "mq.pmr.acttoken", FT_BYTES, BASE_NONE, NULL, 0x0, "PMR accounting token", HFILL}},
4340 
4341         {&hf_mq_md_StructID, {"StructID.", "mq.md.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4342         {&hf_mq_md_version, {"Version..", "mq.md.version", FT_UINT32, BASE_DEC, NULL, 0x0, "MD version", HFILL}},
4343         {&hf_mq_md_report, {"Report...", "mq.md.report", FT_UINT32, BASE_DEC, NULL, 0x0, "MD report", HFILL}},
4344         {&hf_mq_md_msgtype, {"Msg Type.", "mq.md.msgtype", FT_UINT32, BASE_DEC, VALS(GET_VALSV(MQMT)), 0x0, "MD message type", HFILL}},
4345         {&hf_mq_md_expiry, {"Expiry  .", "mq.md.expiry", FT_INT32, BASE_DEC, NULL, 0x0, "MD expiry", HFILL}},
4346         {&hf_mq_md_feedback, {"Feedback.", "mq.md.feedback", FT_UINT32, BASE_DEC, NULL, 0x0, "MD feedback", HFILL}},
4347         {&hf_mq_md_encoding, {"Encoding.", "mq.md.encoding", FT_UINT32, BASE_DEC, NULL, 0x0, "MD encoding", HFILL}},
4348         {&hf_mq_md_ccsid, {"CCSID....", "mq.md.ccsid", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "MD character set", HFILL}},
4349         {&hf_mq_md_format, {"Format...", "mq.md.format", FT_STRING, STR_UNICODE, NULL, 0x0, "MD format", HFILL}},
4350         {&hf_mq_md_priority, {"Priority.", "mq.md.priority", FT_INT32, BASE_DEC, NULL, 0x0, "MD priority", HFILL}},
4351         {&hf_mq_md_persistence, {"Persist..", "mq.md.persistence", FT_UINT32, BASE_DEC, VALS(GET_VALSV(MQPER)), 0x0, "MD persistence", HFILL}},
4352         {&hf_mq_md_msgid, {"Msg ID...", "mq.md.msgid", FT_BYTES, BASE_NONE, NULL, 0x0, "MD Message Id", HFILL}},
4353         {&hf_mq_md_correlid, {"CorrelID.", "mq.md.correlid", FT_BYTES, BASE_NONE, NULL, 0x0, "MD Correlation Id", HFILL}},
4354         {&hf_mq_md_backoutcnt, {"BackoCnt.", "mq.md.backount", FT_UINT32, BASE_DEC, NULL, 0x0, "MD Backout count", HFILL}},
4355         {&hf_mq_md_replytoq, {"ReplyToQ.", "mq.md.replytoq", FT_STRING, STR_UNICODE, NULL, 0x0, "MD ReplyTo queue", HFILL}},
4356         {&hf_mq_md_replytoqmgr, {"RepToQMgr", "mq.md.replytoqmgr", FT_STRING, STR_UNICODE, NULL, 0x0, "MD ReplyTo queue manager", HFILL}},
4357         {&hf_mq_md_userid, {"UserId...", "mq.md.userid", FT_STRING, STR_UNICODE, NULL, 0x0, "MD UserId", HFILL}},
4358         {&hf_mq_md_acttoken, {"AccntTok.", "mq.md.acttoken", FT_BYTES, BASE_NONE, NULL, 0x0, "MD accounting token", HFILL}},
4359         {&hf_mq_md_appliddata, {"AppIdData", "mq.md.appldata", FT_STRING, STR_UNICODE, NULL, 0x0, "MD Put applicationId data", HFILL}},
4360         {&hf_mq_md_putappltype, {"PutAppTyp", "mq.md.appltype", FT_INT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(MQAT), 0x0, "MD Put application type", HFILL}},
4361         {&hf_mq_md_putapplname, {"PutAppNme", "mq.md.applname", FT_STRING, STR_UNICODE, NULL, 0x0, "MD Put application name", HFILL}},
4362         {&hf_mq_md_putdate, {"PutDatGMT", "mq.md.date", FT_STRING, STR_UNICODE, NULL, 0x0, "MD Put date", HFILL}},
4363         {&hf_mq_md_puttime, {"PutTimGMT", "mq.md.time", FT_STRING, STR_UNICODE, NULL, 0x0, "MD Put time", HFILL}},
4364         {&hf_mq_md_apporigdata, {"AppOriDat", "mq.md.origdata", FT_STRING, STR_UNICODE, NULL, 0x0, "MD Application original data", HFILL}},
4365         {&hf_mq_md_groupid, {"GroupId..", "mq.md.groupid", FT_BYTES, BASE_NONE, NULL, 0x0, "MD GroupId", HFILL}},
4366         {&hf_mq_md_msgseqnumber, {"MsgSeqNum", "mq.md.msgseqnumber", FT_UINT32, BASE_DEC, NULL, 0x0, "MD Message sequence number", HFILL}},
4367         {&hf_mq_md_offset, {"Offset...", "mq.md.offset", FT_UINT32, BASE_DEC, NULL, 0x0, "MD Offset", HFILL}},
4368         {&hf_mq_md_msgflags, {"Msg flags", "mq.md.msgflags", FT_UINT32, BASE_HEX, NULL, 0x0, "MD Message flags", HFILL}},
4369         {&hf_mq_md_origlen, {"Orig len.", "mq.md.origlength", FT_INT32, BASE_DEC, NULL, 0x0, "MD Original length", HFILL}},
4370 
4371         {&hf_mq_dlh_StructID, {"StructID.", "mq.dlh.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4372         {&hf_mq_dlh_version, {"Version..", "mq.dlh.version", FT_UINT32, BASE_DEC, NULL, 0x0, "DLH version", HFILL}},
4373         {&hf_mq_dlh_reason, {"Reason...", "mq.dlh.reason", FT_UINT32, BASE_DEC, NULL, 0x0, "DLH reason", HFILL}},
4374         {&hf_mq_dlh_destq, {"Dest Q...", "mq.dlh.destq", FT_STRING, STR_UNICODE, NULL, 0x0, "DLH destination queue", HFILL}},
4375         {&hf_mq_dlh_destqmgr, {"DestQMgr.", "mq.dlh.destqmgr", FT_STRING, STR_UNICODE, NULL, 0x0, "DLH destination queue manager", HFILL}},
4376         {&hf_mq_dlh_encoding, {"Encoding.", "mq.dlh.encoding", FT_UINT32, BASE_DEC, NULL, 0x0, "DLH encoding", HFILL}},
4377         {&hf_mq_dlh_ccsid, {"CCSID....", "mq.dlh.ccsid", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "DLH character set", HFILL}},
4378         {&hf_mq_dlh_format, {"Format...", "mq.dlh.format", FT_STRING, STR_UNICODE, NULL, 0x0, "DLH format", HFILL}},
4379         {&hf_mq_dlh_putappltype, {"PutAppTyp", "mq.dlh.putappltype", FT_INT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(MQAT), 0x0, "DLH put application type", HFILL}},
4380         {&hf_mq_dlh_putapplname, {"PutAppNme", "mq.dlh.putapplname", FT_STRING, STR_UNICODE, NULL, 0x0, "DLH put application name", HFILL}},
4381         {&hf_mq_dlh_putdate, {"PutDatGMT", "mq.dlh.putdate", FT_STRING, STR_UNICODE, NULL, 0x0, "DLH put date", HFILL}},
4382         {&hf_mq_dlh_puttime, {"PutTimGMT", "mq.dlh.puttime", FT_STRING, STR_UNICODE, NULL, 0x0, "DLH put time", HFILL}},
4383 
4384         {&hf_mq_gmo_StructID, {"StructID.", "mq.gmo.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4385         {&hf_mq_gmo_version, {"Version..", "mq.gmo.version", FT_UINT32, BASE_DEC, NULL, 0x0, "GMO version", HFILL}},
4386         {&hf_mq_gmo_options, {"GetMsgOpt", "mq.gmo.getmsgopt", FT_UINT32, BASE_HEX, NULL, 0x0, "GMO Get Message Options", HFILL}},
4387 
4388         {&hf_mq_gmo_options_PROPERTIES_COMPATIBILITY, {"PROPERTIES_COMPATIBILITY", "mq.gmo.options.PROPERTIES_COMPATIBILITY", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_PROPERTIES_COMPATIBILITY, "GMO options PROPERTIES_COMPATIBILITY", HFILL}},
4389         {&hf_mq_gmo_options_PROPERTIES_IN_HANDLE, {"PROPERTIES_IN_HANDLE", "mq.gmo.options.PROPERTIES_IN_HANDLE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_PROPERTIES_IN_HANDLE, "GMO options PROPERTIES_IN_HANDLE", HFILL}},
4390         {&hf_mq_gmo_options_NO_PROPERTIES, {"NO_PROPERTIES", "mq.gmo.options.NO_PROPERTIES", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_NO_PROPERTIES, "GMO options NO_PROPERTIES", HFILL}},
4391         {&hf_mq_gmo_options_PROPERTIES_FORCE_MQRFH2, {"PROPERTIES_FORCE_MQRFH2", "mq.gmo.options.PROPERTIES_FORCE_MQRFH2", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_PROPERTIES_FORCE_MQRFH2, "GMO options PROPERTIES_FORCE_MQRFH2", HFILL}},
4392         {&hf_mq_gmo_options_UNMARKED_BROWSE_MSG, {"UNMARKED_BROWSE_MSG", "mq.gmo.options.UNMARKED_BROWSE_MSG", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_UNMARKED_BROWSE_MSG, "GMO options UNMARKED_BROWSE_MSG", HFILL}},
4393         {&hf_mq_gmo_options_UNMARK_BROWSE_HANDLE, {"UNMARK_BROWSE_HANDLE", "mq.gmo.options.UNMARK_BROWSE_HANDLE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_UNMARK_BROWSE_HANDLE, "GMO options UNMARK_BROWSE_HANDLE", HFILL}},
4394         {&hf_mq_gmo_options_UNMARK_BROWSE_CO_OP, {"UNMARK_BROWSE_CO_OP", "mq.gmo.options.UNMARK_BROWSE_CO_OP", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_UNMARK_BROWSE_CO_OP, "GMO options UNMARK_BROWSE_CO_OP", HFILL}},
4395         {&hf_mq_gmo_options_MARK_BROWSE_CO_OP, {"MARK_BROWSE_CO_OP", "mq.gmo.options.MARK_BROWSE_CO_OP", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_MARK_BROWSE_CO_OP, "GMO options MARK_BROWSE_CO_OP", HFILL}},
4396         {&hf_mq_gmo_options_MARK_BROWSE_HANDLE, {"MARK_BROWSE_HANDLE", "mq.gmo.options.MARK_BROWSE_HANDLE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_MARK_BROWSE_HANDLE, "GMO options MARK_BROWSE_HANDLE", HFILL}},
4397         {&hf_mq_gmo_options_ALL_SEGMENTS_AVAILABLE, {"ALL_SEGMENTS_AVAILABLE", "mq.gmo.options.ALL_SEGMENTS_AVAILABLE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_ALL_SEGMENTS_AVAILABLE, "GMO options ALL_SEGMENTS_AVAILABLE", HFILL}},
4398         {&hf_mq_gmo_options_ALL_MSGS_AVAILABLE, {"ALL_MSGS_AVAILABLE", "mq.gmo.options.ALL_MSGS_AVAILABLE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_ALL_MSGS_AVAILABLE, "GMO options ALL_MSGS_AVAILABLE", HFILL}},
4399         {&hf_mq_gmo_options_COMPLETE_MSG, {"COMPLETE_MSG", "mq.gmo.options.COMPLETE_MSG", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_COMPLETE_MSG, "GMO options COMPLETE_MSG", HFILL}},
4400         {&hf_mq_gmo_options_LOGICAL_ORDER, {"LOGICAL_ORDER", "mq.gmo.options.LOGICAL_ORDER", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_LOGICAL_ORDER, "GMO options LOGICAL_ORDER", HFILL}},
4401         {&hf_mq_gmo_options_CONVERT, {"CONVERT", "mq.gmo.options.CONVERT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_CONVERT, "GMO options CONVERT", HFILL}},
4402         {&hf_mq_gmo_options_FAIL_IF_QUIESCING, {"FAIL_IF_QUIESCING", "mq.gmo.options.FAIL_IF_QUIESCING", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_FAIL_IF_QUIESCING, "GMO options FAIL_IF_QUIESCING", HFILL}},
4403         {&hf_mq_gmo_options_SYNCPOINT_IF_PERSISTENT, {"SYNCPOINT_IF_PERSISTENT", "mq.gmo.options.SYNCPOINT_IF_PERSISTENT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_SYNCPOINT_IF_PERSISTENT, "GMO options SYNCPOINT_IF_PERSISTENT", HFILL}},
4404         {&hf_mq_gmo_options_BROWSE_MSG_UNDER_CURSOR, {"BROWSE_MSG_UNDER_CURSOR", "mq.gmo.options.BROWSE_MSG_UNDER_CURSOR", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_BROWSE_MSG_UNDER_CURSOR, "GMO options BROWSE_MSG_UNDER_CURSOR", HFILL}},
4405         {&hf_mq_gmo_options_UNLOCK, {"UNLOCK", "mq.gmo.options.UNLOCK", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_UNLOCK, "GMO options UNLOCK", HFILL}},
4406         {&hf_mq_gmo_options_LOCK, {"LOCK", "mq.gmo.options.LOCK", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_LOCK, "GMO options LOCK", HFILL}},
4407         {&hf_mq_gmo_options_MSG_UNDER_CURSOR, {"MSG_UNDER_CURSOR", "mq.gmo.options.MSG_UNDER_CURSOR", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_MSG_UNDER_CURSOR, "GMO options MSG_UNDER_CURSOR", HFILL}},
4408         {&hf_mq_gmo_options_MARK_SKIP_BACKOUT, {"MARK_SKIP_BACKOUT", "mq.gmo.options.MARK_SKIP_BACKOUT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_MARK_SKIP_BACKOUT, "GMO options MARK_SKIP_BACKOUT", HFILL}},
4409         {&hf_mq_gmo_options_ACCEPT_TRUNCATED_MSG, {"ACCEPT_TRUNCATED_MSG", "mq.gmo.options.ACCEPT_TRUNCATED_MSG", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_ACCEPT_TRUNCATED_MSG, "GMO options ACCEPT_TRUNCATED_MSG", HFILL}},
4410         {&hf_mq_gmo_options_BROWSE_NEXT, {"BROWSE_NEXT", "mq.gmo.options.BROWSE_NEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_BROWSE_NEXT, "GMO options BROWSE_NEXT", HFILL}},
4411         {&hf_mq_gmo_options_BROWSE_FIRST, {"BROWSE_FIRST", "mq.gmo.options.BROWSE_FIRST", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_BROWSE_FIRST, "GMO options BROWSE_FIRST", HFILL}},
4412         {&hf_mq_gmo_options_SET_SIGNAL, {"SET_SIGNAL", "mq.gmo.options.SET_SIGNAL", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_SET_SIGNAL, "GMO options SET_SIGNAL", HFILL}},
4413         {&hf_mq_gmo_options_NO_SYNCPOINT, {"NO_SYNCPOINT", "mq.gmo.options.NO_SYNCPOINT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_NO_SYNCPOINT, "GMO options NO_SYNCPOINT", HFILL}},
4414         {&hf_mq_gmo_options_SYNCPOINT, {"SYNCPOINT", "mq.gmo.options.SYNCPOINT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_SYNCPOINT, "GMO options SYNCPOINT", HFILL}},
4415         {&hf_mq_gmo_options_WAIT, {"WAIT", "mq.gmo.options.WAIT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQGMO_WAIT, "GMO options WAIT", HFILL}},
4416 
4417         {&hf_mq_gmo_waitinterval, {"WaitIntv.", "mq.gmo.waitint", FT_INT32, BASE_DEC, NULL, 0x0, "GMO wait interval", HFILL}},
4418         {&hf_mq_gmo_signal1, {"Signal 1.", "mq.gmo.signal1", FT_UINT32, BASE_HEX, NULL, 0x0, "GMO signal 1", HFILL}},
4419         {&hf_mq_gmo_signal2, {"Signal 2.", "mq.gmo.signal2", FT_UINT32, BASE_HEX, NULL, 0x0, "GMO signal 2", HFILL}},
4420         {&hf_mq_gmo_resolvqname, {"ResQName.", "mq.gmo.resolvq", FT_STRING, STR_UNICODE, NULL, 0x0, "GMO resolved queue name", HFILL}},
4421         {&hf_mq_gmo_matchoptions, {"MatchOpt.", "mq.gmo.matchopt", FT_UINT32, BASE_HEX, NULL, 0x0, "GMO match options", HFILL}},
4422 
4423         {&hf_mq_gmo_matchoptions_MATCH_MSG_TOKEN, {"MATCH_MSG_TOKEN", "mq.gmo.matchoptions.MATCH_MSG_TOKEN", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQMO_MATCH_MSG_TOKEN, "GMO matchoptions MATCH_MSG_TOKEN", HFILL}},
4424         {&hf_mq_gmo_matchoptions_MATCH_OFFSET, {"MATCH_OFFSET", "mq.gmo.matchoptions.MATCH_OFFSET", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQMO_MATCH_OFFSET, "GMO matchoptions MATCH_OFFSET", HFILL}},
4425         {&hf_mq_gmo_matchoptions_MATCH_MSG_SEQ_NUMBER, {"MATCH_MSG_SEQ_NUMBER", "mq.gmo.matchoptions.MATCH_MSG_SEQ_NUMBER", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQMO_MATCH_MSG_SEQ_NUMBER, "GMO matchoptions MATCH_MSG_SEQ_NUMBER", HFILL}},
4426         {&hf_mq_gmo_matchoptions_MATCH_GROUP_ID, {"MATCH_GROUP_ID", "mq.gmo.matchoptions.MATCH_GROUP_ID", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQMO_MATCH_GROUP_ID, "GMO matchoptions MATCH_GROUP_ID", HFILL}},
4427         {&hf_mq_gmo_matchoptions_MATCH_CORREL_ID, {"MATCH_CORREL_ID", "mq.gmo.matchoptions.MATCH_CORREL_ID", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQMO_MATCH_CORREL_ID, "GMO matchoptions MATCH_CORREL_ID", HFILL}},
4428         {&hf_mq_gmo_matchoptions_MATCH_MSG_ID, {"MATCH_MSG_ID", "mq.gmo.matchoptions.MATCH_MSG_ID", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQMO_MATCH_MSG_ID, "GMO matchoptions MATCH_MSG_ID", HFILL}},
4429 
4430         {&hf_mq_gmo_groupstatus, {"GrpStatus", "mq.gmo.grpstat", FT_UINT8, BASE_HEX, NULL, 0x0, "GMO group status", HFILL}},
4431         {&hf_mq_gmo_segmstatus, {"SegStatus", "mq.gmo.sgmtstat", FT_UINT8, BASE_HEX, NULL, 0x0, "GMO segment status", HFILL}},
4432         {&hf_mq_gmo_segmentation, {"Segmentat", "mq.gmo.segmentation", FT_UINT8, BASE_HEX, NULL, 0x0, "GMO segmentation", HFILL}},
4433         {&hf_mq_gmo_reserved, {"Reserved.", "mq.gmo.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, "GMO reserved", HFILL}},
4434         {&hf_mq_gmo_msgtoken, {"MsgToken.", "mq.gmo.msgtoken", FT_BYTES, BASE_NONE, NULL, 0x0, "GMO message token", HFILL}},
4435         {&hf_mq_gmo_returnedlen, {"RtnLength", "mq.gmo.retlen", FT_INT32, BASE_DEC, NULL, 0x0, "GMO returned length", HFILL}},
4436         {&hf_mq_gmo_reserved2, {"Reserved2", "mq.gmo.reserved2", FT_INT32, BASE_DEC, NULL, 0x0, "GMO reserved2", HFILL}},
4437         {&hf_mq_gmo_msghandle, {"MsgHandle", "mq.gmo.msghandle", FT_UINT64, BASE_DEC | BASE_HEX, NULL, 0x0, "GMO Message Handle", HFILL}},
4438 
4439         {&hf_mq_lpoo_StructID, {"StructID......", "mq.lpoo.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4440         {&hf_mq_lpoo_version, {"version.......", "mq.lpoo.version", FT_UINT32, BASE_DEC, NULL, 0x0, "LPOO version", HFILL}},
4441         {&hf_mq_lpoo_lpiopts, {"lpiopts.......", "mq.lpoo.lpioopts", FT_UINT32, BASE_HEX, NULL, 0x0, "LPOO Lpi Options", HFILL}},
4442 
4443         {&hf_mq_lpoo_lpiopts_SAVE_USER_CTXT, {"SAVE_USER_CTXT", "mq.lpoo.opts.SAVE_USER_CTXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_LPOO_SAVE_USER_CTXT, "LPOO options SAVE_USER_CTXT", HFILL}},
4444         {&hf_mq_lpoo_lpiopts_SAVE_ORIGIN_CTXT, {"SAVE_ORIGIN_CTXT", "mq.lpoo.opts.SAVE_ORIGIN_CTXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_LPOO_SAVE_ORIGIN_CTXT, "LPOO options SAVE_ORIGIN_CTXT", HFILL}},
4445         {&hf_mq_lpoo_lpiopts_SAVE_IDENTITY_CTXT, {"SAVE_IDENTITY_CTXT", "mq.lpoo.opts.SAVE_IDENTITY_CTXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_LPOO_SAVE_IDENTITY_CTXT, "LPOO options SAVE_IDENTITY_CTXT", HFILL}},
4446 
4447         {&hf_mq_lpoo_defpersist, {"DefPersistence", "mq.lpoo.defpersist", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQPER)), 0x0, "LPOO Default Persistence", HFILL}},
4448         {&hf_mq_lpoo_defputresptype, {"DefPutRespType", "mq.lpoo.defputresptype", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQPRT)), 0x0, "LPOO Default Put Response Type", HFILL}},
4449         {&hf_mq_lpoo_defreadahead, {"DefReadAHead..", "mq.lpoo.defreadahead", FT_INT32, BASE_DEC, VALS(GET_VALSV(MQREADA)), 0x0, "LPOO Default Read AHead", HFILL}},
4450         {&hf_mq_lpoo_propertyctl, {"PropertyCtl...", "mq.lpoo.propertyctl", FT_INT32, BASE_DEC, NULL, 0x0, "LPOO Property Control", HFILL}},
4451         {&hf_mq_lpoo_qprotect, {"qprotect......", "mq.lpoo.qprotect", FT_STRING, STR_UNICODE, NULL, 0x0, "LPOO queue protection", HFILL}},
4452         {&hf_mq_lpoo_qprotect_val1, {"qprotect_val1.", "mq.lpoo.qprotect.val2", FT_INT32, BASE_DEC, NULL, 0x0, "LPOO queue protection val1", HFILL}},
4453         {&hf_mq_lpoo_qprotect_val2, {"qprotect_val2.", "mq.lpoo.qprotect.val1", FT_INT32, BASE_DEC, NULL, 0x0, "LPOO queue protection val2", HFILL}},
4454 
4455         {&hf_mq_pmo_StructID, {"StructID...", "mq.pmo.structid", FT_STRING, STR_UNICODE, NULL, 0x0, NULL, HFILL}},
4456         {&hf_mq_pmo_version, {"Version....", "mq.pmo.version", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO version", HFILL}},
4457         {&hf_mq_pmo_options, {"Options....", "mq.pmo.options", FT_UINT32, BASE_HEX, NULL, 0x0, "PMO options", HFILL}},
4458         {&hf_mq_pmo_options_NOT_OWN_SUBS, {"NOT_OWN_SUBS", "mq.pmo.options.NOT_OWN_SUBS", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_NOT_OWN_SUBS, "PMO options NOT_OWN_SUBS", HFILL}},
4459         {&hf_mq_pmo_options_SUPPRESS_REPLYTO, {"SUPPRESS_REPLYTO", "mq.pmo.options.SUPPRESS_REPLYTO", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_SUPPRESS_REPLYTO, "PMO options SUPPRESS_REPLYTO", HFILL}},
4460         {&hf_mq_pmo_options_SCOPE_QMGR, {"SCOPE_QMGR", "mq.pmo.options.SCOPE_QMGR", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_SCOPE_QMGR, "PMO options SCOPE_QMGR", HFILL}},
4461         {&hf_mq_pmo_options_MD_FOR_OUTPUT_ONLY, {"MD_FOR_OUTPUT_ONLY", "mq.pmo.options.MD_FOR_OUTPUT_ONLY", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_MD_FOR_OUTPUT_ONLY, "PMO options MD_FOR_OUTPUT_ONLY", HFILL}},
4462         {&hf_mq_pmo_options_RETAIN, {"RETAIN", "mq.pmo.options.RETAIN", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_RETAIN, "PMO options RETAIN", HFILL}},
4463         {&hf_mq_pmo_options_WARN_IF_NO_SUBS_MATCHED, {"WARN_IF_NO_SUBS_MATCHED", "mq.pmo.options.WARN_IF_NO_SUBS_MATCHED", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_WARN_IF_NO_SUBS_MATCHED, "PMO options WARN_IF_NO_SUBS_MATCHED", HFILL}},
4464         {&hf_mq_pmo_options_RESOLVE_LOCAL_Q, {"RESOLVE_LOCAL_Q", "mq.pmo.options.RESOLVE_LOCAL_Q", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_RESOLVE_LOCAL_Q, "PMO options RESOLVE_LOCAL_Q", HFILL}},
4465         {&hf_mq_pmo_options_SYNC_RESPONSE, {"SYNC_RESPONSE", "mq.pmo.options.SYNC_RESPONSE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_SYNC_RESPONSE, "PMO options SYNC_RESPONSE", HFILL}},
4466         {&hf_mq_pmo_options_ASYNC_RESPONSE, {"ASYNC_RESPONSE", "mq.pmo.options.ASYNC_RESPONSE", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_ASYNC_RESPONSE, "PMO options ASYNC_RESPONSE", HFILL}},
4467         {&hf_mq_pmo_options_LOGICAL_ORDER, {"LOGICAL_ORDER", "mq.pmo.options.LOGICAL_ORDER", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_LOGICAL_ORDER, "PMO options LOGICAL_ORDER", HFILL}},
4468         {&hf_mq_pmo_options_NO_CONTEXT, {"NO_CONTEXT", "mq.pmo.options.NO_CONTEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_NO_CONTEXT, "PMO options NO_CONTEXT", HFILL}},
4469         {&hf_mq_pmo_options_FAIL_IF_QUIESCING, {"FAIL_IF_QUIESCING", "mq.pmo.options.FAIL_IF_QUIESCING", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_FAIL_IF_QUIESCING, "PMO options FAIL_IF_QUIESCING", HFILL}},
4470         {&hf_mq_pmo_options_ALTERNATE_USER_AUTHORITY, {"ALTERNATE_USER_AUTHORITY", "mq.pmo.options.ALTERNATE_USER_AUTHORITY", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_ALTERNATE_USER_AUTHORITY, "PMO options ALTERNATE_USER_AUTHORITY", HFILL}},
4471         {&hf_mq_pmo_options_SET_ALL_CONTEXT, {"SET_ALL_CONTEXT", "mq.pmo.options.SET_ALL_CONTEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_SET_ALL_CONTEXT, "PMO options SET_ALL_CONTEXT", HFILL}},
4472         {&hf_mq_pmo_options_SET_IDENTITY_CONTEXT, {"SET_IDENTITY_CONTEXT", "mq.pmo.options.SET_IDENTITY_CONTEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_SET_IDENTITY_CONTEXT, "PMO options SET_IDENTITY_CONTEXT", HFILL}},
4473         {&hf_mq_pmo_options_PASS_ALL_CONTEXT, {"PASS_ALL_CONTEXT", "mq.pmo.options.PASS_ALL_CONTEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_PASS_ALL_CONTEXT, "PMO options PASS_ALL_CONTEXT", HFILL}},
4474         {&hf_mq_pmo_options_PASS_IDENTITY_CONTEXT, {"PASS_IDENTITY_CONTEXT", "mq.pmo.options.PASS_IDENTITY_CONTEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_PASS_IDENTITY_CONTEXT, "PMO options PASS_IDENTITY_CONTEXT", HFILL}},
4475         {&hf_mq_pmo_options_NEW_CORREL_ID, {"NEW_CORREL_ID", "mq.pmo.options.NEW_CORREL_ID", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_NEW_CORREL_ID, "PMO options NEW_CORREL_ID", HFILL}},
4476         {&hf_mq_pmo_options_NEW_MSG_ID, {"NEW_MSG_ID", "mq.pmo.options.NEW_MSG_ID", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_NEW_MSG_ID, "PMO options NEW_MSG_ID", HFILL}},
4477         {&hf_mq_pmo_options_DEFAULT_CONTEXT, {"DEFAULT_CONTEXT", "mq.pmo.options.DEFAULT_CONTEXT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_DEFAULT_CONTEXT, "PMO options DEFAULT_CONTEXT", HFILL}},
4478         {&hf_mq_pmo_options_NO_SYNCPOINT, {"NO_SYNCPOINT", "mq.pmo.options.NO_SYNCPOINT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_NO_SYNCPOINT, "PMO options NO_SYNCPOINT", HFILL}},
4479         {&hf_mq_pmo_options_SYNCPOINT, {"SYNCPOINT", "mq.pmo.options.SYNCPOINT", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQPMO_SYNCPOINT, "PMO options SYNCPOINT", HFILL}},
4480 
4481         {&hf_mq_pmo_timeout, {"Timeout....", "mq.pmo.timeout", FT_INT32, BASE_DEC, NULL, 0x0, "PMO time out", HFILL}},
4482         {&hf_mq_pmo_context, {"Context....", "mq.pmo.context", FT_UINT32, BASE_HEX, NULL, 0x0, "PMO context", HFILL}},
4483         {&hf_mq_pmo_knowndstcnt, {"KnDstCnt...", "mq.pmo.kdstcount", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO known destination count", HFILL}},
4484         {&hf_mq_pmo_unkndstcnt, {"UkDstCnt...", "mq.pmo.udestcount", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO unknown destination count", HFILL}},
4485         {&hf_mq_pmo_invaldstcnt, {"InDstCnt...", "mq.pmo.idestcount", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO invalid destination count", HFILL}},
4486         {&hf_mq_pmo_resolvqname, {"ResQName...", "mq.pmo.resolvq", FT_STRING, STR_UNICODE, NULL, 0x0, "PMO resolved queue name", HFILL}},
4487         {&hf_mq_pmo_resolvqmgr, {"ResQMgr....", "mq.pmo.resolvqmgr", FT_STRING, STR_UNICODE, NULL, 0x0, "PMO resolved queue manager name", HFILL}},
4488         {&hf_mq_pmo_recspresent, {"NumRecs....", "mq.pmo.nbrrec", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO number of records", HFILL}},
4489         {&hf_mq_pmo_putmsgrecfld, {"PMR Flag...", "mq.pmo.flagspmr", FT_UINT32, BASE_HEX, NULL, 0x0, "PMO flags PMR fields", HFILL}},
4490         {&hf_mq_pmo_putmsgrecofs, {"Ofs1stPMR..", "mq.pmo.offsetpmr", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO offset of first PMR", HFILL}},
4491         {&hf_mq_pmo_resprecofs, {"Off1stRR...", "mq.pmo.offsetrr", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO offset of first RR", HFILL}},
4492         {&hf_mq_pmo_putmsgrecptr, {"Adr1stPMR..", "mq.pmo.addrrec", FT_UINT32, BASE_HEX, NULL, 0x0, "PMO address of first record", HFILL}},
4493         {&hf_mq_pmo_resprecptr, {"Adr1stRR...", "mq.pmo.addrres", FT_UINT32, BASE_HEX, NULL, 0x0, "PMO address of first response record", HFILL}},
4494         {&hf_mq_pmo_originalmsghandle, {"OrigMsgHdl.", "mq.pmo.originalmsghandle", FT_UINT64, BASE_HEX, NULL, 0x0, "PMO original message handle", HFILL}},
4495         {&hf_mq_pmo_newmsghandle, {"NewMsgHdl..", "mq.pmo.newmsghandle", FT_UINT64, BASE_HEX, NULL, 0x0, "PMO new message handle", HFILL}},
4496         {&hf_mq_pmo_action, {"Action.....", "mq.pmo.action", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO action", HFILL}},
4497         {&hf_mq_pmo_publevel, {"PubLevel...", "mq.pmo.publevel", FT_UINT32, BASE_DEC, NULL, 0x0, "PMO pub level", HFILL}},
4498 
4499         {&hf_mq_xa_length, {"Length.......", "mq.xa.length", FT_UINT32, BASE_DEC, NULL, 0x0, "XA Length", HFILL}},
4500         {&hf_mq_xa_returnvalue, {"Return value.", "mq.xa.returnvalue", FT_INT32, BASE_DEC, VALS(mq_xaer_vals), 0x0, "XA Return Value", HFILL}},
4501         {&hf_mq_xa_tmflags, {"TransMgrFlags", "mq.xa.tmflags", FT_UINT32, BASE_HEX, NULL, 0x0, "XA Transaction Manager Flags", HFILL}},
4502         {&hf_mq_xa_rmid, {"ResourceMgrID", "mq.xa.rmid", FT_UINT32, BASE_DEC, NULL, 0x0, "XA Resource Manager ID", HFILL}},
4503         {&hf_mq_xa_count, {"Number of Xid", "mq.xa.nbxid", FT_UINT32, BASE_DEC, NULL, 0x0, "XA Number of Xid", HFILL}},
4504         {&hf_mq_xa_tmflags_join, {"JOIN", "mq.xa.tmflags.join", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMJOIN, "XA TM Flags JOIN", HFILL}},
4505         {&hf_mq_xa_tmflags_endrscan, {"ENDRSCAN", "mq.xa.tmflags.endrscan", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMENDRSCAN, "XA TM Flags ENDRSCAN", HFILL}},
4506         {&hf_mq_xa_tmflags_startrscan, {"STARTRSCAN", "mq.xa.tmflags.startrscan", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMSTARTRSCAN, "XA TM Flags STARTRSCAN", HFILL}},
4507         {&hf_mq_xa_tmflags_suspend, {"SUSPEND", "mq.xa.tmflags.suspend", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMSUSPEND, "XA TM Flags SUSPEND", HFILL}},
4508         {&hf_mq_xa_tmflags_success, {"SUCCESS", "mq.xa.tmflags.success", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMSUCCESS, "XA TM Flags SUCCESS", HFILL}},
4509         {&hf_mq_xa_tmflags_resume, {"RESUME", "mq.xa.tmflags.resume", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMRESUME, "XA TM Flags RESUME", HFILL}},
4510         {&hf_mq_xa_tmflags_fail, {"FAIL", "mq.xa.tmflags.fail", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMFAIL, "XA TM Flags FAIL", HFILL}},
4511         {&hf_mq_xa_tmflags_onephase, {"ONEPHASE", "mq.xa.tmflags.onephase", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_XA_TMONEPHASE, "XA TM Flags ONEPHASE", HFILL}},
4512 
4513         {&hf_mq_xa_xid_formatid, {"Format ID....", "mq.xa.xid.formatid", FT_STRING, STR_UNICODE, NULL, 0x0, "XA Xid Format ID", HFILL}},
4514         {&hf_mq_xa_xid_glbxid_len, {"GlbTransIDLen", "mq.xa.xid.gxidl", FT_UINT8, BASE_DEC, NULL, 0x0, "XA Xid Global TransactionId Length", HFILL}},
4515         {&hf_mq_xa_xid_brq_length, {"BranchQualLen", "mq.xa.xid.bql", FT_UINT8, BASE_DEC, NULL, 0x0, "XA Xid Branch Qualifier Length", HFILL}},
4516         {&hf_mq_xa_xid_globalxid, {"GlbTransactID", "mq.xa.xid.gxid", FT_BYTES, BASE_NONE, NULL, 0x0, "XA Xid Global TransactionId", HFILL}},
4517         {&hf_mq_xa_xid_brq, {"BranchQualif.", "mq.xa.xid.bq", FT_BYTES, BASE_NONE, NULL, 0x0, "XA Xid Branch Qualifier", HFILL}},
4518         {&hf_mq_xa_xainfo_length, {"Length.......", "mq.xa.xainfo.length", FT_UINT8, BASE_DEC, NULL, 0x0, "XA XA_info Length", HFILL}},
4519         {&hf_mq_xa_xainfo_value, {"Value........", "mq.xa.xainfo.value", FT_STRING, STR_UNICODE, NULL, 0x0, "XA XA_info Value", HFILL}},
4520 
4521         {&hf_mq_charv_vsptr, {"VLStr Addr.", "mq.charv.vsptr", FT_UINT32, BASE_HEX, NULL, 0x0, "VS Address", HFILL}},
4522         {&hf_mq_charv_vsoffset, {"VLStr Offs.", "mq.charv.vsoffset", FT_UINT32, BASE_DEC, NULL, 0x0, "VS Offset", HFILL}},
4523         {&hf_mq_charv_vsbufsize, {"VLStr BufSz", "mq.charv.vsbufsize", FT_UINT32, BASE_DEC, NULL, 0x0, "VS BufSize", HFILL}},
4524         {&hf_mq_charv_vslength, {"VLStr Len..", "mq.charv.vslength", FT_UINT32, BASE_DEC, NULL, 0x0, "VS Length", HFILL}},
4525         {&hf_mq_charv_vsccsid, {"VLStr Ccsid", "mq.charv.vsccsid", FT_INT32, BASE_DEC, NULL, 0x0, "VS CCSID", HFILL}},
4526         {&hf_mq_charv_vsvalue, {"VLStr Value", "mq.charv.vsvalue", FT_STRING, STR_UNICODE, NULL, 0x0, "VS value", HFILL}},
4527 
4528         {&hf_mq_head_StructID, {"Structid", "mq.head.structid", FT_STRING, STR_UNICODE, NULL, 0x0, "Header structid", HFILL}},
4529         {&hf_mq_head_version, {"version.", "mq.head.version", FT_UINT32, BASE_DEC, NULL, 0x0, "Header version", HFILL}},
4530         {&hf_mq_head_length, {"Length..", "mq.head.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Header length", HFILL}},
4531         {&hf_mq_head_encoding, {"Encoding", "mq.head.encoding", FT_UINT32, BASE_DEC, NULL, 0x0, "Header encoding", HFILL}},
4532         {&hf_mq_head_ccsid, {"CCSID...", "mq.head.ccsid", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "Header character set", HFILL}},
4533         {&hf_mq_head_format, {"Format..", "mq.head.format", FT_STRING, STR_UNICODE, NULL, 0x0, "Header format", HFILL}},
4534 
4535         {&hf_mq_head_flags, {"Flags...", "mq.head.flags", FT_UINT32, BASE_HEX, NULL, 0x0, "Header flags", HFILL}},
4536         {&hf_mq_head_struct, {"Struct..", "mq.head.struct", FT_BYTES, BASE_NONE, NULL, 0x0, "Header struct", HFILL}},
4537 
4538         {&hf_mq_dh_flags_newmsgid, {"NEW_MSG_IDS", "mq.dh.flags.newmsgid", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQIIH_CM0_REQUEST_RESPONSE, "MQ DH Flags MQDHF_NEW_MSG_IDS", HFILL}},
4539 
4540         {&hf_mq_dh_putmsgrecfld, {"Flags PMR", "mq.dh.flagspmr", FT_UINT32, BASE_DEC, NULL, 0x0, "DH flags PMR", HFILL}},
4541         {&hf_mq_dh_recspresent, {"NumOfRecs", "mq.dh.nbrrec", FT_UINT32, BASE_DEC, NULL, 0x0, "DH number of records", HFILL}},
4542         {&hf_mq_dh_objrecofs, {"Ofs1stOR.", "mq.dh.offsetor", FT_UINT32, BASE_DEC, NULL, 0x0, "DH offset of first OR", HFILL}},
4543         {&hf_mq_dh_putmsgrecofs, {"Ofs1stPMR", "mq.dh.offsetpmr", FT_UINT32, BASE_DEC, NULL, 0x0, "DH offset of first PMR", HFILL}},
4544 
4545         {&hf_mq_iih_flags_cmqrqstresp, {"CMO_RQST_RESP", "mq.iih.flags.cmqrqstresp", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQIIH_CM0_REQUEST_RESPONSE, "MQ IIH Flags CM0_REQUEST_RESPONSE", HFILL}},
4546         {&hf_mq_iih_flags_ignorepurg, {"IGNORE_PURG..", "mq.iih.flags.ignorepurg", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQIIH_IGNORE_PURG, "MQ IIH Flags IGNORE_PURG", HFILL}},
4547         {&hf_mq_iih_flags_replyfmtnone, {"REPL_FMT_NONE", "mq.iih.flags.replyfmtnone", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQIIH_REPLY_FORMAT_NONE, "MQ IIH Flags REPLY_FORMAT_NONE", HFILL}},
4548         {&hf_mq_iih_flags_passexpir, {"PASS_EXPIR...", "mq.iih.flags.passexpir", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQIIH_PASS_EXPIRATION, "MQ IIH Flags PASS_EXPIRATION", HFILL}},
4549 
4550         {&hf_mq_iih_ltermoverride, {"LTerm Override", "mq.iih.ltermoverrid", FT_STRING, STR_UNICODE, NULL, 0x0, "Logical Terminal Override", HFILL}},
4551         {&hf_mq_iih_mfsmapname, {"MFS Map Name..", "mq.iih.mfsmapname", FT_STRING, STR_UNICODE, NULL, 0x0, "MFS Map Name", HFILL}},
4552         {&hf_mq_iih_replytofmt, {"ReplyToFormat.", "mq.iih.replytofmt", FT_STRING, STR_UNICODE, NULL, 0x0, "Reply To Format", HFILL}},
4553         {&hf_mq_iih_authenticator, {"Authenticator.", "mq.iih.authenticator", FT_STRING, STR_UNICODE, NULL, 0x0, "Password or Passcode", HFILL}},
4554         {&hf_mq_iih_transinstid, {"TransInstIdent", "mq.iih.transinstid", FT_BYTES, BASE_NONE, NULL, 0x0, "Transaction Instance Identifier", HFILL}},
4555         {&hf_mq_iih_transstate, {"TransactState.", "mq.iih.transstate", FT_STRING, STR_UNICODE, NULL, 0x0, "Transaction State", HFILL}},
4556         {&hf_mq_iih_commimode, {"Commit Mode...", "mq.iih.commimode", FT_STRING, STR_UNICODE, NULL, 0x0, "Commit Mode", HFILL}},
4557         {&hf_mq_iih_securityscope, {"SecurityScope.", "mq.iih.securityscope", FT_STRING, STR_UNICODE, NULL, 0x0, "Security Scope", HFILL}},
4558         {&hf_mq_iih_reserved, {"Reserved......", "mq.iih.reserved", FT_STRING, STR_UNICODE, NULL, 0x0, "Reserved", HFILL}},
4559 
4560         {&hf_mq_cih_flags_synconret, {"SYNC_ON_RETURN", "mq.iih.flags.synconret", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCIH_SYNC_ON_RETURN, "MQ CIH Flags IGNORE_PURG", HFILL}},
4561         {&hf_mq_cih_flags_replywonulls, {"REPLY_WO_NULLS", "mq.iih.flags.replywonulls", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCIH_REPLY_WITHOUT_NULLS, "MQ CIH Flags REPLY_WITHOUT_NULLS", HFILL}},
4562         {&hf_mq_cih_flags_passexpir, {"PASS_EXPIR....", "mq.iih.flags.passexpir", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQCIH_PASS_EXPIRATION, "MQ CIH Flags PASS_EXPIRATION", HFILL}},
4563 
4564         {&hf_mq_ims_ll, {"ll..", "mq.ims.ll", FT_UINT16, BASE_DEC, NULL, 0x0, "IMS ll", HFILL}},
4565         {&hf_mq_ims_zz, {"zz..", "mq.ims.zz", FT_UINT16, BASE_DEC, NULL, 0x0, "IMS zz", HFILL}},
4566         {&hf_mq_ims_trx, {"trx.", "mq.ims.trx", FT_STRING, STR_UNICODE, NULL, 0x0, "IMS Transaction", HFILL}},
4567         {&hf_mq_ims_data, {"data", "mq.ims.data", FT_BYTES, BASE_NONE, NULL, 0x0, "Transaction Instance Identifier", HFILL}},
4568 
4569         {&hf_mq_tm_StructID, {"Structid", "mq.tm.structid", FT_STRING, STR_UNICODE, NULL, 0x0, "TM structid", HFILL}},
4570         {&hf_mq_tm_version, {"version.", "mq.tm.version", FT_UINT32, BASE_DEC, NULL, 0x0, "TM version", HFILL}},
4571         {&hf_mq_tm_QName, {"QName...", "mq.tm.qname", FT_STRING, STR_UNICODE, NULL, 0x0, "TM Queue Name", HFILL}},
4572         {&hf_mq_tm_ProcessNme, {"ProcName", "mq.tm.procname", FT_STRING, STR_UNICODE, NULL, 0x0, "TM Process Name", HFILL}},
4573         {&hf_mq_tm_TriggerData, {"TrigData", "mq.tm.triggerdata", FT_STRING, STR_UNICODE, NULL, 0x0, "TM Trigger Data", HFILL}},
4574         {&hf_mq_tm_ApplType, {"ApplType", "mq.tm.appltype", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(MQAT), 0x0, "TM Application Type", HFILL}},
4575         {&hf_mq_tm_ApplId, {"ApplId..", "mq.tm.applid", FT_STRING, STR_UNICODE, NULL, 0x0, "TM Application ID", HFILL}},
4576         {&hf_mq_tm_EnvData, {"EnvData.", "mq.tm.envdaqta", FT_STRING, STR_UNICODE, NULL, 0x0, "TM Environment Data", HFILL}},
4577         {&hf_mq_tm_UserData, {"UserData.", "mq.t2.userdata", FT_STRING, STR_UNICODE, NULL, 0x0, "TM User Data", HFILL}},
4578 
4579         {&hf_mq_tmc2_StructID, {"Structid", "mq.tmc2.structid", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 structid", HFILL}},
4580         {&hf_mq_tmc2_version, {"version.", "mq.tmc2.version", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 version", HFILL}},
4581         {&hf_mq_tmc2_QName, {"QName...", "mq.tmc2.qname", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Queue Name", HFILL}},
4582         {&hf_mq_tmc2_ProcessNme, {"ProcName", "mq.tmc2.procname", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Process Name", HFILL}},
4583         {&hf_mq_tmc2_TriggerData, {"TrigData", "mq.tmc2.triggerdata", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Trigger Data", HFILL}},
4584         {&hf_mq_tmc2_ApplType, {"ApplType", "mq.tmc2.appltype", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Application Type", HFILL}},
4585         {&hf_mq_tmc2_ApplId, {"ApplId..", "mq.tmc2.applid", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Application ID", HFILL}},
4586         {&hf_mq_tmc2_EnvData, {"EnvData.", "mq.tmc2.envdaqta", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Environment Data", HFILL}},
4587         {&hf_mq_tmc2_UserData, {"UserData", "mq.tmc2.userdata", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 User Data", HFILL}},
4588         {&hf_mq_tmc2_QMgrName, {"QMgrName", "mq.tmc2.qmgrname", FT_STRING, STR_UNICODE, NULL, 0x0, "TMC2 Queue Manager Name", HFILL}},
4589 
4590         {&hf_mq_cih_returncode, {"ReturnCode...", "mq.cih.returncode", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Return Code", HFILL}},
4591         {&hf_mq_cih_compcode, {"ComplCode....", "mq.cih.compcode", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Completion Code", HFILL}},
4592         {&hf_mq_cih_reasoncode, {"ReasonCode...", "mq.cih.reasoncode", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, "Reason Code", HFILL}},
4593         {&hf_mq_cih_uowcontrols, {"UOWControls..", "mq.cih.uowcontrols", FT_UINT32, BASE_HEX_DEC, VALS(GET_VALSV(UOWControls)), 0x0, "Unit Of Work Controls", HFILL}},
4594         {&hf_mq_cih_getwaitintv, {"GetWaitIntv..", "mq.cih.getwaitintv", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(WaitIntv)), 0x0, "Get Wait Interval", HFILL}},
4595         {&hf_mq_cih_linktype, {"LinkType.....", "mq.cih.linktype", FT_UINT32, BASE_DEC, VALS(GET_VALSV(LinkType)), 0x0, "LinkType", HFILL}},
4596         {&hf_mq_cih_outdatalen, {"OutDataLen...", "mq.cih.outdatalen", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(OutDataLen)), 0x0, "Output Data Len", HFILL}},
4597         {&hf_mq_cih_facilkeeptime, {"FacilKeepTime", "mq.cih.facilkeeptime", FT_UINT32, BASE_DEC, NULL, 0x0, "Facility Keep Time", HFILL}},
4598         {&hf_mq_cih_adsdescriptor, {"ADSDescriptor", "mq.cih.adsdescr", FT_UINT32, BASE_DEC, VALS(GET_VALSV(ADSDescr)), 0x0, "ADS Descriptor", HFILL}},
4599         {&hf_mq_cih_converstask, {"ConversTask..", "mq.cih.converstask", FT_UINT32, BASE_DEC, VALS(GET_VALSV(ConvTaskOpt)), 0x0, "Conversational Task", HFILL}},
4600         {&hf_mq_cih_taskendstatus, {"TaskEndStatus", "mq.cih.taskendstatus", FT_UINT32, BASE_DEC, VALS(GET_VALSV(TaskEndStatus)), 0x0, "Status at End of Task", HFILL}},
4601         {&hf_mq_cih_bridgefactokn, {"BridgeFacTokn", "mq.cih.bridgefactokn", FT_BYTES, BASE_NONE, NULL, 0x0, "Bridge facility token", HFILL}},
4602         {&hf_mq_cih_function, {"Function.....", "mq.cih.function", FT_STRING, STR_UNICODE, NULL, 0x0, "MQ call name or CICS EIBFN function", HFILL}},
4603         {&hf_mq_cih_abendcode, {"AbendCode....", "mq.cih.abendcode", FT_STRING, STR_UNICODE, NULL, 0x0, "Abend Code", HFILL}},
4604         {&hf_mq_cih_authenticator, {"Authenticator", "mq.cih.authenticator", FT_STRING, STR_UNICODE, NULL, 0x0, "Password or Passcode", HFILL}},
4605         {&hf_mq_cih_reserved, {"Reserved.....", "mq.cih.reserved", FT_STRING, STR_UNICODE, NULL, 0x0, "Reserved", HFILL}},
4606         {&hf_mq_cih_replytofmt, {"ReplyToFormat", "mq.cih.replytofmt", FT_STRING, STR_UNICODE, NULL, 0x0, "Reply To Format", HFILL}},
4607         {&hf_mq_cih_remotesysid, {"RemoteSysId..", "mq.cih.remotesysid", FT_STRING, STR_UNICODE, NULL, 0x0, "Remote System Id", HFILL}},
4608         {&hf_mq_cih_remotetransid, {"RemoteTransId", "mq.cih.remotetransid", FT_STRING, STR_UNICODE, NULL, 0x0, "Remote Transaction Id", HFILL}},
4609         {&hf_mq_cih_transactionid, {"TransactionId", "mq.cih.transactionid", FT_STRING, STR_UNICODE, NULL, 0x0, "Transaction to attach", HFILL}},
4610         {&hf_mq_cih_facilitylike, {"FacilityLike.", "mq.cih.facilitylike", FT_STRING, STR_UNICODE, NULL, 0x0, "Terminal emulated attributes", HFILL}},
4611         {&hf_mq_cih_attentionid, {"AttentionID..", "mq.cih.attentionid", FT_STRING, STR_UNICODE, NULL, 0x0, "Attention Id (AID) Key", HFILL}},
4612         {&hf_mq_cih_startcode, {"StartCode....", "mq.cih.startcode", FT_STRING, STR_UNICODE, NULL, 0x0, "Transaction Start Code", HFILL}},
4613         {&hf_mq_cih_cancelcode, {"CancelCode...", "mq.cih.cancelcode", FT_STRING, STR_UNICODE, NULL, 0x0, "Abend transaction code", HFILL}},
4614         {&hf_mq_cih_nexttransid, {"NextTransId..", "mq.cih.nexttransid", FT_STRING, STR_UNICODE, NULL, 0x0, "Next transaction to attach", HFILL}},
4615         {&hf_mq_cih_reserved2, {"Reserved3....", "mq.cih.reserved2", FT_STRING, STR_UNICODE, NULL, 0x0, "Reserved 2", HFILL}},
4616         {&hf_mq_cih_reserved3, {"Reserved3....", "mq.cih.reserved3", FT_STRING, STR_UNICODE, NULL, 0x0, "Reserved 3", HFILL}},
4617         {&hf_mq_cih_cursorpos, {"CursorPos....", "mq.cih.cursorpos", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Cursor Posiution", HFILL}},
4618         {&hf_mq_cih_erroroffset, {"ErrorOffset..", "mq.cih.erroroffset", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Offset of error in message", HFILL}},
4619         {&hf_mq_cih_inputitem, {"InputItem....", "mq.cih.inputitem", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Input Item", HFILL}},
4620         {&hf_mq_cih_reserved4, {"Reserved4....", "mq.cih.reserved4", FT_STRING, STR_UNICODE, NULL, 0x0, "Reserved 4", HFILL}},
4621 
4622         {&hf_mq_rfh_ccsid, {"NmeValCCSID", "mq.rfh.ccsid", FT_INT32, BASE_DEC | BASE_RANGE_STRING, RVALS(GET_VALRV(ccsid)), 0x0, "RFH NameValue CCSID", HFILL}},
4623         {&hf_mq_rfh_length, {"Len.", "mq.rfh.length", FT_UINT32, BASE_DEC, NULL, 0x0, "RFH NameValue Length", HFILL}},
4624         {&hf_mq_rfh_string, {"Val.", "mq.rfh.string", FT_STRING, STR_UNICODE, NULL, 0x0, "RFH NameValue", HFILL}},
4625 
4626         {&hf_mq_rmh_flags_last, {"LAST", "mq.rmh.flags.last", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MQ_MQRMHF_LAST, "MQ RMH LAST", HFILL}},
4627 
4628         {&hf_mq_rmh_objecttype, {"ObjectType...", "mq.rmh.objecttype", FT_STRING, STR_UNICODE, NULL, 0x0, "Object Type", HFILL}},
4629         {&hf_mq_rmh_objectinstid, {"ObjectInstId.", "mq.rmh.objectinstid", FT_BYTES, BASE_NONE, NULL, 0x0, "Object Instance Identifier", HFILL}},
4630         {&hf_mq_rmh_srcenvlen, {"SrcEnvLen....", "mq.rmh.srcenvlen", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of source environment data", HFILL}},
4631         {&hf_mq_rmh_srcenvofs, {"SrcEnvOfs....", "mq.rmh.srcenvofs", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Offset of source environment data", HFILL}},
4632         {&hf_mq_rmh_srcnamelen, {"SrcNameLen...", "mq.rmh.srcnamelen", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of source object name", HFILL}},
4633         {&hf_mq_rmh_srcnameofs, {"SrcNameOfs...", "mq.rmh.srcnameofs", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Offset of source object name", HFILL}},
4634         {&hf_mq_rmh_dstenvlen, {"DstEnvLen....", "mq.rmh.dstenvlen", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of destination environment data", HFILL}},
4635         {&hf_mq_rmh_dstenvofs, {"DstEnvOfs....", "mq.rmh.dstenvofs", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Offset of destination environment data", HFILL}},
4636         {&hf_mq_rmh_dstnamelen, {"DstNameLen...", "mq.rmh.dstnamelen", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of destination object name", HFILL}},
4637         {&hf_mq_rmh_dstnameofs, {"DstNameOfs...", "mq.rmh.dstnameofs", FT_UINT32, BASE_DEC | BASE_HEX, NULL, 0x0, "Offset of destination object name", HFILL}},
4638         {&hf_mq_rmh_datalogiclen, {"DataLogicLen.", "mq.rmh.datalogiclen", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of bulk data", HFILL}},
4639         {&hf_mq_rmh_datalogicofsl, {"DataLogicOfsL", "mq.rmh.datalogicofsl", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "Low offset of bulk data", HFILL}},
4640         {&hf_mq_rmh_datalogicofsh, {"DataLogicOfsH", "mq.rmh.datalogicofsh", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, "High offset of bulk data", HFILL}},
4641 
4642         {&hf_mq_wih_servicename, {"ServiceName..", "mq.wih.servicename", FT_STRING, STR_UNICODE, NULL, 0x0, "Service Name", HFILL}},
4643         {&hf_mq_wih_servicestep, {"ServiceStep..", "mq.wih.servicestep", FT_STRING, STR_UNICODE, NULL, 0x0, "Service Step Name", HFILL}},
4644         {&hf_mq_wih_msgtoken, {"MsgToken.....", "mq.wih.msgtoken", FT_BYTES, BASE_NONE, NULL, 0x0, "Message Token", HFILL}},
4645         {&hf_mq_wih_reserved, {"Reserved.....", "mq.wih.reserved", FT_STRING, STR_UNICODE, NULL, 0x0, "Reserved", HFILL}},
4646     };
4647 
4648     static gint* ett[] =
4649     {
4650         &ett_mq,
4651         &ett_mq_tsh,
4652         &ett_mq_tsh_tcf,
4653         &ett_mq_tsh_tcf2,
4654         &ett_mq_api,
4655         &ett_mq_socket,
4656         &ett_mq_msh,
4657         &ett_mq_caut,
4658         &ett_mq_xqh,
4659         &ett_mq_id,
4660         &ett_mq_id_cf1,
4661         &ett_mq_id_cf2,
4662         &ett_mq_id_cf3,
4663         &ett_mq_id_ecf1,
4664         &ett_mq_id_ecf2,
4665         &ett_mq_id_ecf3,
4666         &ett_mq_id_ief1,
4667         &ett_mq_id_ief2,
4668         &ett_mq_uid,
4669         &ett_mq_conn,
4670         &ett_mq_msg,
4671         &ett_mq_notif,
4672         &ett_mq_inq,
4673         &ett_mq_spi,
4674         &ett_mq_spi_base,
4675         &ett_mq_spi_options,
4676         &ett_mq_put,
4677         &ett_mq_open,
4678         &ett_mq_open_option,
4679         &ett_mq_close_option,
4680         &ett_mq_ping,
4681         &ett_mq_reset,
4682         &ett_mq_status,
4683         &ett_mq_od,
4684         &ett_mq_od_objstr,
4685         &ett_mq_od_selstr,
4686         &ett_mq_od_resobjstr,
4687         &ett_mq_or,
4688         &ett_mq_rr,
4689         &ett_mq_pmr,
4690         &ett_mq_md,
4691         &ett_mq_dlh,
4692         &ett_mq_dh,
4693         &ett_mq_gmo,
4694         &ett_mq_gmo_option,
4695         &ett_mq_gmo_matchoption,
4696         &ett_mq_msgreq_RqstFlags,
4697         &ett_mq_pmo,
4698         &ett_mq_pmo_option,
4699         &ett_mq_fcno,
4700         &ett_mq_fopa,
4701         &ett_mq_fcmi,
4702         &ett_mq_lpoo,
4703         &ett_mq_lpoo_lpiopts,
4704         &ett_mq_head,
4705         &ett_mq_head_flags,
4706         &ett_mq_ims,
4707         &ett_mq_xa,
4708         &ett_mq_xa_tmflags,
4709         &ett_mq_xa_xid,
4710         &ett_mq_xa_info,
4711         &ett_mq_charv,
4712         &ett_mq_rfh_ValueName,
4713         &ett_mq_reassemb,
4714         &ett_mq_structid
4715     };
4716 
4717     module_t* mq_module;
4718     expert_module_t* expert_mq;
4719 
4720     static ei_register_info ei[] = {
4721         {&ei_mq_reassembly_error, {"mq.reassembly_error",
4722         PI_REASSEMBLE, PI_ERROR, "Reassembly error", EXPFILL}}
4723     };
4724 
4725     proto_mq = proto_register_protocol("WebSphere MQ", "MQ", "mq");
4726     proto_register_field_array(proto_mq, hf, array_length(hf));
4727     proto_register_subtree_array(ett, array_length(ett));
4728 
4729     expert_mq = expert_register_protocol(proto_mq);
4730     expert_register_field_array(expert_mq, ei, array_length(ei));
4731 
4732     mq_heur_subdissector_list = register_heur_dissector_list("mq", proto_mq);
4733 
4734     reassembly_table_register(&mq_reassembly_table,
4735         &addresses_reassembly_table_functions);
4736 
4737     mq_module = prefs_register_protocol(proto_mq, NULL);
4738     mq_handle = register_dissector("mq", dissect_mq_tcp, proto_mq);
4739 
4740     prefs_register_bool_preference(mq_module, "desegment",
4741         "Reassemble MQ messages spanning multiple TCP segments",
4742         "Whether the MQ dissector should reassemble messages spanning multiple TCP segments."
4743         " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
4744         &mq_desegment);
4745     prefs_register_bool_preference(mq_module, "reassembly",
4746         "Reassemble segmented MQ messages",
4747         "Whether the MQ dissector should reassemble MQ messages spanning multiple TSH segments",
4748         &mq_reassembly);
4749 }
4750 
proto_reg_handoff_mq(void)4751 void proto_reg_handoff_mq(void)
4752 {
4753     /*  Unlike some protocol (HTTP, POP3, ...) that clearly map to a standard
4754     *  class of applications (web browser, e-mail client, ...) and have a very well
4755     *  known port number, the MQ applications are most often specific to a business application */
4756 
4757     mq_spx_handle = create_dissector_handle(dissect_mq_spx, proto_mq);
4758 
4759     dissector_add_for_decode_as_with_preference("tcp.port", mq_handle);
4760     ssl_dissector_add(0, mq_handle);
4761     heur_dissector_add("tcp", dissect_mq_heur_tcp, "WebSphere MQ over TCP", "mq_tcp", proto_mq, HEURISTIC_ENABLE);
4762     heur_dissector_add("netbios", dissect_mq_heur_nontcp, "WebSphere MQ over Netbios", "mq_netbios", proto_mq, HEURISTIC_ENABLE);
4763     heur_dissector_add("http", dissect_mq_heur_nontcp, "WebSphere MQ over HTTP", "mq_http", proto_mq, HEURISTIC_ENABLE);
4764     heur_dissector_add("tls", dissect_mq_heur_ssl, "WebSphere MQ over TLS", "mq_tls", proto_mq, HEURISTIC_ENABLE);
4765     dissector_add_uint("spx.socket", MQ_SOCKET_SPX, mq_spx_handle);
4766     mqpcf_handle = find_dissector("mqpcf");
4767 }
4768 
4769 /*
4770  * Editor modelines - https://www.wireshark.org/tools/modelines.html
4771  *
4772  * Local variables:
4773  * c-basic-offset: 4
4774  * tab-width: 8
4775  * indent-tabs-mode: nil
4776  * End:
4777  *
4778  * vi: set shiftwidth=4 tabstop=8 expandtab:
4779  * :indentSize=4:tabSize=8:noTabs=true:
4780  */
4781