Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-tn5250.c
Line
Count
Source
1
/* packet-tn5250.c
2
 * Routines for tn5250.packet dissection
3
 *
4
 * Reference:
5
 *  5494 Remote Control Unit - Functions Reference
6
 *  Release 3.0 Document Number SC30-3533-04
7
 *  Chapters 12, 15, 16
8
 *  http://publibfp.dhe.ibm.com/cgi-bin/bookmgr/BOOKS/co2e2001/CCONTENTS
9
 *  [Found in 2020 in https://archive.org/details/5494RemoteControlUnitFunctionsReferenceSC30353304]
10
 *
11
 * Copyright 2009, Robert Hogan <robert@roberthogan.net>
12
 *
13
 * Wireshark - Network traffic analyzer
14
 * By Gerald Combs <gerald@wireshark.org>
15
 * Copyright 1998 Gerald Combs
16
 *
17
 * SPDX-License-Identifier: GPL-2.0-or-later
18
 */
19
20
21
#include "config.h"
22
23
#include <epan/packet.h>
24
#include <epan/expert.h>
25
#include <epan/conversation.h>
26
#include <epan/tfs.h>
27
#include <wsutil/array.h>
28
#include "packet-tn5250.h"
29
30
void proto_register_tn5250(void);
31
32
typedef struct tn5250_conv_info_t {
33
  struct tn5250_conv_info_t *next;
34
  uint32_t outbound_port;
35
  int extended;
36
} tn5250_conv_info_t;
37
38
/* 13.4 SNA LU 4 and LU 7 Negative Responses */
39
40
#define NEGATIVE_RESPONSE1 0x081102
41
#define NEGATIVE_RESPONSE2 0x100301
42
#define NEGATIVE_RESPONSE3 0x100501
43
#define NEGATIVE_RESPONSE4 0x100502
44
45
static const value_string vals_tn5250_negative_responses[] = {
46
  { 0x08110200,  "The Cancel key of a printer was pressed when it was not in an error state"},
47
  { 0x08110201,  "The Cancel key of a printer was pressed when it was in an error state"},
48
  { 0x10030101,  "Command that is not valid encountered in data stream"},
49
  { 0x10030105,  "Clear unit alternate command not valid"},
50
  { 0x10030123,  "Command to enter text mode not valid for the keyboard or country language code used"},
51
  { 0x10050103,  "Format table resequencing error on display data stream"},
52
  { 0x10050110,  "Structured field length is not valid"},
53
  { 0x10050111,  "Structured field class or type is not valid"},
54
  { 0x10050112,  "Parameter is not valid in structured field"},
55
  { 0x10050113,  "Structured field minor structure length is not valid"},
56
  { 0x10050114,  "Parameter is not valid in structured field minor structure"},
57
  { 0x1005011B,  "Data stream command is not valid in WP mode"},
58
  { 0x1005011C,  "Data stream command is not valid in data processing (DP) mode"},
59
  { 0x1005011D,  "Command not allowed on display with unlocked keyboard"},
60
  { 0x10050121,  "Premature data stream termination"},
61
  { 0x10050122,  "Write to display order row/col address is not valid"},
62
  { 0x10050123,  "The address in the Repeat to Address is less than the current workstation screen address"},
63
  { 0x10050125,  "Start-of-field order length not valid"},
64
  { 0x10050126,  "Start-of-field order address not valid"},
65
  { 0x10050127,  "Data in restore not valid"},
66
  { 0x10050128,  "Field extends past the end of the display"},
67
  { 0x10050129,  "Format table overflow"},
68
  { 0x1005012A,  "An attempt was made to write past the end of display"},
69
  { 0x1005012B,  "Start-of-header length not valid"},
70
  { 0x1005012C,  "Parameter that is not valid is on the ROLL command"},
71
  { 0x1005012D,  "Extended attribute type not valid"},
72
  { 0x1005012E,  "RAM load parameter not valid"},
73
  { 0x1005012F,  "Extended attribute not valid"},
74
  { 0x10050130,  "Start-of-field attribute not valid"},
75
  { 0x10050131,  "No escape code was found where it was expected"},
76
  { 0x10050132,  "WRITE ERROR CODE TO WINDOW command row/col address is not valid"},
77
  { 0x10050133,  "WRITE ERROR CODE TO WINDOW command is not valid with the message error line that is in use"},
78
  { 0x10050134,  "SAVE PARTIAL SCREEN command was followed by an immediate read or another SAVE type command"},
79
  { 0x10050135,  "Continued entry field segment is not valid"},
80
  { 0x10050136,  "Word wrap not allowed for this type of entry field"},
81
  { 0x10050138,  "An attempt was made to write a scroll bar beyond the last display column"},
82
  { 0x10050139,  "The total row/col, slider position (sliderpos), or display row/col on a scroll bar is not valid"},
83
  { 0x1005013A,  "At least one selection field choice must be allowed to accept the cursor"},
84
  { 0x1005013B,  "An attempt was made to write a selection field choice before column 1 or beyond the last display column"},
85
  { 0x1005013C,  "An attempt was made to define too  many selection field choices"},
86
  { 0x1005013D,  "An attempt was made to define more than one default selected choice in a single choice selection field"},
87
  { 0x1005013E,  "Too many windows defined. 128 windows are allowed."},
88
  { 0x10050140,  "Write Data command to non-entry field"},
89
  { 0x10050141,  "Too much data or too little data in a Write Data command"},
90
  { 0x10050142,  "An attempt was made to write a X'FF' character to the display screen."},
91
  { 0x10050148,  "The Fax and Image feature is not supported on this device."},
92
  { 0x10050149,  "Data follows an image/fax download command in the data stream and the image/fax download command does"
93
                 " not contain the last  of the image data. No other commands are accepted until all the image/fax data has been received."},
94
  { 0x1005014C,  "The display is not capable of video delivery."},
95
  { 0x1005014D,  "The first 2 bytes of the PC/TV command were not X'E201' or X'E301'."},
96
  { 0x1005014F,  "Data stream longer than 16,368 bytes."},
97
  { 0x10050180,  "The printer LSID sent in the copy-to-printer data stream from the AS/400 system was not in the SNA session table"},
98
  { 0x10050181,  "The LSID sent in the copy-to-printer data stream from the AS/400 system was not a printer LSID"},
99
  { 0x10050187,  "Self-check field length (self-check field > 33 bytes) not valid"},
100
  { 0x10050188,  "Self-check field control word not valid"},
101
  { 0x10050228,  "SCS command not valid"},
102
  { 0x10050229,  "SCS parameter not valid"},
103
  { 0x1005022A,  "Intelligent Printer Data Stream (IPDS parameter error)"},
104
  { 0x10050260,  "IPDS printer's multistatus functions are available"},
105
  { 0x00000000, NULL }
106
};
107
108
0
#define TN5250_ESCAPE  0x04
109
static const value_string vals_tn5250_escape_codes[] = {
110
  { 0x04                                                  ,  "ESC"},
111
  { 0x00, NULL }
112
};
113
114
/* 15.1 Workstation Data Stream Commands*/
115
0
#define CLEAR_UNIT                                                              0x40
116
0
#define CLEAR_UNIT_ALTERNATE                                                    0x20
117
0
#define CLEAR_FORMAT_TABLE                                                      0x50
118
0
#define WRITE_TO_DISPLAY                                                        0x11
119
0
#define WRITE_ERROR_CODE                                                        0x21
120
0
#define WRITE_ERROR_CODE_TO_WINDOW                                              0x22
121
0
#define READ_INPUT_FIELDS                                                       0x42
122
0
#define READ_MDT_FIELDS                                                         0x52
123
0
#define READ_MDT_ALTERNATE                                                      0x82
124
0
#define READ_SCREEN                                                             0x62
125
0
#define READ_SCREEN_WITH_EXTENDED_ATTRIBUTES                                    0x64
126
0
#define READ_SCREEN_TO_PRINT                                                    0x66
127
0
#define READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES                           0x68
128
0
#define READ_SCREEN_TO_PRINT_WITH_GRIDLINES                                     0x6A
129
0
#define READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES_AND_GRIDLINES             0x6C
130
0
#define READ_IMMEDIATE                                                          0x72
131
0
#define READ_MODIFIED_IMMEDIATE_ALTERNATE                                       0x83
132
0
#define SAVE_SCREEN                                                             0x02
133
0
#define SAVE_PARTIAL_SCREEN                                                     0x03
134
0
#define RESTORE_SCREEN                                                          0x12
135
0
#define RESTORE_PARTIAL_SCREEN                                                  0x13
136
0
#define ROLL                                                                    0x23
137
0
#define WRITE_STRUCTURED_FIELD                                                  0xF3
138
0
#define WRITE_SINGLE_STRUCTURED_FIELD                                           0xF4
139
0
#define COPY_TO_PRINTER                                                         0x16
140
141
static const value_string vals_tn5250_command_codes[] = {
142
  { CLEAR_UNIT                                                  ,  "Clear Unit"},
143
  { CLEAR_UNIT_ALTERNATE                                        ,  "Clear Unit Alternate"},
144
  { CLEAR_FORMAT_TABLE                                          ,  "Clear Format Table"},
145
  { WRITE_TO_DISPLAY                                            ,  "Write To Display"},
146
  { WRITE_ERROR_CODE                                            ,  "Write Error Code"},
147
  { WRITE_ERROR_CODE_TO_WINDOW                                  ,  "Write Error Code To Window"},
148
  { READ_INPUT_FIELDS                                           ,  "Read Input Fields"},
149
  { READ_MDT_FIELDS                                             ,  "Read Mdt Fields"},
150
  { READ_MDT_ALTERNATE                                          ,  "Read Mdt Alternate"},
151
  { READ_SCREEN                                                 ,  "Read Screen"},
152
  { READ_SCREEN_WITH_EXTENDED_ATTRIBUTES                        ,  "Read Screen With Extended Attributes"},
153
  { READ_SCREEN_TO_PRINT                                        ,  "Read Screen To Print"},
154
  { READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES               ,  "Read Screen To Print With Extended Attributes"},
155
  { READ_SCREEN_TO_PRINT_WITH_GRIDLINES                         ,  "Read Screen To Print With Gridlines"},
156
  { READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES_AND_GRIDLINES ,  "Read Screen To Print With Extended Attributes And Gridlines"},
157
  { READ_IMMEDIATE                                              ,  "Read Immediate"},
158
  { READ_MODIFIED_IMMEDIATE_ALTERNATE                           ,  "Read Modified Immediate Alternate"},
159
  { SAVE_SCREEN                                                 ,  "Save Screen"},
160
  { SAVE_PARTIAL_SCREEN                                         ,  "Save Partial Screen"},
161
  { RESTORE_SCREEN                                              ,  "Restore Screen"},
162
  { RESTORE_PARTIAL_SCREEN                                      ,  "Restore Partial Screen"},
163
  { ROLL                                                        ,  "Roll"},
164
  { WRITE_STRUCTURED_FIELD                                      ,  "Write Structured Field"},
165
  { WRITE_SINGLE_STRUCTURED_FIELD                               ,  "Write Single Structured Field"},
166
  { COPY_TO_PRINTER                                             ,  "Copy-To-Printer"},
167
  { 0x00, NULL }
168
};
169
170
/* 15.4 Clear Unit Alternate*/
171
static const value_string vals_tn5250_cua_parms[] = {
172
  { 0x00                                                  ,  "Set screen size to 27 rows by 132 columns"},
173
  { 0x80                                                  ,  "Leave the screen size unchanged and do not erase image/fax data from the display memory."},
174
  { 0x00, NULL }
175
};
176
177
178
/* 15.6 Order Codes */
179
0
#define TN5250_SBA        0x11
180
0
#define TN5250_IC         0x13
181
0
#define TN5250_MC         0x14
182
0
#define TN5250_RA         0x02
183
0
#define TN5250_EA         0x03
184
0
#define TN5250_SOH        0x01
185
0
#define TN5250_TD         0x10
186
0
#define TN5250_WEA        0x12
187
0
#define TN5250_SF         0x1D
188
0
#define TN5250_WDSF       0x15
189
190
static const value_string vals_tn5250_order_codes[] = {
191
  { TN5250_SBA,  "Set Buffer Address (SBA)"},
192
  { TN5250_IC ,  "Insert Cursor (IC)"},
193
  { TN5250_MC ,  "Move Cursor (MC)"},
194
  { TN5250_RA ,  "Repeat to Address (RA)"},
195
  { TN5250_EA ,  "Erase to Address (EA)"},
196
  { TN5250_SOH , "Start of Header (SOH)"},
197
  { TN5250_TD ,  "Transparent Data (TD)"},
198
  { TN5250_WEA,  "Write Extended Attribute Order"},
199
  { TN5250_SF ,  "Start Field (SF)"},
200
  { TN5250_WDSF, "Write to Display Structured Field (WDSF)"},
201
  { 0x00, NULL }
202
};
203
204
/* 15.6.1 WTD Control Code */
205
16
#define CCBITS                                0xFF
206
207
static const value_string vals_tn5250_wtd_cc_byteone[] = {
208
  { 0x00  ,  ""},
209
  { 0x20  ,  "Reset pending AID, lock keyboard"},
210
  { 0x40  ,  "Reset pending AID, lock keyboard, Reset MDT flags in non-bypass fields"},
211
  { 0x60  ,  "Reset pending AID, lock keyboard, Reset MDT flags in all fields"},
212
  { 0x80  ,  "Reset pending AID, lock keyboard, Null all non-bypass fields with  MDT on"},
213
  { 0xA0  ,  "Reset pending AID, lock keyboard, Reset MDT flags in non-bypass fields, Null all non-bypass fields"},
214
  { 0xC0  ,  "Reset pending AID, lock keyboard, Reset MDT flags in non-bypass fields, Null all non-bypass fields with MDT on"},
215
  { 0xE0  ,  "Reset pending AID, lock keyboard, Reset MDT flags in all fields, Null all non-bypass fields"},
216
  { 0x00, NULL }
217
};
218
219
/* 15.6.8 Erase to Address Order */
220
/* 15.6.11 Write Extended Attribute Order */
221
0
#define EXTENDED_IDEOGRAPHIC_ATTRIBUTES          0x05
222
0
#define EXTENDED_FOREGROUND_COLOR_ATTRIBUTES     0x03
223
0
#define EXTENDED_PRIMARY_ATTRIBUTES              0x01
224
225
static const value_string vals_tn5250_attributes[] = {
226
  { 0x00,  "Display screen"},
227
  { 0x01,  "Extended primary attributes"},
228
  { 0x02,  "Extended text attributes (use in WP mode only)"},
229
  { 0x03,  "Extended foreground color attributes"},
230
  { 0x05,  "Extended ideographic attributes"},
231
  { 0xFF,  "Display screen and all extended attribute types supported by this "
232
    "workstation. Use X'FF' to clear all extended attribute types for "
233
    "optimum performance, even if all types are not used."},
234
  { 0x00, NULL }
235
};
236
237
238
/* 15.6.11.1 Write Extended Attribute Order - Extended Primary Attribute*/
239
/* 15.6.12.3 Start of Field Order - Field Attribute*/
240
0
#define FA_ID      0x20
241
16
#define FA_ID_BITS 0xE0
242
static const value_string vals_tn5250_fa_id[] = {
243
  { 0x01       ,  "Identifies Field as Field Format Word"},
244
  { 0x00, NULL }
245
};
246
247
static const struct true_false_string tn5250_field_attr_col = {
248
  "Column Separator On",
249
  "Column Separator Off"
250
};
251
252
static const struct true_false_string tn5250_field_attr_blink = {
253
  "Blink Field",
254
  "Do Not Blink Field"
255
};
256
257
static const struct true_false_string tn5250_field_attr_und = {
258
  "Underscore Field",
259
  "Do Not Underscore Field"
260
};
261
262
static const struct true_false_string tn5250_field_attr_int = {
263
  "High Intensity",
264
  "Low Intensity"
265
};
266
267
static const struct true_false_string tn5250_field_attr_rev = {
268
  "Reverse Image",
269
  "Normal Image"
270
};
271
272
273
/* 15.6.11.2 Write Extended Attribute Order - Valid Extended Foreground Color Attributes*/
274
275
static const value_string vals_tn5250_foreground_color_attributes[] = {
276
  { 0x00,  "Null - continue currently defined attribute"},
277
  { 0x80,  "Color of the display background medium; black on most models"},
278
  { 0x81 ,  "Color of the display background medium; black on most models"},
279
  { 0x82,  "blue"},
280
  { 0x83,  "blue; different shade of blue than X'82' on some displays"},
281
  { 0x84,  "green"},
282
  { 0x85,  "green; different shade of green than X'84' on some displays"},
283
  { 0x86,  "turquoise"},
284
  { 0x87,  "turquoise; different shade of turquoise than X'86' on some displays"},
285
  { 0x88,  "red"},
286
  { 0x89,  "red; different shade of red than X'88' on some displays"},
287
  { 0x8A,  "pink"},
288
  { 0x8B,  "pink; different shade of pink than X'8A' on some displays"},
289
  { 0x8C,  "yellow"},
290
  { 0x8D,  "yellow; different shade of pink than X'8C' on some displays"},
291
  { 0x8E,  "white"},
292
  { 0x8F,  "white; different shade of white than X'8E' on some displays"},
293
  { 0x00, NULL }
294
};
295
296
297
/* 15.6.11.3 Write Extended Attribute Order - Valid Extended Ideographic Attributes*/
298
static const value_string vals_tn5250_ideographic_attributes[] = {
299
  { 0x00,  "Null - continue currently defined attribute"},
300
  { 0x80,  "Normal display attribute - end double byte mode (SI)"},
301
  { 0x81,  "Begin double byte mode (SO)"},
302
  { 0x00, NULL }
303
};
304
305
/* 15.6.12.1 Start of Field Order - Field Format Word */
306
0
#define FFW_ID      0x40
307
16
#define FFW_ID_BITS 0xC0
308
static const value_string vals_tn5250_ffw_id[] = {
309
  { 0x01       ,  "Identifies Field as Field Format Word"},
310
  { 0x00, NULL }
311
};
312
313
static const struct true_false_string tn5250_field_ffw_bypass = {
314
  "This is a bypass field",
315
  "This is not a bypass field"
316
};
317
318
static const struct true_false_string tn5250_field_ffw_dup = {
319
  "Duplication or Field Mark is allowed in this field",
320
  "Duplication or Field Mark is not allowed in this field"
321
};
322
323
static const struct true_false_string tn5250_field_ffw_mdt = {
324
  "This field has been modified",
325
  "This field has not been modified"
326
};
327
328
16
#define FFW_SHIFT_BITS                        0x07
329
330
static const value_string vals_tn5250_ffw_shift[] = {
331
  { 0x00,  "Alpha shift"},
332
  { 0x01,  "Alpha only"},
333
  { 0x02,  "Numeric shift"},
334
  { 0x03,  "Numeric only"},
335
  { 0x04,  "Katakana shift"},
336
  { 0x05,  "Digits only"},
337
  { 0x06,  "I/O-(feature input field)"},
338
  { 0x07,  "Signed numeric"},
339
  { 0x00, NULL }
340
};
341
342
static const struct true_false_string tn5250_field_ffw_auto = {
343
  "Auto Enter When Field is Exited",
344
  "No Auto Enter"
345
};
346
347
static const struct true_false_string tn5250_field_ffw_fer = {
348
  "Field Exit key is required",
349
  "Field Exit key is not required"
350
};
351
352
static const struct true_false_string tn5250_field_ffw_monocase = {
353
  "Translate operator keyed letters to uppercase",
354
  "Accept lower case letters"
355
};
356
357
static const struct true_false_string tn5250_field_ffw_me = {
358
  "Mandatory Enter Field",
359
  "Not A Mandatory Enter Field"
360
};
361
362
16
#define FFW_ADJUST_BITS                0x07
363
364
static const value_string vals_tn5250_ffw_adjust[] = {
365
  { 0x00,  "No adjust specified"},
366
  { 0x01,  "Reserved"},
367
  { 0x02,  "Reserved"},
368
  { 0x03,  "Reserved"},
369
  { 0x04,  "Reserved"},
370
  { 0x05,  "Right adjust, zero fill"},
371
  { 0x06,  "Right adjust, blank fill"},
372
  { 0x07,  "Mandatory fill"},
373
  { 0x00, NULL }
374
};
375
376
/* 15.6.12.2 Start of Field Order - Field Control Word */
377
378
0
#define SELECTOR                                                     0x81
379
0
#define IDEOGRAPHIC                                                  0x82
380
0
#define FORWARD_EDGE                                                 0x85
381
0
#define CONTINUED_ENTRY                                              0x86
382
0
#define SELF_CHECK                                                   0xB1
383
0
#define ENTRY_FIELD_RESEQUENCING                                     0x80
384
0
#define CURSOR_PROGRESSION_ENTRY_FIELD                               0x88
385
0
#define HIGHLIGHTED_ENTRY_FIELD                                      0x89
386
0
#define POINTER_DEVICE_SELECTION_ENTRY_FIELD                         0x8A
387
0
#define TRANSPARENCY_ENTRY_FIELD                                     0x84
388
389
static const range_string vals_tn5250_fcw[] = {
390
  { 0x8000,  0x8080, "Entry field resequencing. The nn specifies the next entry field in the sequence (X'00' to X'80')."},
391
  { 0x8101,  0x8101, "Magnetic stripe reader entry field"},
392
  { 0x8102,  0x8102, "Selector light pen or cursor select field"},
393
  { 0x8103,  0x8103, "Magnetic stripe reader and selector light pen entry field"},
394
  { 0x8106,  0x8106, "Selector light pen and selectable attention entry field"},
395
  { 0x8200,  0x8200, "Ideographic-only entry field"},
396
  { 0x8220,  0x8220, "Ideographic data type entry field"},
397
  { 0x8240,  0x8240, "Ideographic-either entry field"},
398
  { 0x8280,  0x8280, "Ideographic-open entry field"},
399
  { 0x82C0,  0x82C0, "Ideographic-open entry field"},
400
  { 0x8400,  0x84FF, "Transparency entry field. The nn can be any two digits."},
401
  { 0x8501,  0x8501, "Forward edge trigger entry field"},
402
  { 0x8601,  0x8603, "Continued entry field"},
403
  { 0x8680,  0x8680, "Word Wrap entry field"},
404
  { 0x8800,  0x88FF, "Cursor progression entry field. The nn is the next entry field in the specified application cursor progression sequence."},
405
  { 0x8900,  0x89FF, "Highlighted entry field. The nn specifies the field attribute"},
406
  { 0x8A00,  0x8AFF, "Pointer device selection entry field. If a user selects the entry field, the nn specifies the AID to be returned."},
407
  { 0xB140,  0xB140, "Self-check modulus 11 entry field"},
408
  { 0xB1A0,  0xB1A0, "Self-check modulus 10 entry field"},
409
  { 0,  0,      NULL}
410
};
411
412
413
#if 0
414
#define MAGNETIC_STRIPE_READER_ENTRY_FIELD                           0x8101
415
#define SELECTOR_LIGHT_PEN_OR_CURSOR_SELECT_FIELD                    0x8102
416
#define MAGNETIC_STRIPE_READER_AND_SELECTOR_LIGHT_PEN_ENTRY_FIELD    0x8103
417
#define SELECTOR_LIGHT_PEN_AND_SELECTABLE_ATTENTION_ENTRY_FIELD      0x8106
418
#define IDEOGRAPHIC_ONLY_ENTRY_FIELD                                 0x8200
419
#define IDEOGRAPHIC_DATA_TYPE_ENTRY_FIELD                            0x8220
420
#define IDEOGRAPHIC_EITHER_ENTRY_FIELD                               0x8240
421
#define IDEOGRAPHIC_OPEN_ENTRY_FIELD                                 0x8280
422
#define IDEOGRAPHIC_OPEN_ENTRY_FIELD1                                0x82C0
423
#define FORWARD_EDGE_TRIGGER_ENTRY_FIELD                             0x8501
424
#define CONTINUED_ENTRY_FIELD                                        0x8601
425
#define CONTINUED_ENTRY_FIELD1                                       0x8602
426
#define CONTINUED_ENTRY_FIELD2                                       0x8603
427
#define WORD_WRAP_ENTRY_FIELD                                        0x8680
428
#define SELF_CHECK_MODULUS_11_ENTRY_FIELD                            0xB140
429
#define SELF_CHECK_MODULUS_10_ENTRY_FIELD                            0xB1A0
430
431
static const value_string vals_tn5250_fcw[] = {
432
  { ENTRY_FIELD_RESEQUENCING                                 ,  "Entry field resequencing. The NN specifies the next entry field "
433
    "in the sequence (X'00' to X'80')."},
434
  { MAGNETIC_STRIPE_READER_ENTRY_FIELD                       ,  "Magnetic stripe reader entry field"},
435
  { SELECTOR_LIGHT_PEN_OR_CURSOR_SELECT_FIELD                ,  "Selector light pen or cursor select field"},
436
  { MAGNETIC_STRIPE_READER_AND_SELECTOR_LIGHT_PEN_ENTRY_FIELD,  "Magnetic stripe reader and selector light pen entry field"},
437
  { SELECTOR_LIGHT_PEN_AND_SELECTABLE_ATTENTION_ENTRY_FIELD  ,  "Selector light pen and selectable attention entry field"},
438
  { IDEOGRAPHIC_ONLY_ENTRY_FIELD                             ,  "Ideographic-only entry field"},
439
  { IDEOGRAPHIC_DATA_TYPE_ENTRY_FIELD                        ,  "Ideographic data type entry field"},
440
  { IDEOGRAPHIC_EITHER_ENTRY_FIELD                           ,  "Ideographic-either entry field"},
441
  { IDEOGRAPHIC_OPEN_ENTRY_FIELD                             ,  "Ideographic-open entry field"},
442
  { IDEOGRAPHIC_OPEN_ENTRY_FIELD1                            ,  "Ideographic-open entry field"},
443
  { TRANSPARENCY_ENTRY_FIELD                                 ,  "Transparency entry field. The NN can be any two digits."},
444
  { FORWARD_EDGE_TRIGGER_ENTRY_FIELD                         ,  "Forward edge trigger entry field"},
445
  { CONTINUED_ENTRY_FIELD                                    ,  "Continued entry field"},
446
  { CONTINUED_ENTRY_FIELD1                                   ,  "Continued entry field"},
447
  { CONTINUED_ENTRY_FIELD2                                   ,  "Continued entry field"},
448
  { WORD_WRAP_ENTRY_FIELD                                    ,  "Word Wrap entry field"},
449
  { CURSOR_PROGRESSION_ENTRY_FIELD                           ,  "Cursor progression entry field. The NN is the next entry field "
450
                                                                "in the specified application cursor progression sequence."},
451
  { HIGHLIGHTED_ENTRY_FIELD                                  ,  "Highlighted entry field. The NN specifies the field attribute"},
452
  { POINTER_DEVICE_SELECTION_ENTRY_FIELD                     ,  "Pointer device selection entry field. If a user selects the "
453
                                                                "entry field, the NN specifies the AID to be returned."},
454
  { SELF_CHECK_MODULUS_11_ENTRY_FIELD                        ,  "Self-check modulus 11 entry field"},
455
  { SELF_CHECK_MODULUS_10_ENTRY_FIELD                        ,  "Self-check modulus 10 entry field"},
456
  { 0x00, NULL }
457
};
458
#endif
459
460
/* 15.6.12.3 Start of Field Order - Field Attribute */
461
462
static const value_string vals_tn5250_fa_color[] = {
463
  { 0x20,  "Green"},
464
  { 0x21,  "Green/Reverse image"},
465
  { 0x22,  "White"},
466
  { 0x23,  "White/Reverse image"},
467
  { 0x24,  "Green/Underscore"},
468
  { 0x25,  "Green/Underscore/Reverse image"},
469
  { 0x26,  "White/Underscore"},
470
  { 0x27,  "Nondisplay"},
471
  { 0x28,  "Red"},
472
  { 0x29,  "Red/Reverse image "},
473
  { 0x2A,  "Red/Blink"},
474
  { 0x2B,  "Red/Reverse image/Blink"},
475
  { 0x2C,  "Red/Underscore"},
476
  { 0x2D,  "Red/Underscore/Reverse image"},
477
  { 0x2E,  "Red/Underscore/Blink"},
478
  { 0x2F,  "Nondisplay"},
479
  { 0x30,  "Turquoise/Column separators "},
480
  { 0x31,  "Turquoise/Column separators/Reverse image"},
481
  { 0x32,  "Yellow/Column separators"},
482
  { 0x33,  "Yellow/Column separators/Reverse image"},
483
  { 0x34,  "Turquoise/Underscore"},
484
  { 0x35,  "Turquoise/Underscore/Reverse image"},
485
  { 0x36,  "Yellow/Underscore"},
486
  { 0x37,  "Nondisplay"},
487
  { 0x38,  "Pink"},
488
  { 0x39,  "Pink/Reverse image"},
489
  { 0x3A,  "Blue"},
490
  { 0x3B,  "Blue/Reverse image"},
491
  { 0x3C,  "Pink/Underscore"},
492
  { 0x3D,  "Pink/Underscore/Reverse image "},
493
  { 0x3E,  "Blue/Underscore"},
494
  { 0x3F,  "Nondisplay"},
495
  { 0x00, NULL }
496
};
497
498
/* 15.6.13  Write to Display Structured Field Order */
499
#define CLASS_5250            0xD9
500
501
static const value_string vals_tn5250_sf_class[] = {
502
  { CLASS_5250       ,  "5250 Class of Structured Field"},
503
  { 0x00, NULL }
504
};
505
506
/* 15.6.13 - Major Structure Types */
507
0
#define DEFINE_SELECTION_FIELD                     0x50
508
0
#define CREATE_WINDOW                              0x51
509
0
#define UNRESTRICTED_WINDOW_CURSOR_MOVEMENT        0x52
510
0
#define DEFINE_SCROLL_BAR_FIELD                    0x53
511
0
#define WRITE_DATA                                 0x54
512
0
#define PROGRAMMABLE_MOUSE_BUTTONS                 0x55
513
0
#define REMOVE_GUI_SELECTION_FIELD                 0x58
514
0
#define REMOVE_GUI_WINDOW                          0x59
515
0
#define REMOVE_GUI_SCROLL_BAR_FIELD                0x5B
516
0
#define REMOVE_ALL_GUI_CONSTRUCTS                  0x5F
517
0
#define DRAW_ERASE_GRID_LINES                      0x60
518
0
#define CLEAR_GRID_LINE_BUFFER                     0x61
519
0
#define IMAGE_FAX_CONTROL                          0x66
520
0
#define IMAGE_FAX_DOWNLOAD                         0x67
521
0
#define WSC_CUSTOMIZATION                          0x71
522
0
#define DEFINE_AUDIT_WINDOW__TABLE                 0x30
523
0
#define DEFINE_COMMAND_KEY_FUNCTION                0x31
524
0
#define READ_TEXT_SCREEN                           0x32
525
0
#define DEFINE_PENDING_OPERATIONS                  0x33
526
0
#define DEFINE_TEXT_SCREEN_FORMAT                  0x34
527
0
#define DEFINE_SCALE_LINE                          0x35
528
0
#define WRITE_TEXT_SCREEN                          0x36
529
0
#define DEFINE_SPECIAL_CHARACTERS                  0x37
530
#define PENDING_DATA                               0x38
531
0
#define DEFINE_OPERATOR_ERROR_MESSAGES             0x39
532
0
#define DEFINE_PITCH_TABLE                         0x3A
533
0
#define DEFINE_FAKE_DP_COMMAND_KEY_FUNCTION        0x3B
534
0
#define PASS_THROUGH                               0x3F
535
0
#define TN5250_QUERY                               0x70
536
0
#define TN5250_QUERY_STATION_STATE                 0x72
537
0
#define VIDEO_AUDIO_CONTROLS                       0x68
538
0
#define TRUE_TRANSPARENCY_WRITE                    0x6A
539
540
static const value_string vals_tn5250_sf_type[] = {
541
  { DEFINE_SELECTION_FIELD             ,  "Define Selection Field"},
542
  { CREATE_WINDOW                      ,  "Create Window"},
543
  { UNRESTRICTED_WINDOW_CURSOR_MOVEMENT,  "Unrestricted Window Cursor Movement"},
544
  { DEFINE_SCROLL_BAR_FIELD            ,  "Define Scroll Bar Field"},
545
  { WRITE_DATA                         ,  "Write Data"},
546
  { PROGRAMMABLE_MOUSE_BUTTONS         ,  "Programmable Mouse Buttons"},
547
  { REMOVE_GUI_SELECTION_FIELD         ,  "Remove Gui Selection Field"},
548
  { REMOVE_GUI_WINDOW                  ,  "Remove Gui Window"},
549
  { REMOVE_GUI_SCROLL_BAR_FIELD        ,  "Remove Gui Scroll Bar Field"},
550
  { REMOVE_ALL_GUI_CONSTRUCTS          ,  "Remove All Gui Constructs"},
551
  { DRAW_ERASE_GRID_LINES              ,  "Draw/Erase Grid Lines"},
552
  { CLEAR_GRID_LINE_BUFFER             ,  "Clear Grid Line Buffer"},
553
  { IMAGE_FAX_CONTROL                  ,  "Image Fax Control"},
554
  { IMAGE_FAX_DOWNLOAD                 ,  "Image Fax Download"},
555
  { WSC_CUSTOMIZATION                  ,  "Wsc Customization"},
556
  { DEFINE_AUDIT_WINDOW__TABLE         ,  "Define Audit Window Table"},
557
  { DEFINE_COMMAND_KEY_FUNCTION        ,  "Define Command Key Function"},
558
  { READ_TEXT_SCREEN                   ,  "Read Text Screen"},
559
  { DEFINE_PENDING_OPERATIONS          ,  "Define Pending Operations"},
560
  { DEFINE_TEXT_SCREEN_FORMAT          ,  "Define Text Screen Format"},
561
  { DEFINE_SCALE_LINE                  ,  "Define Scale Line"},
562
  { WRITE_TEXT_SCREEN                  ,  "Write Text Screen"},
563
  { DEFINE_SPECIAL_CHARACTERS          ,  "Define Special Characters"},
564
  { PENDING_DATA                       ,  "Pending Data"},
565
  { DEFINE_OPERATOR_ERROR_MESSAGES     ,  "Define Operator Error Messages"},
566
  { DEFINE_PITCH_TABLE                 ,  "Define Pitch Table"},
567
  { DEFINE_FAKE_DP_COMMAND_KEY_FUNCTION,  "Define Fake Dp Command Key Function"},
568
  { PASS_THROUGH                       ,  "Pass-Through"},
569
  { TN5250_QUERY                       ,  "5250 Query"},
570
  { TN5250_QUERY_STATION_STATE         ,  "5250 Query Station State"},
571
  { VIDEO_AUDIO_CONTROLS               ,  "Video/Audio Controls Command"},
572
  { TRUE_TRANSPARENCY_WRITE            ,  "True Transparency Write Command"},
573
  { 0x00, NULL }
574
};
575
576
/* 15.6.13.1  Write to Display Structured Field Order - Create Window */
577
static const struct true_false_string tn5250_field_wdsf_cw_flag1_1 = {
578
  "Cursor Restricted To Window",
579
  "Cursor Not Restricted To Window"
580
};
581
582
static const struct true_false_string tn5250_field_wdsf_cw_flag1_2 = {
583
  "Window Is A Pull-Down Menu Bar",
584
  "Window Is Not A Pull-Down Menu Bar"
585
};
586
587
0
#define CW_BORDER_PRESENTATION                     0x01
588
0
#define CW_TITLE_FOOTER                            0x10
589
590
static const value_string vals_tn5250_wdsf_cw_minor_type[] = {
591
  { CW_BORDER_PRESENTATION             ,  "Border Presentation"},
592
  { CW_TITLE_FOOTER                    ,  "Window Title/Footer"},
593
  { 0x00, NULL }
594
};
595
596
/* 15.6.13.1  Write to Display Structured Field Order - Create Window - Border Presentation Minor Structure */
597
static const struct true_false_string tn5250_field_wdsf_cw_bp_flag1_1 = {
598
  "Use Border Presentation Characters on a GUI-like NWS",
599
  "Do Not Use Border Presentation Characters on a GUI-like NWS"
600
};
601
602
/* 15.6.13.1  Write to Display Structured Field Order - Create Window - Window Title/Footer Minor Structure */
603
16
#define WTF_BITS         0xC0
604
605
static const value_string vals_tn5250_wdsf_cw_tf_flag_orientation[] = {
606
  { 0,   "Window Title or Footer is Centered"},
607
  { 1,   "Window Title or Footer is Right Justified"},
608
  { 2,   "Window Title or Footer is Left Justified"},
609
  { 3,   "Reserved (Window Title or Footer is Centered)"},
610
  { 0, NULL }
611
};
612
613
static const struct true_false_string tn5250_field_wdsf_cw_tf_flag_1 = {
614
  "Window Footer is Defined",
615
  "Window Title is Defined"
616
};
617
618
619
/* 15.6.13.4  Write to Display Structured Field Order - Remove All GUI Constructs*/
620
static const struct true_false_string tn5250_field_wdsf_ragc_flag1_0 = {
621
  "5494 Maps GUI-like Characters",
622
  "5494 Does Not Map GUI-like Characters"
623
};
624
625
626
/* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field*/
627
0
#define DS_CHOICE_TEXT                 0x10
628
0
#define DS_MENU_BAR_SEPARATOR          0x09
629
0
#define DS_CHOICE_PRESENTATION_DISPLAY 0x01
630
0
#define DS_CHOICE_INDICATORS           0x02
631
0
#define DS_SCROLLBAR_INDICATORS        0x03
632
633
634
static const value_string vals_tn5250_wdsf_ds_minor_type[] = {
635
  { DS_CHOICE_TEXT                ,  "Choice Text"},
636
  { DS_MENU_BAR_SEPARATOR         ,  "Menu Bar Separator"},
637
  { DS_CHOICE_PRESENTATION_DISPLAY,  "Choice Presentation Display Attributes"},
638
  { DS_CHOICE_INDICATORS          ,  "Choice Indicators"},
639
  { DS_SCROLLBAR_INDICATORS       ,  "Scroll Bar Indicators"},
640
  { 0x00, NULL }
641
};
642
643
16
#define MOUSE_CHARACTERISTICS_BITS         0x03
644
645
static const value_string vals_tn5250_wdsf_ds_flag1_mouse_characteristics[] = {
646
  { 0x00,  "Use this selection field in all cases"},
647
  { 0x02,  "Use this selection field only if the display does not have a mouse."},
648
  { 0x01,  "Use this selection field only if the display has a mouse."},
649
  { 0x03,  "Reserved"},
650
  { 0x00, NULL }
651
};
652
653
16
#define DS_AUTO_ENTER_BITS         0x30
654
655
static const value_string vals_tn5250_wdsf_ds_flag1_auto_enter[] = {
656
  { 0,   "Selection field is not auto-enter"},
657
  { 2,   "Selection field is auto-enter on selection except if double-digit numeric selection is used."},
658
  { 1,   "Selection field is auto-enter on selection or deselection except if double-digit numeric selection is used. "},
659
  { 3,   "Selection field is auto-enter on selection except if single-digit or double-digit numeric selection is used."},
660
  { 0, NULL }
661
};
662
663
static const struct true_false_string tn5250_field_wdsf_ds_flag1_1 = {
664
  "Auto-Select Enabled",
665
  "Auto-Select Not Enabled"
666
};
667
668
static const struct true_false_string tn5250_field_wdsf_ds_flag1_2 = {
669
  "Field MDT Enabled",
670
  "Field MDT Not Enabled"
671
};
672
673
static const struct true_false_string tn5250_field_wdsf_ds_flag2_1 = {
674
  "If set to on, a scroll bar should is created beside the selection field choices, and TotalRows and SliderPos that can "
675
  "be scrolled are included in the major structure.",
676
  "No Action"
677
};
678
679
static const struct true_false_string tn5250_field_wdsf_ds_flag2_2 = {
680
  "If set to on, one blank is added after the numeric separator character.",
681
  "No Action"
682
};
683
684
static const struct true_false_string tn5250_field_wdsf_ds_flag2_3 = {
685
  "If set to on, an asterisk (*) replaces the first character of an unavailable choice on monochrome display.",
686
  "No Action"
687
};
688
689
static const struct true_false_string tn5250_field_wdsf_ds_flag2_4 = {
690
  "If set to on, cursor is limited to input-capable positions only.",
691
  "No Action"
692
};
693
694
static const struct true_false_string tn5250_field_wdsf_ds_flag2_5 = {
695
  "If set to on, the Field Advance/Field Backspace function is like the Character Advance/Character Backspace keys within "
696
  "this selection field.",
697
  "No Action"
698
};
699
700
static const struct true_false_string tn5250_field_wdsf_ds_flag2_6 = {
701
  "If set to on, the cursor movement keys are not allowed to exit this selection field.",
702
  "No Action"
703
};
704
705
static const struct true_false_string tn5250_field_wdsf_ds_flag3_1 = {
706
  "If set to on, any selected choices are changed to available whenever the keyboard is unlocked.",
707
  "No Action"
708
};
709
710
#define MENU_BAR                                                 0x01
711
#define SINGLE_CHOICE_SELECTION_FIELD                            0x11
712
#define MULTIPLE_CHOICE_SELECTION_FIELD                          0x12
713
#define SINGLE_CHOICE_SELECTION_LIST                             0x21
714
#define MULTIPLE_CHOICE_SELECTION_LIST                           0x22
715
#define SINGLE_CHOICE_SELECTION_FIELD_AND_A_PULL_DOWN_LIST       0x31
716
#define MULTIPLE_CHOICE_SELECTION_FIELD_AND_A_PULL_DOWN_LIST     0x32
717
#define PUSH_BUTTONS                                             0x41
718
#define PUSH_BUTTONS_IN_A_PULL_DOWN_MENU_                        0x51
719
720
static const value_string vals_tn5250_wdsf_ds_type[] = {
721
  { MENU_BAR                                            ,  "Menu bar"},
722
  { SINGLE_CHOICE_SELECTION_FIELD                       ,  "Single choice selection field"},
723
  { MULTIPLE_CHOICE_SELECTION_FIELD                     ,  "Multiple choice selection field"},
724
  { SINGLE_CHOICE_SELECTION_LIST                        ,  "Single choice selection list"},
725
  { MULTIPLE_CHOICE_SELECTION_LIST                      ,  "Multiple choice selection list"},
726
  { SINGLE_CHOICE_SELECTION_FIELD_AND_A_PULL_DOWN_LIST  ,  "Single choice selection field and a pull-down list"},
727
  { MULTIPLE_CHOICE_SELECTION_FIELD_AND_A_PULL_DOWN_LIST,  "Multiple choice selection field and a pull-down list"},
728
  { PUSH_BUTTONS                                        ,  "Push buttons"},
729
  { PUSH_BUTTONS_IN_A_PULL_DOWN_MENU_                   ,  "Push buttons in a pull-down menu "},
730
  { 0x00, NULL }
731
};
732
733
#define DS_INDICATOR1              0x00
734
#define DS_INDICATOR2              0x02
735
#define DS_INDICATOR3              0x03
736
#define DS_INDICATOR4              0x04
737
#define DS_INDICATOR5              0x05
738
#define DS_INDICATOR6              0x06
739
#define DS_INDICATOR7              0x0F
740
16
#define DS_INDICATORS_BITS         0x0F
741
742
static const value_string vals_tn5250_wdsf_ds_gdc_indicators[] = {
743
  { DS_INDICATOR1,  "An indicator to the left of each choice (check box or radio button) is created."},
744
  { DS_INDICATOR2,  "A push button box is created around choice text and the choice text is padded with a blank on both sides."},
745
  { DS_INDICATOR3,  "A push button indicator specifies each choice instead of a push button  box on a GUI-like NWS. (A GUI "
746
                    "PWS treats this setting like B'0010'.)"},
747
  { DS_INDICATOR4,  "A push button box is created around choice text and choice text is padded  with a blank on both sides,"
748
                    " and a leading choice text attribute is written on top of the previous choice  text ending attribute."},
749
  { DS_INDICATOR5,  "A push button indicator specifies each choice instead of a push button box on a GUI-like NWS, and a leading "
750
                    "choice text attribute is specified on top of the previous ending choice text attribute. (A GUI PWS treats "
751
                    "this setting like B'0100'.)"},
752
  { DS_INDICATOR6,  "A push button box is created around choice text (with no padding)."},
753
  { DS_INDICATOR7,  "There are no indicators for this value. It is valid for all types of selection."},
754
  { 0x00, NULL }
755
};
756
757
#define DS_SELECTION_TECHNIQUES1             0x1
758
#define DS_SELECTION_TECHNIQUES2             0x2
759
#define DS_SELECTION_TECHNIQUES3             0x7
760
16
#define DS_SELECTION_TECHNIQUES_BITS         0xE0
761
762
static const value_string vals_tn5250_wdsf_ds_gdc_selection_techniques[] = {
763
  { DS_SELECTION_TECHNIQUES1,  "Defines a mnemonic (or numeric) selection for some or all of the choices. The mnemonic is underscored."},
764
  { DS_SELECTION_TECHNIQUES2,  "Defines a mnemonic (or numeric) selection for some or all of the choices. "
765
    "The mnemonic is not underscored."},
766
  { DS_SELECTION_TECHNIQUES3,  "No mnemonic (or numeric) selection is specified."},
767
  { 0x00, NULL }
768
};
769
770
771
#define DS_NWS_INDICATOR1              0x00
772
#define DS_NWS_INDICATOR2              0x03
773
#define DS_NWS_INDICATOR3              0x05
774
#define DS_NWS_INDICATOR4              0x08
775
#define DS_NWS_INDICATOR5              0x0F
776
16
#define DS_NWS_INDICATORS_BITS         0x0F
777
778
static const value_string vals_tn5250_wdsf_ds_nws_indicators[] = {
779
  { DS_NWS_INDICATOR1,  "An indicator to the left of each  choice (for example, a slash (/)) is  created. (1)"},
780
  { DS_NWS_INDICATOR2,  "A push button indicator specifies each choice. (2)"},
781
  { DS_NWS_INDICATOR3,  "A push button indicator specifies each choice, and a leading choice text attribute is "
782
                        "specified on top of a previous ending choice text attribute. (2)"},
783
  { DS_NWS_INDICATOR4,  "A numeric field to the left of the first choice is created. (Single- or double-digit "
784
                        "numeric fields are determined by bits 5-7.) (3)"},
785
  { DS_NWS_INDICATOR5,  "No indicators are specified for this value. This is valid for all types of selection fields."},
786
  { 0x00, NULL }
787
};
788
789
#define DS_NWS_SELECTION_TECHNIQUES1             0x1
790
#define DS_NWS_SELECTION_TECHNIQUES2             0x2
791
#define DS_NWS_SELECTION_TECHNIQUES3             0x4
792
#define DS_NWS_SELECTION_TECHNIQUES4             0x5
793
#define DS_NWS_SELECTION_TECHNIQUES5             0x7
794
16
#define DS_NWS_SELECTION_TECHNIQUES_BITS         0xE0
795
796
static const value_string vals_tn5250_wdsf_ds_nws_selection_techniques[] = {
797
  { DS_NWS_SELECTION_TECHNIQUES1,  "Defines a mnemonic (or numeric) selection for some or all of the choices. "
798
                                   "The mnemonic is underscored."},
799
  { DS_NWS_SELECTION_TECHNIQUES2,  "Defines a mnemonic (or numeric) selection for some or all of the choices. "
800
                                   "The mnemonic is not underscored."},
801
  { DS_NWS_SELECTION_TECHNIQUES3,  "Defines a single-digit numeric selection."},
802
  { DS_NWS_SELECTION_TECHNIQUES4,  "Defines a double-digit numeric selection."},
803
  { DS_NWS_SELECTION_TECHNIQUES5,  "No mnemonic or numeric selection is defined."},
804
  { 0x00, NULL }
805
};
806
807
/* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Choice Text Minor Structure*/
808
#define DS_CHOICE_STATE1             0x01
809
#define DS_CHOICE_STATE2             0x02
810
#define DS_CHOICE_STATE3             0x03
811
16
#define DS_CHOICE_STATE_BITS         0x03
812
813
static const value_string vals_tn5250_wdsf_ds_ct_flag1_choice_state[] = {
814
  { DS_CHOICE_STATE1,  "Available and not a default selection"},
815
  { DS_CHOICE_STATE2,  "Available and is a default selection (selected state)"},
816
  { DS_CHOICE_STATE3,  "Not available"},
817
  { 0x00, NULL }
818
};
819
820
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag1_2 = {
821
  "Set to on: specifies a menu bar choice that starts a new row.",
822
  "Set to on: does not specify a menu bar choice that starts a new row."
823
};
824
825
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag1_3 = {
826
  "Reserved (incorrectly set to on).",
827
  "Reserved (set to zero)."
828
};
829
830
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag1_4 = {
831
  "Set to on: specifies that a  mnemonic offset is included in the minor structure.",
832
  "Set to off: does not specify that a mnemonic offset is included in the minor structure."
833
};
834
835
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag1_5 = {
836
  "If set to on, specifies an AID if 'selected' is included in this minor structure.",
837
  "No Action"
838
};
839
840
#define DS_NUMERIC_SELECTION_NOT_INCLUDED             0x0
841
0
#define DS_NUMERIC_SELECTION_SINGLE_DIGIT             0x1
842
0
#define DS_NUMERIC_SELECTION_DOUBLE_DIGIT             0x2
843
16
#define DS_NUMERIC_SELECTION_BITS                     0xC0
844
845
static const value_string vals_tn5250_wdsf_ds_ct_flag1_numeric_selection[] = {
846
  { DS_NUMERIC_SELECTION_NOT_INCLUDED,  "Numeric selection characters are not included in this minor structure."},
847
  { DS_NUMERIC_SELECTION_SINGLE_DIGIT,  "A single-digit numeric selection character is included in this minor structure."},
848
  { DS_NUMERIC_SELECTION_DOUBLE_DIGIT,  "Double-digit numeric selection characters are included in this minor structure."},
849
  { 0x00, NULL }
850
};
851
852
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_0 = {
853
  "Set to on, the choice cannot accept a cursor.",
854
  "Set to off, the choice can accept a cursor."
855
};
856
857
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_1 = {
858
  "Set to on, the application user desires a roll-down AID if the Cursor Up key is pressed on this choice.",
859
  "Set to off, the application user does not desire a roll-down AID if the Cursor Up key is pressed on this choice."
860
};
861
862
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_2 = {
863
  "Set to on, the application user desires a roll-up AID if the Cursor Up key is pressed on this choice.",
864
  "Set to off, the application user does not desire a roll-up AID if the Cursor Up key is pressed on this choice."
865
};
866
867
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_3 = {
868
  "Set to on, the application user desires a roll-left AID if the Cursor Up key is pressed on this choice.",
869
  "Set to off, the application user does not desire a roll-left AID if the Cursor Up key is pressed on this choice."
870
};
871
872
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_4 = {
873
  "Set to on, the application user desires a roll-right AID if the Cursor Up key is pressed on this choice.",
874
  "Set to off, the application user does not desire a roll-right AID if the Cursor Up key is pressed on this choice."
875
};
876
877
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_5 = {
878
  "Set to on, no push-button box is written for this choice.",
879
  "Set to off, a push-button box is written for this choice."
880
};
881
882
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_6 = {
883
  "Reserved (incorrectly set to on).",
884
  "Reserved (set to zero)."
885
};
886
887
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag2_7 = {
888
  "Set to on, cursor direction is right to left.",
889
  "Set to off, cursor direction is left to right."
890
};
891
892
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag3_0 = {
893
  "Set to on, use this minor structure for GUI devices (including GUI-like NWSs).",
894
  "Set to off, do not use this minor structure for GUI devices (including GUI-like NWSs)."
895
};
896
897
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag3_1 = {
898
  "Set to on, use this minor structure for non-GUI NWSs that are capable of creating mnemonic underscores.",
899
  "Set to off, do not use this minor structure for non-GUI NWSs that are capable of creating mnemonic underscores."
900
};
901
902
static const struct true_false_string tn5250_field_wdsf_ds_ct_flag3_2 = {
903
  "Set to on, use this minor structure for NWS display devices that are not capable of creating underscores.",
904
  "Set to off, do not use this minor structure for NWS display devices that are not capable of creating underscores."
905
};
906
907
/* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Menu Bar Separator Minor Structure*/
908
909
static const struct true_false_string tn5250_field_wdsf_ds_mbs_flag_0 = {
910
  "Use specified separator character on GUI-like NWSs.",
911
  "Do not use specified separator character on GUI-like NWSs."
912
};
913
914
static const struct true_false_string tn5250_field_wdsf_ds_mbs_flag_1 = {
915
  "Suppress writing of leading and ending attributes.",
916
  "Do not suppress writing of leading and ending attributes."
917
};
918
919
/* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Choice Presentation Display Attributes Minor Structure*/
920
921
static const struct true_false_string tn5250_field_wdsf_ds_cpda_flag1_0 = {
922
  "Uses the minor structure for GUI devices (including GUI-like NWSs).",
923
  "Does not use the minor structure for GUI devices (including GUI-like NWSs)."
924
};
925
926
static const struct true_false_string tn5250_field_wdsf_ds_cpda_flag1_1 = {
927
  "Uses the minor structure for NWSs that are capable of creating underscores.",
928
  "Does not use the minor structure for NWSs that are capable of creating underscores."
929
};
930
931
static const struct true_false_string tn5250_field_wdsf_ds_cpda_flag1_2 = {
932
  "Uses the minor structure for NWSs that are not capable of creating mnemonic underscores.",
933
  "Does not use the minor structure for NWSs that are not capable of creating mnemonic underscores."
934
};
935
936
/* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Choice Indicators Minor Structure*/
937
938
static const struct true_false_string tn5250_field_wdsf_ds_ci_flag1_0 = {
939
  "Use the specified indicators on GUI-like NWSs.",
940
  "Do Not Use the specified indicators on GUI-like NWSs"
941
};
942
943
/* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Scroll Bar Indicators Minor Structure*/
944
945
static const struct true_false_string tn5250_field_wdsf_ds_sbi_flag1_0 = {
946
  "Use the specified indicators on GUI-like NWSs.",
947
  "Do Not Use the specified indicators on GUI-like NWSs"
948
};
949
950
/* 15.6.13.7  Write to Display Structured Field Order - Define Scroll Bar Field */
951
952
static const struct true_false_string tn5250_field_wdsf_dsb_flag1_0 = {
953
  "On: Vertical scroll bar is set to off and horizontal scroll bar is set to on.",
954
  "Off: Vertical scroll bar is set to off and horizontal scroll bar is set to on."
955
};
956
957
#if 0
958
static const struct true_false_string tn5250_field_wdsf_dsb_flag1_1 = {
959
  "On: The cursor is moved to the scroll bar on a pointer device scroll bar interaction",
960
  "Off: The cursor is moved to the scroll bar on a pointer device scroll bar interaction."
961
};
962
#endif
963
964
static const struct true_false_string tn5250_field_wdsf_dsb_flag1_7 = {
965
  "On: Field MDT",
966
  "Off: Field MDT"
967
};
968
969
/* 15.6.13.9  Write to Display Structured Field Order - Write Data Field */
970
971
static const struct true_false_string tn5250_field_wdsf_wdf_flag1_0 = {
972
  "On: Write data to entry field",
973
  "Off: Do not write data to entry field"
974
};
975
976
/* 15.6.13.10  Write to Display Structured Field Order - Programmable Mouse Buttons */
977
static const struct true_false_string tn5250_field_wdsf_pmb_flag1_0 = {
978
  "Two-event definition",
979
  "Single-event definition"
980
};
981
982
static const struct true_false_string tn5250_field_wdsf_pmb_flag1_1 = {
983
  "On: The text cursor is moved to the location of the mouse cursor.",
984
  "Off: The text cursor is NOT moved to the location of the mouse cursor."
985
};
986
987
static const struct true_false_string tn5250_field_wdsf_pmb_flag1_2 = {
988
  "On: The single mouse event is queued if the keyboard is locked.",
989
  "Off: The single mouse event is not queued if the keyboard is locked"
990
};
991
992
static const struct true_false_string tn5250_field_wdsf_pmb_flag1_3 = {
993
  "On: A marker box is drawn on the first event of a two-event definition",
994
  "Off: A marker box is not drawn on the first event of a two-event definition"
995
};
996
997
#define PMB_RESERVED                              0x00
998
#define LEFT_BUTTON_PRESSED                       0x01
999
#define LEFT_BUTTON_RELEASED                      0x02
1000
#define LEFT_BUTTON_DOUBLE_CLICK                  0x03
1001
#define RIGHT_BUTTON_PRESSED                      0x04
1002
#define RIGHT_BUTTON_RELEASED                     0x05
1003
#define RIGHT_BUTTON_DOUBLE_CLICK                 0x06
1004
#define MIDDLE_BUTTON_PRESSED                     0x07
1005
#define MIDDLE_BUTTON_RELEASED                    0x08
1006
#define MIDDLE_BUTTON_DOUBLE_CLICK                0x09
1007
#define SHIFTED_LEFT_BUTTON_PRESSED               0x0A
1008
#define SHIFTED_LEFT_BUTTON_RELEASED              0x0B
1009
#define SHIFTED_LEFT_BUTTON_DOUBLE_CLICK          0x0C
1010
#define SHIFTED_RIGHT_BUTTON_PRESSED              0x0D
1011
#define SHIFTED_RIGHT_BUTTON_RELEASED             0x0E
1012
#define SHIFTED_RIGHT_BUTTON_DOUBLE_CLICK         0x0F
1013
#define SHIFTED_MIDDLE_BUTTON_PRESSED             0x10
1014
#define SHIFTED_MIDDLE_BUTTON_RELEASED            0x11
1015
#define SHIFTED_MIDDLE_BUTTON_DOUBLE_CLICK        0x12
1016
1017
static const value_string vals_tn5250_mouse_events[] = {
1018
  { PMB_RESERVED                      ,  "Reserved"},
1019
  { LEFT_BUTTON_PRESSED               ,  "Left button pressed"},
1020
  { LEFT_BUTTON_RELEASED              ,  "Left button released"},
1021
  { LEFT_BUTTON_DOUBLE_CLICK          ,  "Left button double click"},
1022
  { RIGHT_BUTTON_PRESSED              ,  "Right button pressed"},
1023
  { RIGHT_BUTTON_RELEASED             ,  "Right button released"},
1024
  { RIGHT_BUTTON_DOUBLE_CLICK         ,  "Right button double click"},
1025
  { MIDDLE_BUTTON_PRESSED             ,  "Middle button pressed"},
1026
  { MIDDLE_BUTTON_RELEASED            ,  "Middle button released"},
1027
  { MIDDLE_BUTTON_DOUBLE_CLICK        ,  "Middle button double click"},
1028
  { SHIFTED_LEFT_BUTTON_PRESSED       ,  "Shifted left button pressed"},
1029
  { SHIFTED_LEFT_BUTTON_RELEASED      ,  "Shifted left button released"},
1030
  { SHIFTED_LEFT_BUTTON_DOUBLE_CLICK  ,  "Shifted left button double click"},
1031
  { SHIFTED_RIGHT_BUTTON_PRESSED      ,  "Shifted right button pressed"},
1032
  { SHIFTED_RIGHT_BUTTON_RELEASED     ,  "Shifted right button released"},
1033
  { SHIFTED_RIGHT_BUTTON_DOUBLE_CLICK ,  "Shifted right button double click"},
1034
  { SHIFTED_MIDDLE_BUTTON_PRESSED     ,  "Shifted middle button pressed"},
1035
  { SHIFTED_MIDDLE_BUTTON_RELEASED    ,  "Shifted middle button released"},
1036
  { SHIFTED_MIDDLE_BUTTON_DOUBLE_CLICK,  "Shifted middle button double click"},
1037
  { 0x00, NULL }
1038
};
1039
1040
/* 15.7 Draw/Erase Grid Lines Structured Field */
1041
static const struct true_false_string tn5250_field_wdsf_deg_flag1_0 = {
1042
  "On: Clear the grid line buffer specified by the partition byte",
1043
  "Off: Do not clear the grid line buffer specified by the partition byte"
1044
};
1045
1046
#define SOLID_LINE                           0x00
1047
#define THICK_SOLID_LINE_BOLD                0x01
1048
#define DOUBLE_LINE                          0x02
1049
#define DOTTED_LINE                          0x03
1050
#define DASHED_LINE                          0x08
1051
#define THICK_DASHED_LINE_BOLD               0x09
1052
#define DOUBLE_DASHED_LINE                   0x0A
1053
#define USE_DEFAULT_LINE_FOR_THE_DISPLAY     0xFF
1054
1055
static const value_string vals_tn5250_deg_lines[] = {
1056
  { SOLID_LINE                      ,  "Solid line"},
1057
  { THICK_SOLID_LINE_BOLD           ,  "Thick solid line (bold)"},
1058
  { DOUBLE_LINE                     ,  "Double line"},
1059
  { DOTTED_LINE                     ,  "Dotted line"},
1060
  { DASHED_LINE                     ,  "Dashed line"},
1061
  { THICK_DASHED_LINE_BOLD          ,  "Thick dashed line (bold)"},
1062
  { DOUBLE_DASHED_LINE              ,  "Double dashed line"},
1063
  { USE_DEFAULT_LINE_FOR_THE_DISPLAY,  "Use default line for the display."},
1064
  { 0x00, NULL }
1065
};
1066
1067
/* 15.7.1 Draw/Erase Grid Lines Structured Field - Minor Structure*/
1068
0
#define UPPER_HORIZONTAL_LINE                        0x00
1069
0
#define LOWER_HORIZONTAL_LINE                        0x01
1070
0
#define LEFT_VERTICAL_LINE                           0x02
1071
0
#define RIGHT_VERTICAL_LINE                          0x03
1072
0
#define PLAIN_BOX                                    0x04
1073
0
#define HORIZONTALLY_RULED_BOX                       0x05
1074
0
#define VERTICALLY_RULED_BOX                         0x06
1075
0
#define HORIZONTALLY_AND_VERTICALLY_RULED_BOX        0x07
1076
1077
static const value_string vals_tn5250_wdsf_deg_minor_type[] = {
1078
  { UPPER_HORIZONTAL_LINE                ,  "Upper horizontal line"},
1079
  { LOWER_HORIZONTAL_LINE                ,  "Lower horizontal line"},
1080
  { LEFT_VERTICAL_LINE                   ,  "Left vertical line"},
1081
  { RIGHT_VERTICAL_LINE                  ,  "Right vertical line"},
1082
  { PLAIN_BOX                            ,  "Plain box"},
1083
  { HORIZONTALLY_RULED_BOX               ,  "Horizontally ruled box"},
1084
  { VERTICALLY_RULED_BOX                 ,  "Vertically ruled box"},
1085
  { HORIZONTALLY_AND_VERTICALLY_RULED_BOX,  "Horizontally and vertically ruled box"},
1086
  { 0x00, NULL }
1087
};
1088
1089
static const struct true_false_string tn5250_field_wdsf_deg_ms_flag1_0 = {
1090
  "Erase the construct specified",
1091
  "Draw the construct specified"
1092
};
1093
1094
/* 15.22 SAVE PARTIAL SCREEN Command */
1095
static const struct true_false_string tn5250_field_sps_flag1_0 = {
1096
  "Do not include image/fax information",
1097
  "Include image/fax information if image/fax data is on the 5250 session"
1098
};
1099
1100
/* 15.25 ROLL Command */
1101
static const struct true_false_string tn5250_field_roll_flag1_0 = {
1102
  "Roll down",
1103
  "Roll up"
1104
};
1105
1106
/* 15.26.1 WRITE SINGLE STRUCTURED FIELD Command - 5250 WSC CUSTOMIZATION Command*/
1107
0
#define KEYSTROKE_BUFFERING_CONTROL              0x01
1108
0
#define CURSOR_CONTROL                           0x02
1109
1110
static const value_string vals_tn5250_wssf_minor_type[] = {
1111
  { KEYSTROKE_BUFFERING_CONTROL      ,  "Keystroke Buffering Control"},
1112
  { CURSOR_CONTROL                   ,  "Cursor Control"},
1113
  { 0x00, NULL }
1114
};
1115
1116
#define WSC_MINOR_STRUCTURE_LENGTH               0x03
1117
1118
static const struct true_false_string tn5250_field_wssf_flag2_0 = {
1119
  "Reserved",
1120
  "WARNING: Reserved, but set."
1121
};
1122
1123
static const struct true_false_string tn5250_field_wssf_flag2_1 = {
1124
  "Set enhanced field exit required mode",
1125
  "Do not set enhanced field exit required mode"
1126
};
1127
1128
static const struct true_false_string tn5250_field_wssf_flag2_2 = {
1129
  "Resets enhanced field exit required mode",
1130
  "Do not reset enhanced field exit required mode"
1131
};
1132
1133
static const struct true_false_string tn5250_field_wssf_flag2_3 = {
1134
  "Set System/36* mode of operation",
1135
  "Do not set System/36* mode of operation"
1136
};
1137
1138
static const struct true_false_string tn5250_field_wssf_flag2_4 = {
1139
  "Reset System/36* mode of operation",
1140
  "Do not reset System/36* mode of operation"
1141
};
1142
1143
static const struct true_false_string tn5250_field_wssf_flag2_5 = {
1144
  "Set SBA code to X'04' in data returned for READ commands",
1145
  "Do not set SBA code to X'04' in data returned for READ commands"
1146
};
1147
1148
static const struct true_false_string tn5250_field_wssf_flag2_6 = {
1149
  "Set SBA code to X'11' in data returned for READ commands",
1150
  "Do not set SBA code to X'11' in data returned for READ commands"
1151
};
1152
1153
static const struct true_false_string tn5250_field_wssf_flag2_7 = {
1154
  "Customization applies to entire 5494",
1155
  "Customization does not apply to entire 5494"
1156
};
1157
1158
/* 15.26.1 WRITE SINGLE STRUCTURED FIELD Command - 5250 WSC CUSTOMIZATION Command
1159
   - Keystroke Buffering Control Minor Structure*/
1160
static const struct true_false_string tn5250_field_wssf_kbc_flag1_5 = {
1161
  "Change type-ahead state",
1162
  "Do not change type-ahead state"
1163
};
1164
1165
static const struct true_false_string tn5250_field_wssf_kbc_flag1_6 = {
1166
  "Turn on type-ahead if bit is set to 1; ignored if bit 5 is set to 0",
1167
  "Turn off type-ahead if bit 5 is set to 1; ignored if bit 5 is set to 0"
1168
};
1169
1170
static const struct true_false_string tn5250_field_wssf_kbc_flag1_7 = {
1171
  "Attention key is buffered",
1172
  "Attention key is not buffered"
1173
};
1174
1175
/* 15.26.1 WRITE SINGLE STRUCTURED FIELD Command - 5250 WSC CUSTOMIZATION Command
1176
   - Cursor Control Minor Structure*/
1177
1178
static const struct true_false_string tn5250_field_wssf_cc_flag1_7 = {
1179
  "Cursor will blink",
1180
  "Cursor will not blink"
1181
};
1182
1183
/* 15.26.2 WRITE SINGLE STRUCTURED FIELD Command - IMAGE/FAX CONTROL Command */
1184
1185
static const struct true_false_string tn5250_field_wssf_ifc_flag1_0 = {
1186
  "If the display supports a cache,this image/fax data remains in cache memory when the application "
1187
  "sends one of the above commands to erase this image/fax data",
1188
  "Erase this image/fax from memory whenever any of the following commands are received: CLEAR UNIT, CLEAR UNIT ALTERNATE "
1189
  "(without saving image/fax), RESTORE RESTORE PARTIAL (if image/fax data was indicated in the SAVE PARTIAL), Another IMAGE/FAX CONTROL command"
1190
};
1191
1192
static const value_string tn5250_vals_tn5250_wssf_ifc_vals[] = {
1193
  { 0x00   ,  "Normal display (default)"},
1194
  { 0x08   ,  "Transparent display (underlying text may be seen through the image/fax)"},
1195
  { 0x04   ,  "Non-display (the image/fax data remains in memory until it is erased). All other parameters in this command are ignored."},
1196
  { 0x02   ,  "Previously stored image/fax data is erased from the 5250 session and possibly from display memory "
1197
              "(see bit 0 previously). All other parameters in this command are ignored."},
1198
  { 0x00, NULL }
1199
};
1200
1201
static const struct true_false_string tn5250_field_wssf_ifc_flag1_4 = {
1202
  "The display does not present scroll bars",
1203
  "The display presents vertical and horizontal scroll bars as needed and allows the user to scroll without "
1204
  "any interaction with the AS/400 application"
1205
};
1206
1207
static const struct true_false_string tn5250_field_wssf_ifc_flag1_5 = {
1208
  "Image/fax is light foreground on dark background. Preserve the light foreground data during scaling",
1209
  "Image/fax is dark foreground on light background. Preserve the dark foreground data during scaling"
1210
};
1211
1212
static const struct true_false_string tn5250_field_wssf_ifc_flag1_6 = {
1213
  "Background and foreground colors are reversed",
1214
  "Normal image/fax display"
1215
};
1216
1217
static const struct true_false_string tn5250_field_wssf_ifc_flag1_7 = {
1218
  "Do not allow EasyScroll with the primary mouse button.",
1219
  "Allow the primary mouse button to EasyScroll the image/fax"
1220
};
1221
1222
static const struct true_false_string tn5250_field_wssf_ifc_flag2_0 = {
1223
  "For Group 3 or 4 fax, each scan line is duplicated. For high-resolution fax transmission, characters would otherwise appear flattened on the display screen",
1224
  "Normal image/fax display"
1225
};
1226
1227
static const struct true_false_string tn5250_field_wssf_ifc_flag2_1 = {
1228
  "Inhibit the secondary mouse button to Trim Magnify",
1229
  "Allow the secondary mouse button to Trim Magnify the image/fax data"
1230
};
1231
1232
static const struct true_false_string tn5250_field_wssf_ifc_flag2_7 = {
1233
  "True. Reserved for IBM image/fax-capable displays. It is used to download compression algorithms. Non-IBM displays should ignore this bit.",
1234
  "False. Reserved for IBM image/fax-capable displays. It is used to download compression algorithms. Non-IBM displays should ignore this bit."
1235
};
1236
1237
static const value_string vals_tn5250_image_format[] = {
1238
  { 0x0000,  "An unknown IBM-defined format."},
1239
  { 0x0001,  "IOCA (The IOCA header defines the compression algorithm.)"},
1240
  { 0x0002,  "TIFF (The TIFF header defines the compression algorithm.)"},
1241
  { 0x0003,  "PCX"},
1242
  { 0x0004,  "Stand alone Group 3 Fax compression."},
1243
  { 0x00, NULL }
1244
};
1245
1246
1247
static const value_string vals_tn5250_wssf_ifc_scaling[] = {
1248
  { 0xFFFE,  "No Scroll Bar Scaling. The data is scaled such that it fits within the Viewport without requiring scrolling in either direction."},
1249
  { 0xFFFD,  "Fill Scaling. The data is scaled such that it fits horizontally within the Viewport without requiring horizontal scroll bars."},
1250
  { 0xFFEA,  "Decrement Scaling Values."},
1251
  { 0xFFDA,  "Increment Scaling Values."},
1252
  { 0x00, NULL }
1253
};
1254
1255
1256
/* 15.26.3 WRITE SINGLE STRUCTURED FIELD Command - IMAGE/FAX DOWNLOAD Command */
1257
static const struct true_false_string tn5250_field_wssf_ifd_flag1_0 = {
1258
  "This is the last or only IMAGE/FAX DOWNLOAD command for this image/fax",
1259
  "Additional IMAGE/FAX DOWNLOAD commands follow, containing data for this image/fax"
1260
};
1261
1262
static const value_string vals_tn5250_image_fax_error[] = {
1263
  { 0x0001, "Image/fax data was too large. Only the first portion of the data is displayed."},
1264
  { 0x0002, " Image/fax data was too large. The data was ignored."},
1265
  { 0x0003, " Invalid major length in the IMAGE/FAX CONTROL command"},
1266
  { 0x0004, " Invalid major length in the IMAGE/FAX DOWNLOAD command"},
1267
  { 0x0005, " Error in the IMAGE/FAX CONTROL command"},
1268
  { 0x0006, " Error in the IMAGE/FAX DOWNLOAD command"},
1269
  { 0x0007, " Error detected in the image/fax data"},
1270
  { 0x0000, NULL }
1271
};
1272
1273
1274
1275
/* 15.26.4 WRITE SINGLE STRUCTURED FIELD Command - Video/Audio Controls Command Major Structure */
1276
1277
static const range_string vals_tn5250_vac_data[] = {
1278
  { 0x13000001, 0x13000001, "Set View Mode to PIP"},
1279
  { 0x13000000, 0x13000000, "Set View Mode to Off"},
1280
  { 0x14000000, 0x14000000, "Turn Audio On"},
1281
  { 0x14000001, 0x14000001, "Turn Audio Off"},
1282
  { 0x0C000000, 0x0C000064, "Set PC/TV Volume"},
1283
  /* N.B. Set PIP Location and Size was moved to last, to stop it
1284
   * from hiding everything that follows it */
1285
  { 0x1F000001, 0x1F000001, "Set PIP See Through On"},
1286
  { 0x1F000000, 0x1F000000, "Set PIP SeeThrough Off"},
1287
  { 0x20000001, 0x20000001, "Freeze PIP"},
1288
  { 0x20000000, 0x20000000, "Resume After Freeze"},
1289
  { 0x12000000, 0x12000064, "Set PC/TV Channel"},
1290
  { 0x11000000, 0x11000000, "Set Antenna Tuner Source"},
1291
  { 0x11000001, 0x11000001, "Set Cable Tuner Source"},
1292
  { 0x21000001, 0x21000001, "Disable Internal Speaker"},
1293
  { 0x21000000, 0x21000000, "Enable Internal  Speaker"},
1294
  { 0x17000001, 0x17000001, "Keyboard Disable"},
1295
  { 0x17000000, 0x17000000, "Keyboard Enable"},
1296
  { 0x0D000000, 0x0D000064, "Set PC/TV Brightness"},
1297
  { 0x0F000000, 0x0F000064, "Set PC/TV Color"},
1298
  { 0x0E000000, 0x0E000064, "Set PC/TV Contrast"},
1299
  { 0x10000000, 0x10006464, "Set PC/TV Tint"},
1300
  { 0x01010101, 0x1b841b84, "Set PIP Location and Size"}, /* Bytes are RRCCrrcc */
1301
  { 0,  0,      NULL}
1302
};
1303
1304
/* Appendix B.1 WRITE SINGLE STRUCTURED FIELD Command - True Transparency Write Command Major Structure */
1305
static const value_string vals_tn5250_wssf_ttw_flag[] = {
1306
  { 0x00, "Invalid"},
1307
  { 0x01, "ASCII Data"},
1308
  { 0x0000, NULL }
1309
};
1310
1311
1312
/* 15.27.3 WRITE STRUCTURED FIELD (WSF) Command - 5250 QUERY STATION STATE Command*/
1313
static const struct true_false_string tn5250_field_wsf_qss_flag1_0 = {
1314
  "QUERY STATION STATE Command Response",
1315
  "QUERY STATION STATE Command"
1316
};
1317
1318
static const struct true_false_string tn5250_field_wsf_qss_flag2_7 = {
1319
  "Return all customization states",
1320
  "Return Keystroke Buffering Control Minor Structure"
1321
};
1322
1323
/* 15.27.4.1 DEFINE AUDIT WINDOW TABLE Command */
1324
static const range_string vals_tn5250_dawt_id[] = {
1325
  { 0x00, 0x7F, "Indicates if update of primary audit window table is necessary. If this byte matches the ID  of the existing primary audit window table, the  rest of this command is discarded" },
1326
  { 0x80, 0xFE, "Indicates if update of secondary audit window table is necessary. If this byte matches the ID  of the existing secondary audit window table, the rest of this command is discarded" },
1327
  { 0xFF, 0xFF, "Indicates the value of the ID bytes set by the  5494 when the table is built initially. If an ID value of X'FF' is received, both the primary  and secondary tables are initially emptied" },
1328
  { 0,  0,      NULL}
1329
};
1330
1331
static const range_string vals_tn5250_dawt_length[] = {
1332
  { 0x00, 0x01, "Length of Table Entry is Invalid (should between 2 and 22)" },
1333
  { 0x02, 0x16, "Length of Table Entry" },
1334
  { 0x17, 0xFF, "Length of Table Entry is Invalid (should between 2 and 22)" },
1335
  { 0,  0,      NULL}
1336
};
1337
1338
/* 15.27.4.2 DEFINE COMMAND KEY FUNCTION Command */
1339
static const range_string vals_tn5250_dckf_id[] = {
1340
  { 0x00, 0x7F, "Indicates if update of primary command key function table is necessary. If this byte matches the ID  of the existing primary command key function table, the  rest of this command is discarded" },
1341
  { 0x80, 0xFE, "Indicates if update of secondary command key function table is necessary. If this byte matches the ID  of the existing secondary command key function table, the rest of this command is discarded" },
1342
  { 0xFF, 0xFF, "Indicates the value of the ID bytes set by the  5494 when the table is built initially. If an ID value of X'FF' is received, both the primary  and secondary tables are initially emptied" },
1343
  { 0,  0,      NULL}
1344
};
1345
1346
static const range_string vals_tn5250_dckf_length[] = {
1347
  { 0x00, 0x02, "Length of Table Entry is Invalid (should between 3 and 82)" },
1348
  { 0x03, 0x52, "Length of Table Entry" },
1349
  { 0x53, 0xFF, "Length of Table Entry is Invalid (should between 3 and 82)" },
1350
  { 0,  0,      NULL}
1351
};
1352
1353
static const range_string vals_tn5250_dckf_key_code[] = {
1354
  { 0x01, 0x18, "Command key number"},
1355
  { 0xFB, 0xFB, "Symbols Support (Cmd + A) message"},
1356
  { 0xFC, 0xFC, "Formatted text usage"},
1357
  { 0xFD, 0xFD, "Stop code advance key"},
1358
  { 0xFE, 0xFE, "Del key"},
1359
  { 0xFF, 0xFF, "Home key"},
1360
  { 0,  0,      NULL}
1361
};
1362
1363
static const value_string vals_tn5250_dckf_function_code[] = {
1364
  { 0x01,  "Perform general prompt"},
1365
  { 0x02,  "Perform locate"},
1366
  { 0x03,  "Perform copy text"},
1367
  { 0x04,  "Perform move text"},
1368
  { 0x05,  "Perform delete text"},
1369
  { 0x06,  "Perform hyphenate text"},
1370
  { 0x07,  "Display AS/400 system-defined prompt line message"},
1371
  { 0x00, NULL }
1372
};
1373
1374
/* 15.27.4.3 READ TEXT SCREEN Command */
1375
1376
static const range_string vals_tn5250_rts_partition[] = {
1377
  { 0x00, 0x00, "Valid Partition ID" },
1378
  { 0x01, 0xFF, "Invalid Partition ID" },
1379
  { 0,  0,      NULL}
1380
};
1381
1382
static const struct true_false_string tn5250_field_rts_flag1_0 = {
1383
  "The data field is in IBM 5250 line format.The structured field command form is used. Command pending format is used. No pending data is included with the command.",
1384
  "WARNING: Invalid Value"
1385
};
1386
1387
1388
1389
/* 15.27.4.4 DEFINE PENDING OPERATIONS Command */
1390
1391
static const struct true_false_string tn5250_field_dpo_flag1_0 = {
1392
  "Insert mode enabled",
1393
  "Insert mode not enabled"
1394
};
1395
1396
static const struct true_false_string tn5250_field_dpo_flag1_1 = {
1397
  "Locate mode enabled",
1398
  "Locate mode not enabled"
1399
};
1400
1401
static const struct true_false_string tn5250_field_dpo_flag1_2 = {
1402
  "AS/400 system controls text delete",
1403
  "AS/400 system does not control text delete"
1404
};
1405
1406
static const struct true_false_string tn5250_field_dpo_flag1_3 = {
1407
  "5494 responds to the Error Reset key by locking the workstation keyboard and sending an X'4E' AID request to the AS/400 system",
1408
  "5494 does not respond to the Error Reset key by locking the workstation keyboard and sending an X'4E' AID request to the AS/400 system"
1409
};
1410
1411
static const struct true_false_string tn5250_field_dpo_flag1_4 = {
1412
  "5494 must notify the AS/400 system on completion of a copy, move, or delete operation",
1413
  "5494 does not need to notify the AS/400 system on completion of a copy, move, or delete operation"
1414
};
1415
1416
static const struct true_false_string tn5250_field_dpo_flag1_5 = {
1417
  "AS/400 system assisted locate function enabled",
1418
  "AS/400 system assisted locate function not enabled"
1419
};
1420
1421
static const struct true_false_string tn5250_field_dpo_flag1_6 = {
1422
  "Tab function independent of shift status",
1423
  "Tab function not independent of shift status"
1424
};
1425
1426
static const struct true_false_string tn5250_field_dpo_flag1_7 = {
1427
  "Insert mode is reset by Error Reset key",
1428
  "Insert mode is toggled by the Insert key"
1429
};
1430
1431
static const struct true_false_string tn5250_field_dpo_flag2_0 = {
1432
  "Copy, move, or delete is pending",
1433
  "Copy, move, or delete is not pending"
1434
};
1435
1436
1437
/* 15.27.4.5 DEFINE TEXT SCREEN FORMAT Command */
1438
static const struct true_false_string tn5250_field_dtsf_flag1_0 = {
1439
  "Column edit active",
1440
  "Column edit is not active"
1441
};
1442
1443
static const struct true_false_string tn5250_field_dtsf_flag1_1 = {
1444
  "Data exists outside left margin",
1445
  "No data outside left margin"
1446
};
1447
1448
static const struct true_false_string tn5250_field_dtsf_flag1_2 = {
1449
  "Data exists outside right margin",
1450
  "No data outside right margin"
1451
};
1452
1453
static const struct true_false_string tn5250_field_dtsf_flag1_3 = {
1454
  "Cursor-sensitive scrolling active",
1455
  "No cursor-sensitive scrolling active"
1456
};
1457
1458
static const struct true_false_string tn5250_field_dtsf_flag1_4 = {
1459
  "Fake DP mode active",
1460
  "No fake DP mode active"
1461
};
1462
1463
static const struct true_false_string tn5250_field_dtsf_flag1_5 = {
1464
  "Do not clear screen",
1465
  "Clear screen as normal"
1466
};
1467
1468
static const struct true_false_string tn5250_field_dtsf_flag1_6 = {
1469
  "Document orientation is right to left",
1470
  "Document orientation is left to right"
1471
};
1472
1473
static const struct true_false_string tn5250_field_dtsf_flag1_7 = {
1474
  "Host does not have BIDI support.",
1475
  "Host has bi-directional (BIDI) support"
1476
};
1477
1478
1479
static const struct true_false_string tn5250_field_dtsf_flag2_0 = {
1480
  "Data stream from AS/400 system.",
1481
  "Data stream from S/36 system."
1482
};
1483
1484
static const struct true_false_string tn5250_field_dtsf_flag2_1 = {
1485
  "The screen data does have extended attributes.",
1486
  "The screen data in READ and WRITE commands does not have extended attributes."
1487
};
1488
1489
static const struct true_false_string tn5250_field_dtsf_flag2_2 = {
1490
  "WordPerfect/400* edit session",
1491
  "OfficeVision/400* edit session"
1492
};
1493
1494
static const struct true_false_string tn5250_field_dtsf_flag2_3 = {
1495
  "Secondary language tables should be used.",
1496
  "Primary language tables should be used."
1497
};
1498
1499
static const range_string vals_tn5250_dtsf_flag2_vals[] = {
1500
  { 0x0, 0x7, "Reserved"},
1501
  { 0x8, 0x8, "System Version 2 Release 2.0"},
1502
  { 0x9, 0x9, "System Version 2 Release 3.0"},
1503
  { 0xA, 0xA, "System Version 3 Release 0.5"},
1504
  { 0xB, 0xB, "System Version 3 Release 1.0"},
1505
  { 0xC, 0xF, "Reserved"},
1506
  { 0,  0,      NULL}
1507
};
1508
1509
/* 15.27.4.6 DEFINE SCALE LINE Command */
1510
static const struct true_false_string tn5250_field_dsl_flag1_0 = {
1511
  "Suppress display of the right margin symbol",
1512
  "Do not suppress display of the right margin symbol"
1513
};
1514
1515
static const struct true_false_string tn5250_field_dsl_flag1_1 = {
1516
  "Suppress display of the left margin symbol",
1517
  "Do not suppress display of the left margin symbol"
1518
};
1519
1520
static const struct true_false_string tn5250_field_dsl_flag1_2 = {
1521
  "Indicate a tab stop located off the display if the absolute right margin is not defined",
1522
  "Do not indicate a tab stop located off the display if the absolute right margin is not defined"
1523
};
1524
1525
static const range_string vals_tn5250_dsl_function[] = {
1526
  { 0x01,  0x01, "Left margin symbol"},
1527
  { 0x02,  0x02, "Right margin symbol"},
1528
  { 0x03,  0x03, "Left tab symbol"},
1529
  { 0x04,  0x04, "Right tab symbol"},
1530
  { 0x05,  0x05, "Center tab symbol"},
1531
  { 0x06,  0x06, "Decimal align tab symbol"},
1532
  { 0x07,  0x07, "Comma align tab symbol"},
1533
  { 0x08,  0x08, "Colon align tab symbol"},
1534
  { 0x09,  0x09, "Inactive tab stop symbol"},
1535
  { 0x0A,  0x0A, "Center of margins symbol"},
1536
  { 0x0B,  0x0B, "Paper edge symbol"},
1537
  { 0x0C,  0x0C, "Pitch symbol"},
1538
  { 0x0D,  0xFF, "Reserved."},
1539
  { 0,  0,      NULL}
1540
};
1541
1542
1543
/* 15.27.4.7 WRITE TEXT SCREEN Command */
1544
static const struct true_false_string tn5250_field_wts_flag1_0 = {
1545
  "5250 format.",
1546
  "3270 format (not supported on 5494)."
1547
};
1548
1549
static const struct true_false_string tn5250_field_wts_flag1_1 = {
1550
  "First line in body is an odd number of half-spacing units.",
1551
  "First line in body is an even number of half-spacing units."
1552
};
1553
1554
static const struct true_false_string tn5250_field_wts_flag1_2 = {
1555
  "Cursor is on a line of formatted text. The 5494 displays text message defined in the Define Command Key table.",
1556
  "Cursor is not on a line that contains formatted text. No function is performed."
1557
};
1558
1559
static const struct true_false_string tn5250_field_wts_flag1_3 = {
1560
  "Display the primary attribute at the cursor location.",
1561
  "Do not display the primary attribute"
1562
};
1563
1564
static const struct true_false_string tn5250_field_wts_flag2_6 = {
1565
  "Lock keyboard to inhibit data input before any lines are written to screen",
1566
  "Do not lock keyboard to inhibit data input before any lines are written to screen"
1567
};
1568
1569
static const struct true_false_string tn5250_field_wts_flag3_0 = {
1570
  "Reserved",
1571
  "Reserved: should be 0!"
1572
};
1573
1574
static const struct true_false_string tn5250_field_wts_flag3_1 = {
1575
  "Moves cursor to home position after write operation is completed",
1576
  "Does not move cursor to home position after write operation is completed"
1577
};
1578
1579
static const struct true_false_string tn5250_field_wts_flag3_2 = {
1580
  "Resets Cursor Blinking mode after write operation is completed",
1581
  "Does not reset Cursor Blinking mode after write operation is completed"
1582
};
1583
1584
static const struct true_false_string tn5250_field_wts_flag3_3 = {
1585
  "Sets Cursor Blinking mode after write operation is completed",
1586
  "Does not set Cursor Blinking mode after write operation is completed"
1587
};
1588
1589
static const struct true_false_string tn5250_field_wts_flag3_4 = {
1590
  "Resets keyboard locking function after write operation is completed",
1591
  "Does not reset keyboard locking function after write operation is completed"
1592
};
1593
1594
static const struct true_false_string tn5250_field_wts_flag3_5 = {
1595
  "Enables audible alarm after write operation is completed",
1596
  "Does not enable audible alarm after write operation is completed"
1597
};
1598
1599
static const struct true_false_string tn5250_field_wts_flag3_6 = {
1600
  "Resets Message Waiting indicator after write operation is completed",
1601
  "Does not reset Message Waiting indicator after write operation is completed"
1602
};
1603
1604
static const struct true_false_string tn5250_field_wts_flag3_7 = {
1605
  "Sets Message Waiting indicator after write operation is completed",
1606
  "Does not set Message Waiting indicator after write operation is completed"
1607
};
1608
1609
/*  Structure of the WRITE TEXT SCREEN Command Line Data */
1610
static const struct true_false_string tn5250_field_wts_cld_flag1_0 = {
1611
  "Writes nulls to the line before writing data",
1612
  "Does not write nulls to the line before writing data"
1613
};
1614
1615
static const struct true_false_string tn5250_field_wts_cld_flag1_1 = {
1616
  "Inhibits changes to text on this line",
1617
  "Does not inhibit changes to text on this line"
1618
};
1619
1620
static const struct true_false_string tn5250_field_wts_cld_flag1_2 = {
1621
  "Inhibits all input functions on this line",
1622
  "Does not inhibit all input functions on this line"
1623
};
1624
1625
static const struct true_false_string tn5250_field_wts_cld_flag1_3 = {
1626
  "Indicates that this line has been modified by the operator",
1627
  "Indicates that this line has not been modified by the operator"
1628
};
1629
1630
static const struct true_false_string tn5250_field_wts_cld_flag1_4 = {
1631
  "Indicates that the text body has been modified",
1632
  "Indicates that the text body has not been modified"
1633
};
1634
1635
static const struct true_false_string tn5250_field_wts_cld_flag1_5 = {
1636
  "Inhibits the word spill function on this line",
1637
  "Does not inhibit the word spill function on this line"
1638
};
1639
1640
static const struct true_false_string tn5250_field_wts_cld_flag1_6 = {
1641
  "Spills the last word on this line to the next line",
1642
  "Does not spill the last word on this line to the next line"
1643
};
1644
1645
static const struct true_false_string tn5250_field_wts_cld_flag1_7 = {
1646
  "Invalid Use of Reserved Field",
1647
  "Reserved"
1648
};
1649
1650
static const struct true_false_string tn5250_field_wts_cld_flag2_0 = {
1651
  "Indicates that this row contains formatted text",
1652
  "Indicates that this row does not contain formatted text"
1653
};
1654
1655
static const struct true_false_string tn5250_field_wts_cld_flag2_1 = {
1656
  "Indicates that a required tab character exists left of absolute left margin",
1657
  "Indicates that a required tab character does not exist left of absolute left margin"
1658
};
1659
1660
static const struct true_false_string tn5250_field_wts_cld_flag2_2 = {
1661
  "Indicates that a tab character exists left of absolute left margin",
1662
  "Indicates that a tab character does not exist left of absolute left margin"
1663
};
1664
1665
static const struct true_false_string tn5250_field_wts_cld_flag2_3 = {
1666
  "Indicates that a required tab character exists right of absolute right margin",
1667
  "Indicates that a required tab character does not exist right of absolute right margin"
1668
};
1669
1670
static const struct true_false_string tn5250_field_wts_cld_flag2_4 = {
1671
  "Indicates that a tab character exists right of absolute right margin",
1672
  "Indicates that a tab character does not exist right of absolute right margin"
1673
};
1674
1675
static const struct true_false_string tn5250_field_wts_cld_flag3_0 = {
1676
  "Indicates that line orientation is right to left",
1677
  "Indicates that line orientation is not right to left"
1678
};
1679
1680
static const struct true_false_string tn5250_field_wts_cld_flag3_1 = {
1681
  "Indicates that 'begin reverse' exists to the left of left margin",
1682
  "Indicates that 'begin reverse' is not to the left of left margin"
1683
};
1684
1685
static const struct true_false_string tn5250_field_wts_cld_flag3_2 = {
1686
  "Indicates that 'end reverse' exists to the right of right margin",
1687
  "Indicates that 'end reverse' is not to the right of right margin"
1688
};
1689
1690
static const struct true_false_string tn5250_field_wts_cld_flag3_3 = {
1691
  "Invalid Use of Reserved Field",
1692
  "Reserved"
1693
};
1694
1695
static const struct true_false_string tn5250_field_wts_cld_flag3_4 = {
1696
  "Indicates that a primary attribute exists on the line",
1697
  "Indicates that a primary attribute does not exist on the line"
1698
};
1699
1700
static const struct true_false_string tn5250_field_wts_cld_flag3_5 = {
1701
  "Indicates that an end attribute exists one position to the right of right margin",
1702
  "Indicates that an end attribute does not exist one position to the right of right margin"
1703
};
1704
1705
static const struct true_false_string tn5250_field_wts_cld_flag3_6 = {
1706
  "Indicates that one or more word underscore control characters (X'1D') exist on the line",
1707
  "Indicates that one or more word underscore control characters (X'1D') do not exist on the line"
1708
};
1709
1710
static const struct true_false_string tn5250_field_wts_cld_flag3_7 = {
1711
  "Indicates that one or more half index up or half index down text attributes exist on the line",
1712
  "Indicates that one or more half index up or half index down text attributes do not exist on the line"
1713
};
1714
1715
/* 15.27.4.10 DEFINE OPERATOR ERROR MESSAGES Command */
1716
1717
static const range_string vals_tn5250_dorm_id[] = {
1718
  { 0x00,  0x7F, "Indicates update of primary operator error message table is necessary."},
1719
  { 0x80,  0xFE, "Indicates update of secondary operator error message table is necessary."},
1720
  { 0xFF,  0xFF, "Indicates the value of the ID bytes set by the 5494 when the table is built initially."},
1721
  { 0,  0,      NULL}
1722
};
1723
1724
static const range_string vals_tn5250_dorm_length[] = {
1725
  { 0x00, 0x02, "Length of Table Entry is Invalid (should between 3 and 82)" },
1726
  { 0x03, 0x53, "Length of Table Entry" },
1727
  { 0x54, 0xFF, "Length of Table Entry is Invalid (should between 3 and 82)" },
1728
  { 0,  0,      NULL}
1729
};
1730
1731
/* 15.27.4.11 DEFINE PITCH TABLE Command */
1732
1733
static const range_string vals_tn5250_dpt_id[] = {
1734
  { 0x00,  0x7F, "Indicates update of primary pitch table is necessary."},
1735
  { 0x80,  0xFE, "Indicates update of secondary pitch table is necessary."},
1736
  { 0xFF,  0xFF, "Indicates the value of the ID bytes set by the 5494 when the table is built initially."},
1737
  { 0,  0,      NULL}
1738
};
1739
1740
/* 15.27.4.12 DEFINE FAKE DP COMMAND KEY FUNCTION Command */
1741
0
#define TOP_ROW_COMMAND_KEYS    0x40
1742
0
#define CORE_AREA_COMMAND_KEYS  0x80
1743
1744
static const range_string vals_tn5250_dfdpck_data_field[] = {
1745
  { 0x00,  0x3f, "Invalid Data Field Type"},
1746
  { 0x40,  0x40, "Top Row Command Key Functions"},
1747
  { 0x41,  0x79, "Invalid Data Field Type"},
1748
  { 0x80,  0x80, "Core Area Key Command Functions"},
1749
  { 0x81,  0xFF, "Invalid Data Field Type"},
1750
  { 0,  0,      NULL}
1751
};
1752
1753
/* Structure of the DEFINE FAKE DP COMMAND KEY FUNCTION Core Area Command Keys */
1754
1755
static const struct true_false_string tn5250_field_dfdpck_coreflag_0 = {
1756
  "Typing Cmd u (begin underscore) causes the operator error '77'.",
1757
  ""
1758
};
1759
1760
static const struct true_false_string tn5250_field_dfdpck_coreflag_1 = {
1761
  "Typing Cmd j (end attribute) causes the operator error '77'.",
1762
  ""
1763
};
1764
1765
static const struct true_false_string tn5250_field_dfdpck_coreflag_2 = {
1766
  "Typing Cmd b (begin bold) causes the operator error '77'.",
1767
  ""
1768
};
1769
1770
static const struct true_false_string tn5250_field_dfdpck_coreflag_3 = {
1771
  "Typing Cmd w (word underscore) causes the operator error '77'.",
1772
  ""
1773
};
1774
1775
static const struct true_false_string tn5250_field_dfdpck_coreflag_4 = {
1776
  "Typing Cmd y (half-index-up) causes the operator error '77'.",
1777
  ""
1778
};
1779
1780
static const struct true_false_string tn5250_field_dfdpck_coreflag_5 = {
1781
  "Typing Cmd h (half-index-down) causes the operator error '77'.",
1782
  ""
1783
};
1784
1785
static const struct true_false_string tn5250_field_dfdpck_coreflag_6 = {
1786
  "Typing Cmd s (stop code) causes the operator error '77'.",
1787
  ""
1788
};
1789
1790
static const struct true_false_string tn5250_field_dfdpck_coreflag_7 = {
1791
  "Typing Cmd space (requiredspace) causes the operator error '77'.",
1792
  ""
1793
};
1794
1795
/* Structure of the DEFINE FAKE DP COMMAND KEY FUNCTION Top Row Command Keys */
1796
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_0 = {
1797
  "Typing PFA1 causes the operator error '77'.",
1798
  ""
1799
};
1800
1801
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_1 = {
1802
  "Typing PFA2 causes the operator error '77'.",
1803
  ""
1804
};
1805
1806
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_2 = {
1807
  "Typing PFA3 causes the operator error '77'.",
1808
  ""
1809
};
1810
1811
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_3 = {
1812
  "Typing PFA4 causes the operator error '77'.",
1813
  ""
1814
};
1815
1816
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_4 = {
1817
  "Typing PFA5 causes the operator error '77'.",
1818
  ""
1819
};
1820
1821
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_5 = {
1822
  "Typing PFA6 causes the operator error '77'.",
1823
  ""
1824
};
1825
1826
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_6 = {
1827
  "Typing PFA7 causes the operator error '77'.",
1828
  ""
1829
};
1830
1831
static const struct true_false_string tn5250_field_dfdpck_toprowflag1_7 = {
1832
  "Typing PFA8 causes the operator error '77'.",
1833
  ""
1834
};
1835
1836
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_0 = {
1837
  "Typing PFA9 causes the operator error '77'.",
1838
  ""
1839
};
1840
1841
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_1 = {
1842
  "Typing PFA10 causes the operator error '77'.",
1843
  ""
1844
};
1845
1846
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_2 = {
1847
  "Typing PFA11 causes the operator error '77'.",
1848
  ""
1849
};
1850
1851
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_3 = {
1852
  "Typing PFA12 causes the operator error '77'.",
1853
  ""
1854
};
1855
1856
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_4 = {
1857
  "Typing PFA13 causes the operator error '77'.",
1858
  ""
1859
};
1860
1861
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_5 = {
1862
  "Typing PFA14 causes the operator error '77'.",
1863
  ""
1864
};
1865
1866
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_6 = {
1867
  "Typing PFA15 causes the operator error '77'.",
1868
  ""
1869
};
1870
1871
static const struct true_false_string tn5250_field_dfdpck_toprowflag2_7 = {
1872
  "Typing PFA16 causes the operator error '77'.",
1873
  ""
1874
};
1875
1876
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_0 = {
1877
  "Typing PFA17 causes the operator error '77'.",
1878
  ""
1879
};
1880
1881
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_1 = {
1882
  "Typing PFA18 causes the operator error '77'.",
1883
  ""
1884
};
1885
1886
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_2 = {
1887
  "Typing PFA19 causes the operator error '77'.",
1888
  ""
1889
};
1890
1891
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_3 = {
1892
  "Typing PFA20 causes the operator error '77'.",
1893
  ""
1894
};
1895
1896
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_4 = {
1897
  "Typing PFA21 causes the operator error '77'.",
1898
  ""
1899
};
1900
1901
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_5 = {
1902
  "Typing PFA22 causes the operator error '77'.",
1903
  ""
1904
};
1905
1906
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_6 = {
1907
  "Typing PFA23 causes the operator error '77'.",
1908
  ""
1909
};
1910
1911
static const struct true_false_string tn5250_field_dfdpck_toprowflag3_7 = {
1912
  "Typing PFA24 causes the operator error '77'.",
1913
  ""
1914
};
1915
1916
/* 16.2.1 - AID Codes */
1917
0
#define AID_CLEAR                                  0xBD
1918
0
#define AID_ENTER_OR_RECORD_ADV                    0xF1
1919
0
#define AID_HELP                                   0xF3
1920
0
#define AID_ROLL_DOWN                              0xF4
1921
0
#define AID_ROLL_UP                                0xF5
1922
0
#define AID_ROLL_LEFT                              0xD9
1923
0
#define AID_ROLL_RIGHT                             0xDA
1924
0
#define AID_PRINT                                  0xF6
1925
0
#define AID_RECORD_BACKSPACE                       0xF8
1926
0
#define AID_SLP_AUTO_ENTER                         0x3F
1927
0
#define AID_FORWARD_EDGE_TRIGGER_AUTO__ENTER       0x50
1928
0
#define AID_PA1                                    0x6C
1929
0
#define AID_PA2                                    0x6E
1930
0
#define AID_PA3                                    0x6B
1931
0
#define AID_CMD_01                                 0x31
1932
0
#define AID_CMD_02                                 0x32
1933
0
#define AID_CMD_03                                 0x33
1934
0
#define AID_CMD_04                                 0x34
1935
0
#define AID_CMD_05                                 0x35
1936
0
#define AID_CMD_06                                 0x36
1937
0
#define AID_CMD_07                                 0x37
1938
0
#define AID_CMD_08                                 0x38
1939
0
#define AID_CMD_09                                 0x39
1940
0
#define AID_CMD_10                                 0x3A
1941
0
#define AID_CMD_11                                 0x3B
1942
0
#define AID_CMD_12                                 0x3C
1943
0
#define AID_CMD_13                                 0xB1
1944
0
#define AID_CMD_14                                 0xB2
1945
0
#define AID_CMD_15                                 0xB3
1946
0
#define AID_CMD_16                                 0xB4
1947
0
#define AID_CMD_17                                 0xB5
1948
0
#define AID_CMD_18                                 0xB6
1949
0
#define AID_CMD_19                                 0xB7
1950
0
#define AID_CMD_20                                 0xB8
1951
0
#define AID_CMD_21                                 0xB9
1952
0
#define AID_CMD_22                                 0xBA
1953
0
#define AID_CMD_23                                 0xBB
1954
0
#define AID_CMD_24                                 0xBC
1955
0
#define AID_INBOUND_WRITE_STRUCTURED_FIELD         0x88
1956
0
#define AID_PASS_THROUGH_RESPONSE                  0xFF
1957
0
#define AID_IMAGE_FAX_REQUEST                      0x81
1958
0
#define AID_UNKNOWN_IMAGE_FAX_FORMAT               0x82
1959
0
#define AID_IMAGE_FAX_ERROR                        0x83
1960
1961
static const range_string vals_tn5250_attention_identification_bytes[] = {
1962
  { AID_CLEAR                            ,  AID_CLEAR                            , "Clear"},
1963
  { AID_ENTER_OR_RECORD_ADV              ,  AID_ENTER_OR_RECORD_ADV              , "Enter or Record Adv"},
1964
  { AID_HELP                             ,  AID_HELP                             , "Help"},
1965
  { AID_ROLL_DOWN                        ,  AID_ROLL_DOWN                        , "Roll Down"},
1966
  { AID_ROLL_UP                          ,  AID_ROLL_UP                          , "Roll Up"},
1967
  { AID_ROLL_LEFT                        ,  AID_ROLL_LEFT                        , "Roll Left"},
1968
  { AID_ROLL_RIGHT                       ,  AID_ROLL_RIGHT                       , "Roll Right"},
1969
  { AID_PRINT                            ,  AID_PRINT                            , "Print"},
1970
  { AID_RECORD_BACKSPACE                 ,  AID_RECORD_BACKSPACE                 , "Record Backspace"},
1971
  { AID_SLP_AUTO_ENTER                   ,  AID_SLP_AUTO_ENTER                   , "SLP Auto Enter"},
1972
  { AID_FORWARD_EDGE_TRIGGER_AUTO__ENTER ,  AID_FORWARD_EDGE_TRIGGER_AUTO__ENTER , "Forward Edge Trigger Auto  Enter"},
1973
  { AID_PA1                              ,  AID_PA1                              , "PA1"},
1974
  { AID_PA2                              ,  AID_PA2                              , "PA2"},
1975
  { AID_PA3                              ,  AID_PA3                              , "PA3"},
1976
  { AID_CMD_01                           ,  AID_CMD_01                           , "Cmd 01"},
1977
  { AID_CMD_02                           ,  AID_CMD_02                           , "Cmd 02"},
1978
  { AID_CMD_03                           ,  AID_CMD_03                           , "Cmd 03"},
1979
  { AID_CMD_04                           ,  AID_CMD_04                           , "Cmd 04"},
1980
  { AID_CMD_05                           ,  AID_CMD_05                           , "Cmd 05"},
1981
  { AID_CMD_06                           ,  AID_CMD_06                           , "Cmd 06"},
1982
  { AID_CMD_07                           ,  AID_CMD_07                           , "Cmd 07"},
1983
  { AID_CMD_08                           ,  AID_CMD_08                           , "Cmd 08"},
1984
  { AID_CMD_09                           ,  AID_CMD_09                           , "Cmd 09"},
1985
  { AID_CMD_10                           ,  AID_CMD_10                           , "Cmd 10"},
1986
  { AID_CMD_11                           ,  AID_CMD_11                           , "Cmd 11"},
1987
  { AID_CMD_12                           ,  AID_CMD_12                           , "Cmd 12"},
1988
  { AID_CMD_13                           ,  AID_CMD_13                           , "Cmd 13"},
1989
  { AID_CMD_14                           ,  AID_CMD_14                           , "Cmd 14"},
1990
  { AID_CMD_15                           ,  AID_CMD_15                           , "Cmd 15"},
1991
  { AID_CMD_16                           ,  AID_CMD_16                           , "Cmd 16"},
1992
  { AID_CMD_17                           ,  AID_CMD_17                           , "Cmd 17"},
1993
  { AID_CMD_18                           ,  AID_CMD_18                           , "Cmd 18"},
1994
  { AID_CMD_19                           ,  AID_CMD_19                           , "Cmd 19"},
1995
  { AID_CMD_20                           ,  AID_CMD_20                           , "Cmd 20"},
1996
  { AID_CMD_21                           ,  AID_CMD_21                           , "Cmd 21"},
1997
  { AID_CMD_22                           ,  AID_CMD_22                           , "Cmd 22"},
1998
  { AID_CMD_23                           ,  AID_CMD_23                           , "Cmd 23"},
1999
  { AID_CMD_24                           ,  AID_CMD_24                           , "Cmd 24"},
2000
  { 0x70                                 ,  0x7F                                 , "Application Use"},
2001
  { AID_INBOUND_WRITE_STRUCTURED_FIELD   ,  AID_INBOUND_WRITE_STRUCTURED_FIELD   , "AID Inbound Write Structured Field"},
2002
  { AID_IMAGE_FAX_REQUEST                ,  AID_IMAGE_FAX_REQUEST                , "Image/Fax Request Aid"},
2003
  { AID_UNKNOWN_IMAGE_FAX_FORMAT         ,  AID_UNKNOWN_IMAGE_FAX_FORMAT         , "Unknown Image/Fax Format Aid"},
2004
  { AID_IMAGE_FAX_ERROR                  ,  AID_IMAGE_FAX_ERROR                  , "Image/Fax Error Reporting Aid"},
2005
  { 0x00,  0x00,      NULL}
2006
};
2007
2008
2009
/*TN5250 - RFC1205 - Query Reply Fields */
2010
static const struct true_false_string tn5250_field_qr_flag_0 = {
2011
  "Query Reply",
2012
  ""
2013
};
2014
2015
static const value_string vals_tn5250_chc[] = {
2016
  { 0x0001,  "Local Twinax Controller"},
2017
  { 0x0061,  "Local ASCII Controller"},
2018
  { 0x0101,  "SDLC/X.21/X.25 Twinax Controller (5394 emulating a 5294)"},
2019
  { 0x0103,  "SDLC/X.21/X.25 Twinax Controller (5394)"},
2020
  { 0x0200,  "PC DOS non-DBCS WSF"},
2021
  { 0x0300,  "OS/2 non-DBCS WSF"},
2022
  { 0x0400,  "PC DOS DBCS WSF"},
2023
  { 0x0500,  "OS/2 DBCS WSF"},
2024
  { 0x0600,  "Other WSF or any other 5250 Emulator"},
2025
  { 0x00, NULL }
2026
};
2027
2028
static const value_string vals_tn5250_dt[] = {
2029
  { 0x01,  "5250 Display or 5250 Emulation"},
2030
  { 0x02,  "Printer"},
2031
  { 0x00, NULL }
2032
};
2033
2034
static const value_string vals_tn5250_qr_ki[] = {
2035
  { 0x02,  "Standard Keyboard"},
2036
  { 0x82,  "G Keyboard"},
2037
  { 0x00, NULL }
2038
};
2039
2040
static const struct true_false_string tn5250_field_qr_flag1_1 = {
2041
  "Row 1/Col 1 support",
2042
  "No Row 1/Col 1 support"
2043
};
2044
2045
static const struct true_false_string tn5250_field_qr_flag1_2 = {
2046
  "Read MDT Alternate Command support",
2047
  "No Read MDT Alternate Command support"
2048
};
2049
2050
static const struct true_false_string tn5250_field_qr_flag1_3 = {
2051
  "Display does have PA1/PA2 support",
2052
  "Display does not have PA1/PA2 support"
2053
};
2054
2055
static const struct true_false_string tn5250_field_qr_flag1_4 = {
2056
  "Display does have PA3 support",
2057
  "Display does not have PA3 support"
2058
};
2059
2060
static const struct true_false_string tn5250_field_qr_flag1_5 = {
2061
  "Display does have Cursor Select support",
2062
  "Display does not have Cursor Select support"
2063
};
2064
2065
static const struct true_false_string tn5250_field_qr_flag1_6 = {
2066
  "Display does have Move Cursor Order support",
2067
  "Display does not have Move Cursor Order support"
2068
};
2069
2070
static const struct true_false_string tn5250_field_qr_flag1_7 = {
2071
  "Read MDT Immediate Alt Command support",
2072
  "No Read MDT Immediate Alt Command support"
2073
};
2074
2075
static const value_string vals_tn5250_qr_flag2_0to3[] = {
2076
  { 0x1,  "24 x 80 Screen Size"},
2077
  { 0x3,  "Capable of 24 x 80 and 27 x 132"},
2078
  { 0, NULL }
2079
};
2080
2081
static const struct true_false_string tn5250_field_qr_flag2_4 = {
2082
  "Light pen support",
2083
  "No Light pen support"
2084
};
2085
2086
static const struct true_false_string tn5250_field_qr_flag2_5 = {
2087
  "Mag Stripe Reader support",
2088
  "No Mag Stripe Reader support"
2089
};
2090
2091
static const value_string vals_tn5250_qr_flag2_6to7[] = {
2092
  { 0x00,  "Mono display"},
2093
  { 0x01,  "5292/3179 style color, including color PCs"},
2094
  { 0x00, NULL }
2095
};
2096
2097
static const value_string vals_tn5250_qr_flag3[] = {
2098
  { 0x00,  "No Double Byte Character Set (DBCS) capability"},
2099
  { 0x20,  "Presentation screen DBCS capability only"},
2100
  { 0x00, NULL }
2101
};
2102
2103
static const value_string vals_tn5250_qr_flag4[] = {
2104
  { 0x00,  "No graphics capability"},
2105
  { 0x20,  "5292-2 style graphics"},
2106
  { 0x00, NULL }
2107
};
2108
2109
2110
#if 0
2111
/* TN5250 Header - Data Type */
2112
#define TN5250_5250_DATA        0x00
2113
#define TN5250_BIND_IMAGE       0x03
2114
#define TN5250_NVT_DATA         0x05
2115
#define TN5250_REQUEST          0x06
2116
#define TN5250_RESPONSE         0x02
2117
#define TN5250_SCS_DATA         0x01
2118
#define TN5250_SSCP_LU_DATA     0x07
2119
#define TN5250_UNBIND           0x04
2120
2121
static const value_string vals_tn5250_header_data_types[] = {
2122
  { TN5250_5250_DATA   ,  "5250_DATA"},
2123
  { TN5250_BIND_IMAGE  ,  "BIND_IMAGE"},
2124
  { TN5250_NVT_DATA    ,  "NVT_DATA"},
2125
  { TN5250_REQUEST     ,  "REQUEST"},
2126
  { TN5250_RESPONSE    ,  "RESPONSE"},
2127
  { TN5250_SCS_DATA    ,  "SCS_DATA"},
2128
  { TN5250_SSCP_LU_DATA,  "SSCP_LU_DATA"},
2129
  { TN5250_UNBIND      ,  "UNBIND"},
2130
  { 0x00, NULL }
2131
};
2132
#endif
2133
2134
/* TN5250 Header - Record Type */
2135
#define GDS        0x12A0
2136
2137
static const value_string vals_tn5250_sna_record_type[] = {
2138
  { GDS   ,  "General Data Stream"},
2139
  { 0x00, NULL }
2140
};
2141
2142
/* TN5250 Header - Operation Code */
2143
#define NO_OPERATION                        0x00
2144
#define INVITE_OPERATION                    0x01
2145
#define OUTPUT_ONLY                         0x02
2146
#define PUT_GET_OPERATION                   0x03
2147
#define SAVE_SCREEN_OPERATION               0x04
2148
#define RESTORE_SCREEN_OPERATION            0x05
2149
#define READ_IMMEDIATE_OPERATION            0x06
2150
#define RESERVED1                           0x07
2151
#define READ_SCREEN_OPERATION               0x08
2152
#define RESERVED2                           0x09
2153
#define CANCEL_INVITE_OPERATION             0x0A
2154
#define TURN_ON_MESSAGE_LIGHT               0x0B
2155
#define TURN_OFF_MESSAGE_LIGHT              0x0C
2156
2157
static const value_string vals_tn5250_header_operation_code[] = {
2158
  { NO_OPERATION            ,  "No Operation"},
2159
  { INVITE_OPERATION        ,  "Invite Operation"},
2160
  { OUTPUT_ONLY             ,  "Output Only"},
2161
  { PUT_GET_OPERATION       ,  "Put or Get Operation"},
2162
  { SAVE_SCREEN_OPERATION   ,  "Save Screen Operation"},
2163
  { RESTORE_SCREEN_OPERATION,  "Restore Screen Operation"},
2164
  { READ_IMMEDIATE_OPERATION,  "Read Immediate Operation"},
2165
  { RESERVED1               ,  "Reserved"},
2166
  { READ_SCREEN_OPERATION   ,  "Read Screen Operation"},
2167
  { RESERVED2               ,  "Reserved"},
2168
  { CANCEL_INVITE_OPERATION ,  "Cancel Invite Operation"},
2169
  { TURN_ON_MESSAGE_LIGHT   ,  "Turn On Message Light"},
2170
  { TURN_OFF_MESSAGE_LIGHT  ,  "Turn Off Message Light"},
2171
  { 0x00, NULL }
2172
};
2173
2174
#if 0
2175
/* TN5250 Header _ Response Flags - Data Type Response */
2176
#define TN5250_POSITIVE_RESPONSE   0x00
2177
#define TN5250_NEGATIVE_RESPONSE   0x01
2178
2179
static const value_string vals_tn5250_header_response_flags_response[] = {
2180
  { TN5250_POSITIVE_RESPONSE,  "POSITIVE-RESPONSE"},
2181
  { TN5250_NEGATIVE_RESPONSE,  "NEGATIVE-RESPONSE"},
2182
  { 0x00, NULL }
2183
};
2184
#endif
2185
2186
2187
static const value_string vals_tn5250_header_error_codes[] = {
2188
  { 0x0000,  "Help key not allowed."},
2189
  { 0x0001,  "Keyboard overrun."},
2190
  { 0x0002,  "Incorrect scan code."},
2191
  { 0x0003,  "Command or PF key not valid."},
2192
  { 0x0004,  "Data not allowed in this field."},
2193
  { 0x0005,  "Cursor in protected area of display."},
2194
  { 0x0006,  "Key following Sys Req Key is not valid."},
2195
  { 0x0007,  "Mandatory entry field; you must enter data."},
2196
  { 0x0008,  "This field must have alphabetic characters."},
2197
  { 0x0009,  "This field must have numeric characters."},
2198
  { 0x0010,  "Only characters 0 through 9 allowed."},
2199
  { 0x0011,  "You tried to enter data into the last position of a signed numeric field."},
2200
  { 0x0012,  "Insert mode; no room to insert data."},
2201
  { 0x0013,  "Insert mode; only data keys permitted."},
2202
  { 0x0014,  "Must fill field to exit."},
2203
  { 0x0015,  "Modulo 10 or 11 check digit error. You entered data into a self-check field, and the number you entered and the check digit do not compare."},
2204
  { 0x0016,  "Field- not valid in this field."},
2205
  { 0x0017,  "Mandatory-fill field; key pressed is not valid."},
2206
  { 0x0018,  "Key used to exit this field not valid."},
2207
  { 0x0019,  "Dup or Field Mark not permitted in this field."},
2208
  { 0x0020,  "Function key not valid for right-adjust field."},
2209
  { 0x0021,  "Must enter data in mandatory entry field."},
2210
  { 0x0022,  "An AS/400 system error occurred. The status of the current field is not known. This error can occur during an insert or delete operation."},
2211
  { 0x0023,  "Hexadecimal mode; entry not valid."},
2212
  { 0x0024,  "Decimal field; entry not valid."},
2213
  { 0x0026,  "Field- entry not allowed."},
2214
  { 0x0027,  "Cannot use undefined key."},
2215
  { 0x0029,  "Diacritic character not valid."},
2216
  { 0x0031,  "Data buffer overflow."},
2217
  { 0x0032,  "MSR error."},
2218
  { 0x0033,  "MSR data not authorized."},
2219
  { 0x0034,  "Magnetic stripe reader (MSR) data exceeds length of field."},
2220
  { 0x0035,  "MSR error."},
2221
  { 0x0036,  "Cursor select not allowed in field exit required state."},
2222
  { 0x0037,  "You pressed Cursor Select in a non-selectable field."},
2223
  { 0x0038,  "Light pen and magnetic stripe reader (MSR) not allowed."},
2224
  { 0x0040,  "The modem or data circuit-terminating equipment (DCE) is not ready for one of the following reasons:"},
2225
  { 0x0041,  "X.25: Idle condition has been detected. The receive line was idle for 15 or more contiguous bit-times."},
2226
  { 0x0042,  "The receive clock signal is not being received from the modem or data circuit-terminating equipment (DCE)."},
2227
  { 0x0043,  "The 5494 attempted to disconnect from the line, but the data set ready (DSR) signal was not deactivated by the modem or DCE."},
2228
  { 0x0044,  "Switched lines: This error indicates that no valid data has been received for 30 seconds. The 5494 disconnected the line."},
2229
  { 0x0045,  "X.25: The data circuit-terminating equipment (DCE) will not activate. Either a Disconnect mode (DM) or a Disconnect (DISC) command was received during the link setup sequence."},
2230
  { 0x0046,  "X.25 or LAN: Frame reject received. The 5494 received a frame reject (FRMR) from the network, indicating that an error was detected in the last frame transmitted."},
2231
  { 0x0047,  "X.25 or LAN: An unexpected Disconnect mode (DM) or a Disconnect (DISC) command was received while in information transfer state."},
2232
  { 0x0048,  "X.25: An unexpected unnumbered acknowledgment (UA) frame was received."},
2233
  { 0x0049,  "LAN: A set asynchronous balance mode extended (SABME) was received while the 5494 was in information transfer state."},
2234
  { 0x0050,  "Error in ready-for-sending (RFS) signal, also known as the clear-to-send (CTS) signal, received from the modem or data circuit-terminating equipment (DCE). This error is posted when one of the following has occurred:"},
2235
  { 0x0051,  "The transmit clock from the modem or data circuit-terminating equipment (DCE) failed during a transmit operation."},
2236
  { 0x0052,  "The link adapter hardware failed to complete a transmit operation within 30 seconds, but no transmit clock or other modem or data circuit-terminating equipment (DCE) signal failure was detected."},
2237
  { 0x0053,  "X.25: The retry count has expired. No acknowledgment of a transmission was received within the allowed timeout. Timeout retry count (N2) and retry interval (T1) are specified in the 5494 configuration."},
2238
  { 0x0054,  "Frame reject (FRMR) sent. The 5494 sent a link-level FRMR response to the AS/400 system after receiving a data link control (DLC) or link access protocol balanced (LAPB) command that is not valid. Sense bytes S1, S2, and S3 preserve the contents of the FRMR I-field."},
2239
  { 0x0055,  "The 5494 ran a cable wrap test and determined that the communication cable is not attached to the 5494."},
2240
  { 0x0056,  "The link between the AS/400 system and the 5494 was lost. A bridge failure occurred, the AS/400 system has varied off line, or a node in an SNA Subarea network has failed."},
2241
  { 0x0060,  "Ideographic support SRC: You attempted to enter alphanumeric data into a field that accepts only double-byte data characters."},
2242
  { 0x0061,  "Ideographic support SRC: You attempted to enter a double-byte character into a field that accepts only alphanumeric data."},
2243
  { 0x0062,  "You attempted to change the data type, but the cursor is not in an open field or in the first position of an ideographic either field."},
2244
  { 0x0063,  "You entered an ideographic character that is not valid while operating in Alternate Entry mode."},
2245
  { 0x0064,  "You pressed a key that is not valid for the current keyboard mode."},
2246
  { 0x0065,  "The cursor is positioned in a column reserved for shift-out or shift-in characters."},
2247
  { 0x0066,  "Repeat key not valid. The cursor is positioned under a shift character or attribute character, or at the first valid entry character position of an input field. Only data characters can be repeated at these positions."},
2248
  { 0x0067,  "The workstation extension character RAM is full. Any additional extension characters display as special default characters."},
2249
  { 0x0068,  "The output data stream to the 5494 is not valid for extension characters. Any additional extension characters display as special default characters."},
2250
  { 0x0069,  "Ideographic support SRC: The output data stream to the 5494 contains extension characters that are not valid or are undefined. Any additional extension characters display as special default characters."},
2251
  { 0x0070,  "An error occurred during the word spill function or the carriage return function."},
2252
  { 0x0071,  "You attempted a start copy, move, or delete text operation while one of the previous operations was already in progress."},
2253
  { 0x0072,  "The key pressed is not valid when the cursor is in the current position."},
2254
  { 0x0073,  "An attempt was made to delete or replace an instruction or format change when the general prompt function was not active."},
2255
  { 0x0074,  "A key was pressed that is not valid when using the general prompt function."},
2256
  { 0x0075,  "The find function failed to find the keyed characters."},
2257
  { 0x0076,  "The insert function failed because the AS/400 system has not processed the text on the screen."},
2258
  { 0x0077,  "You either pressed a function key that is not valid at this time or tried to use a 5250 keyboard function while in word-processing mode."},
2259
  { 0x0078,  "The required scale line is not defined for your workstation. There is an error in the application program."},
2260
  { 0x0081,  "Too many workstations are attached to the 5494. The 5494 with LAN adapter installed allows a maximum of 80 devices."},
2261
  { 0x0082,  "Keyboard function is not valid within a selection field. These invalid functions include Dup, Erase EOF, and Field Mark."},
2262
  { 0x0083,  "A selection character is not valid. The numeric or mnemonic character you entered is not associated with any of the choices defined within the current selection field."},
2263
  { 0x0084,  "An attempt has been made to select an unavailable selection field."},
2264
  { 0x0087,  "X.25: A flow control entry error has occurred. The 5494 configuration settings for Flow Control Negotiation and Manual Options Allowed are not compatible. If the configuration setting for Flow Control Negotiation is permitted, then Manual Options must be allowed."},
2265
  { 0x0089,  "One or more fields required for the operation of the 5494 are blank. When you press Enter, the 5494 checks for blank fields and moves the cursor to the first blank."},
2266
  { 0x008A,  "One or more fields contain an embedded blank. When you press Enter, the 5494 checks for embedded blanks and moves the cursor to the first embedded blank."},
2267
  { 0x008B,  "Too many different keyboard codes have been used. A maximum of 4 different keyboard codes can be selected (the master country and 3 others)."},
2268
  { 0x008D,  "Printer port and station values are not valid. Valid ports for the Twinaxial Expansion Kit are 4-7. Valid stations are 0-7."},
2269
  { 0x008E,  "One or more fields contain an insufficient number of characters. The cursor is positioned in the field that contains an insufficient number of characters."},
2270
  { 0x008F,  "One or more fields contain a value that is outside the valid range. The cursor is placed under the first character of the field with a value that is out of range."},
2271
  { 0x0091,  "Reverse and Close keys are not supported in a Word Wrap entry field."},
2272
  { 0x0092,  "The reverse key is not supported on a display which is configured for shared addressing."},
2273
  { 0x0097,  "A test request function is not supported by the AS/400 system."},
2274
  { 0x0098,  "Undefined hardware error."},
2275
  { 0x0099,  "A key requiring AS/400 system action was pressed, but one of the following has occurred:"},
2276
  { 0x009A,  "An invalid password has been entered three times in an attempt to access concurrent diagnostics from a PWS."},
2277
  { 0x0170,  "A problem with an attached workstation has been detected. The workstation failed to detect the end of a printer definition table (PDT). Sense data is 00."},
2278
  { 0x0172,  "A problem with an attached workstation has been detected. The workstation detected invalid data in a printer definition table (PDT) sent to it from the AS/400 system. The sense data is 00ccxxyyyyyyyy, where cc is the command code of the definition containing invalid data, xx, is the offset from the command to invalid data in bytes, and yyyyyyyy is additional error data."},
2279
  { 0x0173,  "A problem with an attached workstation has been detected. The workstation received a printer definition table (PDT) that was larger than its maximum size. Sense data is 00xxxxyyyy, where xxxx is the workstation's maximum PDT size, and yyyy was the size of the PDT sent to the display by the AS/400 system."},
2280
  { 0x0176,  "A problem with an attached workstation has been detected. The workstation received a microcode correction file from the AS/400 system that was in error. The sense data defines the error as follows:"},
2281
  { 0x0177,  "A problem with an attached workstation has been detected. The workstation received a font file from the AS/400 system that was in error. Sense data defines the error as follows:"},
2282
  { 0x0000, NULL }
2283
};
2284
2285
static const range_string vals_tn5250_reserved[] = {
2286
  { 0x00,  0x00, "Reserved"},
2287
  { 0x01,  0xFE, "Invalid Use of Reserved Field"},
2288
  { 0,  0,      NULL}
2289
};
2290
2291
2292
static int proto_tn5250;
2293
static int hf_tn5250_aid;
2294
static int hf_tn5250_attn_key;
2295
static int hf_tn5250_attribute_type;
2296
static int hf_tn5250_buffer_x;
2297
static int hf_tn5250_buffer_y;
2298
static int hf_tn5250_command_code;
2299
static int hf_tn5250_ctp_lsid;
2300
static int hf_tn5250_ctp_mlpp;
2301
static int hf_tn5250_cua_parm;
2302
static int hf_tn5250_dawt_char;
2303
static int hf_tn5250_dawt_id;
2304
static int hf_tn5250_dawt_length;
2305
static int hf_tn5250_dawt_message;
2306
static int hf_tn5250_dckf_function_code;
2307
static int hf_tn5250_dckf_id;
2308
static int hf_tn5250_dckf_key_code;
2309
static int hf_tn5250_dckf_length;
2310
static int hf_tn5250_dckf_prompt_text;
2311
static int hf_tn5250_dfdpck_coreflag;
2312
static int hf_tn5250_dfdpck_coreflag_0;
2313
static int hf_tn5250_dfdpck_coreflag_1;
2314
static int hf_tn5250_dfdpck_coreflag_2;
2315
static int hf_tn5250_dfdpck_coreflag_3;
2316
static int hf_tn5250_dfdpck_coreflag_4;
2317
static int hf_tn5250_dfdpck_coreflag_5;
2318
static int hf_tn5250_dfdpck_coreflag_6;
2319
static int hf_tn5250_dfdpck_coreflag_7;
2320
static int hf_tn5250_dfdpck_data_field;
2321
static int hf_tn5250_dfdpck_partition;
2322
static int hf_tn5250_dfdpck_toprowflag1;
2323
static int hf_tn5250_dfdpck_toprowflag1_0;
2324
static int hf_tn5250_dfdpck_toprowflag1_1;
2325
static int hf_tn5250_dfdpck_toprowflag1_2;
2326
static int hf_tn5250_dfdpck_toprowflag1_3;
2327
static int hf_tn5250_dfdpck_toprowflag1_4;
2328
static int hf_tn5250_dfdpck_toprowflag1_5;
2329
static int hf_tn5250_dfdpck_toprowflag1_6;
2330
static int hf_tn5250_dfdpck_toprowflag1_7;
2331
static int hf_tn5250_dfdpck_toprowflag2;
2332
static int hf_tn5250_dfdpck_toprowflag2_0;
2333
static int hf_tn5250_dfdpck_toprowflag2_1;
2334
static int hf_tn5250_dfdpck_toprowflag2_2;
2335
static int hf_tn5250_dfdpck_toprowflag2_3;
2336
static int hf_tn5250_dfdpck_toprowflag2_4;
2337
static int hf_tn5250_dfdpck_toprowflag2_5;
2338
static int hf_tn5250_dfdpck_toprowflag2_6;
2339
static int hf_tn5250_dfdpck_toprowflag2_7;
2340
static int hf_tn5250_dfdpck_toprowflag3;
2341
static int hf_tn5250_dfdpck_toprowflag3_0;
2342
static int hf_tn5250_dfdpck_toprowflag3_1;
2343
static int hf_tn5250_dfdpck_toprowflag3_2;
2344
static int hf_tn5250_dfdpck_toprowflag3_3;
2345
static int hf_tn5250_dfdpck_toprowflag3_4;
2346
static int hf_tn5250_dfdpck_toprowflag3_5;
2347
static int hf_tn5250_dfdpck_toprowflag3_6;
2348
static int hf_tn5250_dfdpck_toprowflag3_7;
2349
static int hf_tn5250_dorm_ec;
2350
static int hf_tn5250_dorm_id;
2351
static int hf_tn5250_dorm_length;
2352
static int hf_tn5250_dorm_mt;
2353
static int hf_tn5250_dpo_displace_characters;
2354
static int hf_tn5250_dpo_flag1;
2355
static int hf_tn5250_dpo_flag1_0;
2356
static int hf_tn5250_dpo_flag1_1;
2357
static int hf_tn5250_dpo_flag1_2;
2358
static int hf_tn5250_dpo_flag1_3;
2359
static int hf_tn5250_dpo_flag1_4;
2360
static int hf_tn5250_dpo_flag1_5;
2361
static int hf_tn5250_dpo_flag1_6;
2362
static int hf_tn5250_dpo_flag1_7;
2363
static int hf_tn5250_dpo_flag2;
2364
static int hf_tn5250_dpo_flag2_0;
2365
static int hf_tn5250_dpo_flag2_reserved;
2366
static int hf_tn5250_dpo_partition;
2367
static int hf_tn5250_dpo_start_location_col;
2368
static int hf_tn5250_dpo_start_location_row;
2369
static int hf_tn5250_dpt_ec;
2370
static int hf_tn5250_dpt_id;
2371
static int hf_tn5250_ds_output_error;
2372
static int hf_tn5250_dsc_ev;
2373
static int hf_tn5250_dsc_partition;
2374
static int hf_tn5250_dsc_sk;
2375
static int hf_tn5250_dsl_flag1;
2376
static int hf_tn5250_dsl_flag1_0;
2377
static int hf_tn5250_dsl_flag1_1;
2378
static int hf_tn5250_dsl_flag1_2;
2379
static int hf_tn5250_dsl_flag1_reserved;
2380
static int hf_tn5250_dsl_function;
2381
static int hf_tn5250_dsl_id;
2382
static int hf_tn5250_dsl_location;
2383
static int hf_tn5250_dsl_offset;
2384
static int hf_tn5250_dsl_partition;
2385
static int hf_tn5250_dsl_rtl_offset;
2386
static int hf_tn5250_dtsf_first_line;
2387
static int hf_tn5250_dtsf_flag1;
2388
static int hf_tn5250_dtsf_flag1_0;
2389
static int hf_tn5250_dtsf_flag1_1;
2390
static int hf_tn5250_dtsf_flag1_2;
2391
static int hf_tn5250_dtsf_flag1_3;
2392
static int hf_tn5250_dtsf_flag1_4;
2393
static int hf_tn5250_dtsf_flag1_5;
2394
static int hf_tn5250_dtsf_flag1_6;
2395
static int hf_tn5250_dtsf_flag1_7;
2396
static int hf_tn5250_dtsf_flag2;
2397
static int hf_tn5250_dtsf_flag2_0;
2398
static int hf_tn5250_dtsf_flag2_1;
2399
static int hf_tn5250_dtsf_flag2_2;
2400
static int hf_tn5250_dtsf_flag2_3;
2401
static int hf_tn5250_dtsf_flag2_4to7;
2402
static int hf_tn5250_dtsf_line_cmd_field_size;
2403
static int hf_tn5250_dtsf_location_of_pitch;
2404
static int hf_tn5250_dtsf_partition;
2405
static int hf_tn5250_dtsf_text_body_height;
2406
static int hf_tn5250_dtsf_text_body_width;
2407
static int hf_tn5250_soh_err;
2408
static int hf_tn5250_error_code;
2409
static int hf_tn5250_error_state;
2410
static int hf_tn5250_escape_code;
2411
static int hf_tn5250_fa_color;
2412
static int hf_tn5250_fcw;
2413
static int hf_tn5250_ffw;
2414
static int hf_tn5250_ffw_adjust;
2415
static int hf_tn5250_ffw_auto;
2416
static int hf_tn5250_ffw_bypass;
2417
static int hf_tn5250_ffw_dup;
2418
static int hf_tn5250_ffw_fer;
2419
static int hf_tn5250_ffw_id;
2420
static int hf_tn5250_ffw_mdt;
2421
static int hf_tn5250_ffw_me;
2422
static int hf_tn5250_ffw_monocase;
2423
static int hf_tn5250_ffw_res;
2424
static int hf_tn5250_ffw_shift;
2425
static int hf_tn5250_field_data;
2426
static int hf_tn5250_foreground_color_attr;
2427
static int hf_tn5250_header_flags;
2428
static int hf_tn5250_ideographic_attr;
2429
static int hf_tn5250_length;
2430
static int hf_tn5250_length_twobyte;
2431
static int hf_tn5250_logical_record_length;
2432
static int hf_tn5250_operation_code;
2433
static int hf_tn5250_order_code;
2434
static int hf_tn5250_repeated_character;
2435
static int hf_tn5250_reserved;
2436
static int hf_tn5250_roll_bottom_line;
2437
static int hf_tn5250_roll_flag1;
2438
static int hf_tn5250_roll_flag1_0;
2439
static int hf_tn5250_roll_flag1_lines;
2440
static int hf_tn5250_roll_flag1_reserved;
2441
static int hf_tn5250_roll_top_line;
2442
static int hf_tn5250_rts_flag1;
2443
static int hf_tn5250_rts_flag1_0;
2444
static int hf_tn5250_rts_flag1_reserved;
2445
static int hf_tn5250_rts_partition;
2446
static int hf_tn5250_sf_attr_flag;
2447
static int hf_tn5250_sf_class;
2448
static int hf_tn5250_fa;
2449
static int hf_tn5250_sf_length;
2450
static int hf_tn5250_sf_type;
2451
static int hf_tn5250_sna_record_type;
2452
static int hf_tn5250_soh_cursor_direction;
2453
static int hf_tn5250_soh_flags;
2454
static int hf_tn5250_soh_input_capable_only;
2455
static int hf_tn5250_soh_pf1;
2456
static int hf_tn5250_soh_pf10;
2457
static int hf_tn5250_soh_pf11;
2458
static int hf_tn5250_soh_pf12;
2459
static int hf_tn5250_soh_pf13;
2460
static int hf_tn5250_soh_pf14;
2461
static int hf_tn5250_soh_pf15;
2462
static int hf_tn5250_soh_pf16;
2463
static int hf_tn5250_soh_pf16to9;
2464
static int hf_tn5250_soh_pf17;
2465
static int hf_tn5250_soh_pf18;
2466
static int hf_tn5250_soh_pf19;
2467
static int hf_tn5250_soh_pf2;
2468
static int hf_tn5250_soh_pf20;
2469
static int hf_tn5250_soh_pf21;
2470
static int hf_tn5250_soh_pf22;
2471
static int hf_tn5250_soh_pf23;
2472
static int hf_tn5250_soh_pf24;
2473
static int hf_tn5250_soh_pf24to17;
2474
static int hf_tn5250_soh_pf3;
2475
static int hf_tn5250_soh_pf4;
2476
static int hf_tn5250_soh_pf5;
2477
static int hf_tn5250_soh_pf6;
2478
static int hf_tn5250_soh_pf7;
2479
static int hf_tn5250_soh_pf8;
2480
static int hf_tn5250_soh_pf8to1;
2481
static int hf_tn5250_soh_pf9;
2482
static int hf_tn5250_soh_resq;
2483
static int hf_tn5250_soh_screen_reverse;
2484
static int hf_tn5250_sps_flag1;
2485
static int hf_tn5250_sps_flag1_0;
2486
static int hf_tn5250_sps_flag1_reserved;
2487
static int hf_tn5250_sps_left_column;
2488
static int hf_tn5250_sps_top_row;
2489
static int hf_tn5250_sps_window_depth;
2490
static int hf_tn5250_sps_window_width;
2491
static int hf_tn5250_sys_request_key;
2492
static int hf_tn5250_test_request_key;
2493
static int hf_tn5250_unknown_data;
2494
static int hf_tn5250_variable_record_length;
2495
static int hf_tn5250_wdsf_cw_bp_flag1_reserved;
2496
static int hf_tn5250_wdsf_cw_tf_flag_reserved;
2497
static int hf_tn5250_wdsf_deg_flag2_reserved;
2498
static int hf_tn5250_wdsf_deg_ms_flag1_reserved;
2499
static int hf_tn5250_wdsf_ds_ci_flag1_reserved;
2500
static int hf_tn5250_wdsf_ds_cpda_flag1_reserved;
2501
static int hf_tn5250_wdsf_ds_ct_flag3_reserved;
2502
static int hf_tn5250_wdsf_ds_gdc_reserved;
2503
static int hf_tn5250_wdsf_ds_nws_reserved;
2504
static int hf_tn5250_wdsf_ds_sbi_flag1_reserved;
2505
static int hf_tn5250_wdsf_dsb_flag1_reserved;
2506
static int hf_tn5250_wdsf_pmb_flag1_reserved;
2507
static int hf_tn5250_wdsf_wdf_flag1_reserved;
2508
static int hf_tn5250_wdsf_cgl_partition;
2509
static int hf_tn5250_wdsf_cgl_rectangle_height;
2510
static int hf_tn5250_wdsf_cgl_rectangle_width;
2511
static int hf_tn5250_wdsf_cgl_start_column;
2512
static int hf_tn5250_wdsf_cgl_start_row;
2513
static int hf_tn5250_wdsf_cw_bp_bbc;
2514
static int hf_tn5250_wdsf_cw_bp_cba;
2515
static int hf_tn5250_wdsf_cw_bp_flag1;
2516
static int hf_tn5250_wdsf_cw_bp_flag1_1;
2517
static int hf_tn5250_wdsf_cw_bp_lbc;
2518
static int hf_tn5250_wdsf_cw_bp_llbc;
2519
static int hf_tn5250_wdsf_cw_bp_lrbc;
2520
static int hf_tn5250_wdsf_cw_bp_mba;
2521
static int hf_tn5250_wdsf_cw_bp_rbc;
2522
static int hf_tn5250_wdsf_cw_bp_tbc;
2523
static int hf_tn5250_wdsf_cw_bp_ulbc;
2524
static int hf_tn5250_wdsf_cw_bp_urbc;
2525
static int hf_tn5250_wdsf_cw_flag1;
2526
static int hf_tn5250_wdsf_cw_flag1_1;
2527
static int hf_tn5250_wdsf_cw_flag1_2;
2528
static int hf_tn5250_wdsf_cw_flag1_reserved;
2529
static int hf_tn5250_wdsf_cw_minor_type;
2530
static int hf_tn5250_wdsf_cw_tf_cba;
2531
static int hf_tn5250_wdsf_cw_tf_flag;
2532
static int hf_tn5250_wdsf_cw_tf_flag_1;
2533
static int hf_tn5250_wdsf_cw_tf_flag_orientation;
2534
static int hf_tn5250_wdsf_cw_tf_mba;
2535
static int hf_tn5250_wdsf_cw_tf_text;
2536
static int hf_tn5250_wdsf_cw_wd;
2537
static int hf_tn5250_wdsf_cw_ww;
2538
static int hf_tn5250_wdsf_deg_default_color;
2539
static int hf_tn5250_wdsf_deg_default_line;
2540
static int hf_tn5250_wdsf_deg_flag1;
2541
static int hf_tn5250_wdsf_deg_flag1_0;
2542
static int hf_tn5250_wdsf_deg_flag1_reserved;
2543
static int hf_tn5250_wdsf_deg_flag2;
2544
static int hf_tn5250_wdsf_deg_flag2_0;
2545
static int hf_tn5250_wdsf_deg_minor_type;
2546
static int hf_tn5250_wdsf_deg_ms_default_color;
2547
static int hf_tn5250_wdsf_deg_ms_flag1;
2548
static int hf_tn5250_wdsf_deg_ms_flag1_0;
2549
static int hf_tn5250_wdsf_deg_ms_horizontal_dimension;
2550
static int hf_tn5250_wdsf_deg_ms_line_interval;
2551
static int hf_tn5250_wdsf_deg_ms_line_repeat;
2552
static int hf_tn5250_wdsf_deg_ms_start_column;
2553
static int hf_tn5250_wdsf_deg_ms_start_row;
2554
static int hf_tn5250_wdsf_deg_ms_vertical_dimension;
2555
static int hf_tn5250_wdsf_deg_partition;
2556
static int hf_tn5250_wdsf_ds_cancel_aid;
2557
static int hf_tn5250_wdsf_ds_ci_first_choice;
2558
static int hf_tn5250_wdsf_ds_ci_flag1;
2559
static int hf_tn5250_wdsf_ds_ci_flag1_0;
2560
static int hf_tn5250_wdsf_ds_ci_left_push;
2561
static int hf_tn5250_wdsf_ds_ci_right_push;
2562
static int hf_tn5250_wdsf_ds_columns;
2563
static int hf_tn5250_wdsf_ds_country_sel;
2564
static int hf_tn5250_wdsf_ds_cpda_color_avail;
2565
static int hf_tn5250_wdsf_ds_cpda_color_indicator;
2566
static int hf_tn5250_wdsf_ds_cpda_color_sel_avail;
2567
static int hf_tn5250_wdsf_ds_cpda_color_sel_selected;
2568
static int hf_tn5250_wdsf_ds_cpda_color_sel_unavail;
2569
static int hf_tn5250_wdsf_ds_cpda_color_selected;
2570
static int hf_tn5250_wdsf_ds_cpda_color_unavail;
2571
static int hf_tn5250_wdsf_ds_cpda_color_unavail_indicator;
2572
static int hf_tn5250_wdsf_ds_cpda_flag1;
2573
static int hf_tn5250_wdsf_ds_cpda_flag1_0;
2574
static int hf_tn5250_wdsf_ds_cpda_flag1_1;
2575
static int hf_tn5250_wdsf_ds_cpda_flag1_2;
2576
static int hf_tn5250_wdsf_ds_cpda_monochrome_avail;
2577
static int hf_tn5250_wdsf_ds_cpda_monochrome_indicator;
2578
static int hf_tn5250_wdsf_ds_cpda_monochrome_sel_avail;
2579
static int hf_tn5250_wdsf_ds_cpda_monochrome_sel_selected;
2580
static int hf_tn5250_wdsf_ds_cpda_monochrome_sel_unavail;
2581
static int hf_tn5250_wdsf_ds_cpda_monochrome_selected;
2582
static int hf_tn5250_wdsf_ds_cpda_monochrome_unavail;
2583
static int hf_tn5250_wdsf_ds_cpda_monochrome_unavail_indicator;
2584
static int hf_tn5250_wdsf_ds_ct_aid;
2585
static int hf_tn5250_wdsf_ds_ct_flag1;
2586
static int hf_tn5250_wdsf_ds_ct_flag1_2;
2587
static int hf_tn5250_wdsf_ds_ct_flag1_3;
2588
static int hf_tn5250_wdsf_ds_ct_flag1_4;
2589
static int hf_tn5250_wdsf_ds_ct_flag1_5;
2590
static int hf_tn5250_wdsf_ds_ct_flag1_choice_state;
2591
static int hf_tn5250_wdsf_ds_ct_flag1_numeric_selection;
2592
static int hf_tn5250_wdsf_ds_ct_flag2;
2593
static int hf_tn5250_wdsf_ds_ct_flag2_0;
2594
static int hf_tn5250_wdsf_ds_ct_flag2_1;
2595
static int hf_tn5250_wdsf_ds_ct_flag2_2;
2596
static int hf_tn5250_wdsf_ds_ct_flag2_3;
2597
static int hf_tn5250_wdsf_ds_ct_flag2_4;
2598
static int hf_tn5250_wdsf_ds_ct_flag2_5;
2599
static int hf_tn5250_wdsf_ds_ct_flag2_6;
2600
static int hf_tn5250_wdsf_ds_ct_flag2_7;
2601
static int hf_tn5250_wdsf_ds_ct_flag3;
2602
static int hf_tn5250_wdsf_ds_ct_flag3_0;
2603
static int hf_tn5250_wdsf_ds_ct_flag3_1;
2604
static int hf_tn5250_wdsf_ds_ct_flag3_2;
2605
static int hf_tn5250_wdsf_ds_ct_mnemonic_offset;
2606
static int hf_tn5250_wdsf_ds_ct_numeric_onebyte;
2607
static int hf_tn5250_wdsf_ds_ct_numeric_twobyte;
2608
static int hf_tn5250_wdsf_ds_ct_text;
2609
static int hf_tn5250_wdsf_ds_flag1;
2610
static int hf_tn5250_wdsf_ds_flag1_1;
2611
static int hf_tn5250_wdsf_ds_flag1_2;
2612
static int hf_tn5250_wdsf_ds_flag1_auto_enter;
2613
static int hf_tn5250_wdsf_ds_flag1_mouse_characteristics;
2614
static int hf_tn5250_wdsf_ds_flag1_reserved;
2615
static int hf_tn5250_wdsf_ds_flag2;
2616
static int hf_tn5250_wdsf_ds_flag2_1;
2617
static int hf_tn5250_wdsf_ds_flag2_2;
2618
static int hf_tn5250_wdsf_ds_flag2_3;
2619
static int hf_tn5250_wdsf_ds_flag2_4;
2620
static int hf_tn5250_wdsf_ds_flag2_5;
2621
static int hf_tn5250_wdsf_ds_flag2_6;
2622
static int hf_tn5250_wdsf_ds_flag2_reserved;
2623
static int hf_tn5250_wdsf_ds_flag3;
2624
static int hf_tn5250_wdsf_ds_flag3_1;
2625
static int hf_tn5250_wdsf_ds_flag3_reserved;
2626
static int hf_tn5250_wdsf_ds_gdc;
2627
static int hf_tn5250_wdsf_ds_gdc_indicators;
2628
static int hf_tn5250_wdsf_ds_gdc_selection_techniques;
2629
static int hf_tn5250_wdsf_ds_mbs_color_sep;
2630
static int hf_tn5250_wdsf_ds_mbs_end_column;
2631
static int hf_tn5250_wdsf_ds_mbs_flag;
2632
static int hf_tn5250_wdsf_ds_mbs_flag_0;
2633
static int hf_tn5250_wdsf_ds_mbs_flag_1;
2634
static int hf_tn5250_wdsf_ds_mbs_flag_reserved;
2635
static int hf_tn5250_wdsf_ds_mbs_monochrome_sep;
2636
static int hf_tn5250_wdsf_ds_mbs_sep_char;
2637
static int hf_tn5250_wdsf_ds_mbs_start_column;
2638
static int hf_tn5250_wdsf_ds_minor_type;
2639
static int hf_tn5250_wdsf_ds_numeric_sep;
2640
static int hf_tn5250_wdsf_ds_nws;
2641
static int hf_tn5250_wdsf_ds_nws_indicators;
2642
static int hf_tn5250_wdsf_ds_nws_selection_techniques;
2643
static int hf_tn5250_wdsf_ds_nws_wout;
2644
static int hf_tn5250_wdsf_ds_padding;
2645
static int hf_tn5250_wdsf_ds_rows;
2646
static int hf_tn5250_wdsf_ds_sbi_bottom_character;
2647
static int hf_tn5250_wdsf_ds_sbi_color_top_highlight;
2648
static int hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft;
2649
static int hf_tn5250_wdsf_ds_sbi_empty_character;
2650
static int hf_tn5250_wdsf_ds_sbi_flag1;
2651
static int hf_tn5250_wdsf_ds_sbi_flag1_0;
2652
static int hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight;
2653
static int hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft;
2654
static int hf_tn5250_wdsf_ds_sbi_slider_character;
2655
static int hf_tn5250_wdsf_ds_sbi_top_character;
2656
static int hf_tn5250_wdsf_ds_sliderpos;
2657
static int hf_tn5250_wdsf_ds_textsize;
2658
static int hf_tn5250_wdsf_ds_totalrows;
2659
static int hf_tn5250_wdsf_ds_type;
2660
static int hf_tn5250_wdsf_dsb_flag1;
2661
static int hf_tn5250_wdsf_dsb_flag1_0;
2662
static int hf_tn5250_wdsf_dsb_flag1_1;
2663
static int hf_tn5250_wdsf_dsb_flag1_7;
2664
static int hf_tn5250_wdsf_pmb_first_mouse_event;
2665
static int hf_tn5250_wdsf_pmb_flag1;
2666
static int hf_tn5250_wdsf_pmb_flag1_0;
2667
static int hf_tn5250_wdsf_pmb_flag1_1;
2668
static int hf_tn5250_wdsf_pmb_flag1_2;
2669
static int hf_tn5250_wdsf_pmb_flag1_3;
2670
static int hf_tn5250_wdsf_pmb_second_mouse_event;
2671
static int hf_tn5250_wdsf_ragc_flag1;
2672
static int hf_tn5250_wdsf_ragc_flag1_0;
2673
static int hf_tn5250_wdsf_ragc_reserved;
2674
static int hf_tn5250_wdsf_rgw_flag1;
2675
static int hf_tn5250_wdsf_rgw_flag1_0;
2676
static int hf_tn5250_wdsf_rgw_flag1_1;
2677
static int hf_tn5250_wdsf_rgw_reserved;
2678
static int hf_tn5250_wdsf_sbi_rowscols;
2679
static int hf_tn5250_wdsf_sbi_sliderpos;
2680
static int hf_tn5250_wdsf_sbi_total_scroll;
2681
static int hf_tn5250_wdsf_wdf_flag1;
2682
static int hf_tn5250_wdsf_wdf_flag1_0;
2683
static int hf_tn5250_wea_prim_attr;
2684
static int hf_tn5250_wea_prim_attr_blink;
2685
static int hf_tn5250_wea_prim_attr_col;
2686
static int hf_tn5250_wea_prim_attr_flag;
2687
static int hf_tn5250_wea_prim_attr_int;
2688
static int hf_tn5250_wea_prim_attr_rev;
2689
static int hf_tn5250_wea_prim_attr_und;
2690
static int hf_tn5250_wectw_end_column;
2691
static int hf_tn5250_wectw_start_column;
2692
static int hf_tn5250_wsf_qss_flag1;
2693
static int hf_tn5250_wsf_qss_flag1_0;
2694
static int hf_tn5250_wsf_qss_flag1_reserved;
2695
static int hf_tn5250_wsf_qss_flag2;
2696
static int hf_tn5250_wsf_qss_flag2_7;
2697
static int hf_tn5250_wsf_qss_flag2_reserved;
2698
static int hf_tn5250_wssf_cc_flag1;
2699
static int hf_tn5250_wssf_cc_flag1_7;
2700
static int hf_tn5250_wssf_cc_flag1_reserved;
2701
static int hf_tn5250_wssf_flag1;
2702
static int hf_tn5250_wssf_flag2;
2703
static int hf_tn5250_wssf_flag2_0;
2704
static int hf_tn5250_wssf_flag2_1;
2705
static int hf_tn5250_wssf_flag2_2;
2706
static int hf_tn5250_wssf_flag2_3;
2707
static int hf_tn5250_wssf_flag2_4;
2708
static int hf_tn5250_wssf_flag2_5;
2709
static int hf_tn5250_wssf_flag2_6;
2710
static int hf_tn5250_wssf_flag2_7;
2711
static int hf_tn5250_wssf_ifc_background_color;
2712
static int hf_tn5250_wssf_ifc_flag1;
2713
static int hf_tn5250_wssf_ifc_flag1_0;
2714
static int hf_tn5250_wssf_ifc_flag1_1to3;
2715
static int hf_tn5250_wssf_ifc_flag1_4;
2716
static int hf_tn5250_wssf_ifc_flag1_5;
2717
static int hf_tn5250_wssf_ifc_flag1_6;
2718
static int hf_tn5250_wssf_ifc_flag1_7;
2719
static int hf_tn5250_wssf_ifc_flag2;
2720
static int hf_tn5250_wssf_ifc_flag2_0;
2721
static int hf_tn5250_wssf_ifc_flag2_1;
2722
static int hf_tn5250_wssf_ifc_flag2_7;
2723
static int hf_tn5250_wssf_ifc_flag2_reserved;
2724
static int hf_tn5250_wssf_ifc_foreground_color;
2725
static int hf_tn5250_wssf_ifc_image_format;
2726
static int hf_tn5250_wssf_ifc_imagefax_name;
2727
static int hf_tn5250_wssf_ifc_rotation;
2728
static int hf_tn5250_wssf_ifc_scaling;
2729
static int hf_tn5250_wssf_ifc_viewimage_location_col;
2730
static int hf_tn5250_wssf_ifc_viewimage_location_row;
2731
static int hf_tn5250_wssf_ifc_viewport_location_col;
2732
static int hf_tn5250_wssf_ifc_viewport_location_row;
2733
static int hf_tn5250_wssf_ifc_viewport_size_col;
2734
static int hf_tn5250_wssf_ifc_viewport_size_row;
2735
static int hf_tn5250_wssf_ifd_flag1;
2736
static int hf_tn5250_wssf_ifd_flag1_0;
2737
static int hf_tn5250_wssf_ifd_flag1_reserved;
2738
static int hf_tn5250_wssf_ifd_imagefax_data;
2739
static int hf_tn5250_wssf_ifd_imagefax_name;
2740
static int hf_tn5250_wssf_kbc_flag1;
2741
static int hf_tn5250_wssf_kbc_flag1_5;
2742
static int hf_tn5250_wssf_kbc_flag1_6;
2743
static int hf_tn5250_wssf_kbc_flag1_7;
2744
static int hf_tn5250_wssf_kbc_flag1_reserved;
2745
static int hf_tn5250_wssf_wsc_minor_type;
2746
static int hf_tn5250_wtd_ccc1;
2747
static int hf_tn5250_wtd_ccc2;
2748
static int hf_tn5250_wtd_ccc2_alarm;
2749
static int hf_tn5250_wtd_ccc2_cursor;
2750
static int hf_tn5250_wtd_ccc2_off;
2751
static int hf_tn5250_wtd_ccc2_on;
2752
static int hf_tn5250_wtd_ccc2_res;
2753
static int hf_tn5250_wtd_ccc2_reset;
2754
static int hf_tn5250_wtd_ccc2_set;
2755
static int hf_tn5250_wtd_ccc2_unlock;
2756
static int hf_tn5250_wts_cld_flag1;
2757
static int hf_tn5250_wts_cld_flag1_0;
2758
static int hf_tn5250_wts_cld_flag1_1;
2759
static int hf_tn5250_wts_cld_flag1_2;
2760
static int hf_tn5250_wts_cld_flag1_3;
2761
static int hf_tn5250_wts_cld_flag1_4;
2762
static int hf_tn5250_wts_cld_flag1_5;
2763
static int hf_tn5250_wts_cld_flag1_6;
2764
static int hf_tn5250_wts_cld_flag1_7;
2765
static int hf_tn5250_wts_cld_flag2;
2766
static int hf_tn5250_wts_cld_flag2_0;
2767
static int hf_tn5250_wts_cld_flag2_1;
2768
static int hf_tn5250_wts_cld_flag2_2;
2769
static int hf_tn5250_wts_cld_flag2_3;
2770
static int hf_tn5250_wts_cld_flag2_4;
2771
static int hf_tn5250_wts_cld_flag2_line_spacing;
2772
static int hf_tn5250_wts_cld_flag3;
2773
static int hf_tn5250_wts_cld_flag3_0;
2774
static int hf_tn5250_wts_cld_flag3_1;
2775
static int hf_tn5250_wts_cld_flag3_2;
2776
static int hf_tn5250_wts_cld_flag3_3;
2777
static int hf_tn5250_wts_cld_flag3_4;
2778
static int hf_tn5250_wts_cld_flag3_5;
2779
static int hf_tn5250_wts_cld_flag3_6;
2780
static int hf_tn5250_wts_cld_flag3_7;
2781
static int hf_tn5250_wts_cld_io;
2782
static int hf_tn5250_wts_cld_li;
2783
static int hf_tn5250_wts_cld_lmo;
2784
static int hf_tn5250_wts_cld_page_num;
2785
static int hf_tn5250_wts_cld_row;
2786
static int hf_tn5250_wts_cld_sli;
2787
static int hf_tn5250_wts_flag1;
2788
static int hf_tn5250_wts_flag1_0;
2789
static int hf_tn5250_wts_flag1_1;
2790
static int hf_tn5250_wts_flag1_2;
2791
static int hf_tn5250_wts_flag1_3;
2792
static int hf_tn5250_wts_flag1_reserved;
2793
static int hf_tn5250_wts_flag2;
2794
static int hf_tn5250_wts_flag2_6;
2795
static int hf_tn5250_wts_flag2_reserved;
2796
static int hf_tn5250_wts_flag2_reserved2;
2797
static int hf_tn5250_wts_flag3;
2798
static int hf_tn5250_wts_flag3_0;
2799
static int hf_tn5250_wts_flag3_1;
2800
static int hf_tn5250_wts_flag3_2;
2801
static int hf_tn5250_wts_flag3_3;
2802
static int hf_tn5250_wts_flag3_4;
2803
static int hf_tn5250_wts_flag3_5;
2804
static int hf_tn5250_wts_flag3_6;
2805
static int hf_tn5250_wts_flag3_7;
2806
static int hf_tn5250_wts_home_position_col;
2807
static int hf_tn5250_wts_home_position_row;
2808
static int hf_tn5250_wts_partition;
2809
static int hf_tn5250_soh_length;
2810
static int hf_tn5250_negative_response;
2811
static int hf_tn5250_qr_ccl;
2812
static int hf_tn5250_qr_chc;
2813
static int hf_tn5250_qr_dm;
2814
static int hf_tn5250_qr_dsn;
2815
static int hf_tn5250_qr_dt;
2816
static int hf_tn5250_qr_dtc;
2817
static int hf_tn5250_qr_eki;
2818
static int hf_tn5250_qr_flag;
2819
static int hf_tn5250_qr_flag1;
2820
static int hf_tn5250_qr_flag2;
2821
static int hf_tn5250_qr_flag3;
2822
static int hf_tn5250_qr_flag4;
2823
static int hf_tn5250_qr_ki;
2824
static int hf_tn5250_qr_flag1_0;
2825
static int hf_tn5250_qr_flag1_1;
2826
static int hf_tn5250_qr_flag1_2;
2827
static int hf_tn5250_qr_flag1_3;
2828
static int hf_tn5250_qr_flag1_4;
2829
static int hf_tn5250_qr_flag1_5;
2830
static int hf_tn5250_qr_flag1_6;
2831
static int hf_tn5250_qr_flag1_7;
2832
static int hf_tn5250_qr_flag2_0to3;
2833
static int hf_tn5250_qr_flag2_4;
2834
static int hf_tn5250_qr_flag2_5;
2835
static int hf_tn5250_qr_flag2_6to7;
2836
static int hf_tn5250_qr_flag_0;
2837
static int hf_tn5250_qr_flag_reserved;
2838
static int hf_tn5250_qr_mni;
2839
static int hf_tn5250_image_fax_error;
2840
static int hf_tn5250_vac_data;
2841
static int hf_tn5250_vac_prefix;
2842
static int hf_tn5250_wssf_ttw_flag;
2843
static int hf_tn5250_wssf_ttw_data;
2844
2845
static int ett_tn5250;
2846
static int ett_tn5250_wcc;
2847
static int ett_sf;
2848
static int ett_tn5250_field_attribute;
2849
static int ett_tn5250_dfdpck_mask;
2850
static int ett_tn5250_field_validation;
2851
static int ett_tn5250_header_flags;
2852
static int ett_tn5250_roll_mask;
2853
static int ett_tn5250_soh_mask;
2854
static int ett_tn5250_soh_pf16to9_mask;
2855
static int ett_tn5250_soh_pf24to17_mask;
2856
static int ett_tn5250_soh_pf8to1_mask;
2857
static int ett_tn5250_sps_mask;
2858
static int ett_tn5250_wdsf_cw_bp_mask;
2859
static int ett_tn5250_wdsf_cw_mask;
2860
static int ett_tn5250_wdsf_cw_tf_mask;
2861
static int ett_tn5250_wdsf_deg_mask;
2862
static int ett_tn5250_wdsf_deg_ms_mask;
2863
static int ett_tn5250_wdsf_ds_ci_mask;
2864
static int ett_tn5250_wdsf_ds_cpda_mask;
2865
static int ett_tn5250_wdsf_ds_ct_mask;
2866
static int ett_tn5250_wdsf_ds_mask;
2867
static int ett_tn5250_wdsf_ds_mbs_mask;
2868
static int ett_tn5250_wdsf_ds_sbi_mask;
2869
static int ett_tn5250_wdsf_dsb_mask;
2870
static int ett_tn5250_wdsf_pmb_mask;
2871
static int ett_tn5250_wdsf_ragc_mask;
2872
static int ett_tn5250_wdsf_rgw_mask;
2873
static int ett_tn5250_wdsf_wdf_mask;
2874
static int ett_tn5250_wsf_dpo_mask;
2875
static int ett_tn5250_wsf_dsl_mask;
2876
static int ett_tn5250_wsf_dtsf_mask;
2877
static int ett_tn5250_wsf_qss_mask;
2878
static int ett_tn5250_wsf_rts_mask;
2879
static int ett_tn5250_wssf_cc_mask;
2880
static int ett_tn5250_wssf_ifc_mask;
2881
static int ett_tn5250_wssf_ifd_mask;
2882
static int ett_tn5250_wssf_kbc_mask;
2883
static int ett_tn5250_wssf_mask;
2884
static int ett_tn5250_wts_mask;
2885
static int ett_tn5250_qr_mask;
2886
static int ett_tn5250_wea_prim_attr;
2887
static int ett_cc;
2888
2889
static expert_field ei_tn5250_command_code;
2890
2891
static uint32_t dissect_tn5250_orders_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset);
2892
2893
typedef struct hf_items {
2894
  int *phf;
2895
  int bitmask_ett;
2896
  int length;
2897
  int * const *bitmask;
2898
  int encoding;
2899
} hf_items;
2900
2901
/* Utility Functions */
2902
2903
static int
2904
tn5250_is_valid_aid(int aid)
2905
0
{
2906
0
  switch (aid) {
2907
0
    case AID_CLEAR:
2908
0
    case AID_ENTER_OR_RECORD_ADV:
2909
0
    case AID_HELP:
2910
0
    case AID_ROLL_DOWN:
2911
0
    case AID_ROLL_UP:
2912
0
    case AID_ROLL_LEFT:
2913
0
    case AID_ROLL_RIGHT:
2914
0
    case AID_PRINT:
2915
0
    case AID_RECORD_BACKSPACE:
2916
0
    case AID_SLP_AUTO_ENTER:
2917
0
    case AID_FORWARD_EDGE_TRIGGER_AUTO__ENTER:
2918
0
    case AID_PA1:
2919
0
    case AID_PA2:
2920
0
    case AID_PA3:
2921
0
    case AID_CMD_01:
2922
0
    case AID_CMD_02:
2923
0
    case AID_CMD_03:
2924
0
    case AID_CMD_04:
2925
0
    case AID_CMD_05:
2926
0
    case AID_CMD_06:
2927
0
    case AID_CMD_07:
2928
0
    case AID_CMD_08:
2929
0
    case AID_CMD_09:
2930
0
    case AID_CMD_10:
2931
0
    case AID_CMD_11:
2932
0
    case AID_CMD_12:
2933
0
    case AID_CMD_13:
2934
0
    case AID_CMD_14:
2935
0
    case AID_CMD_15:
2936
0
    case AID_CMD_16:
2937
0
    case AID_CMD_17:
2938
0
    case AID_CMD_18:
2939
0
    case AID_CMD_19:
2940
0
    case AID_CMD_20:
2941
0
    case AID_CMD_21:
2942
0
    case AID_CMD_22:
2943
0
    case AID_CMD_23:
2944
0
    case AID_CMD_24:
2945
0
    case AID_INBOUND_WRITE_STRUCTURED_FIELD:
2946
0
    case AID_PASS_THROUGH_RESPONSE:
2947
0
      return 1;
2948
0
    default:
2949
0
      break;
2950
0
  }
2951
0
  return 0;
2952
0
}
2953
2954
static uint32_t
2955
tn5250_add_hf_items(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset,
2956
                    const hf_items *fields)
2957
0
{
2958
0
  int start=offset, byte;
2959
0
  int i;
2960
2961
0
  for (i = 0; fields[i].phf; ++i) {
2962
0
    if (fields[i].bitmask == 0) {
2963
      /* Skip an 0xFF byte acting as an escape byte */
2964
0
      byte = tvb_get_uint8(tvb,offset);
2965
0
      if (byte == 0xFF) {
2966
0
        offset++;
2967
0
      }
2968
0
      proto_tree_add_item(tn5250_tree, *fields[i].phf, tvb, offset,
2969
0
                          fields[i].length, fields[i].encoding);
2970
0
    } else {
2971
0
      proto_tree_add_bitmask(tn5250_tree, tvb, offset, *fields[i].phf,
2972
0
                             fields[i].bitmask_ett, fields[i].bitmask, ENC_BIG_ENDIAN);
2973
0
    }
2974
0
    DISSECTOR_ASSERT(fields[i].length > 0);
2975
0
    offset+=fields[i].length;
2976
0
  }
2977
0
  return (offset - start);
2978
0
}
2979
2980
static uint32_t
2981
dissect_unknown_data(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset,
2982
                     int start, int sf_length)
2983
0
{
2984
0
  int len_left;
2985
2986
0
  len_left = sf_length - (offset - start);
2987
2988
0
  if (len_left > 0) {
2989
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_unknown_data, tvb, offset,
2990
0
                        len_left, ENC_NA);
2991
0
    return len_left;
2992
0
  }
2993
0
  return 0;
2994
0
}
2995
2996
static uint32_t
2997
dissect_wcc(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
2998
0
{
2999
3000
0
  static int * const wcc_byte[] = {
3001
0
    &hf_tn5250_wtd_ccc2_res,
3002
0
    &hf_tn5250_wtd_ccc2_cursor,
3003
0
    &hf_tn5250_wtd_ccc2_reset,
3004
0
    &hf_tn5250_wtd_ccc2_set,
3005
0
    &hf_tn5250_wtd_ccc2_unlock,
3006
0
    &hf_tn5250_wtd_ccc2_alarm,
3007
0
    &hf_tn5250_wtd_ccc2_off,
3008
0
    &hf_tn5250_wtd_ccc2_on,
3009
0
    NULL
3010
0
  };
3011
3012
0
  hf_items wcc_fields[] = {
3013
0
    { &hf_tn5250_wtd_ccc1, 0, 1, 0, ENC_BIG_ENDIAN },
3014
0
    { &hf_tn5250_wtd_ccc2, ett_tn5250_wcc, 1, wcc_byte, 0 },
3015
0
    { NULL, 0, 0, 0, 0 }
3016
0
  };
3017
3018
0
  tn5250_add_hf_items(tn5250_tree, tvb, offset, wcc_fields);
3019
3020
0
  return 2;
3021
3022
0
}
3023
3024
static uint32_t
3025
dissect_row_column(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3026
0
{
3027
0
  int start = offset;
3028
0
  proto_tree_add_item(tn5250_tree, hf_tn5250_buffer_x, tvb, offset, 1, ENC_BIG_ENDIAN);
3029
0
  offset++;
3030
0
  proto_tree_add_item(tn5250_tree, hf_tn5250_buffer_y, tvb, offset, 1, ENC_BIG_ENDIAN);
3031
0
  offset++;
3032
3033
0
  return (offset - start);
3034
0
}
3035
3036
/* End - Utility Functions */
3037
3038
3039
/* Start: Handle WCC, Orders and Data */
3040
3041
/* 15.6.8 Erase to Address Order */
3042
static uint32_t
3043
dissect_erase_to_address(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3044
0
{
3045
0
  int start = offset;
3046
0
  uint8_t i, length = 0;
3047
3048
0
  dissect_row_column(tn5250_tree, tvb, offset);
3049
3050
0
  proto_tree_add_item_ret_uint8(tn5250_tree, hf_tn5250_length, tvb, offset, 1, ENC_BIG_ENDIAN, &length);
3051
0
  offset++;
3052
3053
0
  for (i=1; i < length; i++) {
3054
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_attribute_type, tvb, offset, 1,
3055
0
                        ENC_BIG_ENDIAN);
3056
0
    offset++;
3057
0
  }
3058
3059
0
  return (offset - start);
3060
0
}
3061
3062
/* 15.6.9 Start of Header Order */
3063
static uint32_t
3064
dissect_start_of_header(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3065
0
{
3066
0
  int start = offset;
3067
3068
  /*TODO: Warn on invalid length. <= 7 */
3069
0
  static int * const byte[] = {
3070
0
    &hf_tn5250_soh_cursor_direction,
3071
0
    &hf_tn5250_soh_screen_reverse,
3072
0
    &hf_tn5250_soh_input_capable_only,
3073
0
    NULL
3074
0
  };
3075
3076
0
  static int * const byte1[] = {
3077
0
    &hf_tn5250_soh_pf24, &hf_tn5250_soh_pf23, &hf_tn5250_soh_pf22,
3078
0
    &hf_tn5250_soh_pf21, &hf_tn5250_soh_pf20, &hf_tn5250_soh_pf19,
3079
0
    &hf_tn5250_soh_pf18, &hf_tn5250_soh_pf17,
3080
0
    NULL
3081
0
  };
3082
3083
0
  static int * const byte2[] = {
3084
0
    &hf_tn5250_soh_pf16, &hf_tn5250_soh_pf15, &hf_tn5250_soh_pf14,
3085
0
    &hf_tn5250_soh_pf13, &hf_tn5250_soh_pf12, &hf_tn5250_soh_pf11,
3086
0
    &hf_tn5250_soh_pf10, &hf_tn5250_soh_pf9,
3087
0
    NULL
3088
0
  };
3089
3090
0
  static int * const byte3[] = {
3091
0
    &hf_tn5250_soh_pf8, &hf_tn5250_soh_pf7, &hf_tn5250_soh_pf6,
3092
0
    &hf_tn5250_soh_pf5, &hf_tn5250_soh_pf4, &hf_tn5250_soh_pf3,
3093
0
    &hf_tn5250_soh_pf2, &hf_tn5250_soh_pf1,
3094
0
    NULL
3095
0
  };
3096
3097
0
  hf_items start_of_header_fields[] = {
3098
0
    { &hf_tn5250_soh_length, 0, 1, 0, ENC_BIG_ENDIAN },
3099
0
    { &hf_tn5250_soh_flags, ett_tn5250_soh_mask, 1, byte, 0 },
3100
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3101
0
    { &hf_tn5250_soh_resq, 1, 1, 0, ENC_BIG_ENDIAN },
3102
0
    { &hf_tn5250_soh_err, 1, 1, 0, ENC_BIG_ENDIAN },
3103
0
    { &hf_tn5250_soh_pf24to17, ett_tn5250_soh_pf24to17_mask, 1, byte1, 0 },
3104
0
    { &hf_tn5250_soh_pf16to9, ett_tn5250_soh_pf16to9_mask, 1, byte2, 0 },
3105
0
    { &hf_tn5250_soh_pf8to1, ett_tn5250_soh_pf8to1_mask, 1, byte3, 0 },
3106
0
    { NULL, 0, 0, 0, 0 }
3107
0
  };
3108
3109
3110
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
3111
0
                                start_of_header_fields);
3112
3113
0
  return (offset - start);
3114
0
}
3115
3116
/* 15.6.10 Transparent Data */
3117
static uint32_t
3118
dissect_twobyte_length_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3119
0
{
3120
0
  int start = offset;
3121
0
  unsigned length = 0;
3122
3123
0
  length = tvb_get_ntohs(tvb, offset);
3124
0
  proto_tree_add_item(tn5250_tree, hf_tn5250_length_twobyte, tvb, offset, 2,
3125
0
                      ENC_BIG_ENDIAN);
3126
0
  offset+=2;
3127
3128
0
  if (tvb_reported_length_remaining(tvb, offset) >= length) {
3129
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset,
3130
0
                        length, ENC_EBCDIC);
3131
0
    offset+=length;
3132
0
  } else {
3133
0
    offset += dissect_unknown_data(tn5250_tree, tvb, offset, start, length);
3134
0
  }
3135
3136
0
  return (offset - start);
3137
0
}
3138
3139
/* 15.6.11 Write Extended Attribute Order */
3140
static uint32_t
3141
dissect_field_attribute_pair(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3142
0
{
3143
0
  int start = offset;
3144
0
  int attribute_type;
3145
3146
0
  static int * const byte[] = {
3147
0
     &hf_tn5250_wea_prim_attr_flag, &hf_tn5250_wea_prim_attr_col,
3148
0
     &hf_tn5250_wea_prim_attr_blink, &hf_tn5250_wea_prim_attr_und,
3149
0
     &hf_tn5250_wea_prim_attr_int, &hf_tn5250_wea_prim_attr_rev,
3150
0
     NULL
3151
0
  };
3152
3153
0
  attribute_type = tvb_get_uint8(tvb, offset);
3154
0
  proto_tree_add_item(tn5250_tree, hf_tn5250_attribute_type, tvb, offset, 1,
3155
0
                      ENC_BIG_ENDIAN);
3156
0
  offset++;
3157
0
  switch (attribute_type) {
3158
0
    case EXTENDED_PRIMARY_ATTRIBUTES:
3159
0
      proto_tree_add_bitmask(tn5250_tree, tvb, offset, hf_tn5250_wea_prim_attr,
3160
0
                             ett_tn5250_wea_prim_attr, byte, ENC_BIG_ENDIAN);
3161
0
      offset++;
3162
0
      break;
3163
0
    case EXTENDED_FOREGROUND_COLOR_ATTRIBUTES:
3164
0
      proto_tree_add_item(tn5250_tree, hf_tn5250_foreground_color_attr, tvb,
3165
0
                          offset, 1, ENC_BIG_ENDIAN);
3166
0
      offset++;
3167
0
      break;
3168
0
    case EXTENDED_IDEOGRAPHIC_ATTRIBUTES:
3169
0
      proto_tree_add_item(tn5250_tree, hf_tn5250_ideographic_attr, tvb, offset,
3170
0
                          1, ENC_BIG_ENDIAN);
3171
0
      offset++;
3172
0
      break;
3173
0
    default:
3174
      /*TODO: Add invalid data statement here*/
3175
0
      break;
3176
0
  }
3177
3178
0
  return (offset - start);
3179
0
}
3180
3181
/* 15.6.12 Start of Field Order */
3182
static uint32_t
3183
dissect_start_of_field(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3184
0
{
3185
0
  int start = offset;
3186
0
  int done = 0;
3187
0
  int ffw = 0, fcw = 0, fa = 0;
3188
3189
0
  static int * const byte[] = {
3190
0
    &hf_tn5250_ffw_id,
3191
0
    &hf_tn5250_ffw_bypass,
3192
0
    &hf_tn5250_ffw_dup,
3193
0
    &hf_tn5250_ffw_mdt,
3194
0
    &hf_tn5250_ffw_shift,
3195
0
    NULL
3196
0
  };
3197
3198
0
  static int * const byte1[] = {
3199
0
    &hf_tn5250_ffw_auto,
3200
0
    &hf_tn5250_ffw_fer,
3201
0
    &hf_tn5250_ffw_monocase,
3202
0
    &hf_tn5250_ffw_res,
3203
0
    &hf_tn5250_ffw_me,
3204
0
    &hf_tn5250_ffw_adjust,
3205
0
    NULL
3206
0
  };
3207
3208
0
  static int * const fabyte[] = {
3209
0
    &hf_tn5250_sf_attr_flag, &hf_tn5250_wea_prim_attr_col,
3210
0
    &hf_tn5250_wea_prim_attr_blink, &hf_tn5250_wea_prim_attr_und,
3211
0
    &hf_tn5250_wea_prim_attr_int, &hf_tn5250_wea_prim_attr_rev,
3212
0
    NULL
3213
0
  };
3214
3215
0
  hf_items outbound_text_header_fields[] = {
3216
0
    { &hf_tn5250_ffw, ett_tn5250_soh_mask, 1, byte, 0 },
3217
0
    { &hf_tn5250_ffw, ett_tn5250_soh_mask, 1, byte1, 0 },
3218
0
    { NULL, 0, 0, 0, 0 }
3219
0
  };
3220
3221
0
  ffw = tvb_get_uint8(tvb, offset);
3222
3223
0
  if (ffw & FFW_ID) {
3224
0
    offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
3225
0
                                  outbound_text_header_fields);
3226
0
    while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3227
0
      fcw = tvb_get_uint8(tvb, offset);
3228
0
      switch (fcw) {
3229
0
        case SELECTOR:
3230
0
        case IDEOGRAPHIC:
3231
0
        case FORWARD_EDGE:
3232
0
        case CONTINUED_ENTRY:
3233
0
        case SELF_CHECK:
3234
0
        case ENTRY_FIELD_RESEQUENCING:
3235
0
        case CURSOR_PROGRESSION_ENTRY_FIELD:
3236
0
        case HIGHLIGHTED_ENTRY_FIELD:
3237
0
        case POINTER_DEVICE_SELECTION_ENTRY_FIELD:
3238
0
        case TRANSPARENCY_ENTRY_FIELD:
3239
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_fcw, tvb, offset,
3240
0
                              2, ENC_BIG_ENDIAN);
3241
0
          offset+=2;
3242
0
          break;
3243
0
        default:
3244
0
          done = 1;
3245
0
          break;
3246
0
      }
3247
0
    }
3248
0
  }
3249
3250
0
  fa = tvb_get_uint8(tvb, offset);
3251
3252
0
  if (fa & FA_ID) {
3253
0
    proto_tree_add_bitmask(tn5250_tree, tvb, offset, hf_tn5250_fa,
3254
0
                           ett_tn5250_wea_prim_attr, fabyte, ENC_BIG_ENDIAN);
3255
0
    offset++;
3256
0
  } else {
3257
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_fa_color, tvb, offset,
3258
0
                        1, ENC_BIG_ENDIAN);
3259
0
    offset++;
3260
0
  }
3261
0
  proto_tree_add_item(tn5250_tree, hf_tn5250_length_twobyte, tvb, offset,
3262
0
                      2, ENC_BIG_ENDIAN);
3263
0
  offset+=2;
3264
3265
0
  return (offset - start);
3266
0
}
3267
3268
/* 15.6.13 Write To Display Structured Field Order */
3269
static uint32_t
3270
dissect_create_window(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3271
0
{
3272
0
  int start = offset;
3273
0
  int length = 0;
3274
0
  int done = 0, minor_structure = 0;
3275
3276
0
  static int * const byte[] = {
3277
0
    &hf_tn5250_wdsf_cw_flag1_1,
3278
0
    &hf_tn5250_wdsf_cw_flag1_2,
3279
0
    &hf_tn5250_wdsf_cw_flag1_reserved,
3280
0
    NULL
3281
0
  };
3282
3283
0
  hf_items cw_fields[] = {
3284
0
    { &hf_tn5250_wdsf_cw_flag1, ett_tn5250_wdsf_cw_mask, 1, byte, 0 },
3285
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3286
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3287
0
    { &hf_tn5250_wdsf_cw_wd, 0, 1, 0, ENC_BIG_ENDIAN },
3288
0
    { &hf_tn5250_wdsf_cw_ww, 0, 1, 0, ENC_BIG_ENDIAN },
3289
0
    { NULL, 0, 0, 0, 0 }
3290
0
  };
3291
3292
0
  static int * const cw_bp_flag1[] = {
3293
0
    &hf_tn5250_wdsf_cw_bp_flag1_1,
3294
0
    &hf_tn5250_wdsf_cw_bp_flag1_reserved,
3295
0
    NULL
3296
0
  };
3297
3298
3299
0
  hf_items cwbp_fields[] = {
3300
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3301
0
    { &hf_tn5250_wdsf_cw_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3302
0
    { &hf_tn5250_wdsf_cw_bp_flag1, ett_tn5250_wdsf_cw_bp_mask, 1, cw_bp_flag1, 0 },
3303
0
    { &hf_tn5250_wdsf_cw_bp_mba, 0, 1, 0, ENC_BIG_ENDIAN },
3304
0
    { &hf_tn5250_wdsf_cw_bp_cba, 0, 1, 0, ENC_BIG_ENDIAN },
3305
0
    { &hf_tn5250_wdsf_cw_bp_ulbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3306
0
    { &hf_tn5250_wdsf_cw_bp_tbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3307
0
    { &hf_tn5250_wdsf_cw_bp_urbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3308
0
    { &hf_tn5250_wdsf_cw_bp_lbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3309
0
    { &hf_tn5250_wdsf_cw_bp_rbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3310
0
    { &hf_tn5250_wdsf_cw_bp_llbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3311
0
    { &hf_tn5250_wdsf_cw_bp_bbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3312
0
    { &hf_tn5250_wdsf_cw_bp_lrbc, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3313
0
    { NULL, 0, 0, 0, 0 }
3314
0
  };
3315
3316
0
  static int * const cw_tf_flag1[] = {
3317
0
    &hf_tn5250_wdsf_cw_tf_flag_orientation,
3318
0
    &hf_tn5250_wdsf_cw_tf_flag_1,
3319
0
    &hf_tn5250_wdsf_cw_tf_flag_reserved,
3320
0
    NULL
3321
0
  };
3322
3323
3324
0
  hf_items cw_tf_fields[] = {
3325
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3326
0
    { &hf_tn5250_wdsf_cw_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3327
0
    { &hf_tn5250_wdsf_cw_tf_flag, ett_tn5250_wdsf_cw_tf_mask, 1, cw_tf_flag1, 0 },
3328
0
    { &hf_tn5250_wdsf_cw_tf_mba, 0, 1, 0, ENC_BIG_ENDIAN },
3329
0
    { &hf_tn5250_wdsf_cw_tf_cba, 0, 1, 0, ENC_BIG_ENDIAN },
3330
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3331
0
    { NULL, 0, 0, 0, 0 }
3332
0
  };
3333
3334
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, cw_fields);
3335
3336
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3337
0
    minor_structure = tvb_get_uint8(tvb, offset+1);
3338
0
    switch (minor_structure) {
3339
0
      case CW_BORDER_PRESENTATION:
3340
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, cwbp_fields);
3341
0
        break;
3342
0
      case CW_TITLE_FOOTER:
3343
0
        length = tvb_get_uint8(tvb,offset);
3344
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, cw_tf_fields);
3345
0
        if (length < 6) {
3346
          /* XXX - expert info on the length field */
3347
0
          break;
3348
0
        }
3349
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_cw_tf_text, tvb, offset,
3350
0
                            (length - 6), ENC_EBCDIC);
3351
0
        offset += (uint32_t)((length - 6));
3352
0
        break;
3353
0
      default:
3354
0
        done = 1;
3355
0
        break;
3356
0
    }
3357
0
  }
3358
3359
0
  return (offset - start);
3360
0
}
3361
3362
static uint32_t
3363
dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3364
0
{
3365
0
  int start = offset;
3366
0
  int length = 0;
3367
0
  int done = 0, minor_structure = 0, digit_selection = 0;
3368
0
  int minor_structure_start;
3369
3370
0
  static int * const ds_flag1[] = {
3371
0
    &hf_tn5250_wdsf_ds_flag1_mouse_characteristics, &hf_tn5250_wdsf_ds_flag1_reserved,
3372
0
    &hf_tn5250_wdsf_ds_flag1_auto_enter, &hf_tn5250_wdsf_ds_flag1_1,
3373
0
    &hf_tn5250_wdsf_ds_flag1_2, NULL
3374
0
  };
3375
3376
0
  static int * const ds_flag2[] = {
3377
0
    &hf_tn5250_wdsf_ds_flag2_1, &hf_tn5250_wdsf_ds_flag2_2,
3378
0
    &hf_tn5250_wdsf_ds_flag2_3, &hf_tn5250_wdsf_ds_flag2_4,
3379
0
    &hf_tn5250_wdsf_ds_flag2_5, &hf_tn5250_wdsf_ds_flag2_6,
3380
0
    &hf_tn5250_wdsf_ds_flag2_reserved,
3381
0
    NULL
3382
0
  };
3383
3384
0
  static int * const ds_flag3[] = {
3385
0
    &hf_tn5250_wdsf_ds_flag3_1, &hf_tn5250_wdsf_ds_flag3_reserved,
3386
0
    NULL
3387
0
  };
3388
3389
0
  static int * const ds_gdc[] = {
3390
0
    &hf_tn5250_wdsf_ds_gdc_indicators, &hf_tn5250_wdsf_ds_gdc_reserved,
3391
0
    &hf_tn5250_wdsf_ds_gdc_selection_techniques,
3392
0
    NULL
3393
0
  };
3394
3395
0
  static int * const ds_nws[] = {
3396
0
    &hf_tn5250_wdsf_ds_nws_indicators, &hf_tn5250_wdsf_ds_nws_reserved,
3397
0
    &hf_tn5250_wdsf_ds_nws_selection_techniques,
3398
0
    NULL
3399
0
  };
3400
3401
0
  hf_items ds_fields[] = {
3402
0
    { &hf_tn5250_wdsf_ds_flag1, ett_tn5250_wdsf_ds_mask, 1, ds_flag1, 0 },
3403
0
    { &hf_tn5250_wdsf_ds_flag2, ett_tn5250_wdsf_ds_mask, 1, ds_flag2, 0 },
3404
0
    { &hf_tn5250_wdsf_ds_flag3, ett_tn5250_wdsf_ds_mask, 1, ds_flag3, 0 },
3405
0
    { &hf_tn5250_wdsf_ds_type, 0, 1, 0, ENC_BIG_ENDIAN },
3406
0
    { &hf_tn5250_wdsf_ds_gdc, ett_tn5250_wdsf_ds_mask, 1, ds_gdc, 0 },
3407
0
    { &hf_tn5250_wdsf_ds_nws, ett_tn5250_wdsf_ds_mask, 1, ds_nws, 0 },
3408
0
    { &hf_tn5250_wdsf_ds_nws_wout, ett_tn5250_wdsf_ds_mask, 1, ds_nws, 0 },
3409
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3410
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3411
0
    { &hf_tn5250_wdsf_ds_textsize, 0, 1, 0, ENC_BIG_ENDIAN },
3412
0
    { &hf_tn5250_wdsf_ds_rows, 0, 1, 0, ENC_BIG_ENDIAN },
3413
0
    { &hf_tn5250_wdsf_ds_columns, 0, 1, 0, ENC_BIG_ENDIAN },
3414
0
    { &hf_tn5250_wdsf_ds_padding, 0, 1, 0, ENC_BIG_ENDIAN },
3415
0
    { &hf_tn5250_wdsf_ds_numeric_sep, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3416
0
    { &hf_tn5250_wdsf_ds_country_sel, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3417
0
    { &hf_tn5250_wdsf_ds_cancel_aid, 0, 1, 0, ENC_BIG_ENDIAN },
3418
0
    { &hf_tn5250_wdsf_ds_totalrows, 0, 4, 0, ENC_BIG_ENDIAN },
3419
0
    { &hf_tn5250_wdsf_ds_sliderpos, 0, 4, 0, ENC_BIG_ENDIAN },
3420
0
    { NULL, 0, 0, 0, 0 }
3421
0
  };
3422
3423
0
  static int * const ds_ct_flag1[] = {
3424
0
    &hf_tn5250_wdsf_ds_ct_flag1_choice_state, &hf_tn5250_wdsf_ds_ct_flag1_2,
3425
0
    &hf_tn5250_wdsf_ds_ct_flag1_3, &hf_tn5250_wdsf_ds_ct_flag1_4,
3426
0
    &hf_tn5250_wdsf_ds_ct_flag1_5, &hf_tn5250_wdsf_ds_ct_flag1_numeric_selection,
3427
0
    NULL
3428
0
  };
3429
3430
0
  static int * const ds_ct_flag2[] = {
3431
0
    &hf_tn5250_wdsf_ds_ct_flag2_0, &hf_tn5250_wdsf_ds_ct_flag2_1,
3432
0
    &hf_tn5250_wdsf_ds_ct_flag2_2, &hf_tn5250_wdsf_ds_ct_flag2_3,
3433
0
    &hf_tn5250_wdsf_ds_ct_flag2_4, &hf_tn5250_wdsf_ds_ct_flag2_5,
3434
0
    &hf_tn5250_wdsf_ds_ct_flag2_6, &hf_tn5250_wdsf_ds_ct_flag2_7,
3435
0
    NULL
3436
0
  };
3437
3438
0
  static int * const ds_ct_flag3[] = {
3439
0
    &hf_tn5250_wdsf_ds_ct_flag3_0, &hf_tn5250_wdsf_ds_ct_flag3_1,
3440
0
    &hf_tn5250_wdsf_ds_ct_flag3_2, &hf_tn5250_wdsf_ds_ct_flag3_reserved,
3441
0
    NULL
3442
0
  };
3443
3444
0
  hf_items ds_ct_fields[] = {
3445
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3446
0
    { &hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3447
0
    { &hf_tn5250_wdsf_ds_ct_flag1, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag1, 0 },
3448
0
    { &hf_tn5250_wdsf_ds_ct_flag2, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag2, 0 },
3449
0
    { &hf_tn5250_wdsf_ds_ct_flag3, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag3, 0 },
3450
0
    { &hf_tn5250_wdsf_ds_ct_mnemonic_offset, 0, 1, 0, ENC_BIG_ENDIAN },
3451
0
    { &hf_tn5250_wdsf_ds_ct_aid, 0, 1, 0, ENC_BIG_ENDIAN },
3452
0
    { &hf_tn5250_wdsf_ds_ct_numeric_onebyte, 0, 1, 0, ENC_BIG_ENDIAN },
3453
0
    { &hf_tn5250_wdsf_ds_ct_numeric_twobyte, 0, 2, 0, ENC_BIG_ENDIAN },
3454
0
    { NULL, 0, 0, 0, 0 }
3455
0
  };
3456
3457
0
  static int * const ds_mbs_flag[] = {
3458
0
    &hf_tn5250_wdsf_ds_mbs_flag_0, &hf_tn5250_wdsf_ds_mbs_flag_1,
3459
0
    &hf_tn5250_wdsf_ds_mbs_flag_reserved,
3460
0
    NULL
3461
0
  };
3462
3463
0
  hf_items ds_mbs_fields[] = {
3464
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3465
0
    { &hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3466
0
    { &hf_tn5250_wdsf_ds_mbs_flag, ett_tn5250_wdsf_ds_mbs_mask, 1, ds_mbs_flag, 0 },
3467
0
    { &hf_tn5250_wdsf_ds_mbs_start_column, 0, 1, 0, ENC_BIG_ENDIAN },
3468
0
    { &hf_tn5250_wdsf_ds_mbs_end_column, 0, 1, 0, ENC_BIG_ENDIAN },
3469
0
    { &hf_tn5250_wdsf_ds_mbs_start_column, 0, 1, 0, ENC_BIG_ENDIAN },
3470
0
    { &hf_tn5250_wdsf_ds_mbs_monochrome_sep, 0, 1, 0, ENC_BIG_ENDIAN },
3471
0
    { &hf_tn5250_wdsf_ds_mbs_color_sep, 0, 1, 0, ENC_BIG_ENDIAN },
3472
0
    { &hf_tn5250_wdsf_ds_mbs_sep_char, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3473
0
    { NULL, 0, 0, 0, 0 }
3474
0
  };
3475
3476
0
  static int * const ds_cpda_flag[] = {
3477
0
    &hf_tn5250_wdsf_ds_cpda_flag1_0, &hf_tn5250_wdsf_ds_cpda_flag1_1,
3478
0
    &hf_tn5250_wdsf_ds_cpda_flag1_2, &hf_tn5250_wdsf_ds_cpda_flag1_reserved,
3479
0
    NULL
3480
0
  };
3481
3482
0
  hf_items ds_cpda_fields[] = {
3483
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3484
0
    { &hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3485
0
    { &hf_tn5250_wdsf_ds_cpda_flag1, ett_tn5250_wdsf_ds_cpda_mask, 1, ds_cpda_flag, 0 },
3486
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_sel_avail, 0, 1, 0, ENC_BIG_ENDIAN },
3487
0
    { &hf_tn5250_wdsf_ds_cpda_color_sel_avail, 0, 1, 0, ENC_BIG_ENDIAN },
3488
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_sel_selected, 0, 1, 0, ENC_BIG_ENDIAN },
3489
0
    { &hf_tn5250_wdsf_ds_cpda_color_sel_selected, 0, 1, 0, ENC_BIG_ENDIAN },
3490
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_sel_unavail, 0, 1, 0, ENC_BIG_ENDIAN },
3491
0
    { &hf_tn5250_wdsf_ds_cpda_color_sel_unavail, 0, 1, 0, ENC_BIG_ENDIAN },
3492
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_avail, 0, 1, 0, ENC_BIG_ENDIAN },
3493
0
    { &hf_tn5250_wdsf_ds_cpda_color_avail, 0, 1, 0, ENC_BIG_ENDIAN },
3494
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_selected, 0, 1, 0, ENC_BIG_ENDIAN },
3495
0
    { &hf_tn5250_wdsf_ds_cpda_color_selected, 0, 1, 0, ENC_BIG_ENDIAN },
3496
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_unavail, 0, 1, 0, ENC_BIG_ENDIAN },
3497
0
    { &hf_tn5250_wdsf_ds_cpda_color_unavail, 0, 1, 0, ENC_BIG_ENDIAN },
3498
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_indicator, 0, 1, 0, ENC_BIG_ENDIAN },
3499
0
    { &hf_tn5250_wdsf_ds_cpda_color_indicator, 0, 1, 0, ENC_BIG_ENDIAN },
3500
0
    { &hf_tn5250_wdsf_ds_cpda_monochrome_unavail_indicator, 0, 1, 0, ENC_BIG_ENDIAN },
3501
0
    { &hf_tn5250_wdsf_ds_cpda_color_unavail_indicator, 0, 1, 0, ENC_BIG_ENDIAN },
3502
0
    { NULL, 0, 0, 0, 0 }
3503
0
  };
3504
3505
0
  static int * const ds_ci_flag[] = {
3506
0
    &hf_tn5250_wdsf_ds_ci_flag1_0, &hf_tn5250_wdsf_ds_ci_flag1_reserved,
3507
0
    NULL
3508
0
  };
3509
3510
0
  hf_items ds_ci_fields[] = {
3511
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3512
0
    { &hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3513
0
    { &hf_tn5250_wdsf_ds_ci_flag1, ett_tn5250_wdsf_ds_ci_mask, 1, ds_ci_flag, 0 },
3514
0
    { &hf_tn5250_wdsf_ds_ci_left_push, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3515
0
    { &hf_tn5250_wdsf_ds_ci_right_push, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3516
0
    { &hf_tn5250_wdsf_ds_ci_first_choice, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3517
0
    { NULL, 0, 0, 0, 0 }
3518
0
  };
3519
3520
0
  static int * const ds_sbi_flag[] = {
3521
0
    &hf_tn5250_wdsf_ds_sbi_flag1_0, &hf_tn5250_wdsf_ds_sbi_flag1_reserved,
3522
0
    NULL
3523
0
  };
3524
3525
0
  hf_items ds_sbi_fields[] = {
3526
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3527
0
    { &hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3528
0
    { &hf_tn5250_wdsf_ds_sbi_flag1, ett_tn5250_wdsf_ds_sbi_mask, 1, ds_sbi_flag, 0 },
3529
0
    { &hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN },
3530
0
    { &hf_tn5250_wdsf_ds_sbi_color_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN },
3531
0
    { &hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN },
3532
0
    { &hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN },
3533
0
    { &hf_tn5250_wdsf_ds_sbi_top_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3534
0
    { &hf_tn5250_wdsf_ds_sbi_bottom_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3535
0
    { &hf_tn5250_wdsf_ds_sbi_empty_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3536
0
    { &hf_tn5250_wdsf_ds_sbi_slider_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3537
0
    { NULL, 0, 0, 0, 0 }
3538
0
  };
3539
3540
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_fields);
3541
3542
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3543
0
    minor_structure = tvb_get_uint8(tvb, offset+1);
3544
0
    switch (minor_structure) {
3545
0
      case DS_CHOICE_TEXT:
3546
0
        length = tvb_get_uint8(tvb, offset);
3547
0
        digit_selection = tvb_get_uint8(tvb, offset+2);
3548
        /*
3549
         * XXX - the document says the AID field is present only if
3550
         * the "AID if selected" flag bit is set.
3551
         */
3552
0
        minor_structure_start = offset;
3553
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_ct_fields);
3554
0
        if (digit_selection & DS_NUMERIC_SELECTION_SINGLE_DIGIT) {
3555
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_ds_ct_numeric_onebyte,
3556
0
                              tvb, offset, 1, ENC_BIG_ENDIAN);
3557
0
          offset++;
3558
0
        } else if (digit_selection & DS_NUMERIC_SELECTION_DOUBLE_DIGIT) {
3559
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_ds_ct_numeric_twobyte,
3560
0
                              tvb, offset, 2, ENC_BIG_ENDIAN);
3561
0
          offset+=2;
3562
0
        }
3563
0
        if (length < (offset - minor_structure_start)) {
3564
          /* XXX - expert info on the length field */
3565
0
          break;
3566
0
        }
3567
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_ds_ct_text, tvb, offset,
3568
0
                            (length - (offset - minor_structure_start)),
3569
0
                            ENC_EBCDIC);
3570
0
        offset += (uint32_t)((length - (offset - minor_structure_start)));
3571
0
        break;
3572
0
      case DS_MENU_BAR_SEPARATOR:
3573
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_mbs_fields);
3574
0
        break;
3575
0
      case DS_CHOICE_PRESENTATION_DISPLAY:
3576
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_cpda_fields);
3577
0
        break;
3578
0
      case DS_CHOICE_INDICATORS:
3579
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_ci_fields);
3580
0
        break;
3581
0
      case DS_SCROLLBAR_INDICATORS:
3582
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_sbi_fields);
3583
0
        break;
3584
0
      default:
3585
0
        done = 1;
3586
0
        break;
3587
0
    }
3588
0
  }
3589
0
  return (offset - start);
3590
0
}
3591
3592
static uint32_t
3593
dissect_define_scrollbar(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3594
0
{
3595
0
  int start = offset;
3596
0
  int done = 0, minor_structure = 0;
3597
3598
0
  static int * const dsb_byte[] = {
3599
0
    &hf_tn5250_wdsf_dsb_flag1_0, &hf_tn5250_wdsf_dsb_flag1_1,
3600
0
    &hf_tn5250_wdsf_dsb_flag1_reserved, &hf_tn5250_wdsf_dsb_flag1_7,
3601
0
    NULL
3602
0
  };
3603
3604
0
  hf_items dsb_fields[] = {
3605
0
    { &hf_tn5250_wdsf_dsb_flag1, ett_tn5250_wdsf_dsb_mask, 1, dsb_byte, 0 },
3606
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3607
0
    { &hf_tn5250_wdsf_sbi_total_scroll, 0, 4, 0, ENC_BIG_ENDIAN },
3608
0
    { &hf_tn5250_wdsf_sbi_sliderpos, 0, 4, 0, ENC_BIG_ENDIAN },
3609
0
    { &hf_tn5250_wdsf_sbi_rowscols, 0, 1, 0, ENC_BIG_ENDIAN },
3610
0
    { NULL, 0, 0, 0, 0 }
3611
0
  };
3612
3613
0
  static int * const ds_sbi_flag[] = {
3614
0
    &hf_tn5250_wdsf_ds_sbi_flag1_0, &hf_tn5250_wdsf_ds_sbi_flag1_reserved,
3615
0
    NULL
3616
0
  };
3617
3618
0
  hf_items ds_sbi_fields[] = {
3619
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3620
0
    { &hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3621
0
    { &hf_tn5250_wdsf_ds_sbi_flag1, ett_tn5250_wdsf_ds_sbi_mask, 1, ds_sbi_flag, 0 },
3622
0
    { &hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN },
3623
0
    { &hf_tn5250_wdsf_ds_sbi_color_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN },
3624
0
    { &hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN },
3625
0
    { &hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN },
3626
0
    { &hf_tn5250_wdsf_ds_sbi_top_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3627
0
    { &hf_tn5250_wdsf_ds_sbi_bottom_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3628
0
    { &hf_tn5250_wdsf_ds_sbi_empty_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3629
0
    { &hf_tn5250_wdsf_ds_sbi_slider_character, 0, 1, 0, ENC_EBCDIC|ENC_NA },
3630
0
    { NULL, 0, 0, 0, 0 }
3631
0
  };
3632
3633
3634
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dsb_fields);
3635
3636
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3637
0
    minor_structure = tvb_get_uint8(tvb, offset+1);
3638
0
    switch (minor_structure) {
3639
0
      case DS_SCROLLBAR_INDICATORS:
3640
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_sbi_fields);
3641
0
        break;
3642
0
      default:
3643
0
        done = 1;
3644
0
        break;
3645
0
    }
3646
0
  }
3647
0
  return (offset - start);
3648
0
}
3649
3650
static uint32_t
3651
dissect_draw_erase_gridlines(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3652
0
{
3653
0
  int start = offset;
3654
0
  int done = 0, minor_structure=0;
3655
3656
0
  static int * const deg_byte[] = {
3657
0
    &hf_tn5250_wdsf_deg_flag1_0, &hf_tn5250_wdsf_deg_flag1_reserved,
3658
0
    NULL
3659
0
  };
3660
3661
0
  static int * const deg_byte2[] = {
3662
0
    &hf_tn5250_wdsf_deg_flag2_0, &hf_tn5250_wdsf_deg_flag2_reserved,
3663
0
    NULL
3664
0
  };
3665
3666
0
  hf_items deg_fields[] = {
3667
0
    { &hf_tn5250_wdsf_deg_partition, 0, 1, 0, ENC_BIG_ENDIAN },
3668
0
    { &hf_tn5250_wdsf_deg_flag1, ett_tn5250_wdsf_deg_mask, 1, deg_byte, 0 },
3669
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3670
0
    { &hf_tn5250_wdsf_deg_flag2, ett_tn5250_wdsf_deg_mask, 1, deg_byte2, 0 },
3671
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3672
0
    { &hf_tn5250_wdsf_deg_default_color, 0, 1, 0, ENC_BIG_ENDIAN },
3673
0
    { &hf_tn5250_wdsf_deg_default_line, 0, 1, 0, ENC_BIG_ENDIAN },
3674
0
    { NULL, 0, 0, 0, 0 }
3675
0
  };
3676
3677
3678
0
  static int * const deg_ms_byte[] = {
3679
0
    &hf_tn5250_wdsf_deg_ms_flag1_0, &hf_tn5250_wdsf_deg_ms_flag1_reserved,
3680
0
    NULL
3681
0
  };
3682
3683
0
  hf_items deg_ms_fields[] = {
3684
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
3685
0
    { &hf_tn5250_wdsf_deg_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
3686
0
    { &hf_tn5250_wdsf_deg_ms_flag1, ett_tn5250_wdsf_deg_ms_mask, 1, deg_ms_byte, 0 },
3687
0
    { &hf_tn5250_wdsf_deg_ms_start_row, 0, 1, 0, ENC_BIG_ENDIAN },
3688
0
    { &hf_tn5250_wdsf_deg_ms_start_column, 0, 1, 0, ENC_BIG_ENDIAN },
3689
0
    { &hf_tn5250_wdsf_deg_ms_horizontal_dimension, 0, 1, 0, ENC_BIG_ENDIAN },
3690
0
    { &hf_tn5250_wdsf_deg_ms_vertical_dimension, 0, 1, 0, ENC_BIG_ENDIAN },
3691
0
    { &hf_tn5250_wdsf_deg_ms_default_color, 0, 1, 0, ENC_BIG_ENDIAN },
3692
0
    { &hf_tn5250_wdsf_deg_ms_line_repeat, 0, 1, 0, ENC_BIG_ENDIAN },
3693
0
    { &hf_tn5250_wdsf_deg_ms_line_interval, 0, 1, 0, ENC_BIG_ENDIAN },
3694
0
    { NULL, 0, 0, 0, 0 }
3695
0
  };
3696
3697
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, deg_fields);
3698
3699
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3700
0
    minor_structure = tvb_get_uint8(tvb, offset+1);
3701
0
    switch (minor_structure) {
3702
0
      case UPPER_HORIZONTAL_LINE:
3703
0
      case LOWER_HORIZONTAL_LINE:
3704
0
      case LEFT_VERTICAL_LINE:
3705
0
      case RIGHT_VERTICAL_LINE:
3706
0
      case PLAIN_BOX:
3707
0
      case HORIZONTALLY_RULED_BOX:
3708
0
      case VERTICALLY_RULED_BOX:
3709
0
      case HORIZONTALLY_AND_VERTICALLY_RULED_BOX:
3710
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, deg_ms_fields);
3711
0
        break;
3712
0
      default:
3713
0
        done = 1;
3714
0
        break;
3715
0
    }
3716
0
  }
3717
0
  return (offset - start);
3718
0
}
3719
3720
static uint32_t
3721
dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3722
0
{
3723
0
  int start = offset;
3724
0
  int minor_structure_start;
3725
0
  int length = 0, type;
3726
0
  int done = 0, ln_left = 0, i = 0;
3727
3728
0
  hf_items standard_fields[] = {
3729
0
    { &hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN },
3730
0
    { &hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN },
3731
0
    { &hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN },
3732
0
    { NULL, 0, 0, 0, 0 }
3733
0
  };
3734
3735
0
  static int * const rgw_byte[] = {
3736
0
    &hf_tn5250_wdsf_rgw_flag1_0,
3737
0
    &hf_tn5250_wdsf_rgw_flag1_1,
3738
0
    &hf_tn5250_wdsf_rgw_reserved,
3739
0
    NULL
3740
0
  };
3741
3742
0
  hf_items rgw_fields[] = {
3743
0
    { &hf_tn5250_wdsf_rgw_flag1, ett_tn5250_wdsf_rgw_mask, 1, rgw_byte, 0 },
3744
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3745
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3746
0
    { NULL, 0, 0, 0, 0 }
3747
0
  };
3748
3749
0
  static int * const ragc_byte[] = {
3750
0
    &hf_tn5250_wdsf_ragc_flag1_0,
3751
0
    &hf_tn5250_wdsf_ragc_reserved,
3752
0
    NULL
3753
0
  };
3754
3755
0
  hf_items ragc_fields[] = {
3756
0
    { &hf_tn5250_wdsf_ragc_flag1, ett_tn5250_wdsf_ragc_mask, 1, ragc_byte, 0 },
3757
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3758
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3759
0
    { NULL, 0, 0, 0, 0 }
3760
0
  };
3761
3762
0
  static int * const wdf_byte[] = {
3763
0
    &hf_tn5250_wdsf_wdf_flag1_0,
3764
0
    &hf_tn5250_wdsf_wdf_flag1_reserved,
3765
0
    NULL
3766
0
  };
3767
3768
0
  hf_items wdf_fields[] = {
3769
0
    { &hf_tn5250_wdsf_wdf_flag1, ett_tn5250_wdsf_wdf_mask, 1, wdf_byte, 0 },
3770
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
3771
0
    { NULL, 0, 0, 0, 0 }
3772
0
  };
3773
3774
0
  static int * const pmb_byte[] = {
3775
0
    &hf_tn5250_wdsf_pmb_flag1_0, &hf_tn5250_wdsf_pmb_flag1_1,
3776
0
    &hf_tn5250_wdsf_pmb_flag1_2, &hf_tn5250_wdsf_pmb_flag1_3,
3777
0
    &hf_tn5250_wdsf_pmb_flag1_reserved,
3778
0
    NULL
3779
0
  };
3780
3781
0
  hf_items pmb_fields[] = {
3782
0
    { &hf_tn5250_wdsf_pmb_flag1, ett_tn5250_wdsf_pmb_mask, 1, pmb_byte, 0 },
3783
0
    { &hf_tn5250_wdsf_pmb_first_mouse_event, 0, 1, 0, ENC_BIG_ENDIAN },
3784
0
    { &hf_tn5250_wdsf_pmb_second_mouse_event, 0, 1, 0, ENC_BIG_ENDIAN },
3785
0
    { &hf_tn5250_aid, 0, 1, 0, ENC_BIG_ENDIAN },
3786
0
    { NULL, 0, 0, 0, 0 }
3787
0
  };
3788
3789
0
  hf_items cgl_fields[] = {
3790
0
    { &hf_tn5250_wdsf_cgl_partition, 0, 1, 0, ENC_BIG_ENDIAN },
3791
0
    { &hf_tn5250_wdsf_cgl_start_row, 0, 1, 0, ENC_BIG_ENDIAN },
3792
0
    { &hf_tn5250_wdsf_cgl_start_column, 0, 1, 0, ENC_BIG_ENDIAN },
3793
0
    { &hf_tn5250_wdsf_cgl_rectangle_width, 0, 1, 0, ENC_BIG_ENDIAN },
3794
0
    { &hf_tn5250_wdsf_cgl_rectangle_height, 0, 1, 0, ENC_BIG_ENDIAN },
3795
0
    { NULL, 0, 0, 0, 0 }
3796
0
  };
3797
3798
0
  length = tvb_get_ntohs(tvb,offset);
3799
0
  type = tvb_get_uint8(tvb, offset+3);
3800
3801
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, standard_fields);
3802
3803
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3804
0
    switch (type) {
3805
0
      case CREATE_WINDOW:
3806
0
        offset += dissect_create_window(tn5250_tree, tvb, offset);
3807
0
        break;
3808
0
      case UNRESTRICTED_WINDOW_CURSOR_MOVEMENT:
3809
0
      case REMOVE_GUI_SELECTION_FIELD:
3810
0
      case REMOVE_GUI_SCROLL_BAR_FIELD:
3811
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset,
3812
0
                            1, ENC_BIG_ENDIAN);
3813
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset,
3814
0
                            1, ENC_BIG_ENDIAN);
3815
0
        offset +=2;
3816
0
        break;
3817
0
      case REMOVE_GUI_WINDOW:
3818
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, rgw_fields);
3819
0
        break;
3820
0
      case REMOVE_ALL_GUI_CONSTRUCTS:
3821
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ragc_fields);
3822
0
        break;
3823
0
      case DEFINE_SELECTION_FIELD:
3824
0
        offset += dissect_define_selection(tn5250_tree, tvb, offset);
3825
0
        break;
3826
0
      case DEFINE_SCROLL_BAR_FIELD:
3827
0
        offset += dissect_define_scrollbar(tn5250_tree, tvb, offset);
3828
0
        break;
3829
0
      case WRITE_DATA:
3830
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, wdf_fields);
3831
0
        if (length < 6) {
3832
          /* XXX - expert info on the length field */
3833
0
          break;
3834
0
        }
3835
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset,
3836
0
                            (length - 6), ENC_EBCDIC);
3837
0
        offset += (uint32_t)((length - 6));
3838
0
        break;
3839
0
      case PROGRAMMABLE_MOUSE_BUTTONS:
3840
0
        minor_structure_start = start;
3841
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset,
3842
0
                            1, ENC_BIG_ENDIAN);
3843
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset,
3844
0
                            1, ENC_BIG_ENDIAN);
3845
0
        offset +=2;
3846
0
        if (length < (offset - minor_structure_start)) {
3847
          /* XXX - expert info on length field */
3848
0
          break;
3849
0
        }
3850
0
        ln_left = length - (offset - minor_structure_start);
3851
0
        for (i = 0; i < ln_left; i+=4) {
3852
0
          offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, pmb_fields);
3853
0
        }
3854
0
        break;
3855
0
      case DRAW_ERASE_GRID_LINES:
3856
0
        offset += dissect_draw_erase_gridlines(tn5250_tree, tvb, offset);
3857
0
        break;
3858
0
      case CLEAR_GRID_LINE_BUFFER:
3859
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, cgl_fields);
3860
0
        break;
3861
0
      default:
3862
0
        done = 1;
3863
0
        break;
3864
0
    }
3865
0
  }
3866
0
  offset += dissect_unknown_data(tn5250_tree, tvb, offset, start, length);
3867
3868
0
  return (offset - start);
3869
3870
0
}
3871
3872
3873
/* 15.6 WRITE TO DISPLAY Command - Orders and Data */
3874
static uint32_t
3875
dissect_tn5250_ra_data(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3876
0
{
3877
0
  int order_code, done = 0;
3878
0
  int start = offset;
3879
3880
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3881
0
    order_code = tvb_get_uint8(tvb, offset);
3882
0
    switch (order_code) {
3883
0
      case TN5250_IC:
3884
0
      case TN5250_MC:
3885
0
      case TN5250_SBA:
3886
0
      case TN5250_RA:
3887
0
      case TN5250_EA:
3888
0
      case TN5250_SOH:
3889
0
      case TN5250_TD:
3890
0
      case TN5250_WEA:
3891
0
      case TN5250_SF:
3892
0
      case TN5250_WDSF:
3893
0
      case TN5250_ESCAPE:
3894
0
        done = 1;
3895
0
        break;
3896
0
      default:
3897
0
        offset++;
3898
0
        break;
3899
0
    }
3900
0
  }
3901
3902
0
  if (offset > start) {
3903
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_repeated_character,
3904
0
                        tvb, start, (offset - start), ENC_EBCDIC);
3905
0
  }
3906
0
  return (offset - start);
3907
3908
0
}
3909
3910
static uint32_t
3911
dissect_tn5250_orders_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3912
0
{
3913
0
  int start = offset, done = 0;
3914
0
  int order_code;
3915
0
  proto_tree   *cc_tree;
3916
0
  proto_item   *ti;
3917
3918
  /* Order Code */
3919
3920
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
3921
0
    order_code = tvb_get_uint8(tvb, offset);
3922
0
    switch (order_code) {
3923
0
      case TN5250_IC:
3924
0
      case TN5250_MC:
3925
0
      case TN5250_SBA:
3926
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3927
0
                                 offset, 1, ENC_BIG_ENDIAN);
3928
0
        offset++;
3929
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3930
0
        offset += dissect_row_column(cc_tree, tvb, offset);
3931
0
        offset += dissect_tn5250_ra_data(cc_tree, tvb, offset);
3932
0
        break;
3933
0
      case TN5250_RA:
3934
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3935
0
                                 offset, 1, ENC_BIG_ENDIAN);
3936
0
        offset++;
3937
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3938
0
        offset += dissect_row_column(cc_tree, tvb, offset);
3939
0
        offset += dissect_tn5250_ra_data(cc_tree, tvb, offset);
3940
0
        break;
3941
0
      case TN5250_EA:
3942
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3943
0
                                 offset, 1, ENC_BIG_ENDIAN);
3944
0
        offset++;
3945
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3946
0
        offset += dissect_erase_to_address(cc_tree, tvb, offset);
3947
0
        break;
3948
0
      case TN5250_SOH:
3949
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3950
0
                                 offset, 1, ENC_BIG_ENDIAN);
3951
0
        offset++;
3952
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3953
0
        offset += dissect_start_of_header(cc_tree, tvb, offset);
3954
0
        break;
3955
0
      case TN5250_TD:
3956
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3957
0
                                 offset, 1, ENC_BIG_ENDIAN);
3958
0
        offset++;
3959
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3960
0
        offset += dissect_twobyte_length_and_data(cc_tree, tvb, offset);
3961
0
        break;
3962
0
      case TN5250_WEA:
3963
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3964
0
                                 offset, 1, ENC_BIG_ENDIAN);
3965
0
        offset++;
3966
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3967
0
        offset += dissect_field_attribute_pair(cc_tree, tvb, offset);
3968
0
        break;
3969
0
      case TN5250_SF:
3970
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3971
0
                                 offset, 1, ENC_BIG_ENDIAN);
3972
0
        offset++;
3973
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3974
0
        offset += dissect_start_of_field(cc_tree, tvb, offset);
3975
0
        offset += dissect_tn5250_ra_data(cc_tree, tvb, offset);
3976
0
        break;
3977
0
      case TN5250_WDSF:
3978
0
        ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb,
3979
0
                                 offset, 1, ENC_BIG_ENDIAN);
3980
0
        offset++;
3981
0
        cc_tree = proto_item_add_subtree(ti, ett_cc);
3982
0
        offset += dissect_wdsf_structured_field(cc_tree, tvb, offset);
3983
0
        break;
3984
0
      default:
3985
0
        done = 1;
3986
0
        break;
3987
0
    }
3988
0
  }
3989
0
  return (offset - start);
3990
0
}
3991
3992
/* 15.22 SAVE PARTIAL SCREEN Command */
3993
static uint32_t
3994
dissect_save_partial_screen(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
3995
0
{
3996
0
  int start = offset;
3997
0
  int length = 0;
3998
3999
0
  static int * const byte[] = {
4000
0
    &hf_tn5250_sps_flag1_0,
4001
0
    &hf_tn5250_sps_flag1_reserved,
4002
0
    NULL
4003
0
  };
4004
4005
0
  hf_items save_partial_screen_fields[] = {
4006
0
    { &hf_tn5250_soh_length, 0, 1, 0, ENC_BIG_ENDIAN },
4007
0
    { &hf_tn5250_sps_flag1, ett_tn5250_sps_mask, 1, byte, 0 },
4008
0
    { &hf_tn5250_sps_top_row, 0, 1, 0, ENC_BIG_ENDIAN },
4009
0
    { &hf_tn5250_sps_left_column, 0, 1, 0, ENC_BIG_ENDIAN },
4010
0
    { &hf_tn5250_sps_window_depth, 0, 1, 0, ENC_BIG_ENDIAN },
4011
0
    { &hf_tn5250_sps_window_width, 0, 1, 0, ENC_BIG_ENDIAN },
4012
0
    { NULL, 0, 0, 0, 0 }
4013
0
  };
4014
4015
0
  length = tvb_get_uint8(tvb, offset);
4016
4017
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4018
0
                                save_partial_screen_fields);
4019
4020
0
  offset += dissect_unknown_data(tn5250_tree, tvb, offset, start, length);
4021
4022
0
  return (offset - start);
4023
0
}
4024
4025
/* 15.25 ROLL Command */
4026
static uint32_t
4027
dissect_roll(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
4028
0
{
4029
0
  int start = offset;
4030
4031
0
  static int * const byte[] = {
4032
0
    &hf_tn5250_roll_flag1_0,
4033
0
    &hf_tn5250_roll_flag1_reserved,
4034
0
    &hf_tn5250_roll_flag1_lines,
4035
0
    NULL
4036
0
  };
4037
4038
0
  hf_items roll_fields[] = {
4039
0
    { &hf_tn5250_roll_flag1, ett_tn5250_roll_mask, 1, byte, 0 },
4040
0
    { &hf_tn5250_roll_top_line, 0, 1, 0, ENC_BIG_ENDIAN },
4041
0
    { &hf_tn5250_roll_bottom_line, 0, 1, 0, ENC_BIG_ENDIAN },
4042
0
    { NULL, 0, 0, 0, 0 }
4043
0
  };
4044
4045
4046
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, roll_fields);
4047
4048
0
  return (offset - start);
4049
0
}
4050
4051
/* 15.26 WRITE SINGLE STRUCTURED FIELD Command */
4052
static uint32_t
4053
dissect_write_single_structured_field_minor_fields(proto_tree *tn5250_tree,
4054
                                                   tvbuff_t *tvb, int offset)
4055
0
{
4056
4057
0
  int start = offset;
4058
0
  int done = 0, type = 0;
4059
4060
0
  static int * const byte_wssf_kbc_flag1[] = {
4061
0
    &hf_tn5250_wssf_kbc_flag1_reserved,
4062
0
    &hf_tn5250_wssf_kbc_flag1_5,
4063
0
    &hf_tn5250_wssf_kbc_flag1_6,
4064
0
    &hf_tn5250_wssf_kbc_flag1_7,
4065
0
    NULL
4066
0
  };
4067
4068
0
  static int * const byte_wssf_cc_flag1[] = {
4069
0
    &hf_tn5250_wssf_cc_flag1_reserved,
4070
0
    &hf_tn5250_wssf_cc_flag1_7,
4071
0
    NULL
4072
0
  };
4073
4074
0
  hf_items wsc_customization_kbc_fields[] = {
4075
0
    { &hf_tn5250_sf_length, 0, 1, 0, ENC_BIG_ENDIAN },
4076
0
    { &hf_tn5250_wssf_wsc_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
4077
0
    { &hf_tn5250_wssf_kbc_flag1, ett_tn5250_wssf_kbc_mask, 1, byte_wssf_kbc_flag1, 0 },
4078
0
    { NULL, 0, 0, 0, 0 }
4079
0
  };
4080
4081
0
  hf_items wsc_customization_cc_fields[] = {
4082
0
    { &hf_tn5250_sf_length, 0, 1, 0, ENC_BIG_ENDIAN },
4083
0
    { &hf_tn5250_wssf_wsc_minor_type, 0, 1, 0, ENC_BIG_ENDIAN },
4084
0
    { &hf_tn5250_wssf_cc_flag1, ett_tn5250_wssf_cc_mask, 1, byte_wssf_cc_flag1, 0 },
4085
0
    { NULL, 0, 0, 0, 0 }
4086
0
  };
4087
4088
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
4089
0
    type = tvb_get_uint8(tvb, offset+1);
4090
0
    switch (type) {
4091
0
      case KEYSTROKE_BUFFERING_CONTROL:
4092
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4093
0
                                      wsc_customization_kbc_fields);
4094
0
        break;
4095
0
      case CURSOR_CONTROL:
4096
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4097
0
                                      wsc_customization_cc_fields);
4098
0
        break;
4099
0
      default:
4100
0
        done = 1;
4101
0
        break;
4102
0
    }
4103
0
  }
4104
4105
0
  return (offset - start);
4106
4107
0
}
4108
4109
static uint32_t
4110
dissect_write_single_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb,
4111
                                      int offset)
4112
0
{
4113
0
  int start = offset;
4114
0
  int length, type, done = 0;
4115
0
  uint32_t namelength;
4116
4117
0
  static int * const byte[] = {
4118
0
    &hf_tn5250_wssf_flag2_0,
4119
0
    &hf_tn5250_wssf_flag2_1,
4120
0
    &hf_tn5250_wssf_flag2_2,
4121
0
    &hf_tn5250_wssf_flag2_3,
4122
0
    &hf_tn5250_wssf_flag2_4,
4123
0
    &hf_tn5250_wssf_flag2_5,
4124
0
    &hf_tn5250_wssf_flag2_6,
4125
0
    &hf_tn5250_wssf_flag2_7,
4126
0
    NULL
4127
0
  };
4128
4129
0
  static int * const ifc_byte[] = {
4130
0
    &hf_tn5250_wssf_ifc_flag1_0,
4131
0
    &hf_tn5250_wssf_ifc_flag1_1to3,
4132
0
    &hf_tn5250_wssf_ifc_flag1_4,
4133
0
    &hf_tn5250_wssf_ifc_flag1_5,
4134
0
    &hf_tn5250_wssf_ifc_flag1_6,
4135
0
    &hf_tn5250_wssf_ifc_flag1_7,
4136
0
    NULL
4137
0
  };
4138
4139
0
  static int * const ifc_byte2[] = {
4140
0
    &hf_tn5250_wssf_ifc_flag2_0,
4141
0
    &hf_tn5250_wssf_ifc_flag2_1,
4142
0
    &hf_tn5250_wssf_ifc_flag2_reserved,
4143
0
    &hf_tn5250_wssf_ifc_flag2_7,
4144
0
    NULL
4145
0
  };
4146
4147
0
  static int * const ifd_byte[] = {
4148
0
    &hf_tn5250_wssf_ifd_flag1_0,
4149
0
    &hf_tn5250_wssf_ifd_flag1_reserved,
4150
0
    NULL
4151
0
  };
4152
4153
4154
0
  hf_items standard_fields[] = {
4155
0
    { &hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN },
4156
0
    { &hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN },
4157
0
    { &hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN },
4158
0
    { NULL, 0, 0, 0, 0 }
4159
0
  };
4160
4161
0
  hf_items wsc_customization_fields[] = {
4162
0
    { &hf_tn5250_wssf_flag1, 0, 1, 0, ENC_BIG_ENDIAN },
4163
0
    { &hf_tn5250_wssf_flag2, ett_tn5250_wssf_mask, 1, byte, 0 },
4164
0
    { NULL, 0, 0, 0, 0 }
4165
0
  };
4166
4167
0
  hf_items wsc_image_control_fields[] = {
4168
0
    { &hf_tn5250_wssf_ifc_flag1, ett_tn5250_wssf_ifc_mask, 1, ifc_byte, 0 },
4169
0
    { &hf_tn5250_wssf_ifc_flag2, ett_tn5250_wssf_ifc_mask, 1, ifc_byte2, 0 },
4170
0
    { &hf_tn5250_wssf_ifc_image_format, 0, 2, 0, ENC_BIG_ENDIAN },
4171
0
    { &hf_tn5250_wssf_ifc_viewport_location_row, 0, 1, 0, ENC_BIG_ENDIAN },
4172
0
    { &hf_tn5250_wssf_ifc_viewport_location_col, 0, 1, 0, ENC_BIG_ENDIAN },
4173
0
    { &hf_tn5250_wssf_ifc_viewport_size_row, 0, 1, 0, ENC_BIG_ENDIAN },
4174
0
    { &hf_tn5250_wssf_ifc_viewport_size_col, 0, 1, 0, ENC_BIG_ENDIAN },
4175
0
    { &hf_tn5250_wssf_ifc_scaling, 0, 2, 0, ENC_BIG_ENDIAN },
4176
0
    { &hf_tn5250_wssf_ifc_viewimage_location_row, 0, 1, 0, ENC_BIG_ENDIAN },
4177
0
    { &hf_tn5250_wssf_ifc_viewimage_location_col, 0, 1, 0, ENC_BIG_ENDIAN },
4178
0
    { &hf_tn5250_wssf_ifc_rotation, 0, 2, 0, ENC_BIG_ENDIAN },
4179
0
    { &hf_tn5250_wssf_ifc_foreground_color, 0, 1, 0, ENC_BIG_ENDIAN },
4180
0
    { &hf_tn5250_wssf_ifc_background_color, 0, 1, 0, ENC_BIG_ENDIAN },
4181
0
    { NULL, 0, 0, 0, 0 }
4182
0
  };
4183
4184
0
  hf_items wsc_image_download_fields[] = {
4185
0
    { &hf_tn5250_wssf_ifd_flag1, ett_tn5250_wssf_ifd_mask, 1, ifd_byte, 0 },
4186
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4187
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4188
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4189
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4190
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4191
0
    { &hf_tn5250_length, 0, 2, 0, ENC_BIG_ENDIAN },
4192
0
    { NULL, 0, 0, 0, 0 }
4193
0
  };
4194
4195
0
  length = tvb_get_ntohs(tvb,offset);
4196
0
  type = tvb_get_uint8(tvb, offset+3);
4197
4198
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, standard_fields);
4199
4200
  /*
4201
   * XXX - the documentation says "Unlike the WSF command (X'F3'),
4202
   * a WSSF command does not have to be the last command in the data stream.",
4203
   * so should we be looping here, or what?
4204
   */
4205
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
4206
0
    switch (type) {
4207
0
      case WSC_CUSTOMIZATION:
4208
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4209
0
                                      wsc_customization_fields);
4210
0
        offset += dissect_write_single_structured_field_minor_fields(tn5250_tree, tvb, offset);
4211
0
        break;
4212
0
      case IMAGE_FAX_CONTROL:
4213
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4214
0
                                      wsc_image_control_fields);
4215
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ifc_imagefax_name, tvb, offset,
4216
0
                            (length - (start + offset)), ENC_EBCDIC);
4217
0
        if (length > (start + offset))
4218
0
          offset += (uint32_t)(length - (start + offset));
4219
0
        break;
4220
0
      case IMAGE_FAX_DOWNLOAD:
4221
0
        namelength = tvb_get_ntohs(tvb,offset+6);
4222
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4223
0
                                      wsc_image_download_fields);
4224
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ifd_imagefax_name, tvb, offset,
4225
0
                            namelength, ENC_EBCDIC);
4226
0
        offset += namelength;
4227
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ifd_imagefax_data, tvb, offset,
4228
0
                            (length - (start + offset)), ENC_NA);
4229
0
        if (length > (start + offset))
4230
0
          offset += (uint32_t)(length - (start + offset));
4231
0
        break;
4232
0
      case VIDEO_AUDIO_CONTROLS:
4233
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_vac_prefix, tvb, offset,
4234
0
                            2, ENC_BIG_ENDIAN);
4235
0
        offset += 2;
4236
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_vac_data, tvb, offset,
4237
0
                            4, ENC_BIG_ENDIAN);
4238
0
        offset += 2;
4239
0
        break;
4240
0
      case TRUE_TRANSPARENCY_WRITE:
4241
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ttw_flag, tvb, offset,
4242
0
                            1, ENC_BIG_ENDIAN);
4243
0
        offset ++;
4244
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ttw_data, tvb, offset,
4245
0
                            (length - (start + offset)), ENC_NA);
4246
0
        if (length > (start + offset))
4247
0
          offset += (uint32_t)(length - (start + offset));
4248
0
        break;
4249
0
      default:
4250
0
        done = 1;
4251
0
        break;
4252
0
    }
4253
0
  }
4254
0
  offset += dissect_unknown_data(tn5250_tree, tvb, offset, start, length);
4255
4256
0
  return (offset - start);
4257
0
}
4258
4259
/* 15.27 WRITE STRUCTURED FIELD Command */
4260
static uint32_t
4261
dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
4262
0
{
4263
0
  int start = offset;
4264
0
  uint16_t sf_length = 0;
4265
0
  int length, type, done = 0, used = 0;
4266
4267
0
  hf_items standard_fields[] = {
4268
0
    { &hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN },
4269
0
    { &hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN },
4270
0
    { &hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN },
4271
0
    { NULL, 0, 0, 0, 0 }
4272
0
  };
4273
4274
0
  static int * const qss_byte1[] = {
4275
0
    &hf_tn5250_wsf_qss_flag1_0,
4276
0
    &hf_tn5250_wsf_qss_flag1_reserved,
4277
0
    NULL
4278
0
  };
4279
4280
0
  static int * const qss_byte2[] = {
4281
0
    &hf_tn5250_wsf_qss_flag2_reserved,
4282
0
    &hf_tn5250_wsf_qss_flag2_7,
4283
0
    NULL
4284
0
  };
4285
4286
0
  hf_items qss_fields[] = {
4287
0
    { &hf_tn5250_wsf_qss_flag1, ett_tn5250_wsf_qss_mask, 1, qss_byte1, 0 },
4288
0
    { &hf_tn5250_wsf_qss_flag2, ett_tn5250_wsf_qss_mask, 1, qss_byte2, 0 },
4289
0
    { NULL, 0, 0, 0, 0 }
4290
0
  };
4291
4292
0
  hf_items dawt_fields[] = {
4293
0
    { &hf_tn5250_dawt_length, 0, 1, 0, ENC_BIG_ENDIAN },
4294
0
    { &hf_tn5250_dawt_char, 0, 1, 0, ENC_EBCDIC|ENC_NA },
4295
0
    { NULL, 0, 0, 0, 0 }
4296
0
  };
4297
4298
0
  hf_items dckf_fields[] = {
4299
0
    { &hf_tn5250_dckf_length, 0, 1, 0, ENC_BIG_ENDIAN },
4300
0
    { &hf_tn5250_dckf_key_code, 0, 1, 0, ENC_BIG_ENDIAN },
4301
0
    { &hf_tn5250_dckf_function_code, 0, 1, 0, ENC_BIG_ENDIAN },
4302
0
    { NULL, 0, 0, 0, 0 }
4303
0
  };
4304
4305
0
  static int * const rts_byte1[] = {
4306
0
    &hf_tn5250_rts_flag1_0,
4307
0
    &hf_tn5250_rts_flag1_reserved,
4308
0
    NULL
4309
0
  };
4310
4311
0
  hf_items rts_fields[] = {
4312
0
    { &hf_tn5250_rts_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4313
0
    { &hf_tn5250_rts_flag1, ett_tn5250_wsf_rts_mask, 1, rts_byte1, 0 },
4314
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4315
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4316
0
    { NULL, 0, 0, 0, 0 }
4317
0
  };
4318
4319
0
  static int * const dpo_byte1[] = {
4320
0
    &hf_tn5250_dpo_flag1_0,
4321
0
    &hf_tn5250_dpo_flag1_1,
4322
0
    &hf_tn5250_dpo_flag1_2,
4323
0
    &hf_tn5250_dpo_flag1_3,
4324
0
    &hf_tn5250_dpo_flag1_4,
4325
0
    &hf_tn5250_dpo_flag1_5,
4326
0
    &hf_tn5250_dpo_flag1_6,
4327
0
    &hf_tn5250_dpo_flag1_7,
4328
0
    NULL
4329
0
  };
4330
4331
0
  static int * const dpo_byte2[] = {
4332
0
    &hf_tn5250_dpo_flag2_0,
4333
0
    &hf_tn5250_dpo_flag2_reserved,
4334
0
    NULL
4335
0
  };
4336
4337
0
  hf_items dpo_fields[] = {
4338
0
    { &hf_tn5250_dpo_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4339
0
    { &hf_tn5250_dpo_flag1, ett_tn5250_wsf_dpo_mask, 1, dpo_byte1, 0 },
4340
0
    { &hf_tn5250_dpo_flag2, ett_tn5250_wsf_dpo_mask, 1, dpo_byte2, 0 },
4341
0
    { &hf_tn5250_dpo_displace_characters, 0, 3, 0, ENC_EBCDIC|ENC_NA },
4342
0
    { &hf_tn5250_dpo_start_location_row, 0, 2, 0, ENC_BIG_ENDIAN },
4343
0
    { &hf_tn5250_dpo_start_location_col, 0, 2, 0, ENC_BIG_ENDIAN },
4344
0
    { NULL, 0, 0, 0, 0 }
4345
0
  };
4346
4347
0
  static int * const dtsf_byte1[] = {
4348
0
    &hf_tn5250_dtsf_flag1_0,
4349
0
    &hf_tn5250_dtsf_flag1_1,
4350
0
    &hf_tn5250_dtsf_flag1_2,
4351
0
    &hf_tn5250_dtsf_flag1_3,
4352
0
    &hf_tn5250_dtsf_flag1_4,
4353
0
    &hf_tn5250_dtsf_flag1_5,
4354
0
    &hf_tn5250_dtsf_flag1_6,
4355
0
    &hf_tn5250_dtsf_flag1_7,
4356
0
    NULL
4357
0
  };
4358
4359
0
  static int * const dtsf_byte2[] = {
4360
0
    &hf_tn5250_dtsf_flag2_0,
4361
0
    &hf_tn5250_dtsf_flag2_1,
4362
0
    &hf_tn5250_dtsf_flag2_2,
4363
0
    &hf_tn5250_dtsf_flag2_3,
4364
0
    &hf_tn5250_dtsf_flag2_4to7,
4365
0
    NULL
4366
0
  };
4367
4368
0
  hf_items dtsf_fields[] = {
4369
0
    { &hf_tn5250_dtsf_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4370
0
    { &hf_tn5250_dtsf_flag1, ett_tn5250_wsf_dtsf_mask, 1, dtsf_byte1, 0 },
4371
0
    { &hf_tn5250_dtsf_flag2, ett_tn5250_wsf_dtsf_mask, 1, dtsf_byte2, 0 },
4372
0
    { &hf_tn5250_dtsf_text_body_height, 0, 2, 0, ENC_BIG_ENDIAN },
4373
0
    { &hf_tn5250_dtsf_text_body_width, 0, 2, 0, ENC_BIG_ENDIAN },
4374
0
    { &hf_tn5250_dtsf_line_cmd_field_size, 0, 1, 0, ENC_BIG_ENDIAN },
4375
0
    { &hf_tn5250_dtsf_location_of_pitch, 0, 1, 0, ENC_BIG_ENDIAN },
4376
0
    { &hf_tn5250_dtsf_first_line, 0, 1, 0, ENC_BIG_ENDIAN },
4377
0
    { NULL, 0, 0, 0, 0 }
4378
0
  };
4379
4380
0
  static int * const dsl_byte1[] = {
4381
0
    &hf_tn5250_dsl_flag1_0,
4382
0
    &hf_tn5250_dsl_flag1_1,
4383
0
    &hf_tn5250_dsl_flag1_2,
4384
0
    &hf_tn5250_dsl_flag1_reserved,
4385
0
    NULL
4386
0
  };
4387
4388
0
  hf_items dsl_fields[] = {
4389
0
    { &hf_tn5250_dsl_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4390
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4391
0
    { &hf_tn5250_dsl_rtl_offset, 0, 1, 0, ENC_BIG_ENDIAN },
4392
0
    { &hf_tn5250_dsl_offset, 0, 1, 0, ENC_BIG_ENDIAN },
4393
0
    { NULL, 0, 0, 0, 0 }
4394
0
  };
4395
4396
0
  hf_items dsl_fields2[] = {
4397
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
4398
0
    { &hf_tn5250_dsl_flag1, ett_tn5250_wsf_dsl_mask, 1, dsl_byte1, 0 },
4399
0
    { &hf_tn5250_dsl_id, 0, 1, 0, ENC_BIG_ENDIAN },
4400
0
    { &hf_tn5250_dsl_location, 0, 1, 0, ENC_BIG_ENDIAN },
4401
0
    { &hf_tn5250_dsl_function, 0, 1, 0, ENC_BIG_ENDIAN },
4402
0
    { NULL, 0, 0, 0, 0 }
4403
0
  };
4404
4405
0
  static int * const wts_byte1[] = {
4406
0
    &hf_tn5250_wts_flag1_0,
4407
0
    &hf_tn5250_wts_flag1_1,
4408
0
    &hf_tn5250_wts_flag1_2,
4409
0
    &hf_tn5250_wts_flag1_3,
4410
0
    &hf_tn5250_wts_flag1_reserved,
4411
0
    NULL
4412
0
  };
4413
4414
0
  static int * const wts_byte2[] = {
4415
0
    &hf_tn5250_wts_flag2_reserved,
4416
0
    &hf_tn5250_wts_flag2_6,
4417
0
    &hf_tn5250_wts_flag2_reserved2,
4418
0
    NULL
4419
0
  };
4420
4421
0
  static int * const wts_byte3[] = {
4422
0
    &hf_tn5250_wts_flag3_0,
4423
0
    &hf_tn5250_wts_flag3_1,
4424
0
    &hf_tn5250_wts_flag3_2,
4425
0
    &hf_tn5250_wts_flag3_3,
4426
0
    &hf_tn5250_wts_flag3_4,
4427
0
    &hf_tn5250_wts_flag3_5,
4428
0
    &hf_tn5250_wts_flag3_6,
4429
0
    &hf_tn5250_wts_flag3_7,
4430
0
    NULL
4431
0
  };
4432
4433
0
  hf_items wts_fields[] = {
4434
0
    { &hf_tn5250_wts_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4435
0
    { &hf_tn5250_wts_flag1, ett_tn5250_wts_mask, 1, wts_byte1, 0 },
4436
0
    { &hf_tn5250_wts_flag2, ett_tn5250_wts_mask, 1, wts_byte2, 0 },
4437
0
    { &hf_tn5250_wts_flag3, ett_tn5250_wts_mask, 1, wts_byte3, 0 },
4438
0
    { &hf_tn5250_wts_home_position_row, 0, 2, 0, ENC_BIG_ENDIAN },
4439
0
    { &hf_tn5250_wts_home_position_col, 0, 2, 0, ENC_BIG_ENDIAN },
4440
0
    { NULL, 0, 0, 0, 0 }
4441
0
  };
4442
4443
0
  static int * const wts_cld_byte1[] = {
4444
0
    &hf_tn5250_wts_cld_flag1_0,
4445
0
    &hf_tn5250_wts_cld_flag1_1,
4446
0
    &hf_tn5250_wts_cld_flag1_2,
4447
0
    &hf_tn5250_wts_cld_flag1_3,
4448
0
    &hf_tn5250_wts_cld_flag1_4,
4449
0
    &hf_tn5250_wts_cld_flag1_5,
4450
0
    &hf_tn5250_wts_cld_flag1_6,
4451
0
    &hf_tn5250_wts_cld_flag1_7,
4452
0
    NULL
4453
0
  };
4454
4455
0
  static int * const wts_cld_byte2[] = {
4456
0
    &hf_tn5250_wts_cld_flag2_0,
4457
0
    &hf_tn5250_wts_cld_flag2_1,
4458
0
    &hf_tn5250_wts_cld_flag2_2,
4459
0
    &hf_tn5250_wts_cld_flag2_3,
4460
0
    &hf_tn5250_wts_cld_flag2_4,
4461
0
    &hf_tn5250_wts_cld_flag2_line_spacing,
4462
0
    NULL
4463
0
  };
4464
4465
0
  static int * const wts_cld_byte3[] = {
4466
0
    &hf_tn5250_wts_cld_flag3_0,
4467
0
    &hf_tn5250_wts_cld_flag3_1,
4468
0
    &hf_tn5250_wts_cld_flag3_2,
4469
0
    &hf_tn5250_wts_cld_flag3_3,
4470
0
    &hf_tn5250_wts_cld_flag3_4,
4471
0
    &hf_tn5250_wts_cld_flag3_5,
4472
0
    &hf_tn5250_wts_cld_flag3_6,
4473
0
    &hf_tn5250_wts_cld_flag3_7,
4474
0
    NULL
4475
0
  };
4476
4477
0
  hf_items wts_line_data_fields[] = {
4478
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, /*FIXME: Could be one or two bytes! */
4479
0
    { &hf_tn5250_wts_cld_flag1, ett_tn5250_wts_mask, 1, wts_cld_byte1, 0 },
4480
0
    { &hf_tn5250_wts_cld_flag2, ett_tn5250_wts_mask, 1, wts_cld_byte2, 0 },
4481
0
    { &hf_tn5250_wts_cld_row, 0, 2, 0, ENC_BIG_ENDIAN },
4482
0
    { &hf_tn5250_wts_cld_flag3, ett_tn5250_wts_mask, 1, wts_cld_byte3, 0 },
4483
0
    { &hf_tn5250_wts_cld_page_num, 0, 2, 0, ENC_BIG_ENDIAN },
4484
0
    { &hf_tn5250_wts_cld_lmo, 0, 1, 0, ENC_BIG_ENDIAN },
4485
0
    { &hf_tn5250_wts_cld_io, 0, 1, 0, ENC_BIG_ENDIAN },
4486
0
    { &hf_tn5250_wts_cld_sli, 0, 1, 0, ENC_BIG_ENDIAN },
4487
0
    { NULL, 0, 0, 0, 0 }
4488
0
  };
4489
4490
4491
0
  hf_items dsc_fields[] = {
4492
0
    { &hf_tn5250_dsc_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4493
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4494
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4495
0
    { &hf_tn5250_dsc_sk, 0, 1, 0, ENC_BIG_ENDIAN },
4496
0
    { &hf_tn5250_dsc_ev, 0, 1, 0, ENC_EBCDIC|ENC_NA },
4497
0
    { NULL, 0, 0, 0, 0 }
4498
0
  };
4499
4500
0
  hf_items dorm_fields[] = {
4501
0
    { &hf_tn5250_dorm_length, 0, 1, 0, ENC_BIG_ENDIAN },
4502
0
    { &hf_tn5250_dorm_ec, 0, 2, 0, ENC_BIG_ENDIAN },
4503
0
    { NULL, 0, 0, 0, 0 }
4504
0
  };
4505
4506
4507
0
  static int * const dfdpck_coreflag[] = {
4508
0
    &hf_tn5250_dfdpck_coreflag_0,
4509
0
    &hf_tn5250_dfdpck_coreflag_1,
4510
0
    &hf_tn5250_dfdpck_coreflag_2,
4511
0
    &hf_tn5250_dfdpck_coreflag_3,
4512
0
    &hf_tn5250_dfdpck_coreflag_4,
4513
0
    &hf_tn5250_dfdpck_coreflag_5,
4514
0
    &hf_tn5250_dfdpck_coreflag_6,
4515
0
    &hf_tn5250_dfdpck_coreflag_7,
4516
0
    NULL
4517
0
  };
4518
4519
0
  static int * const dfdpck_toprowflag1[] = {
4520
0
    &hf_tn5250_dfdpck_toprowflag1_0,
4521
0
    &hf_tn5250_dfdpck_toprowflag1_1,
4522
0
    &hf_tn5250_dfdpck_toprowflag1_2,
4523
0
    &hf_tn5250_dfdpck_toprowflag1_3,
4524
0
    &hf_tn5250_dfdpck_toprowflag1_4,
4525
0
    &hf_tn5250_dfdpck_toprowflag1_5,
4526
0
    &hf_tn5250_dfdpck_toprowflag1_6,
4527
0
    &hf_tn5250_dfdpck_toprowflag1_7,
4528
0
    NULL
4529
0
  };
4530
4531
0
  static int * const dfdpck_toprowflag2[] = {
4532
0
    &hf_tn5250_dfdpck_toprowflag2_0,
4533
0
    &hf_tn5250_dfdpck_toprowflag2_1,
4534
0
    &hf_tn5250_dfdpck_toprowflag2_2,
4535
0
    &hf_tn5250_dfdpck_toprowflag2_3,
4536
0
    &hf_tn5250_dfdpck_toprowflag2_4,
4537
0
    &hf_tn5250_dfdpck_toprowflag2_5,
4538
0
    &hf_tn5250_dfdpck_toprowflag2_6,
4539
0
    &hf_tn5250_dfdpck_toprowflag2_7,
4540
0
    NULL
4541
0
  };
4542
4543
0
  static int * const dfdpck_toprowflag3[] = {
4544
0
    &hf_tn5250_dfdpck_toprowflag3_0,
4545
0
    &hf_tn5250_dfdpck_toprowflag3_1,
4546
0
    &hf_tn5250_dfdpck_toprowflag3_2,
4547
0
    &hf_tn5250_dfdpck_toprowflag3_3,
4548
0
    &hf_tn5250_dfdpck_toprowflag3_4,
4549
0
    &hf_tn5250_dfdpck_toprowflag3_5,
4550
0
    &hf_tn5250_dfdpck_toprowflag3_6,
4551
0
    &hf_tn5250_dfdpck_toprowflag3_7,
4552
0
    NULL
4553
0
  };
4554
4555
0
  hf_items dfdpck_fields[] = {
4556
0
    { &hf_tn5250_dfdpck_partition, 0, 1, 0, ENC_BIG_ENDIAN },
4557
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4558
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4559
0
    { NULL, 0, 0, 0, 0 }
4560
0
  };
4561
4562
0
  hf_items dfdpck_core_area_fields[] = {
4563
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
4564
0
    { &hf_tn5250_dfdpck_data_field, 0, 1, 0, ENC_BIG_ENDIAN },
4565
0
    { &hf_tn5250_dfdpck_coreflag, ett_tn5250_dfdpck_mask, 1, dfdpck_coreflag, 0 },
4566
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4567
0
    { NULL, 0, 0, 0, 0 }
4568
0
  };
4569
4570
0
  hf_items dfdpck_top_row_fields[] = {
4571
0
    { &hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN },
4572
0
    { &hf_tn5250_dfdpck_data_field, 0, 1, 0, ENC_BIG_ENDIAN },
4573
0
    { &hf_tn5250_dfdpck_toprowflag1, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag1, 0 },
4574
0
    { &hf_tn5250_dfdpck_toprowflag2, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag2, 0 },
4575
0
    { &hf_tn5250_dfdpck_toprowflag3, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag3, 0 },
4576
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4577
0
    { NULL, 0, 0, 0, 0 }
4578
0
  };
4579
4580
0
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
4581
0
    sf_length = tvb_get_ntohs(tvb,offset);
4582
0
    type = tvb_get_uint8(tvb, offset+3);
4583
4584
0
    offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, standard_fields);
4585
4586
0
    switch (type) {
4587
0
      case PASS_THROUGH:
4588
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset,
4589
0
                            (sf_length - (start + offset)), ENC_EBCDIC);
4590
0
        offset += (uint32_t)(sf_length - (start + offset));
4591
0
        break;
4592
0
      case TN5250_QUERY:
4593
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset,
4594
0
                            1, ENC_BIG_ENDIAN);
4595
0
        offset ++;
4596
0
        break;
4597
0
      case TN5250_QUERY_STATION_STATE:
4598
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, qss_fields);
4599
0
        break;
4600
0
      case DEFINE_AUDIT_WINDOW__TABLE:
4601
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_dawt_id, tvb, offset,
4602
0
                            1, ENC_BIG_ENDIAN);
4603
0
        offset += 1;
4604
0
        while ((offset - start) < sf_length) {
4605
0
          length = tvb_get_uint8(tvb,offset);
4606
0
          offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dawt_fields);
4607
0
          if (length < 2) {
4608
            /* XXX - expert info on the length field */
4609
0
            break;
4610
0
          }
4611
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_dawt_message, tvb, offset,
4612
0
                              (length - 2), ENC_EBCDIC);
4613
0
          offset += length;
4614
0
        }
4615
0
        break;
4616
0
      case DEFINE_COMMAND_KEY_FUNCTION:
4617
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_dckf_id, tvb, offset,
4618
0
                            1, ENC_BIG_ENDIAN);
4619
0
        offset++;
4620
0
        while ((offset - start) < sf_length) {
4621
0
          length = tvb_get_uint8(tvb,offset);
4622
0
          offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4623
0
                                        dckf_fields);
4624
0
          if (length < 2) {
4625
            /* XXX - expert info on the length field */
4626
0
            break;
4627
0
          }
4628
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_dckf_prompt_text, tvb,
4629
0
                              offset, (length - 2), ENC_EBCDIC);
4630
0
          offset += length;
4631
0
        }
4632
0
        break;
4633
0
      case READ_TEXT_SCREEN:
4634
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, rts_fields);
4635
0
        break;
4636
0
      case DEFINE_PENDING_OPERATIONS:
4637
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dpo_fields);
4638
0
        break;
4639
0
      case DEFINE_TEXT_SCREEN_FORMAT:
4640
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dtsf_fields);
4641
0
        break;
4642
0
      case DEFINE_SCALE_LINE:
4643
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dsl_fields);
4644
0
        while ((offset - start) < sf_length) {
4645
          /* XXX length unused
4646
          length = tvb_get_uint8(tvb,offset); */
4647
0
          offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dsl_fields2);
4648
0
        }
4649
0
        break;
4650
0
      case WRITE_TEXT_SCREEN:
4651
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4652
0
                                      wts_fields);
4653
0
        length = tvb_get_uint8(tvb,offset);
4654
0
        used = tn5250_add_hf_items(tn5250_tree, tvb, offset,
4655
0
                                   wts_line_data_fields);
4656
0
        offset += used;
4657
0
        if (length < used) {
4658
          /* XXX - expert info on the length field */
4659
0
          break;
4660
0
        }
4661
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_wts_cld_li, tvb, offset,
4662
0
                            (length - used), ENC_EBCDIC);
4663
0
        break;
4664
0
      case DEFINE_SPECIAL_CHARACTERS:
4665
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4666
0
                                      dsc_fields);
4667
0
        break;
4668
0
      case DEFINE_OPERATOR_ERROR_MESSAGES:
4669
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_dorm_id, tvb, offset,
4670
0
                            1, ENC_BIG_ENDIAN);
4671
0
        offset++;
4672
0
        while ((offset - start) < sf_length) {
4673
0
          length = tvb_get_uint8(tvb,offset);
4674
0
          offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4675
0
                                        dorm_fields);
4676
0
          if (length < 2) {
4677
            /* XXX - expert info on the length field */
4678
0
            break;
4679
0
          }
4680
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_dorm_mt, tvb, offset,
4681
0
                              (length - 2), ENC_EBCDIC);
4682
0
          offset += length;
4683
0
        }
4684
0
        break;
4685
0
      case DEFINE_PITCH_TABLE:
4686
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_dpt_id, tvb, offset,
4687
0
                            1, ENC_BIG_ENDIAN);
4688
0
        offset++;
4689
0
        while ((offset - start) < sf_length) {
4690
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_length, tvb, offset,
4691
0
                              1, ENC_BIG_ENDIAN);
4692
0
          offset++;
4693
          /*
4694
           * XXX - the documentation cited above says this is a
4695
           * "4-byte EBCDIC code for the value of text pitch that is
4696
           * displayed on the status line".  Does that mean that
4697
           * each of these entries is 5 bytes long?
4698
           */
4699
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_dpt_ec, tvb, offset,
4700
0
                              4, ENC_EBCDIC);
4701
0
          offset += 4;
4702
0
        }
4703
0
        break;
4704
0
      case DEFINE_FAKE_DP_COMMAND_KEY_FUNCTION:
4705
0
        offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4706
0
                                      dfdpck_fields);
4707
0
        while ((offset - start) < sf_length) {
4708
0
          length = tvb_get_uint8(tvb,offset);
4709
0
          type = tvb_get_uint8(tvb,offset+1);
4710
0
          if (type == CORE_AREA_COMMAND_KEYS) {
4711
0
            offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4712
0
                                          dfdpck_core_area_fields);
4713
0
          } else if (type == TOP_ROW_COMMAND_KEYS) {
4714
0
            offset += tn5250_add_hf_items(tn5250_tree, tvb, offset,
4715
0
                                          dfdpck_top_row_fields);
4716
0
          } else {
4717
0
            uint32_t step;
4718
4719
0
            step = dissect_unknown_data(tn5250_tree, tvb, offset, start, length);
4720
0
            if (step==0)
4721
0
              break;
4722
0
            offset += step;
4723
0
          }
4724
0
        }
4725
0
        break;
4726
0
      default:
4727
0
        done = 1;
4728
0
        break;
4729
0
    }
4730
0
  }
4731
4732
0
  offset += dissect_unknown_data(tn5250_tree, tvb, offset, start, sf_length);
4733
4734
0
  return (offset - start);
4735
0
}
4736
4737
/* 15.27.2 5250 Query Command - Response */
4738
/*TN5250 - RFC1205 - Query Reply Fields */
4739
static uint32_t
4740
dissect_query_reply(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
4741
0
{
4742
0
  int start = offset;
4743
4744
0
  static int * const byte[] = {
4745
0
    &hf_tn5250_qr_flag_0,
4746
0
    &hf_tn5250_qr_flag_reserved,
4747
0
    NULL
4748
0
  };
4749
4750
0
  static int * const byte1[] = {
4751
0
    &hf_tn5250_qr_flag1_0,
4752
0
    &hf_tn5250_qr_flag1_1,
4753
0
    &hf_tn5250_qr_flag1_2,
4754
0
    &hf_tn5250_qr_flag1_3,
4755
0
    &hf_tn5250_qr_flag1_4,
4756
0
    &hf_tn5250_qr_flag1_5,
4757
0
    &hf_tn5250_qr_flag1_6,
4758
0
    &hf_tn5250_qr_flag1_7,
4759
0
    NULL
4760
0
  };
4761
4762
0
  static int * const byte2[] = {
4763
0
    &hf_tn5250_qr_flag2_0to3,
4764
0
    &hf_tn5250_qr_flag2_4,
4765
0
    &hf_tn5250_qr_flag2_5,
4766
0
    &hf_tn5250_qr_flag2_6to7,
4767
0
    NULL
4768
0
  };
4769
4770
0
  hf_items qr_fields[] = {
4771
0
    { &hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN },
4772
0
    { &hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN },
4773
0
    { &hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN },
4774
0
    { &hf_tn5250_qr_flag, ett_tn5250_qr_mask, 1, byte, 0 },
4775
0
    { &hf_tn5250_qr_chc, 0, 2, 0, ENC_BIG_ENDIAN },
4776
0
    { &hf_tn5250_qr_ccl, 0, 3, 0, ENC_BIG_ENDIAN },
4777
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4778
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4779
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4780
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4781
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4782
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4783
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4784
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4785
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4786
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4787
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4788
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4789
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4790
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4791
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4792
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4793
0
    { &hf_tn5250_qr_dt, 0, 1, 0, ENC_BIG_ENDIAN },
4794
0
    { &hf_tn5250_qr_dtc, 0, 4, 0, ENC_EBCDIC|ENC_NA },
4795
0
    { &hf_tn5250_qr_dm, 0, 3, 0, ENC_EBCDIC|ENC_NA },
4796
0
    { &hf_tn5250_qr_ki, 0, 1, 0, ENC_BIG_ENDIAN },
4797
0
    { &hf_tn5250_qr_eki, 0, 1, 0, ENC_BIG_ENDIAN },
4798
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4799
0
    { &hf_tn5250_qr_dsn, 0, 4, 0, ENC_BIG_ENDIAN },
4800
0
    { &hf_tn5250_qr_mni, 0, 2, 0, ENC_BIG_ENDIAN },
4801
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4802
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4803
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4804
0
    { &hf_tn5250_qr_flag1, ett_tn5250_qr_mask, 1, byte1, 0 },
4805
0
    { &hf_tn5250_qr_flag2, ett_tn5250_qr_mask, 1, byte2, 0 },
4806
0
    { &hf_tn5250_qr_flag3, 0, 1, 0, ENC_BIG_ENDIAN },
4807
0
    { &hf_tn5250_qr_flag4, 0, 1, 0, ENC_BIG_ENDIAN },
4808
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4809
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4810
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4811
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4812
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4813
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4814
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4815
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4816
0
    { NULL, 0, 0, 0, 0 }
4817
0
  };
4818
4819
4820
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, qr_fields);
4821
4822
0
  return (offset - start);
4823
0
}
4824
4825
/* End: Handle WCC, Orders and Data */
4826
4827
4828
static uint32_t
4829
dissect_tn5250_header(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
4830
0
{
4831
4832
0
  int start=offset;
4833
0
  int error_flag;
4834
4835
0
  static int * const byte[] = {
4836
0
    &hf_tn5250_ds_output_error,
4837
0
    &hf_tn5250_attn_key,
4838
0
    &hf_tn5250_sys_request_key,
4839
0
    &hf_tn5250_test_request_key,
4840
0
    &hf_tn5250_error_state,
4841
0
    NULL
4842
0
  };
4843
4844
0
  hf_items fields[] = {
4845
0
    { &hf_tn5250_logical_record_length, 0, 2, 0, ENC_BIG_ENDIAN },
4846
0
    { &hf_tn5250_sna_record_type, 0, 2, 0, ENC_BIG_ENDIAN },
4847
0
    { &hf_tn5250_reserved, 0, 2, 0, ENC_BIG_ENDIAN },
4848
0
    { &hf_tn5250_variable_record_length, 0, 1, 0, ENC_BIG_ENDIAN },
4849
0
    { &hf_tn5250_header_flags, ett_tn5250_header_flags, 1, byte, 0 },
4850
0
    { &hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN },
4851
0
    { &hf_tn5250_operation_code, 0, 1, 0, ENC_BIG_ENDIAN },
4852
0
    { NULL, 0, 0, 0, 0 }
4853
0
  };
4854
4855
0
  error_flag = tvb_get_uint8(tvb, offset+8);
4856
4857
0
  offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, fields);
4858
4859
0
  if (error_flag & 0x02) { /*HLP*/
4860
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_error_code, tvb, offset, 2, ENC_BIG_ENDIAN);
4861
0
  }
4862
4863
0
  return (offset - start);
4864
0
}
4865
4866
#if 0
4867
/* XXX - unused */
4868
/* Detect and Handle Direction of Stream */
4869
static int
4870
dissect_tn5250_data_until_next_command(proto_tree *tn5250_tree, tvbuff_t *tvb, int offset)
4871
{
4872
  int order_code, done = 0;
4873
  int start = offset;
4874
4875
  while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) {
4876
    order_code = tvb_get_uint8(tvb, offset);
4877
    switch (order_code) {
4878
      case CLEAR_UNIT:
4879
      case CLEAR_FORMAT_TABLE:
4880
      case CLEAR_UNIT_ALTERNATE:
4881
      case WRITE_TO_DISPLAY:
4882
      case WRITE_ERROR_CODE:
4883
      case RESTORE_SCREEN:
4884
      case WRITE_ERROR_CODE_TO_WINDOW:
4885
      case READ_INPUT_FIELDS:
4886
      case READ_MDT_FIELDS:
4887
      case READ_MDT_ALTERNATE:
4888
      case READ_SCREEN:
4889
      case READ_SCREEN_WITH_EXTENDED_ATTRIBUTES:
4890
      case READ_SCREEN_TO_PRINT:
4891
      case READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES:
4892
      case READ_SCREEN_TO_PRINT_WITH_GRIDLINES:
4893
      case READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES_AND_GRIDLINES:
4894
      case READ_IMMEDIATE:
4895
      case READ_MODIFIED_IMMEDIATE_ALTERNATE:
4896
      case SAVE_SCREEN:
4897
      case SAVE_PARTIAL_SCREEN:
4898
      case RESTORE_PARTIAL_SCREEN:
4899
      case ROLL:
4900
      case WRITE_SINGLE_STRUCTURED_FIELD:
4901
      case WRITE_STRUCTURED_FIELD:
4902
      case COPY_TO_PRINTER:
4903
        done = 1;
4904
        break;
4905
      default:
4906
        offset++;
4907
        break;
4908
    }
4909
  }
4910
4911
  if (offset > start) {
4912
    proto_tree_add_item(tn5250_tree, hf_tn5250_field_data,
4913
                        tvb, start, (offset - start), ENC_EBCDIC);
4914
  }
4915
4916
  return (offset - start);
4917
}
4918
#endif
4919
4920
static uint32_t
4921
// NOLINTNEXTLINE(misc-no-recursion)
4922
dissect_outbound_stream(proto_tree *tn5250_tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
4923
0
{
4924
0
  int command_code;
4925
0
  int start = offset, length = 0;
4926
0
  proto_tree   *cc_tree;
4927
0
  proto_item   *ti, *item;
4928
4929
  /*Escape*/
4930
0
  ti = proto_tree_add_item(tn5250_tree, hf_tn5250_escape_code, tvb, offset, 1,
4931
0
                           ENC_BIG_ENDIAN);
4932
0
  offset++;
4933
0
  cc_tree = proto_item_add_subtree(ti, ett_cc);
4934
4935
  /* Command Code*/
4936
0
  command_code = tvb_get_uint8(tvb, offset);
4937
0
  item = proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1,
4938
0
                          ENC_BIG_ENDIAN);
4939
0
  offset++;
4940
4941
0
  switch (command_code) {
4942
0
    case CLEAR_UNIT:
4943
0
    case CLEAR_FORMAT_TABLE:
4944
0
      break;
4945
0
    case CLEAR_UNIT_ALTERNATE:
4946
0
      proto_tree_add_item(cc_tree, hf_tn5250_cua_parm, tvb, offset, 1, ENC_BIG_ENDIAN);
4947
0
      offset++;
4948
0
      break;
4949
0
    case WRITE_TO_DISPLAY:
4950
      /* WCC */
4951
0
      offset += dissect_wcc(cc_tree, tvb, offset);
4952
0
      offset += dissect_tn5250_orders_and_data(cc_tree, tvb, offset);
4953
0
      break;
4954
0
    case WRITE_ERROR_CODE:
4955
      /* Check for the optional TN5250_IC */
4956
0
      offset += dissect_tn5250_orders_and_data(cc_tree, tvb, offset);
4957
      /* Add Field Data */
4958
0
      proto_tree_add_item(cc_tree, hf_tn5250_fa, tvb, offset, 1, ENC_BIG_ENDIAN);
4959
0
      offset++;
4960
0
      proto_tree_add_item(cc_tree, hf_tn5250_field_data, tvb, offset,
4961
0
                          tvb_reported_length_remaining(tvb, offset) - 1,
4962
0
                          ENC_EBCDIC);
4963
0
      offset += (uint32_t)(tvb_reported_length_remaining(tvb, offset) - 1);
4964
0
      proto_tree_add_item(cc_tree, hf_tn5250_fa, tvb, offset, 1, ENC_BIG_ENDIAN);
4965
0
      offset++;
4966
0
      break;
4967
0
    case RESTORE_SCREEN:
4968
0
      while (tvb_reported_length_remaining(tvb, offset) > 0) {
4969
0
        increment_dissection_depth(pinfo);
4970
0
        offset += dissect_outbound_stream(cc_tree, pinfo, tvb, offset);
4971
0
        decrement_dissection_depth(pinfo);
4972
0
      }
4973
0
      break;
4974
0
    case WRITE_ERROR_CODE_TO_WINDOW:
4975
0
      proto_tree_add_item(cc_tree, hf_tn5250_wectw_start_column, tvb, offset,
4976
0
                          1, ENC_BIG_ENDIAN);
4977
0
      offset++;
4978
0
      proto_tree_add_item(cc_tree, hf_tn5250_wectw_end_column, tvb, offset, 1,
4979
0
                          ENC_BIG_ENDIAN);
4980
0
      offset++;
4981
0
      break;
4982
0
    case READ_INPUT_FIELDS:
4983
0
    case READ_MDT_FIELDS:
4984
0
    case READ_MDT_ALTERNATE:
4985
0
      offset += dissect_wcc(cc_tree, tvb, offset);
4986
0
      break;
4987
0
    case READ_SCREEN:
4988
0
    case READ_SCREEN_WITH_EXTENDED_ATTRIBUTES:
4989
0
    case READ_SCREEN_TO_PRINT:
4990
0
    case READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES:
4991
0
    case READ_SCREEN_TO_PRINT_WITH_GRIDLINES:
4992
0
    case READ_SCREEN_TO_PRINT_WITH_EXTENDED_ATTRIBUTES_AND_GRIDLINES:
4993
0
    case READ_IMMEDIATE:
4994
0
    case READ_MODIFIED_IMMEDIATE_ALTERNATE:
4995
0
    case SAVE_SCREEN:
4996
0
      break;
4997
0
    case SAVE_PARTIAL_SCREEN:
4998
0
      offset += dissect_save_partial_screen(cc_tree, tvb, offset);
4999
0
      break;
5000
0
    case RESTORE_PARTIAL_SCREEN:
5001
0
      length = tvb_get_ntohs(tvb, offset);
5002
0
      proto_tree_add_item(cc_tree, hf_tn5250_length_twobyte, tvb, offset, 2,
5003
0
                          ENC_BIG_ENDIAN);
5004
0
      offset++;
5005
0
      offset += dissect_tn5250_orders_and_data(cc_tree, tvb, offset);
5006
0
      proto_tree_add_item(cc_tree, hf_tn5250_field_data, tvb, offset,
5007
0
                          (length - 2), ENC_EBCDIC);
5008
0
      offset++;
5009
0
      break;
5010
0
    case ROLL:
5011
0
      offset += dissect_roll(cc_tree, tvb, offset);
5012
0
      break;
5013
0
    case WRITE_SINGLE_STRUCTURED_FIELD:
5014
0
      offset += dissect_write_single_structured_field(cc_tree, tvb, offset);
5015
0
      break;
5016
0
    case WRITE_STRUCTURED_FIELD:
5017
0
      offset += dissect_write_structured_field(cc_tree, tvb, offset);
5018
0
      break;
5019
0
    case COPY_TO_PRINTER:
5020
0
      proto_tree_add_item(cc_tree, hf_tn5250_ctp_lsid, tvb, offset, 1, ENC_BIG_ENDIAN);
5021
0
      offset++;
5022
0
      proto_tree_add_item(cc_tree, hf_tn5250_ctp_mlpp, tvb, offset, 1, ENC_BIG_ENDIAN);
5023
0
      offset++;
5024
0
      break;
5025
0
    default:
5026
0
      expert_add_info(pinfo, item, &ei_tn5250_command_code);
5027
0
      offset ++;
5028
0
      break;
5029
0
  }
5030
5031
0
  return (offset - start);
5032
0
}
5033
5034
static uint32_t
5035
dissect_inbound_stream(proto_tree *tn5250_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int sna_flag)
5036
0
{
5037
0
  int start = offset, aid;
5038
0
  uint32_t commands;
5039
5040
5041
0
  if (sna_flag & 0x01) { /* Stream contains error code */
5042
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_error_code, tvb, offset, 2,
5043
0
                        ENC_BIG_ENDIAN);
5044
0
    offset+=2;
5045
0
    return (offset - start);
5046
0
  } else if (sna_flag & 0x80) { /* Stream contains negative response */
5047
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_negative_response,
5048
0
                        tvb, offset, 4, ENC_BIG_ENDIAN);
5049
0
    offset+=4;
5050
0
    return (offset - start);
5051
0
  }
5052
5053
0
  aid = tvb_get_uint8(tvb,offset+2);
5054
0
  if (tn5250_is_valid_aid(aid)) {
5055
0
    switch(aid) {
5056
0
      case AID_IMAGE_FAX_REQUEST:
5057
0
      case AID_UNKNOWN_IMAGE_FAX_FORMAT:
5058
0
      case AID_IMAGE_FAX_ERROR:
5059
0
        proto_tree_add_item(tn5250_tree, hf_tn5250_image_fax_error, tvb, offset,
5060
0
                            2, ENC_BIG_ENDIAN);
5061
0
        offset+=2;
5062
0
        break;
5063
0
      default:
5064
        /*Response must be a normal row/col, aid, field data response */
5065
0
        offset += dissect_row_column(tn5250_tree, tvb, offset);
5066
0
        break;
5067
0
    }
5068
5069
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_aid, tvb, offset, 1, ENC_BIG_ENDIAN);
5070
0
    offset++;
5071
5072
0
    if (aid == AID_INBOUND_WRITE_STRUCTURED_FIELD) {
5073
0
      offset += dissect_query_reply(tn5250_tree, tvb, offset);
5074
0
      return (offset - start);
5075
0
    }
5076
    /* Check for a response containing order codes */
5077
0
    offset += dissect_tn5250_orders_and_data(tn5250_tree, tvb, offset);
5078
0
  } else {
5079
    /* FIXME: need to know when escape/commands are expected. */
5080
    /* Check the response data for commands */
5081
0
    if (tvb_get_uint8(tvb,offset) == TN5250_ESCAPE) {
5082
0
      commands = dissect_outbound_stream(tn5250_tree, pinfo, tvb, offset);
5083
      /* It if contained commands then we're done. Anything else is unexpected data */
5084
0
      if (commands) {
5085
0
        offset += commands;
5086
0
        if (tvb_reported_length_remaining(tvb, offset)) {
5087
0
          proto_tree_add_item(tn5250_tree, hf_tn5250_unknown_data, tvb, offset,
5088
0
                              tvb_reported_length_remaining(tvb, offset), ENC_NA);
5089
0
          offset += tvb_reported_length_remaining(tvb, offset);
5090
0
        }
5091
0
        return (offset - start);
5092
0
      }
5093
0
    }
5094
0
  }
5095
5096
  /* Anything else is unformatted field data */
5097
0
  if (tvb_reported_length_remaining(tvb, offset)) {
5098
0
    proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset,
5099
0
                        tvb_reported_length_remaining(tvb, offset),
5100
0
                        ENC_EBCDIC);
5101
0
    offset += tvb_reported_length_remaining(tvb, offset);
5102
0
  }
5103
5104
0
  return (offset - start);
5105
0
}
5106
5107
static int
5108
dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
5109
0
{
5110
0
  proto_tree   *tn5250_tree;
5111
0
  proto_item   *ti;
5112
0
  int          offset = 0;
5113
0
  conversation_t *conversation;
5114
0
  tn5250_conv_info_t *tn5250_info = NULL;
5115
0
  int sna_flag;
5116
5117
  /* Do we have a conversation for this connection? */
5118
0
  conversation = find_conversation_pinfo(pinfo, 0);
5119
0
  if (conversation != NULL) {
5120
    /* Do we already have a type and mechanism? */
5121
0
    tn5250_info = (tn5250_conv_info_t *)conversation_get_proto_data(conversation, proto_tn5250);
5122
0
  }
5123
5124
0
  if (!tn5250_info)
5125
0
    return 0;
5126
5127
0
  pinfo->fd->encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
5128
5129
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "TN5250");
5130
5131
0
  ti = proto_tree_add_item(tree, proto_tn5250, tvb, offset, -1, ENC_NA);
5132
0
  tn5250_tree = proto_item_add_subtree(ti, ett_tn5250);
5133
0
  if (pinfo->srcport == tn5250_info->outbound_port) {
5134
0
    col_set_str(pinfo->cinfo, COL_INFO, "TN5250 Data from Mainframe");
5135
0
  } else {
5136
0
    col_set_str(pinfo->cinfo, COL_INFO, "TN5250 Data to Mainframe");
5137
0
  }
5138
5139
0
  if (tree) {
5140
0
    sna_flag = tvb_get_ntohs(tvb, offset+6);
5141
0
    offset += dissect_tn5250_header(tn5250_tree, tvb, offset);
5142
5143
0
    while (tvb_reported_length_remaining(tvb, offset) > 0) {
5144
0
      if (pinfo->srcport == tn5250_info->outbound_port) {
5145
0
        offset += dissect_outbound_stream(tn5250_tree, pinfo, tvb, offset);
5146
0
      } else {
5147
0
        offset += dissect_inbound_stream(tn5250_tree, pinfo, tvb, offset, sna_flag);
5148
0
      }
5149
0
    }
5150
0
  }
5151
5152
0
  return tvb_captured_length(tvb);
5153
0
}
5154
5155
void
5156
add_tn5250_conversation(packet_info *pinfo, int tn5250e)
5157
0
{
5158
0
  conversation_t *conversation;
5159
0
  tn5250_conv_info_t *tn5250_info = NULL;
5160
5161
0
  conversation = find_or_create_conversation(pinfo);
5162
5163
  /*
5164
   * Do we already have a type and mechanism?
5165
   */
5166
0
  tn5250_info = (tn5250_conv_info_t *)conversation_get_proto_data(conversation, proto_tn5250);
5167
0
  if (tn5250_info == NULL) {
5168
    /* No.  Attach that information to the conversation, and add
5169
     * it to the list of information structures.
5170
     */
5171
0
    tn5250_info = wmem_new(wmem_file_scope(), tn5250_conv_info_t);
5172
0
    tn5250_info->outbound_port = pinfo->destport;
5173
0
    conversation_add_proto_data(conversation, proto_tn5250, tn5250_info);
5174
0
  }
5175
5176
0
  tn5250_info->extended = tn5250e;
5177
5178
0
}
5179
5180
int
5181
find_tn5250_conversation(packet_info *pinfo)
5182
408
{
5183
408
  conversation_t *conversation = NULL;
5184
408
  tn5250_conv_info_t *tn5250_info = NULL;
5185
5186
  /*
5187
   * Do we have a conversation for this connection?
5188
   */
5189
408
  conversation = find_conversation_pinfo(pinfo, 0);
5190
5191
408
  if (conversation != NULL) {
5192
408
    tn5250_info = (tn5250_conv_info_t *)conversation_get_proto_data(conversation, proto_tn5250);
5193
5194
408
    if (tn5250_info != NULL) {
5195
      /*
5196
       * Do we already have a type and mechanism?
5197
       */
5198
0
      return 1;
5199
0
    }
5200
408
  }
5201
408
  return 0;
5202
408
}
5203
5204
void
5205
proto_register_tn5250(void)
5206
16
{
5207
16
  static hf_register_info hf[] = {
5208
16
    { &hf_tn5250_escape_code,
5209
16
      { "Escape Code",           "tn5250.escape_code",
5210
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_escape_codes), 0x0,
5211
16
        NULL, HFILL }},
5212
16
    { &hf_tn5250_command_code,
5213
16
      { "Command Code",           "tn5250.command_code",
5214
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_command_codes), 0x0,
5215
16
        NULL, HFILL }},
5216
16
    { &hf_tn5250_sf_length,
5217
16
      {  "Structured Field Length", "tn5250.sf_length",
5218
16
         FT_UINT16, BASE_DEC, NULL, 0x0,
5219
16
         NULL, HFILL }},
5220
16
    { &hf_tn5250_sf_class,
5221
16
      { "Structured Field Class", "tn5250.class",
5222
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_sf_class), 0,
5223
16
        NULL, HFILL }},
5224
16
    { &hf_tn5250_sf_type,
5225
16
      { "Structured Field Type", "tn5250.type",
5226
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_sf_type), 0,
5227
16
        NULL, HFILL }},
5228
5229
    /* 15.4 - Clear Unit Alternate Command Code*/
5230
16
    { &hf_tn5250_cua_parm,
5231
16
      { "TN5250 CUA Parameter", "tn5250.cua_parm",
5232
16
        FT_UINT16, BASE_HEX, VALS(vals_tn5250_cua_parms), 0x0,
5233
16
        NULL, HFILL }},
5234
5235
    /* 15.6 Write To Display Command Code */
5236
    /* 15.6.1 WTD Control Code */
5237
16
    { &hf_tn5250_wtd_ccc1,
5238
16
      {"Write To Display Command Control Character Byte 1", "tn5250.wtd_ccc1",
5239
16
       FT_UINT8, BASE_HEX,
5240
16
       VALS (vals_tn5250_wtd_cc_byteone), CCBITS, NULL, HFILL}},
5241
16
    { &hf_tn5250_wtd_ccc2,
5242
16
      { "Write To Display Command Control Character Byte 2", "tn5250.wtd_ccc2",
5243
16
        FT_UINT8, BASE_HEX, NULL, 0,
5244
16
        NULL, HFILL }},
5245
16
    { &hf_tn5250_wtd_ccc2_res,
5246
16
      { "Reserved",
5247
16
        "tn5250.wtd_ccc_reserved", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
5248
16
    { &hf_tn5250_wtd_ccc2_cursor,
5249
16
      { "Cursor does not move when keyboard unlocks",
5250
16
        "tn5250.wtd_ccc_cursor", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
5251
16
    { &hf_tn5250_wtd_ccc2_reset,
5252
16
      { "Reset blinking cursor",
5253
16
        "tn5250.wtd_ccc_reset", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
5254
16
    { &hf_tn5250_wtd_ccc2_set,
5255
16
      { "Set blinking cursor",
5256
16
        "tn5250.wtd_ccc_set", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
5257
16
    { &hf_tn5250_wtd_ccc2_unlock,
5258
16
      { "Unlock the keyboard and reset any pending AID bytes",
5259
16
        "tn5250.wtd_ccc_unlock", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
5260
16
    { &hf_tn5250_wtd_ccc2_alarm,
5261
16
      { "Sound Alarm",
5262
16
        "tn5250.wtd_ccc_alarm", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
5263
16
    { &hf_tn5250_wtd_ccc2_off,
5264
16
      { "Set Message Waiting indicator off",
5265
16
        "tn5250.wtd_ccc_off", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
5266
16
    { &hf_tn5250_wtd_ccc2_on,
5267
16
      { "Set Message Waiting indicator on",
5268
16
        "tn5250.wtd_ccc_on", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
5269
5270
5271
    /* 15.6.7 Repeat to Address Order */
5272
16
    { &hf_tn5250_repeated_character,
5273
16
      { "Repeated Character", "tn5250.repeated_character",
5274
16
        FT_STRING, BASE_NONE, NULL, 0x0,
5275
16
        NULL, HFILL }},
5276
5277
    /* 15.6.9 Start of Header Order */
5278
16
    { &hf_tn5250_soh_length,
5279
16
      { "Length", "tn5250.soh_length",
5280
16
        FT_UINT8, BASE_DEC, NULL, 0,
5281
16
        NULL, HFILL }},
5282
16
    { &hf_tn5250_soh_flags,
5283
16
      { "Start of Header Flags", "tn5250.soh_flags",
5284
16
        FT_UINT8, BASE_HEX, NULL, 0,
5285
16
        NULL, HFILL }},
5286
16
    { &hf_tn5250_soh_cursor_direction,
5287
16
      { "Right To Left Screen-Level Cursor Direction", "tn5250.soh_cursor_direction",
5288
16
        FT_BOOLEAN, 8, NULL, 0x80,
5289
16
        NULL, HFILL }},
5290
16
    { &hf_tn5250_soh_screen_reverse,
5291
16
      { "Automatic local screen reverse", "tn5250.soh_screen_reverse",
5292
16
        FT_BOOLEAN, 8, NULL, 0x20,
5293
16
        NULL, HFILL }},
5294
16
    { &hf_tn5250_soh_input_capable_only,
5295
16
      { "The cursor is allowed to move only to input-capable positions", "tn5250.soh_input_capable_only",
5296
16
        FT_BOOLEAN, 8, NULL, 0x10,
5297
16
        NULL, HFILL }},
5298
5299
16
    { &hf_tn5250_soh_pf24to17, { "Command Key Switch 1", "tn5250.soh_pf24to17",
5300
16
                                 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
5301
16
    { &hf_tn5250_soh_pf24, { "PF24", "tn5250.soh_pf24",
5302
16
                             FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
5303
16
    { &hf_tn5250_soh_pf23, { "PF23", "tn5250.soh_pf23",
5304
16
                             FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
5305
16
    { &hf_tn5250_soh_pf22, { "PF22", "tn5250.soh_pf22",
5306
16
                             FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
5307
16
    { &hf_tn5250_soh_pf21, { "PF21", "tn5250.soh_pf21",
5308
16
                             FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
5309
16
    { &hf_tn5250_soh_pf20, { "PF20", "tn5250.soh_pf20",
5310
16
                             FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
5311
16
    { &hf_tn5250_soh_pf19, { "PF19", "tn5250.soh_pf19",
5312
16
                             FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
5313
16
    { &hf_tn5250_soh_pf18, { "PF18", "tn5250.soh_pf18",
5314
16
                             FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
5315
16
    { &hf_tn5250_soh_pf17, { "PF17", "tn5250.soh_pf17",
5316
16
                             FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
5317
5318
16
    { &hf_tn5250_soh_pf16to9, { "Command Key Switch 2", "tn5250.soh_pf16to9",
5319
16
                                FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
5320
16
    { &hf_tn5250_soh_pf16, { "PF16", "tn5250.soh_pf16",
5321
16
                             FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
5322
16
    { &hf_tn5250_soh_pf15, { "PF15", "tn5250.soh_pf15",
5323
16
                             FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
5324
16
    { &hf_tn5250_soh_pf14, { "PF14", "tn5250.soh_pf14",
5325
16
                             FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
5326
16
    { &hf_tn5250_soh_pf13, { "PF13", "tn5250.soh_pf13",
5327
16
                             FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
5328
16
    { &hf_tn5250_soh_pf12, { "PF12", "tn5250.soh_pf12",
5329
16
                             FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
5330
16
    { &hf_tn5250_soh_pf11, { "PF11", "tn5250.soh_pf11",
5331
16
                             FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
5332
16
    { &hf_tn5250_soh_pf10, { "PF10", "tn5250.soh_pf10",
5333
16
                             FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
5334
16
    { &hf_tn5250_soh_pf9, { "PF9", "tn5250.soh_pf9",
5335
16
                            FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
5336
5337
16
    { &hf_tn5250_soh_pf8to1, { "Command Key Switch 3", "tn5250.soh_pf8to1",
5338
16
                               FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
5339
16
    { &hf_tn5250_soh_pf8, { "PF8", "tn5250.soh_pf8",
5340
16
                            FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
5341
16
    { &hf_tn5250_soh_pf7, { "PF7", "tn5250.soh_pf7",
5342
16
                            FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
5343
16
    { &hf_tn5250_soh_pf6, { "PF6", "tn5250.soh_pf6",
5344
16
                            FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
5345
16
    { &hf_tn5250_soh_pf5, { "PF5", "tn5250.soh_pf5",
5346
16
                            FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
5347
16
    { &hf_tn5250_soh_pf4, { "PF4", "tn5250.soh_pf4",
5348
16
                            FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
5349
16
    { &hf_tn5250_soh_pf3, { "PF3", "tn5250.soh_pf3",
5350
16
                            FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
5351
16
    { &hf_tn5250_soh_pf2, { "PF2", "tn5250.soh_pf2",
5352
16
                            FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
5353
16
    { &hf_tn5250_soh_pf1, { "PF1", "tn5250.soh_pf1",
5354
16
                            FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
5355
5356
16
    { &hf_tn5250_soh_resq, { "Resequence to Field", "tn5250.soh_resq",
5357
16
                             FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
5358
16
    { &hf_tn5250_soh_err, { "Error Row", "tn5250.soh_err",
5359
16
                            FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
5360
5361
5362
    /* 15.6.11.1 Write Extended Attribute Order - Extended Primary Attribute*/
5363
    /* 15.6.12.3 Start of Field Order - Field Attribute*/
5364
16
    { &hf_tn5250_wea_prim_attr,
5365
16
      { "Extended Primary Attributes", "tn5250.wea_prim_attr",
5366
16
        FT_UINT8, BASE_HEX, NULL, 0,
5367
16
        NULL, HFILL }},
5368
16
    { &hf_tn5250_wea_prim_attr_flag,
5369
16
      { "Attribute Change",
5370
16
        "tn5250.wea_prim_attr_flag", FT_BOOLEAN, 8, NULL,
5371
16
        0x80, NULL, HFILL }},
5372
16
    { &hf_tn5250_wea_prim_attr_col,
5373
16
      { "Column Separator",
5374
16
        "tn5250.wea_prim_attr_col", FT_BOOLEAN, 8,
5375
16
        TFS(&tn5250_field_attr_col), 0x10, NULL, HFILL }},
5376
16
    { &hf_tn5250_wea_prim_attr_blink,
5377
16
      { "Blink",
5378
16
        "tn5250.wea_prim_attr_blink", FT_BOOLEAN, 8,
5379
16
        TFS(&tn5250_field_attr_blink), 0x08, NULL, HFILL }},
5380
16
    { &hf_tn5250_wea_prim_attr_und,
5381
16
      { "Underscore",
5382
16
        "tn5250.wea_prim_attr_und", FT_BOOLEAN, 8,
5383
16
        TFS(&tn5250_field_attr_und), 0x04, NULL, HFILL }},
5384
16
    { &hf_tn5250_wea_prim_attr_int,
5385
16
      { "Intensity",
5386
16
        "tn5250.wea_prim_attr_int", FT_BOOLEAN, 8,
5387
16
        TFS(&tn5250_field_attr_int), 0x02, NULL, HFILL }},
5388
16
    { &hf_tn5250_wea_prim_attr_rev,
5389
16
      { "Reverse Image",
5390
16
        "tn5250.wea_prim_attr_rev", FT_BOOLEAN, 8,
5391
16
        TFS(&tn5250_field_attr_rev), 0x01, NULL, HFILL }},
5392
5393
    /* 15.6.11.2 Write Extended Attribute Order - Foreground Color Attribute*/
5394
16
    { &hf_tn5250_foreground_color_attr,
5395
16
      { "Foreground Color Attribute",           "tn5250.foreground_color_attr",
5396
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_foreground_color_attributes), 0x0,
5397
16
        NULL, HFILL }},
5398
    /* 15.6.11.3 Write Extended Attribute Order - Ideographic Attribute*/
5399
16
    { &hf_tn5250_ideographic_attr,
5400
16
      { "Ideographic Attribute",           "tn5250.ideographic_attr",
5401
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_ideographic_attributes), 0x0,
5402
16
        NULL, HFILL }},
5403
5404
    /* 15.6.12 Start of Field Order - Field Format Word */
5405
16
    { &hf_tn5250_ffw,
5406
16
      { "Field Format Word", "tn5250.ffw",
5407
16
        FT_UINT8, BASE_HEX, NULL, 0,
5408
16
        NULL, HFILL }},
5409
16
    { &hf_tn5250_ffw_id,
5410
16
      { "Field Format Word ID", "tn5250.ffw_id", FT_UINT8, BASE_HEX,
5411
16
        VALS(vals_tn5250_ffw_id), FFW_ID_BITS, NULL, HFILL }},
5412
16
    { &hf_tn5250_ffw_bypass,
5413
16
      { "Bypass", "tn5250.ffw_bypass",
5414
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_bypass),
5415
16
        0x20, NULL, HFILL }},
5416
16
    { &hf_tn5250_ffw_dup,
5417
16
      { "Dupe or Field Mark Enable", "tn5250.ffw_dup",
5418
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_dup),
5419
16
        0x10, NULL, HFILL }},
5420
16
    { &hf_tn5250_ffw_mdt,
5421
16
      { "Modified Data Tag", "tn5250.ffw_mdt",
5422
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_mdt),
5423
16
        0x08, NULL, HFILL }},
5424
16
    { &hf_tn5250_ffw_shift,
5425
16
      { "Field Shift/Edit Specification", "tn5250.ffw_shift", FT_UINT8, BASE_HEX,
5426
16
        VALS(vals_tn5250_ffw_shift), FFW_SHIFT_BITS, NULL, HFILL }},
5427
16
    { &hf_tn5250_ffw_auto,
5428
16
      { "Auto Enter", "tn5250.ffw_auto",
5429
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_auto),
5430
16
        0x80, NULL, HFILL }},
5431
16
    { &hf_tn5250_ffw_fer,
5432
16
      { "Field Exit Required", "tn5250.ffw_fer",
5433
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_fer),
5434
16
        0x40, NULL, HFILL }},
5435
16
    { &hf_tn5250_ffw_monocase,
5436
16
      { "Monocase", "tn5250.ffw_monocase",
5437
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_monocase),
5438
16
        0x20, NULL, HFILL }},
5439
16
    { &hf_tn5250_ffw_res,
5440
16
      { "Reserved", "tn5250.ffw_res",
5441
16
        FT_BOOLEAN, 8, NULL,
5442
16
        0x10, NULL, HFILL }},
5443
16
    { &hf_tn5250_ffw_me,
5444
16
      { "Mandatory Enter", "tn5250.ffw_me",
5445
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_ffw_me),
5446
16
        0x08, NULL, HFILL }},
5447
16
    { &hf_tn5250_ffw_adjust,
5448
16
      { "Right Adjust/Mandatory Fill", "tn5250.ffw_adjust", FT_UINT8, BASE_HEX,
5449
16
        VALS(vals_tn5250_ffw_adjust), FFW_ADJUST_BITS, NULL, HFILL }},
5450
5451
16
    { &hf_tn5250_fcw,
5452
16
      { "Field Control Word", "tn5250.fcw",
5453
16
        FT_UINT16, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_fcw), 0,
5454
16
        NULL, HFILL }},
5455
5456
16
    { &hf_tn5250_fa_color,
5457
16
      { "Field Attribute (Color)", "tn5250.fa_color",
5458
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5459
16
        NULL, HFILL }},
5460
16
    { &hf_tn5250_fa,
5461
16
      { "Field Attributes", "tn5250.sf_fa",
5462
16
        FT_UINT8, BASE_HEX, NULL, 0,
5463
16
        NULL, HFILL }},
5464
16
    { &hf_tn5250_sf_attr_flag,
5465
16
      { "Attribute ID",
5466
16
        "tn5250.sf_attr_flag", FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_id), FA_ID_BITS, NULL, HFILL }},
5467
    /* Use Attribute Field fields from 14.6.11.1 for rest of attribute fields */
5468
5469
    /* 15.6.13  Write to Display Structured Field Order */
5470
5471
    /* 15.6.13.1  Write to Display Structured Field Order - Create Window */
5472
16
    { &hf_tn5250_wdsf_cw_flag1,
5473
16
      { "Flags", "tn5250.wdsf_cw_flag1",
5474
16
        FT_UINT8, BASE_HEX, NULL, 0,
5475
16
        NULL, HFILL }},
5476
16
    { &hf_tn5250_wdsf_cw_flag1_1,
5477
16
      { "Flag 1", "tn5250.wdsf_cw_flag1_1",
5478
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_cw_flag1_1),
5479
16
        0x80, NULL, HFILL }},
5480
16
    { &hf_tn5250_wdsf_cw_flag1_2,
5481
16
      { "Flag 2", "tn5250.wdsf_cw_flag1_2",
5482
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_cw_flag1_2),
5483
16
        0x40, NULL, HFILL }},
5484
16
    { &hf_tn5250_wdsf_cw_flag1_reserved,
5485
16
      { "Reserved", "tn5250.wdsf_cw_flag1_reserved", FT_UINT8, BASE_HEX,
5486
16
        NULL, 0x3F, NULL, HFILL }},
5487
16
    { &hf_tn5250_wdsf_cw_wd,
5488
16
      { "Window Depth", "tn5250.wdsf_cw_wd",
5489
16
        FT_UINT8, BASE_DEC, NULL, 0,
5490
16
        NULL, HFILL }},
5491
16
    { &hf_tn5250_wdsf_cw_ww,
5492
16
      { "Window Width", "tn5250.wdsf_cw_ww",
5493
16
        FT_UINT8, BASE_DEC, NULL, 0,
5494
16
        NULL, HFILL }},
5495
5496
16
    { &hf_tn5250_wdsf_cw_minor_type,
5497
16
      { "Minor Structured Field Type", "tn5250.wdsf_cw_minor_type",
5498
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_wdsf_cw_minor_type), 0,
5499
16
        NULL, HFILL }},
5500
5501
    /* 15.6.13.1  Write to Display Structured Field Order - Create Window - Border Presentation Minor Structure */
5502
16
    { &hf_tn5250_wdsf_cw_bp_flag1,
5503
16
      { "Flags", "tn5250.wdsf_cw_bp_flag1",
5504
16
        FT_UINT8, BASE_HEX, NULL, 0,
5505
16
        NULL, HFILL }},
5506
16
    { &hf_tn5250_wdsf_cw_bp_flag1_1,
5507
16
      { "Flag 1", "tn5250.wdsf_cw_bp_flag1_1",
5508
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_cw_bp_flag1_1),
5509
16
        0x80, NULL, HFILL }},
5510
16
    { &hf_tn5250_wdsf_cw_bp_flag1_reserved,
5511
16
      { "Reserved", "tn5250.wdsf_cw_bp_flag1_reserved", FT_UINT8, BASE_HEX,
5512
16
        NULL, 0x7F, NULL, HFILL }},
5513
16
    { &hf_tn5250_wdsf_cw_bp_mba,
5514
16
      { "Monochrome Border Attribute", "tn5250.wdsf_cw_bp_mba",
5515
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5516
16
        NULL, HFILL }},
5517
16
    { &hf_tn5250_wdsf_cw_bp_cba,
5518
16
      { "Color Border Attribute", "tn5250.wdsf_cw_bp_cba",
5519
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5520
16
        NULL, HFILL }},
5521
16
    { &hf_tn5250_wdsf_cw_bp_ulbc,
5522
16
      { "Upper Left Border Character", "tn5250.wdsf_cw_bp_ulbc",
5523
16
        FT_STRING, BASE_NONE, NULL, 0,
5524
16
        NULL, HFILL }},
5525
16
    { &hf_tn5250_wdsf_cw_bp_tbc,
5526
16
      { "Top Border Character", "tn5250.wdsf_cw_bp_tbc",
5527
16
        FT_STRING, BASE_NONE, NULL, 0,
5528
16
        NULL, HFILL }},
5529
16
    { &hf_tn5250_wdsf_cw_bp_urbc,
5530
16
      { "Upper Right Border Character", "tn5250.wdsf_cw_bp_urbc",
5531
16
        FT_STRING, BASE_NONE, NULL, 0,
5532
16
        NULL, HFILL }},
5533
16
    { &hf_tn5250_wdsf_cw_bp_lbc,
5534
16
      { "Left Border Character", "tn5250.wdsf_cw_bp_lbc",
5535
16
        FT_STRING, BASE_NONE, NULL, 0,
5536
16
        NULL, HFILL }},
5537
16
    { &hf_tn5250_wdsf_cw_bp_rbc,
5538
16
      { "Right Border Character", "tn5250.wdsf_cw_bp_rbc",
5539
16
        FT_STRING, BASE_NONE, NULL, 0,
5540
16
        NULL, HFILL }},
5541
16
    { &hf_tn5250_wdsf_cw_bp_llbc,
5542
16
      { "Lower Left Border Character", "tn5250.wdsf_cw_bp_llbc",
5543
16
        FT_STRING, BASE_NONE, NULL, 0,
5544
16
        NULL, HFILL }},
5545
16
    { &hf_tn5250_wdsf_cw_bp_bbc,
5546
16
      { "Bottom Border Character", "tn5250.wdsf_cw_bp_bbc",
5547
16
        FT_STRING, BASE_NONE, NULL, 0,
5548
16
        NULL, HFILL }},
5549
16
    { &hf_tn5250_wdsf_cw_bp_lrbc,
5550
16
      { "Lower Right Border Character", "tn5250.wdsf_cw_bp_lrbc",
5551
16
        FT_STRING, BASE_NONE, NULL, 0,
5552
16
        NULL, HFILL }},
5553
5554
    /* 15.6.13.1  Write to Display Structured Field Order - Create Window - Window/Title Footer Minor Structure */
5555
16
    { &hf_tn5250_wdsf_cw_tf_flag,
5556
16
      { "Flags", "tn5250.wdsf_cw_tf_flag",
5557
16
        FT_UINT8, BASE_HEX, NULL, 0,
5558
16
        NULL, HFILL }},
5559
16
    { &hf_tn5250_wdsf_cw_tf_flag_orientation,
5560
16
      { "Orientation", "tn5250.wdsf_cw_tf_flag_orientation", FT_UINT8, BASE_HEX,
5561
16
        VALS(vals_tn5250_wdsf_cw_tf_flag_orientation), WTF_BITS, NULL, HFILL }},
5562
16
    { &hf_tn5250_wdsf_cw_tf_flag_1,
5563
16
      { "Title/Footer Defined", "tn5250.wdsf_cw_tf_flag_1",
5564
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_cw_tf_flag_1),
5565
16
        0x20, NULL, HFILL }},
5566
16
    { &hf_tn5250_wdsf_cw_tf_flag_reserved,
5567
16
      { "Reserved", "tn5250.wdsf_cw_tf_flag_reserved", FT_UINT8, BASE_HEX,
5568
16
        NULL, 0xF8, NULL, HFILL }},
5569
16
    { &hf_tn5250_wdsf_cw_tf_mba,
5570
16
      { "Monochrome Title/Footer Attribute", "tn5250.wdsf_cw_tf_mba",
5571
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5572
16
        NULL, HFILL }},
5573
16
    { &hf_tn5250_wdsf_cw_tf_cba,
5574
16
      { "Color Title/Footer Attribute", "tn5250.wdsf_cw_tf_cba",
5575
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5576
16
        NULL, HFILL }},
5577
16
    { &hf_tn5250_wdsf_cw_tf_text,
5578
16
      { "Title Text", "tn5250.wdsf_cw_tf_text",
5579
16
        FT_STRING, BASE_NONE, NULL, 0,
5580
16
        NULL, HFILL }},
5581
5582
    /* 15.6.13.2  Write to Display Structured Field Order - Unrestricted Window Cursor Movement */
5583
    /* Consists of reserved fields only */
5584
5585
    /* 15.6.13.3  Write to Display Structured Field Order - Remove GUI Window */
5586
16
    { &hf_tn5250_wdsf_rgw_flag1,
5587
16
      { "Flags", "tn5250.wdsf_rgw_flag",
5588
16
        FT_UINT8, BASE_HEX, NULL, 0,
5589
16
        NULL, HFILL }},
5590
16
    { &hf_tn5250_wdsf_rgw_flag1_0,
5591
16
      { "Reserved", "tn5250.wdsf_rgw_flag1_0",
5592
16
        FT_BOOLEAN, 8, NULL,
5593
16
        0x80, NULL, HFILL }},
5594
16
    { &hf_tn5250_wdsf_rgw_flag1_1,
5595
16
      { "Window Pull-Down", "tn5250.wdsf_rgw_flag1_1",
5596
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_cw_flag1_2),
5597
16
        0x40, NULL, HFILL }},
5598
16
    { &hf_tn5250_wdsf_rgw_reserved,
5599
16
      { "Reserved", "tn5250.wdsf_rgw_flag_reserved", FT_UINT8, BASE_HEX,
5600
16
        NULL, 0x3F, NULL, HFILL }},
5601
5602
    /* 15.6.13.4  Write to Display Structured Field Order - Remove All GUI Constructs*/
5603
16
    { &hf_tn5250_wdsf_ragc_flag1,
5604
16
      { "Flags", "tn5250.wdsf_ragc_flag",
5605
16
        FT_UINT8, BASE_HEX, NULL, 0,
5606
16
        NULL, HFILL }},
5607
16
    { &hf_tn5250_wdsf_ragc_flag1_0,
5608
16
      { "GUI-Like Characters", "tn5250.wdsf_ragc_flag1_0",
5609
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ragc_flag1_0),
5610
16
        0x80, NULL, HFILL }},
5611
16
    { &hf_tn5250_wdsf_ragc_reserved,
5612
16
      { "Reserved", "tn5250.wdsf_ragc_flag_reserved", FT_UINT8, BASE_HEX,
5613
16
        NULL, 0x7F, NULL, HFILL }},
5614
5615
    /* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field*/
5616
16
    { &hf_tn5250_wdsf_ds_flag1,
5617
16
      { "Flags", "tn5250.wdsf_ds_flag1",
5618
16
        FT_UINT8, BASE_HEX, NULL, 0,
5619
16
        NULL, HFILL }},
5620
16
    { &hf_tn5250_wdsf_ds_flag1_mouse_characteristics,
5621
16
      { "Mouse Characteristics", "tn5250.wdsf_ds_flag1_mouse_characteristics", FT_UINT8, BASE_HEX,
5622
16
        VALS(vals_tn5250_wdsf_ds_flag1_mouse_characteristics), MOUSE_CHARACTERISTICS_BITS, NULL, HFILL }},
5623
16
    { &hf_tn5250_wdsf_ds_flag1_reserved,
5624
16
      { "Reserved", "tn5250.wdsf_ds_flag1_reserved", FT_UINT8, BASE_HEX,
5625
16
        NULL, 0x0C, NULL, HFILL }},
5626
16
    { &hf_tn5250_wdsf_ds_flag1_auto_enter,
5627
16
      { "Mouse Characteristics", "tn5250.wdsf_ds_flag1_auto_enter", FT_UINT8, BASE_HEX,
5628
16
        VALS(vals_tn5250_wdsf_ds_flag1_auto_enter), DS_AUTO_ENTER_BITS, NULL, HFILL }},
5629
16
    { &hf_tn5250_wdsf_ds_flag1_1,
5630
16
      { "Auto Select", "tn5250.wdsf_ds_flag1_1",
5631
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag1_1),
5632
16
        0x40, NULL, HFILL }},
5633
16
    { &hf_tn5250_wdsf_ds_flag1_2,
5634
16
      { "Field MDT", "tn5250.wdsf_ds_flag1_2",
5635
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag1_2),
5636
16
        0x80, NULL, HFILL }},
5637
5638
16
    { &hf_tn5250_wdsf_ds_flag2,
5639
16
      { "Flags", "tn5250.wdsf_ds_flag2",
5640
16
        FT_UINT8, BASE_HEX, NULL, 0,
5641
16
        NULL, HFILL }},
5642
16
    { &hf_tn5250_wdsf_ds_flag2_1,
5643
16
      { "Bit 0", "tn5250.wdsf_ds_flag2_1",
5644
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag2_1),
5645
16
        0x01, NULL, HFILL }},
5646
16
    { &hf_tn5250_wdsf_ds_flag2_2,
5647
16
      { "Bit 1", "tn5250.wdsf_ds_flag2_2",
5648
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag2_2),
5649
16
        0x02, NULL, HFILL }},
5650
16
    { &hf_tn5250_wdsf_ds_flag2_3,
5651
16
      { "Bit 2", "tn5250.wdsf_ds_flag2_3",
5652
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag2_3),
5653
16
        0x04, NULL, HFILL }},
5654
16
    { &hf_tn5250_wdsf_ds_flag2_4,
5655
16
      { "Bit 3", "tn5250.wdsf_ds_flag2_4",
5656
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag2_4),
5657
16
        0x08, NULL, HFILL }},
5658
16
    { &hf_tn5250_wdsf_ds_flag2_5,
5659
16
      { "Bit 4", "tn5250.wdsf_ds_flag2_5",
5660
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag2_5),
5661
16
        0x10, NULL, HFILL }},
5662
16
    { &hf_tn5250_wdsf_ds_flag2_6,
5663
16
      { "Bit 5", "tn5250.wdsf_ds_flag2_6",
5664
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag2_6),
5665
16
        0x20, NULL, HFILL }},
5666
16
    { &hf_tn5250_wdsf_ds_flag2_reserved,
5667
16
      { "Reserved", "tn5250.wdsf_ds_flag2_reserved", FT_UINT8, BASE_HEX,
5668
16
        NULL, 0xC0, NULL, HFILL }},
5669
5670
16
    { &hf_tn5250_wdsf_ds_flag3,
5671
16
      { "Flags", "tn5250.wdsf_ds_flag3",
5672
16
        FT_UINT8, BASE_HEX, NULL, 0,
5673
16
        NULL, HFILL }},
5674
16
    { &hf_tn5250_wdsf_ds_flag3_1,
5675
16
      { "Bit 0", "tn5250.wdsf_ds_flag3_1",
5676
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_flag3_1),
5677
16
        0x01, NULL, HFILL }},
5678
16
    { &hf_tn5250_wdsf_ds_flag3_reserved,
5679
16
      { "Reserved", "tn5250.wdsf_ds_flag3_reserved", FT_UINT8, BASE_HEX,
5680
16
        NULL, 0xFE, NULL, HFILL }},
5681
5682
16
    { &hf_tn5250_wdsf_ds_type,
5683
16
      { "Type of Selection Field", "tn5250.wdsf_ds_type",
5684
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_wdsf_ds_type), 0,
5685
16
        NULL, HFILL }},
5686
5687
16
    { &hf_tn5250_wdsf_ds_gdc,
5688
16
      { "GUI Device Characteristics", "tn5250.wdsf_ds_gdc",
5689
16
        FT_UINT8, BASE_HEX, NULL, 0,
5690
16
        NULL, HFILL }},
5691
16
    { &hf_tn5250_wdsf_ds_gdc_indicators,
5692
16
      { "Indicators", "tn5250.wdsf_ds_gdc_indicators", FT_UINT8, BASE_HEX,
5693
16
        VALS(vals_tn5250_wdsf_ds_gdc_indicators), DS_INDICATORS_BITS, NULL, HFILL }},
5694
16
    { &hf_tn5250_wdsf_ds_gdc_reserved,
5695
16
      { "Reserved", "tn5250.wdsf_ds_gdc_reserved", FT_BOOLEAN, 8,
5696
16
        NULL, 0x10, NULL, HFILL }},
5697
16
    { &hf_tn5250_wdsf_ds_gdc_selection_techniques,
5698
16
      { "Selection Techniques", "tn5250.wdsf_ds_gdc_selection_techniques", FT_UINT8, BASE_HEX,
5699
16
        VALS(vals_tn5250_wdsf_ds_gdc_selection_techniques), DS_SELECTION_TECHNIQUES_BITS, NULL, HFILL }},
5700
5701
16
    { &hf_tn5250_wdsf_ds_nws,
5702
16
      { "NWS With Mnemonic Underscore Characteristics", "tn5250.wdsf_ds_nws",
5703
16
        FT_UINT8, BASE_HEX, NULL, 0,
5704
16
        NULL, HFILL }},
5705
16
    { &hf_tn5250_wdsf_ds_nws_indicators,
5706
16
      { "Indicators", "tn5250.wdsf_ds_nws_indicators", FT_UINT8, BASE_HEX,
5707
16
        VALS(vals_tn5250_wdsf_ds_nws_indicators), DS_NWS_INDICATORS_BITS, NULL, HFILL }},
5708
16
    { &hf_tn5250_wdsf_ds_nws_reserved,
5709
16
      { "Reserved", "tn5250.wdsf_ds_nws_reserved", FT_BOOLEAN, 8,
5710
16
        NULL, 0x10, NULL, HFILL }},
5711
16
    { &hf_tn5250_wdsf_ds_nws_selection_techniques,
5712
16
      { "Selection Techniques", "tn5250.wdsf_ds_nws_selection_techniques", FT_UINT8, BASE_HEX,
5713
16
        VALS(vals_tn5250_wdsf_ds_nws_selection_techniques), DS_NWS_SELECTION_TECHNIQUES_BITS, NULL, HFILL }},
5714
5715
16
    { &hf_tn5250_wdsf_ds_nws_wout,
5716
16
      { "NWS Without Mnemonic Underscore Characteristics", "tn5250.wdsf_ds_nws_wout",
5717
16
        FT_UINT8, BASE_HEX, NULL, 0,
5718
16
        NULL, HFILL }},
5719
    /* hf_tn5250_wdsf_ds_nws_wout uses same bitfields as hf_tn5250_wdsf_ds_nws */
5720
5721
16
    { &hf_tn5250_wdsf_ds_textsize,
5722
16
      { "Text Size", "tn5250.wdsf_ds_textsize",
5723
16
        FT_UINT8, BASE_DEC, NULL, 0,
5724
16
        NULL, HFILL }},
5725
16
    { &hf_tn5250_wdsf_ds_rows,
5726
16
      { "Rows", "tn5250.wdsf_ds_rows",
5727
16
        FT_UINT8, BASE_DEC, NULL, 0,
5728
16
        NULL, HFILL }},
5729
16
    { &hf_tn5250_wdsf_ds_columns,
5730
16
      { "Columns/Menu Bar Choices", "tn5250.wdsf_ds_columns",
5731
16
        FT_UINT8, BASE_DEC, NULL, 0,
5732
16
        NULL, HFILL }},
5733
16
    { &hf_tn5250_wdsf_ds_padding,
5734
16
      { "Padding Between Choices", "tn5250.wdsf_ds_padding",
5735
16
        FT_UINT8, BASE_DEC, NULL, 0,
5736
16
        NULL, HFILL }},
5737
16
    { &hf_tn5250_wdsf_ds_numeric_sep,
5738
16
      { "Numeric Separator Character", "tn5250.wdsf_ds_numeric_sep",
5739
16
        FT_STRING, BASE_NONE, NULL, 0,
5740
16
        NULL, HFILL }},
5741
16
    { &hf_tn5250_wdsf_ds_country_sel,
5742
16
      { "Country Specific Selection Character", "tn5250.wdsf_ds_country_sel",
5743
16
        FT_STRING, BASE_NONE, NULL, 0,
5744
16
        NULL, HFILL }},
5745
16
    { &hf_tn5250_wdsf_ds_cancel_aid,
5746
16
      { "Mouse Pull-Down Cancel AID", "tn5250.wdsf_ds_cancel_aid",
5747
16
        FT_UINT8, BASE_HEX, NULL, 0,
5748
16
        NULL, HFILL }},
5749
16
    { &hf_tn5250_wdsf_ds_totalrows,
5750
16
      { "Total Rows or Minor Structures That Can Be Scrolled", "tn5250.wdsf_ds_totalrows",
5751
16
        FT_UINT32, BASE_DEC, NULL, 0,
5752
16
        NULL, HFILL }},
5753
16
    { &hf_tn5250_wdsf_ds_sliderpos,
5754
16
      { "Slider Positions That Can Be Scrolled", "tn5250.wdsf_ds_sliderpos",
5755
16
        FT_UINT32, BASE_DEC, NULL, 0,
5756
16
        NULL, HFILL }},
5757
5758
16
    { &hf_tn5250_wdsf_ds_minor_type,
5759
16
      { "Minor Structured Field Type", "tn5250.wdsf_ds_minor_type",
5760
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_wdsf_ds_minor_type), 0,
5761
16
        NULL, HFILL }},
5762
5763
    /* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Choice Text Minor Structure*/
5764
16
    { &hf_tn5250_wdsf_ds_ct_flag1,
5765
16
      { "Flag Byte 1", "tn5250.wdsf_ds_ct_flag1",
5766
16
        FT_UINT8, BASE_HEX, NULL, 0,
5767
16
        NULL, HFILL }},
5768
16
    { &hf_tn5250_wdsf_ds_ct_flag1_choice_state,
5769
16
      { "Choice State", "tn5250.wdsf_ds_ct_flag1_choice_state", FT_UINT8, BASE_HEX,
5770
16
        VALS(vals_tn5250_wdsf_ds_ct_flag1_choice_state), DS_CHOICE_STATE_BITS, NULL, HFILL }},
5771
16
    { &hf_tn5250_wdsf_ds_ct_flag1_2,
5772
16
      { "Bit 2", "tn5250.wdsf_ds_ct_flag1_2",
5773
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag1_2),
5774
16
        0x04, NULL, HFILL }},
5775
16
    { &hf_tn5250_wdsf_ds_ct_flag1_3,
5776
16
      { "Bit 3", "tn5250.wdsf_ds_ct_flag1_3",
5777
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag1_3),
5778
16
        0x08, NULL, HFILL }},
5779
16
    { &hf_tn5250_wdsf_ds_ct_flag1_4,
5780
16
      { "Bit 4", "tn5250.wdsf_ds_ct_flag1_4",
5781
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag1_4),
5782
16
        0x10, NULL, HFILL }},
5783
16
    { &hf_tn5250_wdsf_ds_ct_flag1_5,
5784
16
      { "Bit 5", "tn5250.wdsf_ds_ct_flag1_5",
5785
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag1_5),
5786
16
        0x20, NULL, HFILL }},
5787
16
    { &hf_tn5250_wdsf_ds_ct_flag1_numeric_selection,
5788
16
      { "Numeric Selection Characters", "tn5250.wdsf_ds_ct_flag1_numeric_selection", FT_UINT8, BASE_HEX,
5789
16
        VALS(vals_tn5250_wdsf_ds_ct_flag1_numeric_selection), DS_NUMERIC_SELECTION_BITS, NULL, HFILL }},
5790
5791
16
    { &hf_tn5250_wdsf_ds_ct_flag2,
5792
16
      { "Flag Byte 2", "tn5250.wdsf_ds_ct_flag2",
5793
16
        FT_UINT8, BASE_HEX, NULL, 0,
5794
16
        NULL, HFILL }},
5795
16
    { &hf_tn5250_wdsf_ds_ct_flag2_0,
5796
16
      { "Bit 0", "tn5250.wdsf_ds_ct_flag2_0",
5797
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_0),
5798
16
        0x01, NULL, HFILL }},
5799
16
    { &hf_tn5250_wdsf_ds_ct_flag2_1,
5800
16
      { "Bit 1", "tn5250.wdsf_ds_ct_flag2_1",
5801
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_1),
5802
16
        0x02, NULL, HFILL }},
5803
16
    { &hf_tn5250_wdsf_ds_ct_flag2_2,
5804
16
      { "Bit 2", "tn5250.wdsf_ds_ct_flag2_2",
5805
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_2),
5806
16
        0x04, NULL, HFILL }},
5807
16
    { &hf_tn5250_wdsf_ds_ct_flag2_3,
5808
16
      { "Bit 3", "tn5250.wdsf_ds_ct_flag2_3",
5809
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_3),
5810
16
        0x08, NULL, HFILL }},
5811
16
    { &hf_tn5250_wdsf_ds_ct_flag2_4,
5812
16
      { "Bit 4", "tn5250.wdsf_ds_ct_flag2_4",
5813
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_4),
5814
16
        0x10, NULL, HFILL }},
5815
16
    { &hf_tn5250_wdsf_ds_ct_flag2_5,
5816
16
      { "Bit 5", "tn5250.wdsf_ds_ct_flag2_5",
5817
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_5),
5818
16
        0x20, NULL, HFILL }},
5819
16
    { &hf_tn5250_wdsf_ds_ct_flag2_6,
5820
16
      { "Bit 6", "tn5250.wdsf_ds_ct_flag2_6",
5821
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_6),
5822
16
        0x40, NULL, HFILL }},
5823
16
    { &hf_tn5250_wdsf_ds_ct_flag2_7,
5824
16
      { "Bit 7", "tn5250.wdsf_ds_ct_flag2_7",
5825
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag2_7),
5826
16
        0x80, NULL, HFILL }},
5827
5828
16
    { &hf_tn5250_wdsf_ds_ct_flag3,
5829
16
      { "Flag Byte 3", "tn5250.wdsf_ds_ct_flag3",
5830
16
        FT_UINT8, BASE_HEX, NULL, 0,
5831
16
        NULL, HFILL }},
5832
16
    { &hf_tn5250_wdsf_ds_ct_flag3_0,
5833
16
      { "Bit 0", "tn5250.wdsf_ds_ct_flag3_0",
5834
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag3_0),
5835
16
        0x01, NULL, HFILL }},
5836
16
    { &hf_tn5250_wdsf_ds_ct_flag3_1,
5837
16
      { "Bit 1", "tn5250.wdsf_ds_ct_flag3_1",
5838
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag3_1),
5839
16
        0x02, NULL, HFILL }},
5840
16
    { &hf_tn5250_wdsf_ds_ct_flag3_2,
5841
16
      { "Bit 2", "tn5250.wdsf_ds_ct_flag3_2",
5842
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ct_flag3_2),
5843
16
        0x04, NULL, HFILL }},
5844
16
    { &hf_tn5250_wdsf_ds_ct_flag3_reserved,
5845
16
      { "Reserved", "tn5250.wdsf_ds_ct_flag3_reserved", FT_UINT8, BASE_HEX,
5846
16
        NULL, 0xF8, NULL, HFILL }},
5847
5848
16
    { &hf_tn5250_wdsf_ds_ct_mnemonic_offset,
5849
16
      { "Mnemonic Offset", "tn5250.wdsf_ds_ct_mnemonic_offset",
5850
16
        FT_UINT8, BASE_DEC, NULL, 0,
5851
16
        NULL, HFILL }},
5852
16
    { &hf_tn5250_wdsf_ds_ct_aid,
5853
16
      { "AID", "tn5250.wdsf_ds_ct_aid",
5854
16
        FT_UINT8, BASE_HEX, NULL, 0,
5855
16
        NULL, HFILL }},
5856
16
    { &hf_tn5250_wdsf_ds_ct_numeric_onebyte,
5857
16
      { "Numeric Characters", "tn5250.wdsf_ds_ct_numeric",
5858
16
        FT_UINT8, BASE_HEX, NULL, 0,
5859
16
        NULL, HFILL }},
5860
16
    { &hf_tn5250_wdsf_ds_ct_numeric_twobyte,
5861
16
      { "Numeric Characters", "tn5250.wdsf_ds_ct_numeric",
5862
16
        FT_UINT16, BASE_HEX, NULL, 0,
5863
16
        NULL, HFILL }},
5864
16
    { &hf_tn5250_wdsf_ds_ct_text,
5865
16
      { "Choice Text", "tn5250.wdsf_ds_ct_text",
5866
16
        FT_STRING, BASE_NONE, NULL, 0,
5867
16
        NULL, HFILL }},
5868
5869
    /* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Menu Bar Separator Minor Structure*/
5870
5871
16
    { &hf_tn5250_wdsf_ds_mbs_flag,
5872
16
      { "Flags", "tn5250.wdsf_ds_mbs_flag",
5873
16
        FT_UINT8, BASE_HEX, NULL, 0,
5874
16
        NULL, HFILL }},
5875
16
    { &hf_tn5250_wdsf_ds_mbs_flag_0,
5876
16
      { "Bit 0", "tn5250.wdsf_ds_mbs_flag_0",
5877
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_mbs_flag_0),
5878
16
        0x01, NULL, HFILL }},
5879
16
    { &hf_tn5250_wdsf_ds_mbs_flag_1,
5880
16
      { "Bit 1", "tn5250.wdsf_ds_mbs_flag_1",
5881
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_mbs_flag_1),
5882
16
        0x02, NULL, HFILL }},
5883
16
    { &hf_tn5250_wdsf_ds_mbs_flag_reserved,
5884
16
      { "Reserved", "tn5250.wdsf_ds_mbs_flag_reserved", FT_UINT8, BASE_HEX,
5885
16
        NULL, 0xF8, NULL, HFILL }},
5886
16
    { &hf_tn5250_wdsf_ds_mbs_start_column,
5887
16
      { "Start Column", "tn5250.wdsf_ds_mbs_start_column",
5888
16
        FT_UINT8, BASE_DEC, NULL, 0,
5889
16
        NULL, HFILL }},
5890
16
    { &hf_tn5250_wdsf_ds_mbs_end_column,
5891
16
      { "End Column", "tn5250.wdsf_ds_mbs_end_column",
5892
16
        FT_UINT8, BASE_DEC, NULL, 0,
5893
16
        NULL, HFILL }},
5894
16
    { &hf_tn5250_wdsf_ds_mbs_monochrome_sep,
5895
16
      { "Monochrome Separator Emphasis", "tn5250.wdsf_ds_mbs_monochrome_sep",
5896
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5897
16
        NULL, HFILL }},
5898
16
    { &hf_tn5250_wdsf_ds_mbs_color_sep,
5899
16
      { "Color Separator Emphasis", "tn5250.wdsf_ds_mbs_color_sep",
5900
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5901
16
        NULL, HFILL }},
5902
16
    { &hf_tn5250_wdsf_ds_mbs_sep_char,
5903
16
      { "Separator Character", "tn5250.wdsf_ds_mbs_sep_char",
5904
16
        FT_STRING, BASE_NONE, NULL, 0,
5905
16
        NULL, HFILL }},
5906
5907
    /* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Choice Presentation Display Attributes Minor Structure*/
5908
16
    { &hf_tn5250_wdsf_ds_cpda_flag1,
5909
16
      { "Flags", "tn5250.wdsf_ds_cpda_flag1",
5910
16
        FT_UINT8, BASE_HEX, NULL, 0,
5911
16
        NULL, HFILL }},
5912
16
    { &hf_tn5250_wdsf_ds_cpda_flag1_0,
5913
16
      { "Bit 0", "tn5250.wdsf_ds_cpda_flag1_0",
5914
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_cpda_flag1_0),
5915
16
        0x01, NULL, HFILL }},
5916
16
    { &hf_tn5250_wdsf_ds_cpda_flag1_1,
5917
16
      { "Bit 1", "tn5250.wdsf_ds_cpda_flag1_1",
5918
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_cpda_flag1_1),
5919
16
        0x02, NULL, HFILL }},
5920
16
    { &hf_tn5250_wdsf_ds_cpda_flag1_2,
5921
16
      { "Bit 2", "tn5250.wdsf_ds_cpda_flag1_2",
5922
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_cpda_flag1_2),
5923
16
        0x04, NULL, HFILL }},
5924
16
    { &hf_tn5250_wdsf_ds_cpda_flag1_reserved,
5925
16
      { "Reserved", "tn5250.wdsf_ds_cpda_flag1_reserved", FT_UINT8, BASE_HEX,
5926
16
        NULL, 0xF8, NULL, HFILL }},
5927
5928
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_sel_avail,
5929
16
      { "Monochrome Selection Cursor Available Emphasis", "tn5250.wdsf_ds_cpda_monochrome_sel_avail",
5930
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5931
16
        NULL, HFILL }},
5932
16
    { &hf_tn5250_wdsf_ds_cpda_color_sel_avail,
5933
16
      { "Color Selection Cursor Available Emphasis", "tn5250.wdsf_ds_cpda_color_sel_avail",
5934
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5935
16
        NULL, HFILL }},
5936
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_sel_selected,
5937
16
      { "Monochrome Selection Cursor Selected Emphasis", "tn5250.wdsf_ds_cpda_monochrome_sel_selected",
5938
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5939
16
        NULL, HFILL }},
5940
16
    { &hf_tn5250_wdsf_ds_cpda_color_sel_selected,
5941
16
      { "Color Selection Cursor Selected Emphasis", "tn5250.wdsf_ds_cpda_color_sel_selected",
5942
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5943
16
        NULL, HFILL }},
5944
5945
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_sel_unavail,
5946
16
      { "Monochrome Selection Cursor Unavailable Emphasis", "tn5250.wdsf_ds_cpda_monochrome_sel_unavail",
5947
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5948
16
        NULL, HFILL }},
5949
16
    { &hf_tn5250_wdsf_ds_cpda_color_sel_unavail,
5950
16
      { "Color Selection Cursor Unavailable Emphasis", "tn5250.wdsf_ds_cpda_color_sel_unavail",
5951
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5952
16
        NULL, HFILL }},
5953
5954
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_avail,
5955
16
      { "Monochrome Available Emphasis", "tn5250.wdsf_ds_cpda_monochrome_avail",
5956
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5957
16
        NULL, HFILL }},
5958
16
    { &hf_tn5250_wdsf_ds_cpda_color_avail,
5959
16
      { "Color Available Emphasis", "tn5250.wdsf_ds_cpda_color_avail",
5960
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5961
16
        NULL, HFILL }},
5962
5963
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_selected,
5964
16
      { "Monochrome Selected Emphasis", "tn5250.wdsf_ds_cpda_monochrome_selected",
5965
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5966
16
        NULL, HFILL }},
5967
16
    { &hf_tn5250_wdsf_ds_cpda_color_selected,
5968
16
      { "Color Selected Emphasis", "tn5250.wdsf_ds_cpda_color_selected",
5969
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5970
16
        NULL, HFILL }},
5971
5972
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_unavail,
5973
16
      { "Monochrome Unavailable Emphasis", "tn5250.wdsf_ds_cpda_monochrome_unavail",
5974
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5975
16
        NULL, HFILL }},
5976
16
    { &hf_tn5250_wdsf_ds_cpda_color_unavail,
5977
16
      { "Color Unavailable Emphasis", "tn5250.wdsf_ds_cpda_color_unavail",
5978
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5979
16
        NULL, HFILL }},
5980
5981
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_indicator,
5982
16
      { "Monochrome Indicator Emphasis", "tn5250.wdsf_ds_cpda_monochrome_indicator",
5983
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5984
16
        NULL, HFILL }},
5985
16
    { &hf_tn5250_wdsf_ds_cpda_color_indicator,
5986
16
      { "Color Indicator Emphasis", "tn5250.wdsf_ds_cpda_color_indicator",
5987
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5988
16
        NULL, HFILL }},
5989
5990
16
    { &hf_tn5250_wdsf_ds_cpda_monochrome_unavail_indicator,
5991
16
      { "Monochrome Unavailable Indicator Emphasis", "tn5250.wdsf_ds_cpda_monochrome_unavail_indicator",
5992
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5993
16
        NULL, HFILL }},
5994
16
    { &hf_tn5250_wdsf_ds_cpda_color_unavail_indicator,
5995
16
      { "Color Unavailable Indicator Emphasis", "tn5250.wdsf_ds_cpda_color_unavail_indicator",
5996
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
5997
16
        NULL, HFILL }},
5998
5999
6000
6001
    /* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Choice Indicators Minor Structure*/
6002
16
    { &hf_tn5250_wdsf_ds_ci_flag1,
6003
16
      { "Flags", "tn5250.wdsf_ds_ci_flag1",
6004
16
        FT_UINT8, BASE_HEX, NULL, 0,
6005
16
        NULL, HFILL }},
6006
16
    { &hf_tn5250_wdsf_ds_ci_flag1_0,
6007
16
      { "Bit 0", "tn5250.wdsf_ds_ci_flag1_0",
6008
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_ci_flag1_0),
6009
16
        0x01, NULL, HFILL }},
6010
16
    { &hf_tn5250_wdsf_ds_ci_flag1_reserved,
6011
16
      { "Reserved", "tn5250.wdsf_ds_ci_flag1_reserved", FT_UINT8, BASE_HEX,
6012
16
        NULL, 0xFE, NULL, HFILL }},
6013
6014
16
    { &hf_tn5250_wdsf_ds_ci_left_push,
6015
16
      { "Empty Indicator or Left Push Button", "tn5250.wdsf_ds_ci_left_push",
6016
16
        FT_STRING, BASE_NONE, NULL, 0,
6017
16
        NULL, HFILL }},
6018
16
    { &hf_tn5250_wdsf_ds_ci_right_push,
6019
16
      { "Selected Indicator or Right Push Button", "tn5250.wdsf_ds_ci_right_push",
6020
16
        FT_STRING, BASE_NONE, NULL, 0,
6021
16
        NULL, HFILL }},
6022
16
    { &hf_tn5250_wdsf_ds_ci_first_choice,
6023
16
      { "Character That Replaces the First Choice Text Character for Unavailable Choices On a Monochrome Display", "tn5250.wdsf_ds_ci_first_choice",
6024
16
        FT_STRING, BASE_NONE, NULL, 0,
6025
16
        NULL, HFILL }},
6026
6027
    /* 15.6.13.5  Write to Display Structured Field Order - Define Selection Field - Scroll Bar Indicators Minor Structure*/
6028
16
    { &hf_tn5250_wdsf_ds_sbi_flag1,
6029
16
      { "Flags", "tn5250.wdsf_ds_sbi_flag1",
6030
16
        FT_UINT8, BASE_HEX, NULL, 0,
6031
16
        NULL, HFILL }},
6032
16
    { &hf_tn5250_wdsf_ds_sbi_flag1_0,
6033
16
      { "Bit 0", "tn5250.wdsf_ds_sbi_flag1_0",
6034
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_ds_sbi_flag1_0),
6035
16
        0x01, NULL, HFILL }},
6036
16
    { &hf_tn5250_wdsf_ds_sbi_flag1_reserved,
6037
16
      { "Reserved", "tn5250.wdsf_ds_sbi_flag1_reserved", FT_UINT8, BASE_HEX,
6038
16
        NULL, 0xFE, NULL, HFILL }},
6039
6040
16
    { &hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight,
6041
16
      { "Monochrome Top of ScrollBar Highlighting", "tn5250.wdsf_ds_sbi_monochrome_top_highlight",
6042
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
6043
16
        NULL, HFILL }},
6044
16
    { &hf_tn5250_wdsf_ds_sbi_color_top_highlight,
6045
16
      { "Color Top of ScrollBar Highlighting", "tn5250.wdsf_ds_sbi_color_top_highlightl",
6046
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
6047
16
        NULL, HFILL }},
6048
6049
16
    { &hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft,
6050
16
      { "Monochrome Shaft ScrollBar Highlighting", "tn5250.wdsf_ds_sbi_monochrome_top_highlight_shaft",
6051
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
6052
16
        NULL, HFILL }},
6053
16
    { &hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft,
6054
16
      { "Color Shaft ScrollBar Highlighting", "tn5250.wdsf_ds_sbi_color_top_highlight_shaft",
6055
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
6056
16
        NULL, HFILL }},
6057
6058
16
    { &hf_tn5250_wdsf_ds_sbi_top_character,
6059
16
      { "Top Scroll Bar Character", "tn5250.wdsf_ds_sbi_top_character",
6060
16
        FT_STRING, BASE_NONE, NULL, 0,
6061
16
        NULL, HFILL }},
6062
16
    { &hf_tn5250_wdsf_ds_sbi_bottom_character,
6063
16
      { "Bottom Scroll Bar Character", "tn5250.wdsf_ds_sbi_bottom_character",
6064
16
        FT_STRING, BASE_NONE, NULL, 0,
6065
16
        NULL, HFILL }},
6066
16
    { &hf_tn5250_wdsf_ds_sbi_empty_character,
6067
16
      { "Empty Scroll Bar Character", "tn5250.wdsf_ds_sbi_empty_character",
6068
16
        FT_STRING, BASE_NONE, NULL, 0,
6069
16
        NULL, HFILL }},
6070
16
    { &hf_tn5250_wdsf_ds_sbi_slider_character,
6071
16
      { "Slider Scroll Bar Character", "tn5250.wdsf_ds_sbi_slider_character",
6072
16
        FT_STRING, BASE_NONE, NULL, 0,
6073
16
        NULL, HFILL }},
6074
6075
    /* 15.6.13.6  Write to Display Structured Field Order - Remove GUI Selection Field */
6076
    /* Consists of reserved fields only */
6077
6078
    /* 15.6.13.7  Write to Display Structured Field Order - Define Scroll Bar Field */
6079
16
    { &hf_tn5250_wdsf_dsb_flag1,
6080
16
      { "Flags", "tn5250.wdsf_dsb_flag1",
6081
16
        FT_UINT8, BASE_HEX, NULL, 0,
6082
16
        NULL, HFILL }},
6083
16
    { &hf_tn5250_wdsf_dsb_flag1_0,
6084
16
      { "Bit 0", "tn5250.wdsf_dsb_flag1_0",
6085
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_dsb_flag1_0),
6086
16
        0x01, NULL, HFILL }},
6087
16
    { &hf_tn5250_wdsf_dsb_flag1_1,
6088
16
      { "Bit 1", "tn5250.wdsf_dsb_flag1_1",
6089
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_dsb_flag1_0),
6090
16
        0x02, NULL, HFILL }},
6091
16
    { &hf_tn5250_wdsf_dsb_flag1_reserved,
6092
16
      { "Reserved", "tn5250.wdsf_dsb_flag1_reserved", FT_UINT8, BASE_HEX,
6093
16
        NULL, 0x7C, NULL, HFILL }},
6094
16
    { &hf_tn5250_wdsf_dsb_flag1_7,
6095
16
      { "Bit 7", "tn5250.wdsf_dsb_flag1_7",
6096
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_dsb_flag1_7),
6097
16
        0x80, NULL, HFILL }},
6098
6099
16
    { &hf_tn5250_wdsf_sbi_total_scroll,
6100
16
      { "TotalRows or TotalCols That Can  Be Scrolled", "tn5250.wdsf_sbi_total_scroll",
6101
16
        FT_UINT32, BASE_DEC, NULL, 0,
6102
16
        NULL, HFILL }},
6103
16
    { &hf_tn5250_wdsf_sbi_sliderpos,
6104
16
      { "SliderPos", "tn5250.wdsf_sbi_sliderpos",
6105
16
        FT_UINT32, BASE_DEC, NULL, 0,
6106
16
        NULL, HFILL }},
6107
16
    { &hf_tn5250_wdsf_sbi_rowscols,
6108
16
      { "Rows or Columns", "tn5250.wdsf_sbi_rowscols",
6109
16
        FT_UINT8, BASE_DEC, NULL, 0,
6110
16
        NULL, HFILL }},
6111
6112
    /* 15.6.13.8  Write to Display Structured Field Order - Remove GUI Scroll Bar Field */
6113
    /* Consists of reserved fields only */
6114
6115
    /* 15.6.13.9  Write to Display Structured Field Order - Write Data Field */
6116
16
    { &hf_tn5250_wdsf_wdf_flag1,
6117
16
      { "Flags", "tn5250.wdsf_wdf_flag1",
6118
16
        FT_UINT8, BASE_HEX, NULL, 0,
6119
16
        NULL, HFILL }},
6120
16
    { &hf_tn5250_wdsf_wdf_flag1_0,
6121
16
      { "Bit 0", "tn5250.wdsf_wdf_flag1_0",
6122
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_wdf_flag1_0),
6123
16
        0x01, NULL, HFILL }},
6124
16
    { &hf_tn5250_wdsf_wdf_flag1_reserved,
6125
16
      { "Reserved", "tn5250.wdsf_wdf_flag1_reserved", FT_UINT8, BASE_HEX,
6126
16
        NULL, 0xFE, NULL, HFILL }},
6127
6128
    /* 15.6.13.10  Write to Display Structured Field Order - Programmable Mouse Buttons */
6129
16
    { &hf_tn5250_wdsf_pmb_flag1,
6130
16
      { "Flags", "tn5250.wdsf_pmb_flag1",
6131
16
        FT_UINT8, BASE_HEX, NULL, 0,
6132
16
        NULL, HFILL }},
6133
16
    { &hf_tn5250_wdsf_pmb_flag1_0,
6134
16
      { "Bit 0", "tn5250.wdsf_pmb_flag1_0",
6135
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_pmb_flag1_0),
6136
16
        0x01, NULL, HFILL }},
6137
16
    { &hf_tn5250_wdsf_pmb_flag1_1,
6138
16
      { "Bit 1", "tn5250.wdsf_pmb_flag1_1",
6139
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_pmb_flag1_1),
6140
16
        0x02, NULL, HFILL }},
6141
16
    { &hf_tn5250_wdsf_pmb_flag1_2,
6142
16
      { "Bit 2", "tn5250.wdsf_pmb_flag1_2",
6143
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_pmb_flag1_2),
6144
16
        0x04, NULL, HFILL }},
6145
16
    { &hf_tn5250_wdsf_pmb_flag1_3,
6146
16
      { "Bit 3", "tn5250.wdsf_pmb_flag1_3",
6147
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_pmb_flag1_3),
6148
16
        0x08, NULL, HFILL }},
6149
16
    { &hf_tn5250_wdsf_pmb_flag1_reserved,
6150
16
      { "Reserved", "tn5250.wdsf_pmb_flag1_reserved", FT_UINT8, BASE_HEX,
6151
16
        NULL, 0xF0, NULL, HFILL }},
6152
16
    { &hf_tn5250_wdsf_pmb_first_mouse_event,
6153
16
      { "First Mouse Event (Leading Edge Event)", "tn5250.wdsf_pmb_first_mouse_event",
6154
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_mouse_events), 0,
6155
16
        NULL, HFILL }},
6156
16
    { &hf_tn5250_wdsf_pmb_second_mouse_event,
6157
16
      { "Second Mouse Event (Trailing Edge Event)", "tn5250.wdsf_pmb_second_mouse_event",
6158
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_mouse_events), 0,
6159
16
        NULL, HFILL }},
6160
6161
    /* 15.7 Draw/Erase Grid Lines Structured Field */
6162
16
    { &hf_tn5250_wdsf_deg_partition,
6163
16
      { "Partition", "tn5250.wdsf_deg_partition",
6164
16
        FT_UINT8, BASE_HEX, NULL, 0,
6165
16
        NULL, HFILL }},
6166
16
    { &hf_tn5250_wdsf_deg_flag1,
6167
16
      { "Flags", "tn5250.wdsf_deg_flag1",
6168
16
        FT_UINT8, BASE_HEX, NULL, 0,
6169
16
        NULL, HFILL }},
6170
16
    { &hf_tn5250_wdsf_deg_flag1_0,
6171
16
      { "Bit 0", "tn5250.wdsf_deg_flag1_0",
6172
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_deg_flag1_0),
6173
16
        0x01, NULL, HFILL }},
6174
16
    { &hf_tn5250_wdsf_deg_flag1_reserved,
6175
16
      { "Reserved", "tn5250.wdsf_deg_flag1_reserved", FT_UINT8, BASE_HEX,
6176
16
        NULL, 0xFE, NULL, HFILL }},
6177
16
    { &hf_tn5250_wdsf_deg_flag2,
6178
16
      { "Flags", "tn5250.wdsf_deg_flag2",
6179
16
        FT_UINT8, BASE_HEX, NULL, 0,
6180
16
        NULL, HFILL }},
6181
16
    { &hf_tn5250_wdsf_deg_flag2_0,
6182
16
      { "Bit 0", "tn5250.wdsf_deg_flag2_0",
6183
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_deg_flag1_0),
6184
16
        0x01, NULL, HFILL }},
6185
16
    { &hf_tn5250_wdsf_deg_flag2_reserved,
6186
16
      { "Reserved", "tn5250.wdsf_deg_flag2_reserved", FT_UINT8, BASE_HEX,
6187
16
        NULL, 0xFE, NULL, HFILL }},
6188
16
    { &hf_tn5250_wdsf_deg_default_color,
6189
16
      { "Default Color for Grid Lines", "tn5250.wdsf_deg_default_color",
6190
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
6191
16
        NULL, HFILL }},
6192
16
    { &hf_tn5250_wdsf_deg_default_line,
6193
16
      { "Default Line Style", "tn5250.wdsf_deg_default_line",
6194
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_deg_lines), 0,
6195
16
        NULL, HFILL }},
6196
6197
    /* 15.7.1 Draw/Erase Grid Lines Structured Field - Minor Structure*/
6198
16
    { &hf_tn5250_wdsf_deg_minor_type,
6199
16
      { "Construct", "tn5250.wdsf_deg_minor_type",
6200
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_wdsf_deg_minor_type), 0,
6201
16
        NULL, HFILL }},
6202
16
    { &hf_tn5250_wdsf_deg_ms_flag1,
6203
16
      { "Flags", "tn5250.wdsf_deg_ms_flag1",
6204
16
        FT_UINT8, BASE_HEX, NULL, 0,
6205
16
        NULL, HFILL }},
6206
16
    { &hf_tn5250_wdsf_deg_ms_flag1_0,
6207
16
      { "Bit 0", "tn5250.wdsf_deg_ms_flag1_0",
6208
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wdsf_deg_ms_flag1_0),
6209
16
        0x01, NULL, HFILL }},
6210
16
    { &hf_tn5250_wdsf_deg_ms_flag1_reserved,
6211
16
      { "Reserved", "tn5250.wdsf_deg_ms_flag1_reserved", FT_UINT8, BASE_HEX,
6212
16
        NULL, 0xFE, NULL, HFILL }},
6213
16
    { &hf_tn5250_wdsf_deg_ms_start_row,
6214
16
      { "Start Row", "tn5250.wdsf_deg_ms_start_row",
6215
16
        FT_UINT8, BASE_DEC, NULL, 0,
6216
16
        NULL, HFILL }},
6217
16
    { &hf_tn5250_wdsf_deg_ms_start_column,
6218
16
      { "Start Column", "tn5250.wdsf_deg_ms_start_column",
6219
16
        FT_UINT8, BASE_DEC, NULL, 0,
6220
16
        NULL, HFILL }},
6221
16
    { &hf_tn5250_wdsf_deg_ms_horizontal_dimension,
6222
16
      { "Horizontal Dimension", "tn5250.wdsf_deg_ms_horizontal_dimension",
6223
16
        FT_UINT8, BASE_DEC, NULL, 0,
6224
16
        NULL, HFILL }},
6225
16
    { &hf_tn5250_wdsf_deg_ms_vertical_dimension,
6226
16
      { "Vertical Dimension", "tn5250.wdsf_deg_ms_vertical_dimension",
6227
16
        FT_UINT8, BASE_DEC, NULL, 0,
6228
16
        NULL, HFILL }},
6229
16
    { &hf_tn5250_wdsf_deg_ms_default_color,
6230
16
      { "Color", "tn5250.wdsf_deg_ms_default_color",
6231
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_fa_color), 0,
6232
16
        NULL, HFILL }},
6233
16
    { &hf_tn5250_wdsf_deg_ms_line_repeat,
6234
16
      { "Line Repeat", "tn5250.wdsf_deg_ms_line_repeat",
6235
16
        FT_UINT8, BASE_DEC, NULL, 0,
6236
16
        NULL, HFILL }},
6237
16
    { &hf_tn5250_wdsf_deg_ms_line_interval,
6238
16
      { "Line Interval", "tn5250.wdsf_deg_ms_line_interval",
6239
16
        FT_UINT8, BASE_DEC, NULL, 0,
6240
16
        NULL, HFILL }},
6241
6242
    /* 15.7.2 Clear Grid Lines Structured Field */
6243
16
    { &hf_tn5250_wdsf_cgl_partition,
6244
16
      { "Partition", "tn5250.wdsf_cgl_partition",
6245
16
        FT_UINT8, BASE_HEX, NULL, 0,
6246
16
        NULL, HFILL }},
6247
16
    { &hf_tn5250_wdsf_cgl_start_row,
6248
16
      { "Start Row", "tn5250.wdsf_cgl_start_row",
6249
16
        FT_UINT8, BASE_DEC, NULL, 0,
6250
16
        NULL, HFILL }},
6251
16
    { &hf_tn5250_wdsf_cgl_start_column,
6252
16
      { "Start Column", "tn5250.wdsf_cgl_start_column",
6253
16
        FT_UINT8, BASE_DEC, NULL, 0,
6254
16
        NULL, HFILL }},
6255
16
    { &hf_tn5250_wdsf_cgl_rectangle_width,
6256
16
      { "Width of Rectangle", "tn5250.wdsf_cgl_rectangle_width",
6257
16
        FT_UINT8, BASE_DEC, NULL, 0,
6258
16
        NULL, HFILL }},
6259
16
    { &hf_tn5250_wdsf_cgl_rectangle_height,
6260
16
      { "Height of Rectangle", "tn5250.wdsf_cgl_rectangle_height",
6261
16
        FT_UINT8, BASE_DEC, NULL, 0,
6262
16
        NULL, HFILL }},
6263
6264
    /* 15.8 WRITE ERROR CODE Command */
6265
    /* 15.9 WRITE ERROR CODE TO WINDOW Command */
6266
16
    { &hf_tn5250_wectw_start_column,
6267
16
      { "Start Column", "tn5250.wectw_start_column",
6268
16
        FT_UINT8, BASE_DEC, NULL, 0,
6269
16
        NULL, HFILL }},
6270
16
    { &hf_tn5250_wectw_end_column,
6271
16
      { "End Column", "tn5250.wectw_end_column",
6272
16
        FT_UINT8, BASE_DEC, NULL, 0,
6273
16
        NULL, HFILL }},
6274
6275
    /* 15.22 SAVE PARTIAL SCREEN Command */
6276
16
    { &hf_tn5250_sps_flag1,
6277
16
      { "Flags", "tn5250.sps_flag1",
6278
16
        FT_UINT8, BASE_HEX, NULL, 0,
6279
16
        NULL, HFILL }},
6280
16
    { &hf_tn5250_sps_flag1_0,
6281
16
      { "Bit 0", "tn5250.sps_flag1_0",
6282
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_sps_flag1_0),
6283
16
        0x01, NULL, HFILL }},
6284
16
    { &hf_tn5250_sps_flag1_reserved,
6285
16
      { "Reserved", "tn5250.sps_flag1_reserved", FT_UINT8, BASE_HEX,
6286
16
        NULL, 0xFE, NULL, HFILL }},
6287
16
    { &hf_tn5250_sps_top_row,
6288
16
      { "Top Row", "tn5250.sps_top_row",
6289
16
        FT_UINT8, BASE_DEC, NULL, 0,
6290
16
        NULL, HFILL }},
6291
16
    { &hf_tn5250_sps_left_column,
6292
16
      { "Left Column", "tn5250.sps_left_column",
6293
16
        FT_UINT8, BASE_DEC, NULL, 0,
6294
16
        NULL, HFILL }},
6295
16
    { &hf_tn5250_sps_window_depth,
6296
16
      { "Window Depth", "tn5250.sps_window_depth",
6297
16
        FT_UINT8, BASE_DEC, NULL, 0,
6298
16
        NULL, HFILL }},
6299
16
    { &hf_tn5250_sps_window_width,
6300
16
      { "Window Width", "tn5250.sps_window_width",
6301
16
        FT_UINT8, BASE_DEC, NULL, 0,
6302
16
        NULL, HFILL }},
6303
6304
    /* 15.25 ROLL Command */
6305
16
    { &hf_tn5250_roll_flag1,
6306
16
      { "Byte 1", "tn5250.roll_flag1",
6307
16
        FT_UINT8, BASE_HEX, NULL, 0,
6308
16
        NULL, HFILL }},
6309
16
    { &hf_tn5250_roll_flag1_0,
6310
16
      { "Bit 0", "tn5250.roll_flag1_0",
6311
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_roll_flag1_0),
6312
16
        0x01, NULL, HFILL }},
6313
16
    { &hf_tn5250_roll_flag1_reserved,
6314
16
      { "Reserved", "tn5250.roll_flag1_reserved", FT_UINT8, BASE_HEX,
6315
16
        NULL, 0x06, NULL, HFILL }},
6316
16
    { &hf_tn5250_roll_flag1_lines,
6317
16
      { "Number of lines that the designated area is to be rolled", "tn5250.roll_flag1_lines", FT_UINT8, BASE_DEC,
6318
16
        NULL, 0xF8, NULL, HFILL }},
6319
16
    { &hf_tn5250_roll_top_line,
6320
16
      { "Line number defining the top line of the area that will participate in the roll", "tn5250.roll_top_line",
6321
16
        FT_UINT8, BASE_DEC, NULL, 0,
6322
16
        NULL, HFILL }},
6323
16
    { &hf_tn5250_roll_bottom_line,
6324
16
      { "Line number defining the bottom line of the area that will participate in the roll", "tn5250.roll_bottom_line",
6325
16
        FT_UINT8, BASE_DEC, NULL, 0,
6326
16
        NULL, HFILL }},
6327
6328
    /* 15.26.1 WRITE SINGLE STRUCTURED FIELD Command - 5250 WSC CUSTOMIZATION Command*/
6329
16
    { &hf_tn5250_wssf_wsc_minor_type,
6330
16
      { "Minor Structured Field Type", "tn5250.wssf_wsc_minor_type",
6331
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_wssf_minor_type), 0,
6332
16
        NULL, HFILL }},
6333
6334
16
    { &hf_tn5250_wssf_flag1,
6335
16
      { "Byte 1", "tn5250.wssf_flag1",
6336
16
        FT_UINT8, BASE_HEX, NULL, 0,
6337
16
        NULL, HFILL }},
6338
16
    { &hf_tn5250_wssf_flag2,
6339
16
      { "Byte 2", "tn5250.wssf_flag2",
6340
16
        FT_UINT8, BASE_HEX, NULL, 0,
6341
16
        NULL, HFILL }},
6342
16
    { &hf_tn5250_wssf_flag2_0,
6343
16
      { "Bit 0", "tn5250.wssf_flag2_0",
6344
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_0),
6345
16
        0x01, NULL, HFILL }},
6346
16
    { &hf_tn5250_wssf_flag2_1,
6347
16
      { "Bit 1", "tn5250.wssf_flag2_1",
6348
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_1),
6349
16
        0x02, NULL, HFILL }},
6350
16
    { &hf_tn5250_wssf_flag2_2,
6351
16
      { "Bit 2", "tn5250.wssf_flag2_2",
6352
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_2),
6353
16
        0x04, NULL, HFILL }},
6354
16
    { &hf_tn5250_wssf_flag2_3,
6355
16
      { "Bit 3", "tn5250.wssf_flag2_3",
6356
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_3),
6357
16
        0x08, NULL, HFILL }},
6358
16
    { &hf_tn5250_wssf_flag2_4,
6359
16
      { "Bit 4", "tn5250.wssf_flag2_4",
6360
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_4),
6361
16
        0x10, NULL, HFILL }},
6362
16
    { &hf_tn5250_wssf_flag2_5,
6363
16
      { "Bit 5", "tn5250.wssf_flag2_5",
6364
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_5),
6365
16
        0x20, NULL, HFILL }},
6366
16
    { &hf_tn5250_wssf_flag2_6,
6367
16
      { "Bit 6", "tn5250.wssf_flag2_6",
6368
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_6),
6369
16
        0x40, NULL, HFILL }},
6370
16
    { &hf_tn5250_wssf_flag2_7,
6371
16
      { "Bit 7", "tn5250.wssf_flag2_7",
6372
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_flag2_7),
6373
16
        0x80, NULL, HFILL }},
6374
6375
    /* 15.26.1 WRITE SINGLE STRUCTURED FIELD Command - 5250 WSC CUSTOMIZATION Command
6376
       - Keystroke Buffering Control Minor Structure*/
6377
16
    { &hf_tn5250_wssf_kbc_flag1,
6378
16
      { "Byte 1", "tn5250.wssf_kbc_flag1",
6379
16
        FT_UINT8, BASE_HEX, NULL, 0,
6380
16
        NULL, HFILL }},
6381
16
    { &hf_tn5250_wssf_kbc_flag1_reserved,
6382
16
      { "Reserved", "tn5250.wssf_kbc_flag1_reserved", FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
6383
16
        RVALS(vals_tn5250_reserved), 0x1F, NULL, HFILL }},
6384
16
    { &hf_tn5250_wssf_kbc_flag1_5,
6385
16
      { "Bit 5", "tn5250.wssf_kbc_flag1_5",
6386
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_kbc_flag1_5),
6387
16
        0x20, NULL, HFILL }},
6388
16
    { &hf_tn5250_wssf_kbc_flag1_6,
6389
16
      { "Bit 6", "tn5250.wssf_kbc_flag1_6",
6390
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_kbc_flag1_6),
6391
16
        0x40, NULL, HFILL }},
6392
16
    { &hf_tn5250_wssf_kbc_flag1_7,
6393
16
      { "Bit 7", "tn5250.wssf_kbc_flag1_7",
6394
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_kbc_flag1_7),
6395
16
        0x80, NULL, HFILL }},
6396
6397
    /* 15.26.1 WRITE SINGLE STRUCTURED FIELD Command - 5250 WSC CUSTOMIZATION Command
6398
       - Cursor Control Minor Structure*/
6399
16
    { &hf_tn5250_wssf_cc_flag1,
6400
16
      { "Byte 1", "tn5250.wssf_cc_flag1",
6401
16
        FT_UINT8, BASE_HEX, NULL, 0,
6402
16
        NULL, HFILL }},
6403
16
    { &hf_tn5250_wssf_cc_flag1_reserved,
6404
16
      { "Reserved", "tn5250.wssf_cc_flag1_reserved", FT_UINT8, BASE_HEX,
6405
16
        NULL, 0x7F, NULL, HFILL }},
6406
16
    { &hf_tn5250_wssf_cc_flag1_7,
6407
16
      { "Bit 7", "tn5250.wssf_cc_flag1_7",
6408
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_cc_flag1_7),
6409
16
        0x80, NULL, HFILL }},
6410
6411
    /* 15.26.2 WRITE SINGLE STRUCTURED FIELD Command - IMAGE/FAX CONTROL Command */
6412
16
    { &hf_tn5250_wssf_ifc_flag1,
6413
16
      { "Byte 1", "tn5250.wssf_ifc_flag1",
6414
16
        FT_UINT8, BASE_HEX, NULL, 0,
6415
16
        NULL, HFILL }},
6416
16
    { &hf_tn5250_wssf_ifc_flag1_0,
6417
16
      { "Bit 0 (Cache allowed flag)", "tn5250.wssf_ifc_flag1_0",
6418
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag1_0),
6419
16
        0x01, NULL, HFILL }},
6420
16
    { &hf_tn5250_wssf_ifc_flag1_1to3,
6421
16
      { "Bits 1-3 (Type of image/fax display)", "tn5250.wssf_ifc_flag1_1to3", FT_UINT8, BASE_HEX,
6422
16
        VALS(tn5250_vals_tn5250_wssf_ifc_vals), 0x0E, NULL, HFILL }},
6423
16
    { &hf_tn5250_wssf_ifc_flag1_4,
6424
16
      { "Bit 4 (Color importance during scaling)", "tn5250.wssf_ifc_flag1_4",
6425
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag1_4),
6426
16
        0x10, NULL, HFILL }},
6427
16
    { &hf_tn5250_wssf_ifc_flag1_5,
6428
16
      { "Bit 5 (Allow display to control scaling)", "tn5250.wssf_ifc_flag1_5",
6429
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag1_5),
6430
16
        0x20, NULL, HFILL }},
6431
16
    { &hf_tn5250_wssf_ifc_flag1_6,
6432
16
      { "Bit 6 (Reverse image)", "tn5250.wssf_ifc_flag1_6",
6433
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag1_6),
6434
16
        0x40, NULL, HFILL }},
6435
16
    { &hf_tn5250_wssf_ifc_flag1_7,
6436
16
      { "Bit 7 (Allow/Inhibit EasyScroll with a mouse)", "tn5250.wssf_ifc_flag1_7",
6437
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag1_7),
6438
16
        0x80, NULL, HFILL }},
6439
6440
16
    { &hf_tn5250_wssf_ifc_flag2,
6441
16
      { "Byte 2", "tn5250.wssf_ifc_flag2",
6442
16
        FT_UINT8, BASE_HEX, NULL, 0,
6443
16
        NULL, HFILL }},
6444
16
    { &hf_tn5250_wssf_ifc_flag2_0,
6445
16
      { "Bit 0 (Duplicate Scan Lines)", "tn5250.wssf_ifc_flag2_0",
6446
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag2_0),
6447
16
        0x01, NULL, HFILL }},
6448
16
    { &hf_tn5250_wssf_ifc_flag2_1,
6449
16
      { "Bit 1 (Allow/Inhibit Trim Magnify Scaling)", "tn5250.wssf_ifc_flag2_1",
6450
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag2_1),
6451
16
        0x02, NULL, HFILL }},
6452
16
    { &hf_tn5250_wssf_ifc_flag2_reserved,
6453
16
      { "Reserved", "tn5250.wssf_ifc_flag2_reserved", FT_UINT8, BASE_HEX,
6454
16
        NULL, 0x7C, NULL, HFILL }},
6455
16
    { &hf_tn5250_wssf_ifc_flag2_7,
6456
16
      { "Bit 7", "tn5250.wssf_ifc_flag2_7",
6457
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifc_flag2_7),
6458
16
        0x80, NULL, HFILL }},
6459
6460
16
    { &hf_tn5250_wssf_ifc_image_format,
6461
16
      { "Image Format", "tn5250.wssf_ifc_image_format",
6462
16
        FT_UINT16, BASE_DEC, VALS(vals_tn5250_image_format), 0,
6463
16
        NULL, HFILL }},
6464
6465
16
    { &hf_tn5250_wssf_ifc_viewport_location_row,
6466
16
      { "Viewport Location (Row)", "tn5250.wssf_ifc_viewport_location_row",
6467
16
        FT_UINT8, BASE_DEC, NULL, 0,
6468
16
        NULL, HFILL }},
6469
16
    { &hf_tn5250_wssf_ifc_viewport_location_col,
6470
16
      { "Viewport Location (Column)", "tn5250.wssf_ifc_viewport_location_col",
6471
16
        FT_UINT8, BASE_DEC, NULL, 0,
6472
16
        NULL, HFILL }},
6473
16
    { &hf_tn5250_wssf_ifc_viewport_size_row,
6474
16
      { "Viewport Size (Row)", "tn5250.wssf_ifc_viewport_size_row",
6475
16
        FT_UINT8, BASE_DEC, NULL, 0,
6476
16
        NULL, HFILL }},
6477
16
    { &hf_tn5250_wssf_ifc_viewport_size_col,
6478
16
      { "Viewport Size (Column)", "tn5250.wssf_ifc_viewport_size_col",
6479
16
        FT_UINT8, BASE_DEC, NULL, 0,
6480
16
        NULL, HFILL }},
6481
6482
16
    { &hf_tn5250_wssf_ifc_scaling,
6483
16
      { "Scaling", "tn5250.wssf_ifc_scaling",
6484
16
        FT_UINT16, BASE_HEX, VALS(vals_tn5250_wssf_ifc_scaling), 0,
6485
16
        NULL, HFILL }},
6486
6487
16
    { &hf_tn5250_wssf_ifc_viewimage_location_row,
6488
16
      { "View Image Location (Vertical Percentage)", "tn5250.wssf_ifc_viewimage_location_row",
6489
16
        FT_UINT8, BASE_DEC, NULL, 0,
6490
16
        NULL, HFILL }},
6491
16
    { &hf_tn5250_wssf_ifc_viewimage_location_col,
6492
16
      { "View Image Location (Horizontal Position)", "tn5250.wssf_ifc_viewimage_location_col",
6493
16
        FT_UINT8, BASE_DEC, NULL, 0,
6494
16
        NULL, HFILL }},
6495
6496
16
    { &hf_tn5250_wssf_ifc_rotation,
6497
16
      { "Rotation (Degrees)", "tn5250.wssf_ifc_rotation",
6498
16
        FT_UINT16, BASE_DEC, NULL, 0,
6499
16
        NULL, HFILL }},
6500
6501
16
    { &hf_tn5250_wssf_ifc_foreground_color,
6502
16
      { "Foreground Color", "tn5250.wssf_ifc_foreground_color",
6503
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_foreground_color_attributes), 0,
6504
16
        NULL, HFILL }},
6505
6506
16
    { &hf_tn5250_wssf_ifc_background_color,
6507
16
      { "Background Color", "tn5250.wssf_ifc_background_color",
6508
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_foreground_color_attributes), 0,
6509
16
        NULL, HFILL }},
6510
6511
16
    { &hf_tn5250_wssf_ifc_imagefax_name,
6512
16
      { "Image/Fax Name", "tn5250.wssf_ifc_imagefax_name",
6513
16
        FT_STRING, BASE_NONE, NULL, 0,
6514
16
        NULL, HFILL }},
6515
6516
    /* 15.26.3 WRITE SINGLE STRUCTURED FIELD Command - IMAGE/FAX DOWNLOAD Command */
6517
16
    { &hf_tn5250_wssf_ifd_flag1,
6518
16
      { "Byte 1", "tn5250.wssf_ifd_flag1",
6519
16
        FT_UINT8, BASE_HEX, NULL, 0,
6520
16
        NULL, HFILL }},
6521
16
    { &hf_tn5250_wssf_ifd_flag1_0,
6522
16
      { "Bit 0 (Last Data Stream flag)", "tn5250.wssf_ifd_flag1_0",
6523
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wssf_ifd_flag1_0),
6524
16
        0x01, NULL, HFILL }},
6525
16
    { &hf_tn5250_wssf_ifd_flag1_reserved,
6526
16
      { "Reserved", "tn5250.wssf_ifd_flag1_reserved", FT_UINT8, BASE_HEX,
6527
16
        NULL, 0xFE, NULL, HFILL }},
6528
6529
16
    { &hf_tn5250_wssf_ifd_imagefax_name,
6530
16
      { "Image/Fax Name", "tn5250.wssf_ifd_imagefax_name",
6531
16
        FT_STRING, BASE_NONE, NULL, 0,
6532
16
        NULL, HFILL }},
6533
16
    { &hf_tn5250_wssf_ifd_imagefax_data,
6534
16
      { "Image/Fax Data", "tn5250.wssf_ifd_imagefax_data",
6535
16
        FT_BYTES, BASE_NONE, NULL, 0,
6536
16
        NULL, HFILL }},
6537
6538
16
    { &hf_tn5250_image_fax_error,
6539
16
      { "Image/Fax Error", "tn5250.image_fax_error",
6540
16
        FT_UINT16, BASE_HEX, VALS(vals_tn5250_image_fax_error), 0,
6541
16
        NULL, HFILL }},
6542
6543
    /* 15.26.4 WRITE SINGLE STRUCTURED FIELD Command - Video/Audio Controls Command Major Structure */
6544
16
    { &hf_tn5250_vac_prefix,
6545
16
      { "Video/Audio Control Data Prefix", "tn5250.vac_data_prefix",
6546
16
        FT_UINT16, BASE_HEX, NULL, 0,
6547
16
        NULL, HFILL }},
6548
16
    { &hf_tn5250_vac_data,
6549
16
      { "Video/Audio Control Data", "tn5250.vac_data",
6550
16
        FT_UINT32, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_vac_data), 0,
6551
16
        NULL, HFILL }},
6552
6553
    /* Appendix B.1 WRITE SINGLE STRUCTURED FIELD Command - True Transparency Write Command Major Structure */
6554
16
    { &hf_tn5250_wssf_ttw_flag,
6555
16
      { "Flag", "tn5250.wssf_ttw_flag",
6556
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_wssf_ttw_flag), 0,
6557
16
        NULL, HFILL }},
6558
    /* XXX - the document says "Currently, this command is designed
6559
       only to pass ASCII data to some type of ASCII device."; should it
6560
       be treated as an ASCII string? */
6561
16
    { &hf_tn5250_wssf_ttw_data,
6562
16
      { "Transparent Data", "tn5250.wssf_ttw_data",
6563
16
        FT_BYTES, BASE_NONE, NULL, 0,
6564
16
        NULL, HFILL }},
6565
6566
    /* 15.27 WRITE STRUCTURED FIELD (WSF) Command */
6567
    /* 15.27.3 WRITE STRUCTURED FIELD (WSF) Command - 5250 QUERY STATION STATE Command*/
6568
16
    { &hf_tn5250_wsf_qss_flag1,
6569
16
      { "Byte 1", "tn5250.wsf_qss_flag1",
6570
16
        FT_UINT8, BASE_HEX, NULL, 0,
6571
16
        NULL, HFILL }},
6572
16
    { &hf_tn5250_wsf_qss_flag1_0,
6573
16
      { "Bit 0", "tn5250.wsf_qss_flag1_0",
6574
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wsf_qss_flag1_0),
6575
16
        0x01, NULL, HFILL }},
6576
16
    { &hf_tn5250_wsf_qss_flag1_reserved,
6577
16
      { "Reserved", "tn5250.wsf_qss_flag1_reserved", FT_UINT8, BASE_HEX,
6578
16
        NULL, 0xFE, NULL, HFILL }},
6579
16
    { &hf_tn5250_wsf_qss_flag2,
6580
16
      { "Byte 2", "tn5250.wsf_qss_flag2",
6581
16
        FT_UINT8, BASE_HEX, NULL, 0,
6582
16
        NULL, HFILL }},
6583
16
    { &hf_tn5250_wsf_qss_flag2_reserved,
6584
16
      { "Reserved", "tn5250.wsf_qss_flag2_reserved", FT_UINT8, BASE_HEX,
6585
16
        NULL, 0x7F, NULL, HFILL }},
6586
16
    { &hf_tn5250_wsf_qss_flag2_7,
6587
16
      { "Bit 7", "tn5250.wsf_qss_flag2_7",
6588
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wsf_qss_flag2_7),
6589
16
        0x80, NULL, HFILL }},
6590
6591
    /* 15.27.4.1 DEFINE AUDIT WINDOW TABLE Command */
6592
16
    { &hf_tn5250_dawt_id,
6593
16
      { "ID", "tn5250.dawt_id",
6594
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dawt_id), 0,
6595
16
        NULL, HFILL }},
6596
16
    { &hf_tn5250_dawt_length,
6597
16
      { "Length", "tn5250.dawt_length",
6598
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dawt_length), 0,
6599
16
        NULL, HFILL }},
6600
6601
16
    { &hf_tn5250_dawt_char,
6602
16
      { "Character", "tn5250.dawt_char",
6603
16
        FT_STRING, BASE_NONE, NULL, 0,
6604
16
        NULL, HFILL }},
6605
16
    { &hf_tn5250_dawt_message,
6606
16
      { "Message", "tn5250.dawt_message",
6607
16
        FT_STRING, BASE_NONE, NULL, 0,
6608
16
        NULL, HFILL }},
6609
6610
    /* 15.27.4.2 DEFINE COMMAND KEY FUNCTION Command */
6611
16
    { &hf_tn5250_dckf_id,
6612
16
      { "ID", "tn5250.dckf_id",
6613
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dckf_id), 0,
6614
16
        NULL, HFILL }},
6615
16
    { &hf_tn5250_dckf_length,
6616
16
      { "Length", "tn5250.dckf_length",
6617
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dckf_length), 0,
6618
16
        NULL, HFILL }},
6619
16
    { &hf_tn5250_dckf_key_code,
6620
16
      { "Key Code", "tn5250.dckf_key_code",
6621
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dckf_key_code), 0,
6622
16
        NULL, HFILL }},
6623
16
    { &hf_tn5250_dckf_function_code,
6624
16
      { "Function Code", "tn5250.dckf_function_code",
6625
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_dckf_function_code), 0,
6626
16
        NULL, HFILL }},
6627
16
    { &hf_tn5250_dckf_prompt_text,
6628
16
      { "Prompt Text", "tn5250.dckf_prompt_text",
6629
16
        FT_STRING, BASE_NONE, NULL, 0,
6630
16
        NULL, HFILL }},
6631
6632
    /* 15.27.4.3 READ TEXT SCREEN Command */
6633
16
    { &hf_tn5250_rts_partition,
6634
16
      { "Partition", "tn5250.rts_partition",
6635
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
6636
16
        NULL, HFILL }},
6637
16
    { &hf_tn5250_rts_flag1,
6638
16
      { "Byte 1", "tn5250.rts_flag1",
6639
16
        FT_UINT8, BASE_HEX, NULL, 0,
6640
16
        NULL, HFILL }},
6641
16
    { &hf_tn5250_rts_flag1_0,
6642
16
      { "Bit 0 (Last Data Stream flag)", "tn5250.rts_flag1_0",
6643
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_rts_flag1_0),
6644
16
        0x01, NULL, HFILL }},
6645
16
    { &hf_tn5250_rts_flag1_reserved,
6646
16
      { "Reserved", "tn5250.rts_flag1_reserved", FT_UINT8, BASE_HEX,
6647
16
        NULL, 0xFE, NULL, HFILL }},
6648
6649
    /* 15.27.4.4 DEFINE PENDING OPERATIONS Command */
6650
16
    { &hf_tn5250_dpo_partition,
6651
16
      { "Partition", "tn5250.dpo_partition",
6652
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
6653
16
        NULL, HFILL }},
6654
16
    { &hf_tn5250_dpo_flag1,
6655
16
      { "Byte 1", "tn5250.dpo_flag1",
6656
16
        FT_UINT8, BASE_HEX, NULL, 0,
6657
16
        NULL, HFILL }},
6658
16
    { &hf_tn5250_dpo_flag1_0,
6659
16
      { "Bit 0", "tn5250.dpo_flag1_0",
6660
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_0),
6661
16
        0x01, NULL, HFILL }},
6662
16
    { &hf_tn5250_dpo_flag1_1,
6663
16
      { "Bit 1", "tn5250.dpo_flag1_1",
6664
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_1),
6665
16
        0x02, NULL, HFILL }},
6666
16
    { &hf_tn5250_dpo_flag1_2,
6667
16
      { "Bit 2", "tn5250.dpo_flag1_2",
6668
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_2),
6669
16
        0x04, NULL, HFILL }},
6670
16
    { &hf_tn5250_dpo_flag1_3,
6671
16
      { "Bit 3", "tn5250.dpo_flag1_3",
6672
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_3),
6673
16
        0x08, NULL, HFILL }},
6674
16
    { &hf_tn5250_dpo_flag1_4,
6675
16
      { "Bit 4", "tn5250.dpo_flag1_4",
6676
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_4),
6677
16
        0x10, NULL, HFILL }},
6678
16
    { &hf_tn5250_dpo_flag1_5,
6679
16
      { "Bit 5", "tn5250.dpo_flag1_5",
6680
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_5),
6681
16
        0x20, NULL, HFILL }},
6682
16
    { &hf_tn5250_dpo_flag1_6,
6683
16
      { "Bit 6", "tn5250.dpo_flag1_6",
6684
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_6),
6685
16
        0x40, NULL, HFILL }},
6686
16
    { &hf_tn5250_dpo_flag1_7,
6687
16
      { "Bit 7", "tn5250.dpo_flag1_7",
6688
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag1_7),
6689
16
        0x80, NULL, HFILL }},
6690
6691
16
    { &hf_tn5250_dpo_flag2,
6692
16
      { "Byte 1", "tn5250.dpo_flag2",
6693
16
        FT_UINT8, BASE_HEX, NULL, 0,
6694
16
        NULL, HFILL }},
6695
16
    { &hf_tn5250_dpo_flag2_0,
6696
16
      { "Bit 0", "tn5250.dpo_flag2_0",
6697
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dpo_flag2_0),
6698
16
        0x01, NULL, HFILL }},
6699
16
    { &hf_tn5250_dpo_flag2_reserved,
6700
16
      { "Reserved", "tn5250.dpo_flag2_reserved", FT_UINT8, BASE_HEX,
6701
16
        NULL, 0xFE, NULL, HFILL }},
6702
6703
16
    { &hf_tn5250_dpo_displace_characters,
6704
16
      { "Displaced Characters", "tn5250.dpo_displace_characters",
6705
16
        FT_STRING, BASE_NONE, NULL, 0,
6706
16
        NULL, HFILL }},
6707
6708
16
    { &hf_tn5250_dpo_start_location_row,
6709
16
      { "Start Location (Row)", "tn5250.dpo_start_location_row",
6710
16
        FT_UINT16, BASE_DEC, NULL, 0,
6711
16
        NULL, HFILL }},
6712
16
    { &hf_tn5250_dpo_start_location_col,
6713
16
      { "Start Location (Column)", "tn5250.dpo_start_location_col",
6714
16
        FT_UINT16, BASE_DEC, NULL, 0,
6715
16
        NULL, HFILL }},
6716
6717
    /* 15.27.4.5 DEFINE TEXT SCREEN FORMAT Command */
6718
16
    { &hf_tn5250_dtsf_partition,
6719
16
      { "Partition", "tn5250.dtsf_partition",
6720
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
6721
16
        NULL, HFILL }},
6722
16
    { &hf_tn5250_dtsf_flag1,
6723
16
      { "Byte 1", "tn5250.dtsf_flag1",
6724
16
        FT_UINT8, BASE_HEX, NULL, 0,
6725
16
        NULL, HFILL }},
6726
16
    { &hf_tn5250_dtsf_flag1_0,
6727
16
      { "Bit 0", "tn5250.dtsf_flag1_0",
6728
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_0),
6729
16
        0x01, NULL, HFILL }},
6730
16
    { &hf_tn5250_dtsf_flag1_1,
6731
16
      { "Bit 1", "tn5250.dtsf_flag1_1",
6732
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_1),
6733
16
        0x02, NULL, HFILL }},
6734
16
    { &hf_tn5250_dtsf_flag1_2,
6735
16
      { "Bit 2", "tn5250.dtsf_flag1_2",
6736
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_2),
6737
16
        0x04, NULL, HFILL }},
6738
16
    { &hf_tn5250_dtsf_flag1_3,
6739
16
      { "Bit 3", "tn5250.dtsf_flag1_3",
6740
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_3),
6741
16
        0x08, NULL, HFILL }},
6742
16
    { &hf_tn5250_dtsf_flag1_4,
6743
16
      { "Bit 4", "tn5250.dtsf_flag1_4",
6744
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_4),
6745
16
        0x10, NULL, HFILL }},
6746
16
    { &hf_tn5250_dtsf_flag1_5,
6747
16
      { "Bit 5", "tn5250.dtsf_flag1_5",
6748
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_5),
6749
16
        0x20, NULL, HFILL }},
6750
16
    { &hf_tn5250_dtsf_flag1_6,
6751
16
      { "Bit 6", "tn5250.dtsf_flag1_6",
6752
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_6),
6753
16
        0x40, NULL, HFILL }},
6754
16
    { &hf_tn5250_dtsf_flag1_7,
6755
16
      { "Bit 7", "tn5250.dtsf_flag1_7",
6756
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag1_7),
6757
16
        0x80, NULL, HFILL }},
6758
6759
16
    { &hf_tn5250_dtsf_flag2,
6760
16
      { "Byte 1", "tn5250.dtsf_flag2",
6761
16
        FT_UINT8, BASE_HEX, NULL, 0,
6762
16
        NULL, HFILL }},
6763
16
    { &hf_tn5250_dtsf_flag2_0,
6764
16
      { "Bit 0", "tn5250.dtsf_flag2_0",
6765
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag2_0),
6766
16
        0x01, NULL, HFILL }},
6767
16
    { &hf_tn5250_dtsf_flag2_1,
6768
16
      { "Bit 1", "tn5250.dtsf_flag2_1",
6769
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag2_1),
6770
16
        0x02, NULL, HFILL }},
6771
16
    { &hf_tn5250_dtsf_flag2_2,
6772
16
      { "Bit 2", "tn5250.dtsf_flag2_2",
6773
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag2_2),
6774
16
        0x04, NULL, HFILL }},
6775
16
    { &hf_tn5250_dtsf_flag2_3,
6776
16
      { "Bit 3", "tn5250.dtsf_flag2_3",
6777
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dtsf_flag2_3),
6778
16
        0x08, NULL, HFILL }},
6779
16
    { &hf_tn5250_dtsf_flag2_4to7,
6780
16
      { "Bits 4 to 7", "tn5250.dtsf_flag2_4to7",
6781
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dtsf_flag2_vals), 0xF0,
6782
16
        NULL, HFILL }},
6783
6784
16
    { &hf_tn5250_dtsf_text_body_height,
6785
16
      { "Text Body Height", "tn5250.dtsf_text_body_height",
6786
16
        FT_UINT16, BASE_DEC, NULL, 0,
6787
16
        NULL, HFILL }},
6788
16
    { &hf_tn5250_dtsf_text_body_width,
6789
16
      { "Text Body Width", "tn5250.dtsf_text_body_width",
6790
16
        FT_UINT16, BASE_DEC, NULL, 0,
6791
16
        NULL, HFILL }},
6792
6793
16
    { &hf_tn5250_dtsf_line_cmd_field_size,
6794
16
      { "Line Cmd Field Size", "tn5250.dtsf_line_cmd_field_size",
6795
16
        FT_UINT8, BASE_DEC, NULL, 0,
6796
16
        NULL, HFILL }},
6797
16
    { &hf_tn5250_dtsf_location_of_pitch,
6798
16
      { "Location of Pitch", "tn5250.dtsf_location_of_pitch",
6799
16
        FT_UINT8, BASE_DEC, NULL, 0,
6800
16
        NULL, HFILL }},
6801
16
    { &hf_tn5250_dtsf_first_line,
6802
16
      { "First Line in Text Body", "tn5250.dtsf_first_line",
6803
16
        FT_UINT8, BASE_DEC, NULL, 0,
6804
16
        NULL, HFILL }},
6805
6806
    /* 15.27.4.6 DEFINE SCALE LINE Command */
6807
16
    { &hf_tn5250_dsl_partition,
6808
16
      { "Partition", "tn5250.dsl_partition",
6809
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
6810
16
        NULL, HFILL }},
6811
16
    { &hf_tn5250_dsl_rtl_offset,
6812
16
      { "RTL Offset", "tn5250.dsl_rtl_offset",
6813
16
        FT_UINT8, BASE_DEC, NULL, 0,
6814
16
        NULL, HFILL }},
6815
16
    { &hf_tn5250_dsl_offset,
6816
16
      { "Offset", "tn5250.dsl_offset",
6817
16
        FT_UINT8, BASE_DEC, NULL, 0,
6818
16
        NULL, HFILL }},
6819
6820
16
    { &hf_tn5250_dsl_flag1,
6821
16
      { "Byte 1", "tn5250.dsl_flag1",
6822
16
        FT_UINT8, BASE_HEX, NULL, 0,
6823
16
        NULL, HFILL }},
6824
16
    { &hf_tn5250_dsl_flag1_0,
6825
16
      { "Bit 0", "tn5250.dsl_flag1_0",
6826
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dsl_flag1_0),
6827
16
        0x01, NULL, HFILL }},
6828
16
    { &hf_tn5250_dsl_flag1_1,
6829
16
      { "Bit 1", "tn5250.dsl_flag1_1",
6830
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dsl_flag1_1),
6831
16
        0x02, NULL, HFILL }},
6832
16
    { &hf_tn5250_dsl_flag1_2,
6833
16
      { "Bit 2", "tn5250.dsl_flag1_2",
6834
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dsl_flag1_2),
6835
16
        0x04, NULL, HFILL }},
6836
16
    { &hf_tn5250_dsl_flag1_reserved,
6837
16
      { "Reserved", "tn5250.dsl_flag1_reserved", FT_UINT8, BASE_HEX,
6838
16
        NULL, 0xF8, NULL, HFILL }},
6839
6840
16
    { &hf_tn5250_dsl_id,
6841
16
      { "ID", "tn5250.dsl_id",
6842
16
        FT_UINT8, BASE_HEX, NULL, 0,
6843
16
        NULL, HFILL }},
6844
16
    { &hf_tn5250_dsl_location,
6845
16
      { "Location", "tn5250.dsl_location",
6846
16
        FT_UINT8, BASE_DEC, NULL, 0,
6847
16
        NULL, HFILL }},
6848
16
    { &hf_tn5250_dsl_function,
6849
16
      { "Function", "tn5250.dsl_function",
6850
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dsl_function), 0x00,
6851
16
        NULL, HFILL }},
6852
6853
    /* 15.27.4.7 WRITE TEXT SCREEN Command */
6854
16
    { &hf_tn5250_wts_partition,
6855
16
      { "Partition", "tn5250.wts_partition",
6856
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
6857
16
        NULL, HFILL }},
6858
6859
16
    { &hf_tn5250_wts_flag1,
6860
16
      { "Byte 1", "tn5250.wts_flag1",
6861
16
        FT_UINT8, BASE_HEX, NULL, 0,
6862
16
        NULL, HFILL }},
6863
16
    { &hf_tn5250_wts_flag1_0,
6864
16
      { "Bit 0", "tn5250.wts_flag1_0",
6865
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag1_0),
6866
16
        0x01, NULL, HFILL }},
6867
16
    { &hf_tn5250_wts_flag1_1,
6868
16
      { "Bit 1", "tn5250.wts_flag1_1",
6869
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag1_1),
6870
16
        0x02, NULL, HFILL }},
6871
16
    { &hf_tn5250_wts_flag1_2,
6872
16
      { "Bit 2", "tn5250.wts_flag1_2",
6873
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag1_2),
6874
16
        0x04, NULL, HFILL }},
6875
16
    { &hf_tn5250_wts_flag1_3,
6876
16
      { "Bit 3", "tn5250.wts_flag1_3",
6877
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag1_3),
6878
16
        0x08, NULL, HFILL }},
6879
16
    { &hf_tn5250_wts_flag1_reserved,
6880
16
      { "Reserved", "tn5250.wts_flag1_reserved", FT_UINT8, BASE_HEX,
6881
16
        NULL, 0xF0, NULL, HFILL }},
6882
6883
16
    { &hf_tn5250_wts_flag2,
6884
16
      { "Byte 2", "tn5250.wts_flag2",
6885
16
        FT_UINT8, BASE_HEX, NULL, 0,
6886
16
        NULL, HFILL }},
6887
16
    { &hf_tn5250_wts_flag2_reserved,
6888
16
      { "Reserved", "tn5250.wts_flag2_reserved", FT_UINT8, BASE_HEX,
6889
16
        NULL, 0x1F, NULL, HFILL }},
6890
16
    { &hf_tn5250_wts_flag2_6,
6891
16
      { "Bit 6", "tn5250.wts_flag2_6",
6892
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag2_6),
6893
16
        0x20, NULL, HFILL }},
6894
16
    { &hf_tn5250_wts_flag2_reserved2,
6895
16
      { "Reserved", "tn5250.wts_flag2_reserved2", FT_UINT8, BASE_HEX,
6896
16
        NULL, 0xC0, NULL, HFILL }},
6897
6898
16
    { &hf_tn5250_wts_flag3,
6899
16
      { "Byte 3", "tn5250.wts_flag3",
6900
16
        FT_UINT8, BASE_HEX, NULL, 0,
6901
16
        NULL, HFILL }},
6902
16
    { &hf_tn5250_wts_flag3_0,
6903
16
      { "Bit 0", "tn5250.wts_flag3_0",
6904
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_0),
6905
16
        0x01, NULL, HFILL }},
6906
16
    { &hf_tn5250_wts_flag3_1,
6907
16
      { "Bit 1", "tn5250.wts_flag3_1",
6908
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_1),
6909
16
        0x02, NULL, HFILL }},
6910
16
    { &hf_tn5250_wts_flag3_2,
6911
16
      { "Bit 2", "tn5250.wts_flag3_2",
6912
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_2),
6913
16
        0x04, NULL, HFILL }},
6914
16
    { &hf_tn5250_wts_flag3_3,
6915
16
      { "Bit 3", "tn5250.wts_flag3_3",
6916
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_3),
6917
16
        0x08, NULL, HFILL }},
6918
16
    { &hf_tn5250_wts_flag3_4,
6919
16
      { "Bit 4", "tn5250.wts_flag3_4",
6920
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_4),
6921
16
        0x10, NULL, HFILL }},
6922
16
    { &hf_tn5250_wts_flag3_5,
6923
16
      { "Bit 5", "tn5250.wts_flag3_5",
6924
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_5),
6925
16
        0x20, NULL, HFILL }},
6926
16
    { &hf_tn5250_wts_flag3_6,
6927
16
      { "Bit 6", "tn5250.wts_flag3_6",
6928
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_6),
6929
16
        0x40, NULL, HFILL }},
6930
16
    { &hf_tn5250_wts_flag3_7,
6931
16
      { "Bit 7", "tn5250.wts_flag3_7",
6932
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_flag3_7),
6933
16
        0x80, NULL, HFILL }},
6934
6935
16
    { &hf_tn5250_wts_home_position_row,
6936
16
      { "Home Position (Row)", "tn5250.wts_home_position_row",
6937
16
        FT_UINT16, BASE_DEC, NULL, 0,
6938
16
        NULL, HFILL }},
6939
16
    { &hf_tn5250_wts_home_position_col,
6940
16
      { "Home Position (Column)", "tn5250.wts_home_position_col",
6941
16
        FT_UINT16, BASE_DEC, NULL, 0,
6942
16
        NULL, HFILL }},
6943
6944
    /*  Structure of the WRITE TEXT SCREEN Command Line Data */
6945
16
    { &hf_tn5250_wts_cld_flag1,
6946
16
      { "Byte 1", "tn5250.wts_cld_flag1",
6947
16
        FT_UINT8, BASE_HEX, NULL, 0,
6948
16
        NULL, HFILL }},
6949
16
    { &hf_tn5250_wts_cld_flag1_0,
6950
16
      { "Bit 0", "tn5250.wts_cld_flag1_0",
6951
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_0),
6952
16
        0x01, NULL, HFILL }},
6953
16
    { &hf_tn5250_wts_cld_flag1_1,
6954
16
      { "Bit 1", "tn5250.wts_cld_flag1_1",
6955
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_1),
6956
16
        0x02, NULL, HFILL }},
6957
16
    { &hf_tn5250_wts_cld_flag1_2,
6958
16
      { "Bit 2", "tn5250.wts_cld_flag1_2",
6959
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_2),
6960
16
        0x04, NULL, HFILL }},
6961
16
    { &hf_tn5250_wts_cld_flag1_3,
6962
16
      { "Bit 3", "tn5250.wts_cld_flag1_3",
6963
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_3),
6964
16
        0x08, NULL, HFILL }},
6965
16
    { &hf_tn5250_wts_cld_flag1_4,
6966
16
      { "Bit 4", "tn5250.wts_cld_flag1_4",
6967
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_4),
6968
16
        0x10, NULL, HFILL }},
6969
16
    { &hf_tn5250_wts_cld_flag1_5,
6970
16
      { "Bit 5", "tn5250.wts_cld_flag1_5",
6971
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_5),
6972
16
        0x20, NULL, HFILL }},
6973
16
    { &hf_tn5250_wts_cld_flag1_6,
6974
16
      { "Bit 6", "tn5250.wts_cld_flag1_6",
6975
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_6),
6976
16
        0x40, NULL, HFILL }},
6977
16
    { &hf_tn5250_wts_cld_flag1_7,
6978
16
      { "Bit 7", "tn5250.wts_cld_flag1_7",
6979
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag1_7),
6980
16
        0x80, NULL, HFILL }},
6981
6982
16
    { &hf_tn5250_wts_cld_flag2,
6983
16
      { "Byte 2", "tn5250.wts_cld_flag2",
6984
16
        FT_UINT8, BASE_HEX, NULL, 0,
6985
16
        NULL, HFILL }},
6986
16
    { &hf_tn5250_wts_cld_flag2_0,
6987
16
      { "Bit 0", "tn5250.wts_cld_flag2_0",
6988
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag2_0),
6989
16
        0x01, NULL, HFILL }},
6990
16
    { &hf_tn5250_wts_cld_flag2_1,
6991
16
      { "Bit 1", "tn5250.wts_cld_flag2_1",
6992
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag2_1),
6993
16
        0x02, NULL, HFILL }},
6994
16
    { &hf_tn5250_wts_cld_flag2_2,
6995
16
      { "Bit 2", "tn5250.wts_cld_flag2_2",
6996
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag2_2),
6997
16
        0x04, NULL, HFILL }},
6998
16
    { &hf_tn5250_wts_cld_flag2_3,
6999
16
      { "Bit 3", "tn5250.wts_cld_flag2_3",
7000
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag2_3),
7001
16
        0x08, NULL, HFILL }},
7002
16
    { &hf_tn5250_wts_cld_flag2_4,
7003
16
      { "Bit 4", "tn5250.wts_cld_flag2_4",
7004
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag2_4),
7005
16
        0x10, NULL, HFILL }},
7006
16
    { &hf_tn5250_wts_cld_flag2_line_spacing,
7007
16
      { "Line Spacing in Half-Units", "tn5250.wts_cld_flag2_line_spacing", FT_UINT8, BASE_DEC,
7008
16
        NULL, 0xE0, NULL, HFILL }},
7009
7010
16
    { &hf_tn5250_wts_cld_row,
7011
16
      { "Row", "tn5250.wts_cld_row",
7012
16
        FT_UINT16, BASE_DEC, NULL, 0,
7013
16
        NULL, HFILL }},
7014
7015
16
    { &hf_tn5250_wts_cld_flag3,
7016
16
      { "Byte 3", "tn5250.wts_cld_flag3",
7017
16
        FT_UINT8, BASE_HEX, NULL, 0,
7018
16
        NULL, HFILL }},
7019
16
    { &hf_tn5250_wts_cld_flag3_0,
7020
16
      { "Bit 0", "tn5250.wts_cld_flag3_0",
7021
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_0),
7022
16
        0x01, NULL, HFILL }},
7023
16
    { &hf_tn5250_wts_cld_flag3_1,
7024
16
      { "Bit 1", "tn5250.wts_cld_flag3_1",
7025
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_1),
7026
16
        0x02, NULL, HFILL }},
7027
16
    { &hf_tn5250_wts_cld_flag3_2,
7028
16
      { "Bit 2", "tn5250.wts_cld_flag3_2",
7029
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_2),
7030
16
        0x04, NULL, HFILL }},
7031
16
    { &hf_tn5250_wts_cld_flag3_3,
7032
16
      { "Bit 3", "tn5250.wts_cld_flag3_3",
7033
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_3),
7034
16
        0x08, NULL, HFILL }},
7035
16
    { &hf_tn5250_wts_cld_flag3_4,
7036
16
      { "Bit 4", "tn5250.wts_cld_flag3_4",
7037
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_4),
7038
16
        0x10, NULL, HFILL }},
7039
16
    { &hf_tn5250_wts_cld_flag3_5,
7040
16
      { "Bit 5", "tn5250.wts_cld_flag3_5",
7041
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_5),
7042
16
        0x20, NULL, HFILL }},
7043
16
    { &hf_tn5250_wts_cld_flag3_6,
7044
16
      { "Bit 6", "tn5250.wts_cld_flag3_6",
7045
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_6),
7046
16
        0x40, NULL, HFILL }},
7047
16
    { &hf_tn5250_wts_cld_flag3_7,
7048
16
      { "Bit 7", "tn5250.wts_cld_flag3_7",
7049
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_wts_cld_flag3_7),
7050
16
        0x80, NULL, HFILL }},
7051
7052
16
    { &hf_tn5250_wts_cld_page_num,
7053
16
      { "Page Number", "tn5250.wts_cld_page_num",
7054
16
        FT_UINT16, BASE_DEC, NULL, 0,
7055
16
        NULL, HFILL }},
7056
7057
16
    { &hf_tn5250_wts_cld_lmo,
7058
16
      { "Left Margin Offset", "tn5250.wts_cld_lmo",
7059
16
        FT_UINT8, BASE_DEC, NULL, 0,
7060
16
        NULL, HFILL }},
7061
16
    { &hf_tn5250_wts_cld_io,
7062
16
      { "Indent Offset", "tn5250.wts_cld_io",
7063
16
        FT_UINT8, BASE_DEC, NULL, 0,
7064
16
        NULL, HFILL }},
7065
16
    { &hf_tn5250_wts_cld_sli,
7066
16
      { "Scale Line ID", "tn5250.wts_cld_sli",
7067
16
        FT_UINT8, BASE_DEC, NULL, 0,
7068
16
        NULL, HFILL }},
7069
16
    { &hf_tn5250_wts_cld_li,
7070
16
      { "Line Image", "tn5250.wts_cld_li",
7071
16
        FT_STRING, BASE_NONE, NULL, 0,
7072
16
        NULL, HFILL }},
7073
7074
    /* 15.27.4.8 DEFINE SPECIAL CHARACTERS Command */
7075
16
    { &hf_tn5250_dsc_partition,
7076
16
      { "Partition", "tn5250.dsc_partition",
7077
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
7078
16
        NULL, HFILL }},
7079
16
    { &hf_tn5250_dsc_sk,
7080
16
      { "Symbol Key", "tn5250.dsc_sk",
7081
16
        FT_UINT8, BASE_HEX, NULL, 0,
7082
16
        NULL, HFILL }},
7083
16
    { &hf_tn5250_dsc_ev,
7084
16
      { "EBCDIC Value", "tn5250.dsc_ev",
7085
16
        FT_STRING, BASE_NONE, NULL, 0,
7086
16
        NULL, HFILL }},
7087
7088
    /* 15.27.4.10 DEFINE OPERATOR ERROR MESSAGES Command */
7089
16
    { &hf_tn5250_dorm_id,
7090
16
      { "ID", "tn5250.dorm_id",
7091
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dorm_id), 0x00,
7092
16
        NULL, HFILL }},
7093
16
    { &hf_tn5250_dorm_length,
7094
16
      { "Length", "tn5250.dorm_length",
7095
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dorm_length), 0,
7096
16
        NULL, HFILL }},
7097
7098
16
    { &hf_tn5250_dorm_ec,
7099
16
      { "Error Code", "tn5250.dorm_ec",
7100
16
        FT_UINT16, BASE_HEX, NULL, 0,
7101
16
        NULL, HFILL }},
7102
16
    { &hf_tn5250_dorm_mt,
7103
16
      { "Message Text", "tn5250.dorm_mt",
7104
16
        FT_STRING, BASE_NONE, NULL, 0,
7105
16
        NULL, HFILL }},
7106
7107
    /* 15.27.4.11 DEFINE PITCH TABLE Command */
7108
16
    { &hf_tn5250_dpt_id,
7109
16
      { "ID", "tn5250.dpt_id",
7110
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dpt_id), 0x00,
7111
16
        NULL, HFILL }},
7112
16
    { &hf_tn5250_dpt_ec,
7113
16
      { "EBCDIC Code", "tn5250.dpt_ec",
7114
16
        FT_STRING, BASE_NONE, NULL, 0,
7115
16
        NULL, HFILL }},
7116
7117
    /* 15.27.4.12 DEFINE FAKE DP COMMAND KEY FUNCTION Command */
7118
16
    { &hf_tn5250_dfdpck_partition,
7119
16
      { "Partition", "tn5250.dfdpck_partition",
7120
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_rts_partition), 0,
7121
16
        NULL, HFILL }},
7122
7123
16
    { &hf_tn5250_dfdpck_data_field,
7124
16
      { "Data Field", "tn5250.dfdpck_data_field",
7125
16
        FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_dfdpck_data_field), 0,
7126
16
        NULL, HFILL }},
7127
7128
    /* Structure of the DEFINE FAKE DP COMMAND KEY FUNCTION Core Area Command Keys */
7129
16
    { &hf_tn5250_dfdpck_coreflag,
7130
16
      { "Core Area Flag", "tn5250.dfdpck_coreflag",
7131
16
        FT_UINT8, BASE_HEX, NULL, 0,
7132
16
        NULL, HFILL }},
7133
16
    { &hf_tn5250_dfdpck_coreflag_0,
7134
16
      { "Bit 0", "tn5250.dfdpck_coreflag_0",
7135
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_0),
7136
16
        0x01, NULL, HFILL }},
7137
16
    { &hf_tn5250_dfdpck_coreflag_1,
7138
16
      { "Bit 1", "tn5250.dfdpck_coreflag_1",
7139
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_1),
7140
16
        0x02, NULL, HFILL }},
7141
16
    { &hf_tn5250_dfdpck_coreflag_2,
7142
16
      { "Bit 2", "tn5250.dfdpck_coreflag_2",
7143
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_2),
7144
16
        0x04, NULL, HFILL }},
7145
16
    { &hf_tn5250_dfdpck_coreflag_3,
7146
16
      { "Bit 3", "tn5250.dfdpck_coreflag_3",
7147
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_3),
7148
16
        0x08, NULL, HFILL }},
7149
16
    { &hf_tn5250_dfdpck_coreflag_4,
7150
16
      { "Bit 4", "tn5250.dfdpck_coreflag_4",
7151
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_4),
7152
16
        0x10, NULL, HFILL }},
7153
16
    { &hf_tn5250_dfdpck_coreflag_5,
7154
16
      { "Bit 5", "tn5250.dfdpck_coreflag_5",
7155
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_5),
7156
16
        0x20, NULL, HFILL }},
7157
16
    { &hf_tn5250_dfdpck_coreflag_6,
7158
16
      { "Bit 6", "tn5250.dfdpck_coreflag_6",
7159
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_6),
7160
16
        0x40, NULL, HFILL }},
7161
16
    { &hf_tn5250_dfdpck_coreflag_7,
7162
16
      { "Bit 7", "tn5250.dfdpck_coreflag_7",
7163
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_coreflag_7),
7164
16
        0x80, NULL, HFILL }},
7165
7166
    /* Structure of the DEFINE FAKE DP COMMAND KEY FUNCTION Top Row Command Keys */
7167
7168
16
    { &hf_tn5250_dfdpck_toprowflag1,
7169
16
      { "Top Row Flags", "tn5250.dfdpck_toprowflag1",
7170
16
        FT_UINT8, BASE_HEX, NULL, 0,
7171
16
        NULL, HFILL }},
7172
16
    { &hf_tn5250_dfdpck_toprowflag1_0,
7173
16
      { "Bit 0", "tn5250.dfdpck_toprowflag1_0",
7174
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_0),
7175
16
        0x01, NULL, HFILL }},
7176
16
    { &hf_tn5250_dfdpck_toprowflag1_1,
7177
16
      { "Bit 1", "tn5250.dfdpck_toprowflag1_1",
7178
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_1),
7179
16
        0x02, NULL, HFILL }},
7180
16
    { &hf_tn5250_dfdpck_toprowflag1_2,
7181
16
      { "Bit 2", "tn5250.dfdpck_toprowflag1_2",
7182
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_2),
7183
16
        0x04, NULL, HFILL }},
7184
16
    { &hf_tn5250_dfdpck_toprowflag1_3,
7185
16
      { "Bit 3", "tn5250.dfdpck_toprowflag1_3",
7186
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_3),
7187
16
        0x08, NULL, HFILL }},
7188
16
    { &hf_tn5250_dfdpck_toprowflag1_4,
7189
16
      { "Bit 4", "tn5250.dfdpck_toprowflag1_4",
7190
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_4),
7191
16
        0x10, NULL, HFILL }},
7192
16
    { &hf_tn5250_dfdpck_toprowflag1_5,
7193
16
      { "Bit 5", "tn5250.dfdpck_toprowflag1_5",
7194
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_5),
7195
16
        0x20, NULL, HFILL }},
7196
16
    { &hf_tn5250_dfdpck_toprowflag1_6,
7197
16
      { "Bit 6", "tn5250.dfdpck_toprowflag1_6",
7198
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_6),
7199
16
        0x40, NULL, HFILL }},
7200
16
    { &hf_tn5250_dfdpck_toprowflag1_7,
7201
16
      { "Bit 7", "tn5250.dfdpck_toprowflag1_7",
7202
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag1_7),
7203
16
        0x80, NULL, HFILL }},
7204
7205
16
    { &hf_tn5250_dfdpck_toprowflag2,
7206
16
      { "Top Row Flags", "tn5250.dfdpck_toprowflag2",
7207
16
        FT_UINT8, BASE_HEX, NULL, 0,
7208
16
        NULL, HFILL }},
7209
16
    { &hf_tn5250_dfdpck_toprowflag2_0,
7210
16
      { "Bit 0", "tn5250.dfdpck_toprowflag2_0",
7211
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_0),
7212
16
        0x01, NULL, HFILL }},
7213
16
    { &hf_tn5250_dfdpck_toprowflag2_1,
7214
16
      { "Bit 1", "tn5250.dfdpck_toprowflag2_1",
7215
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_1),
7216
16
        0x02, NULL, HFILL }},
7217
16
    { &hf_tn5250_dfdpck_toprowflag2_2,
7218
16
      { "Bit 2", "tn5250.dfdpck_toprowflag2_2",
7219
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_2),
7220
16
        0x04, NULL, HFILL }},
7221
16
    { &hf_tn5250_dfdpck_toprowflag2_3,
7222
16
      { "Bit 3", "tn5250.dfdpck_toprowflag2_3",
7223
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_3),
7224
16
        0x08, NULL, HFILL }},
7225
16
    { &hf_tn5250_dfdpck_toprowflag2_4,
7226
16
      { "Bit 4", "tn5250.dfdpck_toprowflag2_4",
7227
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_4),
7228
16
        0x10, NULL, HFILL }},
7229
16
    { &hf_tn5250_dfdpck_toprowflag2_5,
7230
16
      { "Bit 5", "tn5250.dfdpck_toprowflag2_5",
7231
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_5),
7232
16
        0x20, NULL, HFILL }},
7233
16
    { &hf_tn5250_dfdpck_toprowflag2_6,
7234
16
      { "Bit 6", "tn5250.dfdpck_toprowflag2_6",
7235
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_6),
7236
16
        0x40, NULL, HFILL }},
7237
16
    { &hf_tn5250_dfdpck_toprowflag2_7,
7238
16
      { "Bit 7", "tn5250.dfdpck_toprowflag2_7",
7239
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag2_7),
7240
16
        0x80, NULL, HFILL }},
7241
7242
16
    { &hf_tn5250_dfdpck_toprowflag3,
7243
16
      { "Top Row Flags", "tn5250.dfdpck_toprowflag3",
7244
16
        FT_UINT8, BASE_HEX, NULL, 0,
7245
16
        NULL, HFILL }},
7246
16
    { &hf_tn5250_dfdpck_toprowflag3_0,
7247
16
      { "Bit 0", "tn5250.dfdpck_toprowflag3_0",
7248
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_0),
7249
16
        0x01, NULL, HFILL }},
7250
16
    { &hf_tn5250_dfdpck_toprowflag3_1,
7251
16
      { "Bit 1", "tn5250.dfdpck_toprowflag3_1",
7252
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_1),
7253
16
        0x02, NULL, HFILL }},
7254
16
    { &hf_tn5250_dfdpck_toprowflag3_2,
7255
16
      { "Bit 2", "tn5250.dfdpck_toprowflag3_2",
7256
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_2),
7257
16
        0x04, NULL, HFILL }},
7258
16
    { &hf_tn5250_dfdpck_toprowflag3_3,
7259
16
      { "Bit 3", "tn5250.dfdpck_toprowflag3_3",
7260
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_3),
7261
16
        0x08, NULL, HFILL }},
7262
16
    { &hf_tn5250_dfdpck_toprowflag3_4,
7263
16
      { "Bit 4", "tn5250.dfdpck_toprowflag3_4",
7264
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_4),
7265
16
        0x10, NULL, HFILL }},
7266
16
    { &hf_tn5250_dfdpck_toprowflag3_5,
7267
16
      { "Bit 5", "tn5250.dfdpck_toprowflag3_5",
7268
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_5),
7269
16
        0x20, NULL, HFILL }},
7270
16
    { &hf_tn5250_dfdpck_toprowflag3_6,
7271
16
      { "Bit 6", "tn5250.dfdpck_toprowflag3_6",
7272
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_6),
7273
16
        0x40, NULL, HFILL }},
7274
16
    { &hf_tn5250_dfdpck_toprowflag3_7,
7275
16
      { "Bit 7", "tn5250.dfdpck_toprowflag3_7",
7276
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_dfdpck_toprowflag3_7),
7277
16
        0x80, NULL, HFILL }},
7278
7279
    /* 15.28 COPY-TO-PRINTER Command */
7280
16
    { &hf_tn5250_ctp_lsid,
7281
16
      { "Printer LSID", "tn5250.ctp_lsid",
7282
16
        FT_UINT8, BASE_HEX, NULL, 0,
7283
16
        NULL, HFILL }},
7284
16
    { &hf_tn5250_ctp_mlpp,
7285
16
      { "Max Lines Per Page", "tn5250.ctp_mlpp",
7286
16
        FT_UINT8, BASE_DEC, NULL, 0,
7287
16
        NULL, HFILL }},
7288
7289
    /*TN5250 - RFC1205 - Query Reply Fields */
7290
16
    { &hf_tn5250_qr_flag,
7291
16
      { "Flag", "tn5250.qr_flag",
7292
16
        FT_UINT8, BASE_HEX, NULL, 0,
7293
16
        NULL, HFILL }},
7294
16
    { &hf_tn5250_qr_flag_0,
7295
16
      { "Bit 1", "tn5250.qr_flag_0",
7296
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag_0),
7297
16
        0x80, NULL, HFILL }},
7298
16
    { &hf_tn5250_qr_flag_reserved,
7299
16
      { "Reserved", "tn5250.qr_flag_reserved", FT_UINT8, BASE_HEX,
7300
16
        NULL, 0x7F, NULL, HFILL }},
7301
16
    { &hf_tn5250_qr_chc,
7302
16
      { "Controller Hardware Class", "tn5250.qr_chc",
7303
16
        FT_UINT16, BASE_HEX, VALS(vals_tn5250_chc), 0x0,
7304
16
        NULL, HFILL }},
7305
16
    { &hf_tn5250_qr_ccl,
7306
16
      { "Controller Code Level", "tn5250.qr_ccl",
7307
16
        FT_UINT24, BASE_HEX, NULL, 0x0,
7308
16
        NULL, HFILL }},
7309
16
    { &hf_tn5250_qr_dt,
7310
16
      { "Device Type", "tn5250.qr_dt",
7311
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_dt), 0x0,
7312
16
        NULL, HFILL }},
7313
16
    { &hf_tn5250_qr_dtc,
7314
16
      { "Device Type", "tn5250.qr_dtc",
7315
16
        FT_STRING, BASE_NONE, NULL, 0x0,
7316
16
        NULL, HFILL }},
7317
16
    { &hf_tn5250_qr_dm,
7318
16
      { "Device Model", "tn5250.qr_dm",
7319
16
        FT_STRING, BASE_NONE, NULL, 0x0,
7320
16
        NULL, HFILL }},
7321
16
    { &hf_tn5250_qr_ki,
7322
16
      { "Keyboard ID", "tn5250.qr_ki",
7323
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_qr_ki), 0x0,
7324
16
        NULL, HFILL }},
7325
16
    { &hf_tn5250_qr_eki,
7326
16
      { "Extended Keyboard ID", "tn5250.qr_eki",
7327
16
        FT_UINT8, BASE_HEX, NULL, 0x0,
7328
16
        NULL, HFILL }},
7329
16
    { &hf_tn5250_qr_dsn,
7330
16
      { "Display Serial Number", "tn5250.qr_dsn",
7331
16
        FT_UINT32, BASE_DEC, NULL, 0x0,
7332
16
        NULL, HFILL }},
7333
16
    { &hf_tn5250_qr_mni,
7334
16
      { "Maximum number of input fields", "tn5250.qr_mni",
7335
16
        FT_UINT16, BASE_DEC, NULL, 0x0,
7336
16
        NULL, HFILL }},
7337
7338
16
    { &hf_tn5250_qr_flag1,
7339
16
      { "Flags", "tn5250.qr_flag1",
7340
16
        FT_UINT8, BASE_HEX, NULL, 0,
7341
16
        NULL, HFILL }},
7342
16
    { &hf_tn5250_qr_flag1_0,
7343
16
      { "Bit 0 (Reserved)", "tn5250.qr_flag1_0",
7344
16
        FT_BOOLEAN, 8, NULL,
7345
16
        0x80, NULL, HFILL }},
7346
16
    { &hf_tn5250_qr_flag1_1,
7347
16
      { "Bit 1", "tn5250.qr_flag1_1",
7348
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_1),
7349
16
        0x40, NULL, HFILL }},
7350
16
    { &hf_tn5250_qr_flag1_2,
7351
16
      { "Bit 2", "tn5250.qr_flag1_2",
7352
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_2),
7353
16
        0x20, NULL, HFILL }},
7354
16
    { &hf_tn5250_qr_flag1_3,
7355
16
      { "Bit 3", "tn5250.qr_flag1_3",
7356
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_3),
7357
16
        0x10, NULL, HFILL }},
7358
16
    { &hf_tn5250_qr_flag1_4,
7359
16
      { "Bit 4", "tn5250.qr_flag1_4",
7360
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_4),
7361
16
        0x08, NULL, HFILL }},
7362
16
    { &hf_tn5250_qr_flag1_5,
7363
16
      { "Bit 5", "tn5250.qr_flag1_5",
7364
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_5),
7365
16
        0x04, NULL, HFILL }},
7366
16
    { &hf_tn5250_qr_flag1_6,
7367
16
      { "Bit 6", "tn5250.qr_flag1_6",
7368
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_6),
7369
16
        0x02, NULL, HFILL }},
7370
16
    { &hf_tn5250_qr_flag1_7,
7371
16
      { "Bit 7", "tn5250.qr_flag1_7",
7372
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag1_7),
7373
16
        0x01, NULL, HFILL }},
7374
7375
16
    { &hf_tn5250_qr_flag2,
7376
16
      { "Flags", "tn5250.qr_flag2",
7377
16
        FT_UINT8, BASE_HEX, NULL, 0,
7378
16
        NULL, HFILL }},
7379
16
    { &hf_tn5250_qr_flag2_0to3,
7380
16
      { "Bits 0 to 3", "tn5250.qr_flag2_0to3",  FT_UINT8, BASE_HEX,
7381
16
        VALS(vals_tn5250_qr_flag2_0to3), 0xF0, NULL, HFILL }},
7382
16
    { &hf_tn5250_qr_flag2_4,
7383
16
      { "Bit 4", "tn5250.qr_flag2_4",
7384
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag2_4),
7385
16
        0x08, NULL, HFILL }},
7386
16
    { &hf_tn5250_qr_flag2_5,
7387
16
      { "Bit 5", "tn5250.qr_flag2_5",
7388
16
        FT_BOOLEAN, 8, TFS(&tn5250_field_qr_flag2_5),
7389
16
        0x04, NULL, HFILL }},
7390
16
    { &hf_tn5250_qr_flag2_6to7,
7391
16
      { "Bits 6 to 7", "tn5250.qr_flag2_6to7",  FT_UINT8, BASE_HEX,
7392
16
        VALS(vals_tn5250_qr_flag2_6to7), 0x03, NULL, HFILL }},
7393
7394
16
    { &hf_tn5250_qr_flag3,
7395
16
      { "Flags", "tn5250.qr_flag3",
7396
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_qr_flag3), 0,
7397
16
        NULL, HFILL }},
7398
16
    { &hf_tn5250_qr_flag4,
7399
16
      { "Flags", "tn5250.qr_flag4",
7400
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_qr_flag4), 0,
7401
16
        NULL, HFILL }},
7402
7403
7404
    /* Order Code */
7405
16
    { &hf_tn5250_order_code, { "Order Code", "tn5250.order_code",
7406
16
                               FT_UINT8, BASE_HEX, VALS(vals_tn5250_order_codes), 0x0, NULL, HFILL }},
7407
16
    { &hf_tn5250_attribute_type, { "Attribute Type", "tn5250.attribute",
7408
16
                                   FT_UINT8, BASE_HEX, VALS(vals_tn5250_attributes), 0x0, NULL, HFILL }},
7409
16
    { &hf_tn5250_aid, {  "Attention Identification", "tn5250.aid",
7410
16
                         FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
7411
16
                         RVALS(vals_tn5250_attention_identification_bytes), 0x0, NULL, HFILL }},
7412
7413
    /* Miscellaneous Fields */
7414
16
    { &hf_tn5250_buffer_x, {  "Row Address", "tn5250.buffer_x",
7415
16
                              FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7416
16
    { &hf_tn5250_buffer_y, {  "Column Address", "tn5250.buffer_y",
7417
16
                              FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7418
16
    { &hf_tn5250_length, {  "Length", "tn5250.length",
7419
16
                            FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7420
16
    { &hf_tn5250_length_twobyte, {  "Length", "tn5250.length",
7421
16
                                    FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7422
16
    { &hf_tn5250_field_data,
7423
16
      {  "Field Data", "tn5250.field_data", FT_STRING, BASE_NONE, NULL, 0x0,
7424
16
         NULL, HFILL }},
7425
16
    { &hf_tn5250_reserved, {  "Flags (Reserved)", "tn5250.reserved",
7426
16
                              FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_reserved), 0,
7427
16
                              NULL, HFILL }},
7428
16
    { &hf_tn5250_unknown_data,
7429
16
      {  "Unknown Data (Possible Mainframe/Emulator Bug)", "tn5250.unknown_data",
7430
16
         FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7431
7432
    /*TN5250 - RFC1205 - SNA Header Fields */
7433
16
    { &hf_tn5250_logical_record_length,
7434
16
      { "TN5250 Logical Record Length", "tn5250.logical_record_length",
7435
16
        FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7436
16
    { &hf_tn5250_sna_record_type,
7437
16
      { "TN5250 SNA Record Type", "tn5250.sna_record_type",
7438
16
        FT_UINT16, BASE_HEX, VALS(vals_tn5250_sna_record_type), 0x0,
7439
16
        NULL, HFILL }},
7440
16
    { &hf_tn5250_variable_record_length,
7441
16
      { "TN5250 Variable Record Length", "tn5250.variable_record_length",
7442
16
        FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7443
16
    { &hf_tn5250_header_flags, { "TN5250 SNA Flags", "tn5250.header_flags",
7444
16
                                 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
7445
16
    { &hf_tn5250_ds_output_error,
7446
16
      { "Data Stream Output Error",
7447
16
        "tn5250.ds_output_error", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
7448
16
    { &hf_tn5250_attn_key,
7449
16
      { "5250 attention key was pressed.",
7450
16
        "tn5250.attn_key", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
7451
16
    { &hf_tn5250_sys_request_key,
7452
16
      { "5250 System Request key was pressed",
7453
16
        "tn5250.sys_request_key", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
7454
16
    { &hf_tn5250_test_request_key,
7455
16
      { "5250 Test Request key was pressed",
7456
16
        "tn5250.test_request_key", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
7457
16
    { &hf_tn5250_error_state,
7458
16
      { "In Error State",
7459
16
        "tn5250.error_state", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
7460
16
    { &hf_tn5250_operation_code,
7461
16
      { "TN5250 Operation Code",           "tn5250.operation_code",
7462
16
        FT_UINT8, BASE_HEX, VALS(vals_tn5250_header_operation_code), 0x0,
7463
16
        NULL, HFILL }},
7464
16
    { &hf_tn5250_error_code,
7465
16
      { "TN5250 Error Code",           "tn5250.error_code",
7466
16
        FT_UINT16, BASE_HEX, VALS(vals_tn5250_header_error_codes), 0x0,
7467
16
        NULL, HFILL }},
7468
7469
    /* 13.4 SNA LU 4 and LU 7 Negative Responses */
7470
16
    { &hf_tn5250_negative_response,
7471
16
      { "Negative Response",           "tn5250.negative_response",
7472
16
        FT_UINT32, BASE_HEX, VALS(vals_tn5250_negative_responses), 0x0,
7473
16
        NULL, HFILL }},
7474
7475
16
  };
7476
7477
16
  static int *ett[] = {
7478
16
    &ett_tn5250,
7479
16
    &ett_sf,
7480
16
    &ett_tn5250_wcc,
7481
16
    &ett_tn5250_field_attribute,
7482
16
    &ett_tn5250_dfdpck_mask,
7483
16
    &ett_tn5250_field_validation,
7484
16
    &ett_tn5250_header_flags,
7485
16
    &ett_tn5250_roll_mask,
7486
16
    &ett_tn5250_soh_mask,
7487
16
    &ett_tn5250_soh_pf16to9_mask,
7488
16
    &ett_tn5250_soh_pf24to17_mask,
7489
16
    &ett_tn5250_soh_pf8to1_mask,
7490
16
    &ett_tn5250_sps_mask,
7491
16
    &ett_tn5250_wdsf_cw_bp_mask,
7492
16
    &ett_tn5250_wdsf_cw_mask,
7493
16
    &ett_tn5250_wdsf_cw_tf_mask,
7494
16
    &ett_tn5250_wdsf_deg_mask,
7495
16
    &ett_tn5250_wdsf_deg_ms_mask,
7496
16
    &ett_tn5250_wdsf_ds_ci_mask,
7497
16
    &ett_tn5250_wdsf_ds_cpda_mask,
7498
16
    &ett_tn5250_wdsf_ds_ct_mask,
7499
16
    &ett_tn5250_wdsf_ds_mask,
7500
16
    &ett_tn5250_wdsf_ds_mbs_mask,
7501
16
    &ett_tn5250_wdsf_ds_sbi_mask,
7502
16
    &ett_tn5250_wdsf_dsb_mask,
7503
16
    &ett_tn5250_wdsf_pmb_mask,
7504
16
    &ett_tn5250_wdsf_ragc_mask,
7505
16
    &ett_tn5250_wdsf_rgw_mask,
7506
16
    &ett_tn5250_wdsf_wdf_mask,
7507
16
    &ett_tn5250_wsf_dpo_mask,
7508
16
    &ett_tn5250_wsf_dsl_mask,
7509
16
    &ett_tn5250_wsf_dtsf_mask,
7510
16
    &ett_tn5250_wsf_qss_mask,
7511
16
    &ett_tn5250_wsf_rts_mask,
7512
16
    &ett_tn5250_wssf_cc_mask,
7513
16
    &ett_tn5250_wssf_ifc_mask,
7514
16
    &ett_tn5250_wssf_ifd_mask,
7515
16
    &ett_tn5250_wssf_kbc_mask,
7516
16
    &ett_tn5250_wssf_mask,
7517
16
    &ett_tn5250_wts_mask,
7518
16
    &ett_tn5250_wea_prim_attr,
7519
16
    &ett_tn5250_qr_mask,
7520
16
    &ett_cc,
7521
16
  };
7522
7523
16
  static ei_register_info ei[] = {
7524
16
    { &ei_tn5250_command_code, { "tn5250.command_code.bogus", PI_PROTOCOL, PI_WARN, "Bogus value", EXPFILL }},
7525
16
  };
7526
7527
16
  expert_module_t* expert_tn5250;
7528
7529
16
  proto_tn5250 = proto_register_protocol("TN5250 Protocol", "TN5250", "tn5250");
7530
16
  register_dissector("tn5250", dissect_tn5250, proto_tn5250);
7531
16
  proto_register_field_array(proto_tn5250, hf, array_length(hf));
7532
16
  proto_register_subtree_array(ett, array_length(ett));
7533
16
  expert_tn5250 = expert_register_protocol(proto_tn5250);
7534
16
  expert_register_field_array(expert_tn5250, ei, array_length(ei));
7535
7536
16
}
7537
7538
/*
7539
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
7540
 *
7541
 * Local Variables:
7542
 * c-basic-offset: 2
7543
 * tab-width: 8
7544
 * indent-tabs-mode: nil
7545
 * End:
7546
 *
7547
 * ex: set shiftwidth=2 tabstop=8 expandtab:
7548
 * :indentSize=2:tabSize=8:noTabs=true:
7549
 */