Coverage Report

Created: 2026-11-12 07:01

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