2 * Routines for tn3270.packet dissection
5 * 3270 Information Display System: Data Stream Programmer's Reference
7 * http://publib.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CN7P4000
8 * (dead, not archived on the Wayback Machine)
9 * http://bitsavers.trailing-edge.com/pdf/ibm/3174/GA23-0059-07_3270_Data_Stream_Programmers_Reference_199206.pdf
11 * http://bitsavers.trailing-edge.com/pdf/ibm/3270/GA23-0059-07_3270_Data_Stream_Programmers_Reference_199206.pdf
12 * (straightforward scanned PDF, with OCR so searching might work)
13 * (Paragraph references in the comments in this file (e.g., 6.15) are to the above document)
15 * 3174 Establishment Controller Functional Description
17 * http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/cn7a7003
19 * RFC 1041: Telnet 3270 Regime Option
20 * https://tools.ietf.org/html/rfc1041
22 * RFC 1576: TN3270 Current Practices
23 * https://tools.ietf.org/html/rfc1576
25 * RFC 2355: TN3270 Enhancements
26 * https://tools.ietf.org/html/rfc2355
29 * Copyright 2009, Robert Hogan <robert@roberthogan.net>
31 * Wireshark - Network traffic analyzer
32 * By Gerald Combs <gerald@wireshark.org>
33 * Copyright 1998 Gerald Combs
35 * SPDX-License-Identifier: GPL-2.0-or-later
41 #include <epan/packet.h>
42 #include <epan/conversation.h>
43 #include <epan/expert.h>
45 #include <wsutil/array.h>
47 #include "packet-tn3270.h"
49 void proto_register_tn3270(void);
52 * In the IBM "3270 Information Display System: Data Stream Programmer's Reference"
53 * document, the references to bit numbers in the text and tables
54 * are based upon the "MSB 0" bit numbering scheme.
55 * That is: bits are numbered in a byte from left-to-right:
56 * "Bit 0" is the MSB of the byte
57 * "Bit 7" is the LSB of the byte
62 - better tree display: e.g., separate tree for each order code ....
63 - review 'structured field grouping: 5.2
64 - Telnet uses 0xFF as IAC ["interpret as command"] and thus for
65 telnet: any actual 0xFF bytes in a 3270 data stream will be prefixed with
66 a 0xFF escape. The escapes should be removed from the TVB before the
67 buffer is passed to this dissector. See packet-telnet.c
68 - Show the 'as a fraction" display as xx/yy ?
71 /* Dissection is for EBCDIC 3270 */
73 /* OUTBOUND DATA STREAM (MAINFRAME PROGRAM -> DISPLAY)
75 ________________ _____ __________________
76 | Command Code |WCC | Orders and Data |
77 |________________|_____|__________________|
80 ______ ______________________
81 | WSF | Structured Field(s) |
82 |______|______________________|
86 /*--- 3270 Command Codes - "Local Attachment" ----- */
88 #define CC_LCL_EW 0x05
89 #define CC_LCL_EWA 0x0D
90 #define CC_LCL_EAU 0x0F
91 #define CC_LCL_WSF 0x11
93 #define CC_LCL_RB 0x02
94 #define CC_LCL_RM 0x06
95 #define CC_LCL_RMA 0x0E /* XXX Not valid ?? See 3174 Function Description 2.1.4 */
102 /*--- 3.3 3270 Command Codes - "Remote Attachment" ----- */
103 #define CC_RMT_W 0xF1
104 #define CC_RMT_EW 0xF5
105 #define CC_RMT_EWA 0x7E
106 #define CC_RMT_EAU 0x6F
107 #define CC_RMT_WSF 0xF3
109 #define CC_RMT_RB 0xF2
110 #define CC_RMT_RM 0xF6
111 #define CC_RMT_RMA 0x6E
113 #define CC_SNA_BSC 0xF7 /* local copy in a BSC environment */
115 static const value_string vals_command_codes
[] = {
117 { CC_LCL_W
, "Write (Local)" },
118 { CC_LCL_EW
, "Erase/Write (Local)" },
119 { CC_LCL_EWA
, "Erase/Write Alternate (Local)" },
120 { CC_LCL_EAU
, "Erase All Unprotected (Local)" },
121 { CC_LCL_WSF
, "Write Structured Field (Local)" },
122 { CC_LCL_RB
, "Read Buffer (Local)" },
123 { CC_LCL_RM
, "Read Modified (Local)" },
124 { CC_LCL_RMA
, "Read Modified All (Local)" },
125 { CC_RMT_W
, "Write" },
126 { CC_RMT_EW
, "Erase/Write" },
127 { CC_RMT_EWA
, "Erase/Write Alternate" },
128 { CC_RMT_EAU
, "Erase All Unprotected" },
129 { CC_RMT_WSF
, "Write Structured Field" },
130 { CC_RMT_RB
, "Read Buffer" },
131 { CC_RMT_RM
, "Read Modified" },
132 { CC_RMT_RMA
, "Read Modified All" },
133 { CC_SNA_BSC
, "BSC Copy" },
137 /*--- 3.4 WCC (Write Control Characters) ----- */
138 #define WCC_NOP 0x80 /* "Bit 0" */
139 #define WCC_RESET 0x40 /* "Bit 1" */
140 #define WCC_PRINTER1 0x20 /* "Bit 2" */
141 #define WCC_PRINTER2 0x10 /* "Bit 3" */
142 #define WCC_START_PRINTER 0x08 /* "Bit 4" */
143 #define WCC_SOUND_ALARM 0x04 /* "Bit 5" */
144 #define WCC_KEYBOARD_RESTORE 0x02 /* "Bit 6" */
145 #define WCC_RESET_MDT 0x01 /* "Bit 7" */
147 /*--- 4.3 Order Codes ----- */
161 static const value_string vals_order_codes
[] = {
162 { OC_SF
, "Start Field (SF)" },
163 { OC_SFE
, "Start Field Extended (SFE)" },
164 { OC_SBA
, "Set Buffer Address (SBA)" },
165 { OC_SA
, "Set Attribute (SA)" },
166 { OC_MF
, "Modify Field (MF)" },
167 { OC_IC
, "Insert Cursor (IC)" },
168 { OC_PT
, "Program Tab (PT)" },
169 { OC_RA
, "Repeat to Address (RA)" },
170 { OC_EUA
, "Erase Unprotected to Address (EUA)" },
171 { OC_GE
, "Graphic Escape (GE)" },
176 /*--- 4.3.11 Format Control Orders ----- */
177 /* Special treatment for display */
188 static const value_string vals_format_control_orders
[] = {
190 { FCO_SUB
, "Substitute" },
191 { FCO_DUP
, "Duplicate" },
192 { FCO_FM
, "Field Mark" },
193 { FCO_FF
, "Form Feed" },
194 { FCO_CR
, "Carriage Return" },
195 { FCO_NL
, "New Line" },
196 { FCO_EM
, "End of Medium" },
197 { FCO_EO
, "Eight Ones" },
202 /*--- 8.7 Copy Control Code ----- */
203 /* Use for "local Copy" in a "BSC [BiSync] Environment" */
205 /* "Coding Bits" are those required such that the */
206 /* complete 8 bit CCC is a valid EBCDIC character */
207 #define CCC_GRAPHIC_CONVERT_MASK 0xC0
209 #define CCC_PRINT_BITS_MASK 0x30
210 #define CCC_PRINT_BITS_POINT_LINE_LENGTH 0x00
211 #define CCC_PRINT_BITS_PRINT_LINE_40 0x01
212 #define CCC_PRINT_BITS_PRINT_LINE_64 0x02
213 #define CCC_PRINT_BITS_PRINT_LINE_80 0x03
215 static const value_string ccc_vals_printout_format
[] = {
216 { CCC_PRINT_BITS_POINT_LINE_LENGTH
,
217 "The NL, EM, and CR orders in the data stream determine pointline length. "
218 "Provides a 132-print position line when the orders are not present." },
219 { CCC_PRINT_BITS_PRINT_LINE_40
,
220 "Specifies a 40-character print line." },
221 { CCC_PRINT_BITS_PRINT_LINE_64
,
222 "Specifies a 64-character print line." },
223 { CCC_PRINT_BITS_PRINT_LINE_80
,
224 "Specifies an 80-character print line." },
228 #define CCC_START_PRINT 0x08
229 #define CCC_SOUND_ALARM 0x04
231 #define CCC_ATTRIBUTE_BITS_MASK 0x03
232 #define CCC_ATTRIBUTE_BITS_ONLY_ATTRIBUTE_CHARACTERS 0x00
233 #define CCC_ATTRIBUTE_BITS_ATTRIBUTE_CHARACTERS_UNPROTECTED_AN 0x01
234 #define CCC_ATTRIBUTE_BITS_ALL_ATTRIBUTE_PROTECTED 0x02
235 #define CCC_ATTRIBUTE_BITS_ENTIRE_CONTENTS 0x03
237 static const value_string ccc_vals_copytype
[] = {
238 { CCC_ATTRIBUTE_BITS_ONLY_ATTRIBUTE_CHARACTERS
,
239 "Only attribute characters are copied." },
240 { CCC_ATTRIBUTE_BITS_ATTRIBUTE_CHARACTERS_UNPROTECTED_AN
,
241 "Attribute characters and unprotected alphanumeric fields"
242 " (including nulls) are copied. Nulls are transferred for"
243 " the alphanumeric characters not copied from the"
244 " protected fields." },
245 { CCC_ATTRIBUTE_BITS_ALL_ATTRIBUTE_PROTECTED
,
246 "All attribute characters and protected alphanumeric fields"
247 " (including nulls) are copied. Nulls are transferred for the alphanumeric characters not"
248 " copied from the unprotected fields." },
249 { CCC_ATTRIBUTE_BITS_ENTIRE_CONTENTS
,
250 "The entire contents of the storage buffer (including nulls) are copied." },
254 /*--- 4.4.1 Field Attributes ----- */
255 #define FA_GRAPHIC_CONVERT_MASK 0xC0
257 #define FA_PROTECTED 0x20 /* "Bit 2" */
258 #define FA_NUMERIC 0x10 /* "Bit 3" */
260 #define FA_RESERVED 0x02 /* "Bit 6" */
261 #define FA_MODIFIED 0x01 /* "Bit 7" */
263 #define FA_DISPLAY_BITS_MASK 0x0C /* "Bits 4,5" */
264 #define FA_DISPLAY_BITS_DISPLAY_NOT_SELECTOR_PEN_DETECTABLE 0x00
265 #define FA_DISPLAY_BITS_DISPLAY_SELECTOR_PEN_DETECTABLE 0x01
266 #define FA_DISPLAY_BITS_INTENSIFIED_DISPLAY_SELECTOR_PEN_DETECTABLE 0x02
267 #define FA_DISPLAY_BITS_NON_DISPLAY_NON_DETECTABLE 0x03
269 static const value_string vals_fa_display
[] = {
270 { FA_DISPLAY_BITS_DISPLAY_NOT_SELECTOR_PEN_DETECTABLE
, "Display/Not Selector Pen Detectable" },
271 { FA_DISPLAY_BITS_DISPLAY_SELECTOR_PEN_DETECTABLE
, "Display/Selector Pen Detectable" },
272 { FA_DISPLAY_BITS_INTENSIFIED_DISPLAY_SELECTOR_PEN_DETECTABLE
, "Intensified Display/Selector Pen Detectable" },
273 { FA_DISPLAY_BITS_NON_DISPLAY_NON_DETECTABLE
, "Non Display, Non Detectable (not printable)" },
277 /*--- 4.4.5 Attribute Types ----- */
278 #define AT_ALL_CHARACTER_ATTRIBUTES 0x00
279 #define AT_T3270_FIELD_ATTRIBUTE 0xC0
280 #define AT_FIELD_VALIDATION 0xC1
281 #define AT_FIELD_OUTLINING 0xC2
282 #define AT_EXTENDED_HIGHLIGHTING 0x41
283 #define AT_FOREGROUND_COLOR 0x42
284 #define AT_CHARACTER_SET 0x43
285 #define AT_BACKGROUND_COLOR 0x45
286 #define AT_TRANSPARENCY 0x46
289 static const value_string vals_attribute_types
[] = {
290 { AT_ALL_CHARACTER_ATTRIBUTES
, "All character attributes" },
291 { AT_T3270_FIELD_ATTRIBUTE
, "3270 Field attribute" },
292 { AT_FIELD_VALIDATION
, "Field validation" },
293 { AT_FIELD_OUTLINING
, "Field outlining" },
294 { AT_EXTENDED_HIGHLIGHTING
, "Extended highlighting" },
295 { AT_FOREGROUND_COLOR
, "Foreground color" },
296 { AT_CHARACTER_SET
, "Character set" },
297 { AT_BACKGROUND_COLOR
, "Background color" },
298 { AT_TRANSPARENCY
, "Transparency" },
302 /*--- 4.4.6.3 Extended Highlighting ----- */
303 #define AT_EH_DEFAULT_HIGHLIGHTING 0x00
304 #define AT_EH_NORMAL 0xF0
305 #define AT_EH_BLINK 0xF1
306 #define AT_EH_REVERSE_VIDEO 0xF2
307 #define AT_EH_UNDERSCORE 0xF4
309 static const value_string vals_at_extended_highlighting
[] = {
310 { AT_EH_DEFAULT_HIGHLIGHTING
, "Default" },
311 { AT_EH_NORMAL
, "Normal (as determined by the 3270 field attribute)" },
312 { AT_EH_BLINK
, "Blink" },
313 { AT_EH_REVERSE_VIDEO
, "Reverse video" },
314 { AT_EH_UNDERSCORE
, "Underscore." },
318 /*--- 4.4.6.4 Color Identifications ----- */
319 #define AT_CI_ALL_PLANES 0x00
320 #define AT_CI_BLUE_PLANE 0x01
321 #define AT_CI_RED_PLANE 0x02
322 #define AT_CI_GREEN_PLANE 0x04
323 #define AT_CI_NEUTRAL1 0xF0
324 #define AT_CI_BLUE 0xF1
325 #define AT_CI_RED 0xF2
326 #define AT_CI_PINK 0xF3
327 #define AT_CI_GREEN 0xF4
328 #define AT_CI_TURQUOISE 0xF5
329 #define AT_CI_YELLOW 0xF6
330 #define AT_CI_NEUTRAL2 0xF7
331 #define AT_CI_BLACK 0xF8
332 #define AT_CI_DEEP_BLUE 0xF9
333 #define AT_CI_ORANGE 0xFA
334 #define AT_CI_PURPLE 0xFB
335 #define AT_CI_PALE_GREEN 0xFC
336 #define AT_CI_PALE_TURQUOISE 0xFD
337 #define AT_CI_GREY 0xFE
338 #define AT_CI_WHITE 0xFF
341 static const value_string vals_at_color_identifications
[] = {
342 { AT_CI_ALL_PLANES
, "ALL PLANES" },
343 { AT_CI_BLUE_PLANE
, "BLUE PLANE" },
344 { AT_CI_RED_PLANE
, "RED PLANE" },
345 { AT_CI_GREEN_PLANE
, "GREEN PLANE" },
346 { AT_CI_NEUTRAL1
, "Neutral" },
347 { AT_CI_BLUE
, "Blue" },
348 { AT_CI_RED
, "Red" },
349 { AT_CI_PINK
, "Pink" },
350 { AT_CI_GREEN
, "Green" },
351 { AT_CI_TURQUOISE
, "Turquoise" },
352 { AT_CI_YELLOW
, "Yellow" },
353 { AT_CI_NEUTRAL2
, "Neutral" },
354 { AT_CI_BLACK
, "Black" },
355 { AT_CI_DEEP_BLUE
, "Deep Blue" },
356 { AT_CI_ORANGE
, "Orange" },
357 { AT_CI_PURPLE
, "Purple" },
358 { AT_CI_PALE_GREEN
, "Pale Green" },
359 { AT_CI_PALE_TURQUOISE
, "Pale Turquoise" },
360 { AT_CI_GREY
, "Grey" },
361 { AT_CI_WHITE
, "White" },
365 /*--- 4.4.6.5 Character Set ----- */
366 #define AT_CS_DEFAULT_CHARACTER_SET 0x00
367 #define AT_CS_MIN_LOCAL_ID_FOR_LOADABLE_CHARACTER_SETS 0x40
368 #define AT_CS_MAX_LOCAL_ID_FOR_LOADABLE_CHARACTER_SETS 0xEF
369 #define AT_CS_MIN_LOCAL_ID_FOR_NONLOADABLE_CHARACTER_SETS 0xF0
370 #define AT_CS_MAX_LOCAL_ID_FOR_NONLOADABLE_CHARACTER_SETS 0xF7
371 #define AT_CS_MIN_LOCAL_ID_FOR_TWO_BYTE_CODED_CHARACTER_SETS 0xF8
372 #define AT_CS_MAX_LOCAL_ID_FOR_TWO_BYTE_CODED_CHARACTER_SETS 0xFE
374 static const range_string rvals_at_character_set
[] = {
375 { AT_CS_DEFAULT_CHARACTER_SET
,
376 AT_CS_DEFAULT_CHARACTER_SET
,
377 "Default Character Set" },
378 { AT_CS_MIN_LOCAL_ID_FOR_LOADABLE_CHARACTER_SETS
,
379 AT_CS_MAX_LOCAL_ID_FOR_LOADABLE_CHARACTER_SETS
,
380 "Local Id For Loadable Character Sets" },
381 { AT_CS_MIN_LOCAL_ID_FOR_NONLOADABLE_CHARACTER_SETS
,
382 AT_CS_MAX_LOCAL_ID_FOR_NONLOADABLE_CHARACTER_SETS
,
383 "Local Id For Nonloadable Character Sets" },
384 { AT_CS_MIN_LOCAL_ID_FOR_TWO_BYTE_CODED_CHARACTER_SETS
,
385 AT_CS_MAX_LOCAL_ID_FOR_TWO_BYTE_CODED_CHARACTER_SETS
,
386 "Local Id For Two Byte Coded Character Sets" },
390 /*--- 4.4.6.6 Field Outlining ----- */
391 #define AT_FO_NO_OUTLINING_LINES 0X00
392 #define AT_FO_UNDERLINE_ONLY 0X01
393 #define AT_FO_RIGHT_VERTICAL_LINE_ONLY 0X02
394 #define AT_FO_OVERLINE_ONLY 0X04
395 #define AT_FO_LEFT_VERTICAL_LINE_ONLY 0X08
396 #define AT_FO_UNDERLINE_AND_RIGHT_VERTICAL_LINE 0X03
397 #define AT_FO_UNDERLINE_AND_OVERLINE 0X05
398 #define AT_FO_UNDERLINE_AND_LEFT_VERTICAL_LINE 0X09
399 #define AT_FO_RIGHT_VERTICAL_LINE_AND_OVERLINE 0X06
400 #define AT_FO_RIGHT_AND_LEFT_VERTICAL_LINES 0X0A
401 #define AT_FO_OVERLINE_AND_LEFT_VERTICAL_LINE 0X0C
402 #define AT_FO_RECTANGLE_MINUS_LEFT_VERTICAL_LINE 0X07
403 #define AT_FO_RECTANGLE_MINUS_OVERLINE 0X0B
404 #define AT_FO_RECTANGLE_MINUS_RIGHT_VERTICAL_LINE 0X0D
405 #define AT_FO_RECTANGLE_MINUS_UNDERLINE 0X0E
406 #define AT_FO_RECTANGLE 0X0F
408 static const value_string vals_at_field_outlining
[] = {
409 { AT_FO_NO_OUTLINING_LINES
, "No outlining lines" },
410 { AT_FO_UNDERLINE_ONLY
, "Underline only" },
411 { AT_FO_RIGHT_VERTICAL_LINE_ONLY
, "Right vertical line only" },
412 { AT_FO_OVERLINE_ONLY
, "Overline only" },
413 { AT_FO_LEFT_VERTICAL_LINE_ONLY
, "Left vertical line only" },
414 { AT_FO_UNDERLINE_AND_RIGHT_VERTICAL_LINE
, "Underline and right vertical line" },
415 { AT_FO_UNDERLINE_AND_OVERLINE
, "Underline and overline" },
416 { AT_FO_UNDERLINE_AND_LEFT_VERTICAL_LINE
, "Underline and left vertical line" },
417 { AT_FO_RIGHT_VERTICAL_LINE_AND_OVERLINE
, "Right vertical line and overline" },
418 { AT_FO_RIGHT_AND_LEFT_VERTICAL_LINES
, "Right and left vertical lines" },
419 { AT_FO_OVERLINE_AND_LEFT_VERTICAL_LINE
, "Overline and left vertical line" },
420 { AT_FO_RECTANGLE_MINUS_LEFT_VERTICAL_LINE
, "Rectangle minus left vertical line" },
421 { AT_FO_RECTANGLE_MINUS_OVERLINE
, "Rectangle minus overline" },
422 { AT_FO_RECTANGLE_MINUS_RIGHT_VERTICAL_LINE
, "Rectangle minus right vertical line" },
423 { AT_FO_RECTANGLE_MINUS_UNDERLINE
, "Rectangle minus underline" },
424 { AT_FO_RECTANGLE
, "Rectangle" },
428 /*--- 4.4.6.7 Transparency ----- */
429 #define AT_TR_DEFAULT_TRANSPARENCY 0X00
430 #define AT_TR_BACKGROUND_IS_TRANSPARENT_OR 0XF0
431 #define AT_TR_BACKGROUND_IS_TRANSPARENT_XOR 0XF1
432 #define AT_TR_BACKGROUND_IS_OPAQUE 0XFF
434 static const value_string vals_at_transparency
[] = {
435 { AT_TR_DEFAULT_TRANSPARENCY
, "Default" },
436 { AT_TR_BACKGROUND_IS_TRANSPARENT_OR
, "Background is transparent (OR)" },
437 { AT_TR_BACKGROUND_IS_TRANSPARENT_XOR
, "Background is transparent (XOR)" },
438 { AT_TR_BACKGROUND_IS_OPAQUE
, "Background is opaque (non-transparent)" },
442 /*--- 4.4.6.8 Field Validation ----- */
443 #define AT_FV_MANDATORY_FILL 0x04 /* "Bit 5" */
444 #define AT_FV_MANDATORY_ENTRY 0x02 /* "Bit 6" */
445 #define AT_FV_TRIGGER 0x01 /* "Bit 7" */
447 static const struct true_false_string tn3270_field_validation_mandatory_fill
= {
452 static const struct true_false_string tn3270_field_validation_mandatory_entry
= {
457 static const struct true_false_string tn3270_field_validation_trigger
= {
462 /*--- 5.1 Outbound Structured Fields ----- */
463 #define SF_OB_ACTIVATE_PARTITION 0x0E
464 #define SF_OB_BEGIN_OR_END_OF_FILE 0x0F85
465 #define SF_OB_CREATE_PARTITION 0x0C
466 #define SF_OB_DESTROY_PARTITION 0x0D
467 #define SF_OB_ERASE_OR_RESET 0x03
468 #define SF_OB_LOAD_COLOR_TABLE 0x0F05
469 #define SF_OB_LOAD_FORMAT_STORAGE 0x0F24
470 #define SF_OB_LOAD_LINE_TYPE 0x0F07
471 #define SF_OB_LOAD_PROGRAMMED_SYMBOLS 0x06
472 #define SF_OB_MODIFY_PARTITION 0x0F0A
473 #define SF_OB_OUTBOUND_TEXT_HEADER 0x0F71
474 #define SF_OB_OUTBOUND_3270DS 0x40
475 #define SF_OB_PRESENT_ABSOLUTE_FORMAT 0x4B
476 #define SF_OB_PRESENT_RELATIVE_FORMAT 0x4C
477 #define SF_OB_SET_PARTITION_CHARACTERISTICS 0x0F08
478 #define SF_OB_SET_REPLY_MODE 0x09
479 #define SF_OB_TYPE_1_TEXT_OUTBOUND 0x0FC1
480 #define SF_OB_READ_PARTITION 0x01
481 #define SF_OB_REQUEST_RECOVERY_DATA 0x1030
482 #define SF_OB_RESET_PARTITION 0x00
483 #define SF_OB_RESTART 0x1033
484 #define SF_OB_SCS_DATA 0x41
485 #define SF_OB_SELECT_COLOR_TABLE 0x0F04
486 #define SF_OB_SELECT_FORMAT_GROUP 0x4A
487 #define SF_OB_SET_CHECKPOINT_INTERVAL 0x1032
488 #define SF_OB_SET_MSR_CONTROL 0x0F01
489 #define SF_OB_SET_PRINTER_CHARACTERISTICS 0x0F84
490 #define SF_OB_SET_WINDOW_ORIGIN 0x0B
493 static const value_string vals_outbound_structured_fields
[] = {
494 { SF_OB_ACTIVATE_PARTITION
, "Activate Partition" },
495 { SF_OB_BEGIN_OR_END_OF_FILE
, "Begin Or End Of File" },
496 { SF_OB_CREATE_PARTITION
, "Create Partition" },
497 { SF_OB_DESTROY_PARTITION
, "Destroy Partition" },
498 { SF_OB_ERASE_OR_RESET
, "Erase Or Reset" },
499 { SF_OB_LOAD_COLOR_TABLE
, "Load Color Table" },
500 { SF_OB_LOAD_FORMAT_STORAGE
, "Load Format Storage" },
501 { SF_OB_LOAD_LINE_TYPE
, "Load Line Type" },
502 { SF_OB_LOAD_PROGRAMMED_SYMBOLS
, "Load Programmed Symbols" },
503 { SF_OB_MODIFY_PARTITION
, "Modify Partition" },
504 { SF_OB_OUTBOUND_TEXT_HEADER
, "Outbound Text Header" },
505 { SF_OB_OUTBOUND_3270DS
, "Outbound 3270ds" },
506 { SF_OB_PRESENT_ABSOLUTE_FORMAT
, "Present Absolute Format" },
507 { SF_OB_PRESENT_RELATIVE_FORMAT
, "Present Relative Format" },
508 { SF_OB_SET_PARTITION_CHARACTERISTICS
, "Set Partition Characteristics" },
509 { SF_OB_SET_REPLY_MODE
, "Set Reply Mode" },
510 { SF_OB_TYPE_1_TEXT_OUTBOUND
, "Type 1 Text Outbound" },
511 { SF_OB_READ_PARTITION
, "Read Partition" },
512 { SF_OB_REQUEST_RECOVERY_DATA
, "Request Recovery Data" },
513 { SF_OB_RESET_PARTITION
, "Reset Partition" },
514 { SF_OB_RESTART
, "Restart" },
515 { SF_OB_SCS_DATA
, "Scs Data" },
516 { SF_OB_SELECT_COLOR_TABLE
, "Select Color Table" },
517 { SF_OB_SELECT_FORMAT_GROUP
, "Select Format Group" },
518 { SF_OB_SET_CHECKPOINT_INTERVAL
, "Set Checkpoint Interval" },
519 { SF_OB_SET_MSR_CONTROL
, "Set Msr Control" },
520 { SF_OB_SET_PRINTER_CHARACTERISTICS
, "Set Printer Characteristics" },
521 { SF_OB_SET_WINDOW_ORIGIN
, "Set Window Origin" },
525 /*--- 5.1 Outbound/Inbound Structured Fields ----- */
526 #define SF_OB_IB_DATA_CHAIN 0x0F21
527 #define SF_OB_IB_DESTINATION_OR_ORIGIN 0x0F02
528 #define SF_OB_IB_OBJECT_CONTROL 0x0F11
529 #define SF_OB_IB_OBJECT_DATA 0x0F0F
530 #define SF_OB_IB_OBJECT_PICTURE 0x0F10
531 #define SF_OB_IB_OEM_DATA 0x0F1F
532 #define SF_OB_IB_SAVE_OR_RESTORE_FORMAT 0x1034
533 #define SF_OB_IB_SELECT_IPDS_MODE 0x0F83
535 static const value_string vals_outbound_inbound_structured_fields
[] = {
536 { SF_OB_IB_DATA_CHAIN
, "Data Chain" },
537 { SF_OB_IB_DESTINATION_OR_ORIGIN
, "Destination/Origin" },
538 { SF_OB_IB_OBJECT_CONTROL
, "Object Control" },
539 { SF_OB_IB_OBJECT_DATA
, "Object Data" },
540 { SF_OB_IB_OBJECT_PICTURE
, "Object Picture" },
541 { SF_OB_IB_OEM_DATA
, "OEM Data" },
542 { SF_OB_IB_SAVE_OR_RESTORE_FORMAT
, "Save/Restore Format" },
543 { SF_OB_IB_SELECT_IPDS_MODE
, "Select IPDS Mode." },
547 /*--- 5.11 Load Format Storage ----- */
548 #define LOAD_FORMAT_STORAGE_OPERAND_ADD 0x01
549 #define LOAD_FORMAT_STORAGE_OPERAND_DELETE_FORMAT 0x02
550 #define LOAD_FORMAT_STORAGE_OPERAND_DELETE_GROUP 0x03
551 #define LOAD_FORMAT_STORAGE_OPERAND_RESET_ALL 0x04
552 #define LOAD_FORMAT_STORAGE_OPERAND_REQUEST_SUMMARY_STATUS 0x05
553 #define LOAD_FORMAT_STORAGE_OPERAND_REQUEST_GROUP_STATUS 0x06
555 static const value_string vals_load_storage_format_operand
[] = {
556 { LOAD_FORMAT_STORAGE_OPERAND_ADD
, "Add" },
557 { LOAD_FORMAT_STORAGE_OPERAND_DELETE_FORMAT
, "Delete Format" },
558 { LOAD_FORMAT_STORAGE_OPERAND_DELETE_GROUP
, "Delete Group" },
559 { LOAD_FORMAT_STORAGE_OPERAND_RESET_ALL
, "Reset All" },
560 { LOAD_FORMAT_STORAGE_OPERAND_REQUEST_SUMMARY_STATUS
, "Request Summary Status" },
561 { LOAD_FORMAT_STORAGE_OPERAND_REQUEST_GROUP_STATUS
, "Request Group Status" },
565 /*--- 5.19 Read Partition ----- */
566 #define READ_PARTITION_OPTYPE_QUERY 0x02
567 #define READ_PARTITION_OPTYPE_QUERY_LIST 0x03
568 #define READ_PARTITION_OPTYPE_READ_MODIFIED_ALL 0x6E
569 #define READ_PARTITION_OPTYPE_READ_BUFFER 0xF2
570 #define READ_PARTITION_OPTYPE_READ_MODIFIED 0xF6
572 static const value_string vals_read_partition_operation_type
[] = {
573 { READ_PARTITION_OPTYPE_QUERY
, "Read Partition Query" },
574 { READ_PARTITION_OPTYPE_QUERY_LIST
, "Read Partition Query List" },
575 { READ_PARTITION_OPTYPE_READ_MODIFIED_ALL
, "Read Partition Read Modified All" },
576 { READ_PARTITION_OPTYPE_READ_BUFFER
, "Read Partition Read Buffer" },
577 { READ_PARTITION_OPTYPE_READ_MODIFIED
, "Read Partition Read Modified" },
581 #define READ_PARTITION_REQTYPE_MASK 0xC0
582 static const value_string vals_read_partition_reqtype
[] = {
583 { 0x00, "QCODE List" },
584 { 0x01, "Equivalent + QCODE List" },
589 /*--- 5.34 Data Chain ----- */
590 #define DATA_CHAIN_GROUP_MASK 0x60
591 #define DATA_CHAIN_INBOUND_CONTROL_MASK 0x18
593 static const value_string vals_data_chain_group
[] = {
594 { 0x00, "Continue" },
601 static const value_string vals_data_chain_inbound_control
[] = {
602 { 0x00, "No Change" },
603 { 0x01, "Enable Inbound Data Chaining" },
604 { 0x02, "Disable Inbound Data Chaining" },
605 { 0x03, "Reserved" },
609 /*--- 5.35 Destination or Origin ----- */
610 #define DESTINATION_OR_ORIGIN_FLAGS_INPUT_CONTROL_MASK 0xC0
612 static const value_string vals_destination_or_origin_flags_input_control
[] = {
613 { 0x00, "Enable input" },
614 { 0x01, "No Change" },
615 { 0x02, "Disable Input" },
616 { 0x03, "Reserved" },
621 /* INBOUND DATA STREAM (DISPLAY -> MAINFRAME PROGRAM) */
624 ______ _______ ________ _______
626 | AID | Cursor address | Data |
629 |______|_______|________|_______|
631 An inbound data stream can also consist of an AID (X'88') followed by
632 structured fields as follows:
633 ______ __________________ ________ ___________________
635 | AID | Structured Field | ...... | Structured Field |
637 |______|__________________|________|___________________|
642 /*--- 3.5.6 Attention Identification Bytes (AID) ----- */
643 #define AID_NO_AID_GENERATED 0x60
644 #define AID_NO_AID_GENERATED_PRINTER_ONLY 0xE8
645 #define AID_STRUCTURED_FIELD 0x88
646 #define AID_READ_PARTITION_AID 0x61
647 #define AID_TRIGGER_ACTION 0x7F
648 #define AID_TEST_REQ_AND_SYS_REQ 0xF0
649 #define AID_PF1_KEY 0xF1
650 #define AID_PF2_KEY 0xF2
651 #define AID_PF3_KEY 0xF3
652 #define AID_PF4_KEY 0xF4
653 #define AID_PF5_KEY 0xF5
654 #define AID_PF6_KEY 0xF6
655 #define AID_PF7_KEY 0xF7
656 #define AID_PF8_KEY 0xF8
657 #define AID_PF9_KEY 0xF9
658 #define AID_PF10_KEY 0x7A
659 #define AID_PF11_KEY 0x7B
660 #define AID_PF12_KEY 0x7C
661 #define AID_PF13_KEY 0xC1
662 #define AID_PF14_KEY 0xC2
663 #define AID_PF15_KEY 0xC3
664 #define AID_PF16_KEY 0xC4
665 #define AID_PF17_KEY 0xC5
666 #define AID_PF18_KEY 0xC6
667 #define AID_PF19_KEY 0xC7
668 #define AID_PF20_KEY 0xC8
669 #define AID_PF21_KEY 0xC9
670 #define AID_PF22_KEY 0x4A
671 #define AID_PF23_KEY 0x4B
672 #define AID_PF24_KEY 0x4C
673 #define AID_PA1_KEY 0x6C
674 #define AID_PA2_KEY_CNCL 0x6E
675 #define AID_PA3_KEY 0x6B
676 #define AID_CLEAR_KEY 0x6D
677 #define AID_CLEAR_PARTITION_KEY 0x6A
678 #define AID_ENTER_KEY 0x7D
679 #define AID_SELECTOR_PEN_ATTENTION 0x7E
680 #define AID_OPERATOR_ID_READER 0xE6
681 #define AID_MAG_READER_NUMBER 0xE7
683 static const value_string vals_attention_identification_bytes
[] = {
684 { AID_NO_AID_GENERATED
, "No AID generated" },
685 { AID_NO_AID_GENERATED_PRINTER_ONLY
, "No AID generated (printer only)" },
686 { AID_STRUCTURED_FIELD
, "Structured field" },
687 { AID_READ_PARTITION_AID
, "Read partition" },
688 { AID_TRIGGER_ACTION
, "Trigger action" },
689 { AID_TEST_REQ_AND_SYS_REQ
, "Test Req and Sys Req" },
690 { AID_PF1_KEY
, "PF1 key" },
691 { AID_PF2_KEY
, "PF2 key" },
692 { AID_PF3_KEY
, "PF3 key" },
693 { AID_PF4_KEY
, "PF4 key" },
694 { AID_PF5_KEY
, "PF5 key" },
695 { AID_PF6_KEY
, "PF6 key" },
696 { AID_PF7_KEY
, "PF7 key" },
697 { AID_PF8_KEY
, "PF8 key" },
698 { AID_PF9_KEY
, "PF9 key" },
699 { AID_PF10_KEY
, "PF10 key" },
700 { AID_PF11_KEY
, "PF11 key" },
701 { AID_PF12_KEY
, "PF12 key" },
702 { AID_PF13_KEY
, "PF13 key" },
703 { AID_PF14_KEY
, "PF14 key" },
704 { AID_PF15_KEY
, "PF15 key" },
705 { AID_PF16_KEY
, "PF16 key" },
706 { AID_PF17_KEY
, "PF17 key" },
707 { AID_PF18_KEY
, "PF18 key" },
708 { AID_PF19_KEY
, "PF19 key" },
709 { AID_PF20_KEY
, "PF20 key" },
710 { AID_PF21_KEY
, "PF21 key" },
711 { AID_PF22_KEY
, "PF22 key" },
712 { AID_PF23_KEY
, "PF23 key" },
713 { AID_PF24_KEY
, "PF24 key" },
714 { AID_PA1_KEY
, "PA1 key" },
715 { AID_PA2_KEY_CNCL
, "PA2 key (Cncl)" },
716 { AID_PA3_KEY
, "PA3 key" },
717 { AID_CLEAR_KEY
, "Clear key" },
718 { AID_CLEAR_PARTITION_KEY
, "Clear Partition key" },
719 { AID_ENTER_KEY
, "Enter key" },
720 { AID_SELECTOR_PEN_ATTENTION
, "Selector pen attention" },
721 { AID_OPERATOR_ID_READER
, "Operator ID reader" },
722 { AID_MAG_READER_NUMBER
, "Mag Reader Number" },
726 /*--- 5.3.6 Object Control ----- */
727 #define OBJC_GRAPHICS 0x00
728 #define OBJC_IMAGE 0x01
730 static const value_string vals_oc_type
[] = {
731 { OBJC_GRAPHICS
, "Graphics" },
732 { OBJC_IMAGE
, "Image)" },
736 /*--- 6.1 Inbound Structured Fields ----- */
737 #define SF_IB_EXCEPTION_OR_STATUS 0x0F22
738 #define SF_IB_INBOUND_TEXT_HEADER 0x0FB1
739 #define SF_IB_INBOUND_3270DS 0x0F80 /* TODO: Check */
740 #define SF_IB_RECOVERY_DATA 0x1031
741 #define SF_IB_TYPE_1_TEXT_INBOUND 0x0FC1
742 #define SF_IB_QUERY_REPLY_ALPHANUMERIC_PARTITIONS 0x8184
743 #define SF_IB_QUERY_REPLY_AUXILIARY_DEVICE 0x8199
744 #define SF_IB_QUERY_REPLY_BEGIN_OR_END_OF_FILE 0x819F
745 #define SF_IB_QUERY_REPLY_CHARACTER_SETS 0x8185
746 #define SF_IB_QUERY_REPLY_COLOR 0x8186
747 #define SF_IB_QUERY_REPLY_COOPERATIVE_PROCESSING_REQUESTOR 0x81AB
748 #define SF_IB_QUERY_REPLY_DATA_CHAINING 0x8198
749 #define SF_IB_QUERY_REPLY_DATA_STREAMS 0x81A2
750 #define SF_IB_QUERY_REPLY_DBCS_ASIA 0x8191
751 #define SF_IB_QUERY_REPLY_DEVICE_CHARACTERISTICS 0x81A0
752 #define SF_IB_QUERY_REPLY_DISTRIBUTED_DATA_MANAGEMENT 0x8195
753 #define SF_IB_QUERY_REPLY_DOCUMENT_INTERCHANGE_ARCHITECTURE 0x8197
754 #define SF_IB_QUERY_REPLY_EXTENDED_DRAWING_ROUTINE 0x81B5
755 #define SF_IB_QUERY_REPLY_FIELD_OUTLINING 0x818C
756 #define SF_IB_QUERY_REPLY_FIELD_VALIDATION 0x818A
757 #define SF_IB_QUERY_REPLY_FORMAT_PRESENTATION 0x8190
758 #define SF_IB_QUERY_REPLY_FORMAT_STORAGE_AUXILIARY_DEVICE 0x8194
759 #define SF_IB_QUERY_REPLY_GRAPHIC_COLOR 0x81B4
760 #define SF_IB_QUERY_REPLY_GRAPHIC_SYMBOL_SETS 0x81B6
761 #define SF_IB_QUERY_REPLY_HIGHLIGHTING 0x8187
762 #define SF_IB_QUERY_REPLY_IBM_AUXILIARY_DEVICE 0x819E
763 #define SF_IB_QUERY_REPLY_IMAGE 0x8182
764 #define SF_IB_QUERY_REPLY_IMPLICIT_PARTITION 0x81A6
765 #define SF_IB_QUERY_REPLY_IOCA_AUXILIARY_DEVICE 0x81AA
766 #define SF_IB_QUERY_REPLY_LINE_TYPE 0x81B2
767 #define SF_IB_QUERY_REPLY_MSR_CONTROL 0x818B
768 #define SF_IB_QUERY_REPLY_NULL 0x81FF
769 #define SF_IB_QUERY_REPLY_OEM_AUXILIARY_DEVICE 0x818F
770 #define SF_IB_QUERY_REPLY_PAPER_FEED_TECHNIQUES 0x81A7
771 #define SF_IB_QUERY_REPLY_PARTITION_CHARACTERISTICS 0x818E
772 #define SF_IB_QUERY_REPLY_PORT 0x81B3
773 #define SF_IB_QUERY_REPLY_PROCEDURE 0x81B1
774 #define SF_IB_QUERY_REPLY_PRODUCT_DEFINED_DATA_STREAM 0x819C
775 #define SF_IB_QUERY_REPLY_REPLY_MODES 0x8188
776 #define SF_IB_QUERY_REPLY_RPQ_NAMES 0x81A1
777 #define SF_IB_QUERY_REPLY_SAVE_OR_RESTORE_FORMAT 0x8192
778 #define SF_IB_QUERY_REPLY_SEGMENT 0x81B0
779 #define SF_IB_QUERY_REPLY_SETTABLE_PRINTER_CHARACTERISTICS 0x81A9
780 #define SF_IB_QUERY_REPLY_STORAGE_POOLS 0x8196
781 #define SF_IB_QUERY_REPLY_SUMMARY 0x8180
782 #define SF_IB_QUERY_REPLY_TEXT_PARTITIONS 0x8183
783 #define SF_IB_QUERY_REPLY_TRANSPARENCY 0x81A8
784 #define SF_IB_QUERY_REPLY_USABLE_AREA 0x8181
785 #define SF_IB_QUERY_REPLY_3270_IPDS 0x819A
787 static const value_string vals_inbound_structured_fields
[] = {
788 { SF_IB_EXCEPTION_OR_STATUS
, "Exception/Status" },
789 { SF_IB_INBOUND_TEXT_HEADER
, "Inbound Text Header" },
790 { SF_IB_INBOUND_3270DS
, "Inbound 3270DS" },
791 { SF_IB_RECOVERY_DATA
, "Recovery Data" },
792 { SF_IB_TYPE_1_TEXT_INBOUND
, "Type 1 Text Inbound" },
793 { SF_IB_QUERY_REPLY_ALPHANUMERIC_PARTITIONS
, "Query Reply (Alphanumeric Partitions)" },
794 { SF_IB_QUERY_REPLY_AUXILIARY_DEVICE
, "Query Reply (Auxiliary Device)" },
795 { SF_IB_QUERY_REPLY_BEGIN_OR_END_OF_FILE
, "Query Reply (Begin/End of File)" },
796 { SF_IB_QUERY_REPLY_CHARACTER_SETS
, "Query Reply (Character Sets)" },
797 { SF_IB_QUERY_REPLY_COLOR
, "Query Reply (Color)" },
798 { SF_IB_QUERY_REPLY_COOPERATIVE_PROCESSING_REQUESTOR
, "Query Reply (Cooperative Processing Requestor)" },
799 { SF_IB_QUERY_REPLY_DATA_CHAINING
, "Query Reply (Data Chaining)" },
800 { SF_IB_QUERY_REPLY_DATA_STREAMS
, "Query Reply (Data Streams)" },
801 { SF_IB_QUERY_REPLY_DBCS_ASIA
, "Query Reply (DBCS-Asia)" },
802 { SF_IB_QUERY_REPLY_DEVICE_CHARACTERISTICS
, "Query Reply (Device Characteristics)" },
803 { SF_IB_QUERY_REPLY_DISTRIBUTED_DATA_MANAGEMENT
, "Query Reply (Distributed Data Management)" },
804 { SF_IB_QUERY_REPLY_DOCUMENT_INTERCHANGE_ARCHITECTURE
, "Query Reply (Document Interchange Architecture)" },
805 { SF_IB_QUERY_REPLY_EXTENDED_DRAWING_ROUTINE
, "Query Reply (Extended Drawing Routine)" },
806 { SF_IB_QUERY_REPLY_FIELD_OUTLINING
, "Query Reply (Field Outlining)" },
807 { SF_IB_QUERY_REPLY_FIELD_VALIDATION
, "Query Reply (Field Validation)" },
808 { SF_IB_QUERY_REPLY_FORMAT_PRESENTATION
, "Query Reply (Format Presentation)" },
809 { SF_IB_QUERY_REPLY_FORMAT_STORAGE_AUXILIARY_DEVICE
, "Query Reply (Format Storage Auxiliary Device)" },
810 { SF_IB_QUERY_REPLY_GRAPHIC_COLOR
, "Query Reply (Graphic Color)" },
811 { SF_IB_QUERY_REPLY_GRAPHIC_SYMBOL_SETS
, "Query Reply (Graphic Symbol Sets)" },
812 { SF_IB_QUERY_REPLY_HIGHLIGHTING
, "Query Reply (Highlighting)" },
813 { SF_IB_QUERY_REPLY_IBM_AUXILIARY_DEVICE
, "Query Reply (IBM Auxiliary Device)" },
814 { SF_IB_QUERY_REPLY_IMAGE
, "Query Reply (Image)" },
815 { SF_IB_QUERY_REPLY_IMPLICIT_PARTITION
, "Query Reply (Implicit Partition)" },
816 { SF_IB_QUERY_REPLY_IOCA_AUXILIARY_DEVICE
, "Query Reply (IOCA Auxiliary Device)" },
817 { SF_IB_QUERY_REPLY_LINE_TYPE
, "Query Reply (Line Type)" },
818 { SF_IB_QUERY_REPLY_MSR_CONTROL
, "Query Reply (MSR Control)" },
819 { SF_IB_QUERY_REPLY_NULL
, "Query Reply (Null)" },
820 { SF_IB_QUERY_REPLY_OEM_AUXILIARY_DEVICE
, "Query Reply (OEM Auxiliary Device)" },
821 { SF_IB_QUERY_REPLY_PAPER_FEED_TECHNIQUES
, "Query Reply (Paper Feed Techniques)" },
822 { SF_IB_QUERY_REPLY_PARTITION_CHARACTERISTICS
, "Query Reply (Partition Characteristics)" },
823 { SF_IB_QUERY_REPLY_PORT
, "Query Reply (Port)" },
824 { SF_IB_QUERY_REPLY_PROCEDURE
, "Query Reply (Procedure)" },
825 { SF_IB_QUERY_REPLY_PRODUCT_DEFINED_DATA_STREAM
, "Query Reply (Product Defined Data Stream)" },
826 { SF_IB_QUERY_REPLY_REPLY_MODES
, "Query Reply (Reply Modes)" },
827 { SF_IB_QUERY_REPLY_RPQ_NAMES
, "Query Reply (RPQ Names)" },
828 { SF_IB_QUERY_REPLY_SAVE_OR_RESTORE_FORMAT
, "Query Reply (Save/Restore Format)" },
829 { SF_IB_QUERY_REPLY_SEGMENT
, "Query Reply (Segment)" },
830 { SF_IB_QUERY_REPLY_SETTABLE_PRINTER_CHARACTERISTICS
, "Query Reply (Settable Printer Characteristics)" },
831 { SF_IB_QUERY_REPLY_STORAGE_POOLS
, "Query Reply (Storage Pools)" },
832 { SF_IB_QUERY_REPLY_SUMMARY
, "Query Reply (Summary)" },
833 { SF_IB_QUERY_REPLY_TEXT_PARTITIONS
, "Query Reply (Text Partitions)" },
834 { SF_IB_QUERY_REPLY_TRANSPARENCY
, "Query Reply (Transparency)" },
835 { SF_IB_QUERY_REPLY_USABLE_AREA
, "Query Reply (Usable Area)" },
836 { SF_IB_QUERY_REPLY_3270_IPDS
, "Query Reply (3270 IPDS)." },
840 /*--- 6.2 - Exception/Status ----- */
841 #define SDP_STATCODE_ACKNOWLEDGED 0x0000
842 #define SDP_STATCODE_AUXDEVICEAVAIL 0X0001
844 static const value_string vals_sdp_statcode
[] = {
845 { SDP_STATCODE_ACKNOWLEDGED
, "Acknowledged. The formats were successfully loaded, and no exception occurred." },
846 { SDP_STATCODE_AUXDEVICEAVAIL
, "Auxiliary device available" },
850 #define SDP_EXCODE_INVALID_DOID 0x0801
851 #define SDP_EXCODE_DEVICENOTAVAIL 0X0802
852 #define SDP_EXCODE_RETIRED 0X0803
853 #define SDP_EXCODE_BUFFER_OVERRUN 0X0804
854 #define SDP_EXCODE_STORAGE 0X0805
855 #define SDP_EXCODE_FORMATNOTSPEC 0X0806
856 #define SDP_EXCODE_DATAERROR 0X0807
857 #define SDP_EXCODE_INSUFFRESOURCE 0X084B
858 #define SDP_EXCODE_EXCEEDSLIMIT 0X084C
859 #define SDP_EXCODE_FUNCTNOTSUPP 0X1003
861 static const value_string vals_sdp_excode
[] = {
862 { SDP_EXCODE_INVALID_DOID
,
863 "Invalid/unrecognized DOID in the Destination/Origin structured field."
864 " AVAILSTAT must be set to B'0'." },
865 { SDP_EXCODE_DEVICENOTAVAIL
,
866 "DOID valid, but the auxiliary device is not available because of an"
867 " intervention required condition (for example, out of paper, power"
868 " off, or processing code not resident). Available status is sent"
869 " when the condition clears. AVAILSTAT must be set to B'1'." },
870 { SDP_EXCODE_RETIRED
,
872 { SDP_EXCODE_BUFFER_OVERRUN
,
874 { SDP_EXCODE_STORAGE
,
875 "Insufficient storage. The loading of the formats could not be"
876 " completed because storage was exhausted." },
877 { SDP_EXCODE_FORMATNOTSPEC
,
878 "The format or group name was not specified in the Load Format"
879 " Storage structured field." },
880 { SDP_EXCODE_DATAERROR
,
882 { SDP_EXCODE_INSUFFRESOURCE
,
883 "Temporary insufficient resource. The application does not have"
884 " a buffer available or is busy. The device chooses whether to"
885 " set send status when the condition clears and set AVAILSTAT accordingly." },
886 { SDP_EXCODE_EXCEEDSLIMIT
,
887 "The auxiliary device data in the transmission exceeds the limit specified"
888 " in the LIMOUT parameter of the Query Reply for the auxiliary device."
889 " AVAILSTAT must be set to B'0'." },
890 { SDP_EXCODE_FUNCTNOTSUPP
,
891 "Function not supported." },
895 /* Query Reply Types */
896 #define SF_QR_ALPHANUMERIC_PARTITIONS 0x84
897 #define SF_QR_AUXILIARY_DEVICE 0x99
898 #define SF_QR_QBEGIN_OR_END_OF_FILE 0x9F
899 #define SF_QR_CHARACTER_SETS 0x85
900 #define SF_QR_COLOR 0x86
901 #define SF_QR_COOPERATIVE_PROCESSING_REQUESTOR 0xAB
902 #define SF_QR_DATA_CHAINING 0x98
903 #define SF_QR_DATA_STREAMS 0xA2
904 #define SF_QR_DBCS_ASIA 0x91
905 #define SF_QR_DEVICE_CHARACTERISTICS 0xA0
906 #define SF_QR_DISTRIBUTED_DATA_MANAGEMENT 0x95
907 #define SF_QR_DOCUMENT_INTERCHANGE_ARCHITECTURE 0x97
908 #define SF_QR_EXTENDED_DRAWING_ROUTINE 0xB5
909 #define SF_QR_QFIELD_OUTLINING 0x8C
910 #define SF_QR_QFIELD_VALIDATION 0x8A
911 #define SF_QR_FORMAT_PRESENTATION 0x90
912 #define SF_QR_FORMAT_STORAGE_AUXILIARY_DEVICE 0x94
913 #define SF_QR_GRAPHIC_COLOR 0xB4
914 #define SF_QR_GRAPHIC_SYMBOL_SETS 0xB6
915 #define SF_QR_HIGHLIGHTING 0x87
916 #define SF_QR_IBM_AUXILIARY_DEVICE 0x9E
917 #define SF_QR_IMAGE 0x82
918 #define SF_QR_IMPLICIT_PARTITION 0xA6
919 #define SF_QR_IOCA_AUXILIARY_DEVICE 0xAA
920 #define SF_QR_LINE_TYPE 0xB2
921 #define SF_QR_MSR_CONTROL 0x8B
922 #define SF_QR_QNULL 0xFF
923 #define SF_QR_OEM_AUXILIARY_DEVICE 0x8F
924 #define SF_QR_PAPER_FEED_TECHNIQUES 0xA7
925 #define SF_QR_PARTITION_CHARACTERISTICS 0x8E
926 #define SF_QR_PORT 0xB3
927 #define SF_QR_PROCEDURE 0xB1
928 #define SF_QR_PRODUCT_DEFINED_DATA_STREAM 0x9C
929 #define SF_QR_REPLY_MODES 0x88
930 #define SF_QR_RPQ_NAMES 0xA1
931 #define SF_QR_QSAVE_OR_RESTORE_FORMAT 0x92
932 #define SF_QR_SEGMENT 0xB0
933 #define SF_QR_SETTABLE_PRINTER_CHARACTERISTICS 0xA9
934 #define SF_QR_STORAGE_POOLS 0x96
935 #define SF_QR_SUMMARY 0x80
936 #define SF_QR_TEXT_PARTITIONS 0x83
937 #define SF_QR_QTRANSPARENCY 0xA8
938 #define SF_QR_USABLE_AREA 0x81
939 #define SF_QR_T3270_IPDS 0x9A
941 static const value_string vals_sf_query_replies
[] = {
942 { SF_QR_ALPHANUMERIC_PARTITIONS
, "Alphanumeric Partitions" },
943 { SF_QR_AUXILIARY_DEVICE
, "Auxiliary Device" },
944 { SF_QR_QBEGIN_OR_END_OF_FILE
, "Begin/End of File" },
945 { SF_QR_CHARACTER_SETS
, "Character Sets" },
946 { SF_QR_COLOR
, "Color" },
947 { SF_QR_COOPERATIVE_PROCESSING_REQUESTOR
, "Cooperative Processing Requestor" },
948 { SF_QR_DATA_CHAINING
, "Data Chaining" },
949 { SF_QR_DATA_STREAMS
, "Data Streams" },
950 { SF_QR_DBCS_ASIA
, "DBCS-Asia" },
951 { SF_QR_DEVICE_CHARACTERISTICS
, "Device Characteristics" },
952 { SF_QR_DISTRIBUTED_DATA_MANAGEMENT
, "Distributed Data Management" },
953 { SF_QR_DOCUMENT_INTERCHANGE_ARCHITECTURE
, "Document Interchange Architecture" },
954 { SF_QR_EXTENDED_DRAWING_ROUTINE
, "Extended Drawing Routine" },
955 { SF_QR_QFIELD_OUTLINING
, "Field Outlining" },
956 { SF_QR_QFIELD_VALIDATION
, "Field Validation" },
957 { SF_QR_FORMAT_PRESENTATION
, "Format Presentation" },
958 { SF_QR_FORMAT_STORAGE_AUXILIARY_DEVICE
, "Format Storage Auxiliary Device" },
959 { SF_QR_GRAPHIC_COLOR
, "Graphic Color" },
960 { SF_QR_GRAPHIC_SYMBOL_SETS
, "Graphic Symbol Sets" },
961 { SF_QR_HIGHLIGHTING
, "Highlighting" },
962 { SF_QR_IBM_AUXILIARY_DEVICE
, "IBM Auxiliary Device" },
963 { SF_QR_IMAGE
, "Image" },
964 { SF_QR_IMPLICIT_PARTITION
, "Implicit Partition" },
965 { SF_QR_IOCA_AUXILIARY_DEVICE
, "IOCA Auxiliary Device" },
966 { SF_QR_LINE_TYPE
, "Line Type" },
967 { SF_QR_MSR_CONTROL
, "MSR Control" },
968 { SF_QR_QNULL
, "Null" },
969 { SF_QR_OEM_AUXILIARY_DEVICE
, "OEM Auxiliary Device" },
970 { SF_QR_PAPER_FEED_TECHNIQUES
, "Paper Feed Techniques" },
971 { SF_QR_PARTITION_CHARACTERISTICS
, "Partition Characteristics" },
972 { SF_QR_PORT
, "Port" },
973 { SF_QR_PROCEDURE
, "Procedure" },
974 { SF_QR_PRODUCT_DEFINED_DATA_STREAM
, "Product Defined Data Stream" },
975 { SF_QR_REPLY_MODES
, "Reply Modes" },
976 { SF_QR_RPQ_NAMES
, "RPQ Names" },
977 { SF_QR_QSAVE_OR_RESTORE_FORMAT
, "Save/Restore Format" },
978 { SF_QR_SEGMENT
, "Segment" },
979 { SF_QR_SETTABLE_PRINTER_CHARACTERISTICS
, "Settable Printer Characteristics" },
980 { SF_QR_STORAGE_POOLS
, "Storage Pools" },
981 { SF_QR_SUMMARY
, "Summary" },
982 { SF_QR_TEXT_PARTITIONS
, "Text Partitions" },
983 { SF_QR_QTRANSPARENCY
, "Transparency" },
984 { SF_QR_USABLE_AREA
, "Usable Area" },
985 { SF_QR_T3270_IPDS
, "3270 IPDS." },
989 /*--- 6.9 Query Reply Alphanumeric Partitions ----- */
990 #define QR_AP_VERTWIN 0x80
991 #define QR_AP_HORWIN 0x40
992 #define QR_AP_APRES1 0x20
993 #define QR_AP_APA_FLG 0x10
994 #define QR_AP_PROT 0x08
995 #define QR_AP_LCOPY 0x04
996 #define QR_AP_MODPART 0x02
997 #define QR_AP_APRES2 0x01
999 /*--- 6.12 - Query Reply (Character Sets) ----- */
1000 #define QR_CS_ALT 0x80
1001 #define QR_CS_MULTID 0x40
1002 #define QR_CS_LOADABLE 0x20
1003 #define QR_CS_EXT 0x10
1004 #define QR_CS_MS 0x08
1005 #define QR_CS_CH2 0x04
1006 #define QR_CS_GF 0x02
1007 #define QR_CS_CSRES 0x01
1009 #define QR_CS_CSRES2 0x80
1010 #define QR_CS_PSCS 0x40
1011 #define QR_CS_CSRES3 0x20
1012 #define QR_CS_CF 0x10
1013 #define QR_CS_CSRES4 0x08
1014 #define QR_CS_CSRES5 0x04
1015 #define QR_CS_GCSRES6 0x02
1016 #define QR_CS_CSRES7 0x01
1019 /*--- 6.15 Query Reply (Data Chaining) ----- */
1020 static const value_string vals_data_chaining_dir
[] = {
1022 { 0x01, "From device only" },
1023 { 0x02, "To device only" },
1027 /*--- 6.16 Query Reply (Data Streams) ----- */
1028 #define QR_DS_SCS 0x00
1029 #define QR_DS_DCAL2 0x01
1030 #define QR_DS_IPDS 0x02
1032 static const value_string vals_data_streams
[] = {
1034 "SCS Base Data Stream with extensions as specified in the BIND request"
1035 " and Device Characteristics Query Reply structured field" },
1037 "Document Content Architecture Level 2" },
1039 "IPDS as defined in related documentation" },
1043 /*--- 6.51 Query Reply Usable Area ----- */
1044 #define QR_UA_RESERVED1 0x80
1045 #define QR_UA_PAGE_PRINTER 0x40
1046 #define QR_UA_RESERVED2 0x20
1047 #define QR_UA_HARD_COPY 0x10
1049 #define QR_UA_ADDR_MODE_MASK 0x0F
1050 #define QR_UA_ADDR_MODE_RESERVED1 0x00
1051 #define QR_UA_ADDR_MODE_TWELVE_FOURTEEN_BIT_OK 0x01
1052 #define QR_UA_ADDR_MODE_RESERVED2 0x02
1053 #define QR_UA_ADDR_MODE_TWELVE_FOURTEEN_SXTN_BIT_OK 0x03
1054 #define QR_UA_ADDR_MODE_UNMAPPED 0x0F
1056 static const value_string vals_usable_area_addr_mode
[] = {
1057 { QR_UA_ADDR_MODE_RESERVED1
, "Reserved" },
1058 { QR_UA_ADDR_MODE_TWELVE_FOURTEEN_BIT_OK
, "Twelve/Fourteen Bit Addressing Allowed" },
1059 { QR_UA_ADDR_MODE_RESERVED2
, "Reserved" },
1060 { QR_UA_ADDR_MODE_TWELVE_FOURTEEN_SXTN_BIT_OK
, "Twelve/Fourteen/Sixteen Bit Addressing Allowed" },
1061 { QR_UA_ADDR_MODE_UNMAPPED
, "Unmapped" },
1065 #define QR_UA_VARIABLE_CELLS 0x80
1066 #define QR_UA_CHARACTERS 0x40
1067 #define QR_UA_CELL_UNITS 0x20
1069 static const struct true_false_string tn3270_tfs_ua_variable_cells
= {
1074 static const struct true_false_string tn3270_tfs_ua_characters
= {
1075 "Non-matrix character",
1079 static const struct true_false_string tn3270_tfs_ua_cell_units
= {
1085 #define QR_UA_UOM_INCHES 0x00
1086 #define QR_UA_UOM_MILLIMETERS 0x01
1088 static const value_string vals_usable_area_uom
[] = {
1089 { QR_UA_UOM_INCHES
, "Inches" },
1090 { QR_UA_UOM_MILLIMETERS
, "Millimeters" },
1094 /*--- 6.42 - Query reply (Reply Modes) ----- */
1095 /* Also for: 5.30 - Set Reply Mode */
1097 #define RM_REPLY_FIELD_MODE 0x00
1098 #define RM_REPLY_EXTENDED_FIELD_MODE 0x01
1099 #define RM_REPLY_CHARACTER_MODE 0x02
1101 static const value_string vals_reply_modes
[] = {
1102 { RM_REPLY_FIELD_MODE
, "Field Mode" },
1103 { RM_REPLY_EXTENDED_FIELD_MODE
, "Extended Field Mode" },
1104 { RM_REPLY_CHARACTER_MODE
, "Character Mode" },
1108 /*--- 6.19 - Query Reply (Distributed Data Management) ----- */
1109 #define QR_DDM_COPY_SUBSET_1 0x01
1111 static const value_string vals_qr_ddm
[] = {
1112 { QR_DDM_COPY_SUBSET_1
, "DDM Copy Subset 1" },
1116 /*--- 6.20 - Query Reply (Document Interchange Architecture) ----- */
1117 #define QR_DIA_FILE_SERVER 0x01
1118 #define QR_DIA_FILE_REQ 0x02
1119 #define QR_DIA_FILE_SERVER_REQ 0x03
1121 static const value_string vals_qr_dia
[] = {
1122 { QR_DIA_FILE_SERVER
, "File Server" },
1123 { QR_DIA_FILE_REQ
, "File Requestor" },
1124 { QR_DIA_FILE_SERVER_REQ
, "Both File Server and File Requestor" },
1128 /*--- 6.31 - Query Reply (Implicit Partitions) ----- */
1129 #define QR_IP_SDP_DISPLAY 0x01
1130 #define QR_IP_SDP_PRINTER 0x02
1131 #define QR_IP_SDP_CHARACTER 0x03
1134 static const value_string vals_qr_ip
[] = {
1135 { QR_IP_SDP_DISPLAY
, "Display Devices" },
1136 { QR_IP_SDP_PRINTER
, "Printer Devices" },
1137 { QR_IP_SDP_CHARACTER
, "Character Devices" },
1142 /*--- 6.41 - Query Reply (Product Defined Data Streams) ----- */
1143 #define QR_PDDS_REFID_GRAPH5080 0x01
1144 #define QR_PDDS_REFID_WHIPAPI 0x02
1146 static const value_string vals_qr_pdds_refid
[] = {
1147 { QR_PDDS_REFID_GRAPH5080
, "Supports the 5080 Graphics System" },
1148 { QR_PDDS_REFID_WHIPAPI
, "Supports the WHIP API data stream" },
1152 #define QR_PDDS_SSID_HFGD 0x01
1153 #define QR_PDDS_SSID_RS232 0x02
1155 static const value_string vals_qr_pdds_ssid
[] = {
1156 { QR_PDDS_SSID_HFGD
, "5080 HFGD Graphics Subset" },
1157 { QR_PDDS_SSID_RS232
, "5080 RS232 Ports Subset" },
1161 /*--- 6.47 - Query Reply (Storage Pools) ----- */
1162 #define QR_SP_OBJ_SEGMENT1 0x0001
1163 #define QR_SP_OBJ_PROCEDURE1 0x0002
1164 #define QR_SP_OBJ_EXTENDED_DRAWING 0x0003
1165 #define QR_SP_OBJ_DATA_UNIT 0x0004
1166 #define QR_SP_OBJ_TEMPORARY 0x0005
1167 #define QR_SP_OBJ_LINE_TYPE1 0x0006
1168 #define QR_SP_OBJ_SYMBOL_SET 0x0007
1170 static const value_string vals_sp_objlist
[] = {
1171 { QR_SP_OBJ_SEGMENT1
, "Segment" },
1172 { QR_SP_OBJ_PROCEDURE1
, "Procedure" },
1173 { QR_SP_OBJ_EXTENDED_DRAWING
, "Extended drawing routine" },
1174 { QR_SP_OBJ_DATA_UNIT
, "Data unit" },
1175 { QR_SP_OBJ_TEMPORARY
, "Temporary" },
1176 { QR_SP_OBJ_LINE_TYPE1
, "Line type" },
1177 { QR_SP_OBJ_SYMBOL_SET
, "Symbol set" },
1181 /* TN3270E Header - Data Type */
1182 #define TN3270E_3270_DATA 0x00
1183 #define TN3270E_BIND_IMAGE 0x03
1184 #define TN3270E_NVT_DATA 0x05
1185 #define TN3270E_REQUEST 0x06
1186 #define TN3270E_RESPONSE 0x02
1187 #define TN3270E_SCS_DATA 0x01
1188 #define TN3270E_SSCP_LU_DATA 0x07
1189 #define TN3270E_UNBIND 0x04
1191 static const value_string vals_tn3270_header_data_types
[] = {
1192 { TN3270E_3270_DATA
, "3270_DATA" },
1193 { TN3270E_BIND_IMAGE
, "BIND_IMAGE" },
1194 { TN3270E_NVT_DATA
, "NVT_DATA" },
1195 { TN3270E_REQUEST
, "REQUEST" },
1196 { TN3270E_RESPONSE
, "RESPONSE" },
1197 { TN3270E_SCS_DATA
, "SCS_DATA" },
1198 { TN3270E_SSCP_LU_DATA
, "SSCP_LU_DATA" },
1199 { TN3270E_UNBIND
, "UNBIND" },
1204 /* TN3270E Header - Request Flags */
1205 #define TN3270E_COND_CLEARED 0x00
1207 static const value_string vals_tn3270_header_request_flags
[] = {
1208 { TN3270E_COND_CLEARED
, "Condition Cleared" },
1212 /* TN3270E Header - Response Flags - Data Type 3270 and SCS */
1213 #define TN3270E_NO_RESPONSE 0x00
1214 #define TN3270E_ERROR_RESPONSE 0x01
1215 #define TN3270E_ALWAYS_RESPONSE 0x02
1217 static const value_string vals_tn3270_header_response_flags_3270_SCS
[] = {
1218 { TN3270E_NO_RESPONSE
, "No-Response" },
1219 { TN3270E_ERROR_RESPONSE
, "Error-Response" },
1220 { TN3270E_ALWAYS_RESPONSE
, "Always-Response" },
1224 /* TN3270E Header _ Response Flags - Data Type Response */
1225 #define TN3270E_POSITIVE_RESPONSE 0x00
1226 #define TN3270E_NEGATIVE_RESPONSE 0x01
1228 static const value_string vals_tn3270_header_response_flags_response
[] = {
1229 { TN3270E_POSITIVE_RESPONSE
, "Positive-Response" },
1230 { TN3270E_NEGATIVE_RESPONSE
, "Negative-Response" },
1235 * Data structure attached to a conversation, giving session information.
1237 typedef struct tn3270_conv_info_t
{
1238 uint32_t outbound_port
;
1244 } tn3270_conv_info_t
;
1247 static int proto_tn3270
;
1249 static int hf_tn3270_fa_display
;
1250 static int hf_tn3270_fa_graphic_convert
;
1251 static int hf_tn3270_fa_modified
;
1252 static int hf_tn3270_fa_numeric
;
1253 static int hf_tn3270_fa_protected
;
1254 static int hf_tn3270_fa_reserved
;
1255 static int hf_tn3270_field_attribute
;
1256 static int hf_tn3270_aid
;
1257 static int hf_tn3270_all_character_attributes
;
1258 static int hf_tn3270_attribute_type
;
1259 static int hf_tn3270_begin_end_flags1
;
1260 static int hf_tn3270_begin_end_flags2
;
1261 static int hf_tn3270_bsc
;
1262 static int hf_tn3270_buffer_address
;
1263 static int hf_tn3270_c_cav
;
1264 static int hf_tn3270_cc
;
1265 static int hf_tn3270_character_code
;
1266 static int hf_tn3270_character_set
;
1267 static int hf_tn3270_charset
;
1268 static int hf_tn3270_checkpoint
;
1269 static int hf_tn3270_c_ci
;
1270 static int hf_tn3270_c_offset
;
1271 static int hf_tn3270_color
;
1272 static int hf_tn3270_color_command
;
1273 static int hf_tn3270_color_flags
;
1274 static int hf_tn3270_command_code
;
1275 static int hf_tn3270_cro
;
1276 static int hf_tn3270_c_scsoff
;
1277 static int hf_tn3270_c_seqoff
;
1278 static int hf_tn3270_c_sequence
;
1279 static int hf_tn3270_cursor_address
;
1280 static int hf_tn3270_cw
;
1281 static int hf_tn3270_data_chain_fields
;
1282 static int hf_tn3270_data_chain_group
;
1283 static int hf_tn3270_data_chain_inbound_control
;
1284 static int hf_tn3270_destination_or_origin_flags_input_control
;
1285 static int hf_tn3270_destination_or_origin_doid
;
1286 static int hf_tn3270_erase_flags
;
1287 static int hf_tn3270_exception_or_status_flags
;
1288 static int hf_tn3270_extended_highlighting
;
1289 static int hf_tn3270_extended_ps_color
;
1290 static int hf_tn3270_extended_ps_echar
;
1291 static int hf_tn3270_extended_ps_flags
;
1292 static int hf_tn3270_extended_ps_length
;
1293 static int hf_tn3270_extended_ps_lw
;
1294 static int hf_tn3270_extended_ps_lh
;
1295 static int hf_tn3270_extended_ps_nh
;
1296 static int hf_tn3270_extended_ps_nw
;
1297 static int hf_tn3270_extended_ps_res
;
1298 static int hf_tn3270_extended_ps_stsubs
;
1299 static int hf_tn3270_extended_ps_subsn
;
1300 static int hf_tn3270_featl
;
1301 static int hf_tn3270_feats
;
1302 static int hf_tn3270_field_data
;
1303 static int hf_tn3270_field_outlining
;
1304 static int hf_tn3270_field_validation_mandatory_entry
;
1305 static int hf_tn3270_field_validation_mandatory_fill
;
1306 static int hf_tn3270_field_validation_trigger
;
1307 static int hf_tn3270_format_group
;
1308 static int hf_tn3270_format_name
;
1309 static int hf_tn3270_fov
;
1310 static int hf_tn3270_fpc
;
1311 static int hf_tn3270_hilite
;
1312 static int hf_tn3270_h_length
;
1313 static int hf_tn3270_h_offset
;
1314 static int hf_tn3270_horizon
;
1315 static int hf_tn3270_h_sequence
;
1316 static int hf_tn3270_hw
;
1317 static int hf_tn3270_interval
;
1318 static int hf_tn3270_limin
;
1319 static int hf_tn3270_limout
;
1320 static int hf_tn3270_lines
;
1321 static int hf_tn3270_load_color_command
;
1322 static int hf_tn3270_load_format_storage_flags1
;
1323 static int hf_tn3270_load_format_storage_flags2
;
1324 static int hf_tn3270_load_format_storage_format_data
;
1325 static int hf_tn3270_load_format_storage_localname
;
1326 static int hf_tn3270_load_format_storage_operand
;
1327 static int hf_tn3270_load_line_type_command
;
1328 static int hf_tn3270_lvl
;
1329 static int hf_tn3270_mode
;
1330 static int hf_tn3270_msr_ind_mask
;
1331 static int hf_tn3270_msr_ind_value
;
1332 static int hf_tn3270_msr_state_mask
;
1333 static int hf_tn3270_msr_state_value
;
1334 static int hf_tn3270_msr_type
;
1335 static int hf_tn3270_ap_na
;
1336 static int hf_tn3270_ap_m
;
1337 static int hf_tn3270_ap_vertical_scrolling
;
1338 static int hf_tn3270_ap_horizontal_scrolling
;
1339 static int hf_tn3270_ap_apres1
;
1340 static int hf_tn3270_ap_apa
;
1341 static int hf_tn3270_ap_pp
;
1342 static int hf_tn3270_ap_lc
;
1343 static int hf_tn3270_ap_mp
;
1344 static int hf_tn3270_ap_apres2
;
1345 static int hf_tn3270_c_np
;
1346 static int hf_tn3270_number_of_attributes
;
1347 static int hf_tn3270_object_control_flags
;
1348 static int hf_tn3270_object_type
;
1349 static int hf_tn3270_order_code
;
1350 static int hf_tn3270_outbound_text_header_operation_type
;
1351 static int hf_tn3270_outbound_text_header_hdr
;
1352 static int hf_tn3270_outbound_text_header_lhdr
;
1353 static int hf_tn3270_pages
;
1354 static int hf_tn3270_partition_command
;
1355 static int hf_tn3270_partition_cv
;
1356 static int hf_tn3270_partition_cw
;
1357 static int hf_tn3270_partition_flags
;
1358 static int hf_tn3270_partition_height
;
1359 static int hf_tn3270_partition_hv
;
1360 static int hf_tn3270_partition_id
;
1361 static int hf_tn3270_partition_ph
;
1362 static int hf_tn3270_partition_pw
;
1363 static int hf_tn3270_partition_res
;
1364 static int hf_tn3270_partition_rs
;
1365 static int hf_tn3270_partition_rv
;
1366 static int hf_tn3270_partition_rw
;
1367 static int hf_tn3270_partition_uom
;
1368 static int hf_tn3270_partition_width
;
1369 static int hf_tn3270_partition_wv
;
1370 static int hf_tn3270_prime
;
1371 static int hf_tn3270_printer_flags
;
1372 static int hf_tn3270_ps_char
;
1373 static int hf_tn3270_ps_flags
;
1374 static int hf_tn3270_ps_lcid
;
1375 static int hf_tn3270_ps_rws
;
1376 static int hf_tn3270_query_reply_alphanumeric_flags
;
1377 static int hf_tn3270_recovery_data_flags
;
1378 static int hf_tn3270_reply_mode_attr_list
;
1379 static int hf_tn3270_read_partition_operation_type
;
1380 static int hf_tn3270_read_partition_reqtyp
;
1381 static int hf_tn3270_resbyte
;
1382 static int hf_tn3270_resbytes
;
1383 static int hf_tn3270_res_twobytes
;
1384 static int hf_tn3270_rw
;
1385 static int hf_tn3270_save_or_restore_format_flags
;
1386 static int hf_tn3270_scs_data
;
1387 static int hf_tn3270_sf_single_byte_id
;
1388 static int hf_tn3270_sf_double_byte_id
;
1389 static int hf_tn3270_sf_length
;
1390 static int hf_tn3270_sf_query_reply
;
1391 static int hf_tn3270_sld
;
1392 static int hf_tn3270_spd
;
1393 static int hf_tn3270_start_line
;
1394 static int hf_tn3270_start_page
;
1395 static int hf_tn3270_stop_address
;
1396 static int hf_tn3270_transparency
;
1397 static int hf_tn3270_type_1_text_outbound_data
;
1398 static int hf_tn3270_vertical
;
1399 static int hf_tn3270_v_length
;
1400 static int hf_tn3270_v_offset
;
1401 static int hf_tn3270_v_sequence
;
1402 static int hf_tn3270_wcc_nop
;
1403 static int hf_tn3270_wcc_reset
;
1404 static int hf_tn3270_wcc_printer1
;
1405 static int hf_tn3270_wcc_printer2
;
1406 static int hf_tn3270_wcc_start_printer
;
1407 static int hf_tn3270_wcc_sound_alarm
;
1408 static int hf_tn3270_wcc_keyboard_restore
;
1409 static int hf_tn3270_wcc_reset_mdt
;
1410 static int hf_tn3270_ww
;
1411 static int hf_tn3270_tn3270e_data_type
;
1412 static int hf_tn3270_tn3270e_request_flag
;
1413 static int hf_tn3270_tn3270e_response_flag_3270_SCS
;
1414 static int hf_tn3270_tn3270e_response_flag_response
;
1415 static int hf_tn3270_tn3270e_response_flag_unused
;
1416 static int hf_tn3270_tn3270e_seq_number
;
1417 static int hf_tn3270_tn3270e_header_data
;
1418 static int hf_tn3270_ua_cell_units
;
1419 static int hf_tn3270_ua_characters
;
1420 static int hf_tn3270_ua_hard_copy
;
1421 static int hf_tn3270_ua_page_printer
;
1422 static int hf_tn3270_ua_reserved1
;
1423 static int hf_tn3270_ua_reserved2
;
1424 static int hf_tn3270_ua_variable_cells
;
1425 static int hf_tn3270_usable_area_flags1
;
1426 static int hf_tn3270_usable_area_flags2
;
1427 static int hf_tn3270_ua_addressing
;
1428 static int hf_tn3270_ua_width_cells_pels
;
1429 static int hf_tn3270_ua_height_cells_pels
;
1430 static int hf_tn3270_ua_uom_cells_pels
;
1431 static int hf_tn3270_ua_xr
;
1432 static int hf_tn3270_ua_yr
;
1433 static int hf_tn3270_ua_aw
;
1434 static int hf_tn3270_ua_ah
;
1435 static int hf_tn3270_ua_buffsz
;
1436 static int hf_tn3270_ua_xmin
;
1437 static int hf_tn3270_ua_ymin
;
1438 static int hf_tn3270_ua_xmax
;
1439 static int hf_tn3270_ua_ymax
;
1440 static int hf_tn3270_cs_ge
;
1441 static int hf_tn3270_cs_mi
;
1442 static int hf_tn3270_cs_lps
;
1443 static int hf_tn3270_cs_lpse
;
1444 static int hf_tn3270_cs_ms
;
1445 static int hf_tn3270_cs_ch2
;
1446 static int hf_tn3270_cs_gf
;
1447 static int hf_tn3270_cs_res
;
1448 static int hf_tn3270_cs_res2
;
1449 static int hf_tn3270_cs_pscs
;
1450 static int hf_tn3270_cs_res3
;
1451 static int hf_tn3270_cs_cf
;
1452 static int hf_tn3270_cs_form_type1
;
1453 static int hf_tn3270_cs_form_type2
;
1454 static int hf_tn3270_cs_form_type3
;
1455 static int hf_tn3270_cs_form_type4
;
1456 static int hf_tn3270_cs_form_type5
;
1457 static int hf_tn3270_cs_form_type6
;
1458 static int hf_tn3270_cs_form_type8
;
1459 static int hf_tn3270_cs_ds_load
;
1460 static int hf_tn3270_cs_ds_triple
;
1461 static int hf_tn3270_cs_ds_char
;
1462 static int hf_tn3270_cs_ds_cb
;
1463 static int hf_tn3270_character_sets_flags1
;
1464 static int hf_tn3270_character_sets_flags2
;
1465 static int hf_tn3270_sdw
;
1466 static int hf_tn3270_sdh
;
1467 static int hf_tn3270_form
;
1468 static int hf_tn3270_formres
;
1469 static int hf_tn3270_cs_dl
;
1470 static int hf_tn3270_cs_descriptor_set
;
1471 static int hf_tn3270_cs_descriptor_flags
;
1472 static int hf_tn3270_lcid
;
1473 static int hf_tn3270_sw
;
1474 static int hf_tn3270_sh
;
1475 static int hf_tn3270_ssubsn
;
1476 static int hf_tn3270_esubsn
;
1477 static int hf_tn3270_ccsgid
;
1478 static int hf_tn3270_ccsid
;
1479 static int hf_tn3270_c_prtblk
;
1480 static int hf_tn3270_h_np
;
1481 static int hf_tn3270_h_vi
;
1482 static int hf_tn3270_h_ai
;
1483 static int hf_tn3270_ddm_flags
;
1484 static int hf_tn3270_ddm_limin
;
1485 static int hf_tn3270_ddm_limout
;
1486 static int hf_tn3270_ddm_nss
;
1487 static int hf_tn3270_ddm_ddmss
;
1488 static int hf_tn3270_rpq_device
;
1489 static int hf_tn3270_rpq_mid
;
1490 static int hf_tn3270_rpq_rpql
;
1491 static int hf_tn3270_rpq_name
;
1492 static int hf_tn3270_ip_flags
;
1493 static int hf_tn3270_ipdd_wd
;
1494 static int hf_tn3270_ipdd_hd
;
1495 static int hf_tn3270_ipdd_wa
;
1496 static int hf_tn3270_ipdd_ha
;
1497 static int hf_tn3270_ippd_dpbs
;
1498 static int hf_tn3270_ippd_apbs
;
1499 static int hf_tn3270_ipccd_wcd
;
1500 static int hf_tn3270_ipccd_hcd
;
1501 static int hf_tn3270_ipccd_wca
;
1502 static int hf_tn3270_ipccd_hca
;
1503 static int hf_tn3270_dc_dir
;
1504 static int hf_tn3270_oem_dsref
;
1505 static int hf_tn3270_oem_dtype
;
1506 static int hf_tn3270_oem_uname
;
1507 static int hf_tn3270_sdp_daid
;
1508 static int hf_tn3270_oem_sdp_ll_limin
;
1509 static int hf_tn3270_oem_sdp_ll_limout
;
1510 static int hf_tn3270_oem_sdp_pclk_vers
;
1511 static int hf_tn3270_null
;
1512 static int hf_tn3270_unknown_data
;
1513 static int hf_tn3270_ds_default_sfid
;
1514 static int hf_tn3270_ds_sfid
;
1515 static int hf_tn3270_asia_sdp_sosi_soset
;
1516 static int hf_tn3270_asia_sdp_ic_func
;
1517 static int hf_tn3270_ccc
;
1518 static int hf_tn3270_ccc_coding
;
1519 static int hf_tn3270_ccc_printout
;
1520 static int hf_tn3270_ccc_start_print
;
1521 static int hf_tn3270_ccc_sound_alarm
;
1522 static int hf_tn3270_ccc_copytype
;
1523 static int hf_tn3270_msr_user
;
1524 static int hf_tn3270_msr_locked
;
1525 static int hf_tn3270_msr_auto
;
1526 static int hf_tn3270_msr_ind1
;
1527 static int hf_tn3270_msr_ind2
;
1528 static int hf_tn3270_spc_sdp_ot
;
1529 static int hf_tn3270_spc_sdp_ob
;
1530 static int hf_tn3270_spc_sdp_ol
;
1531 static int hf_tn3270_spc_sdp_or
;
1532 static int hf_tn3270_spc_sdp_eucflags
;
1533 static int hf_tn3270_spc_sdp_srepc
;
1534 static int hf_tn3270_srf_fpcb
;
1535 static int hf_tn3270_sdp_statcode
;
1536 static int hf_tn3270_sdp_excode
;
1537 static int hf_tn3270_sdp_ngl
;
1538 static int hf_tn3270_sdp_nml
;
1539 static int hf_tn3270_sdp_nlml
;
1540 static int hf_tn3270_sdp_stor
;
1541 static int hf_tn3270_ap_cm
;
1542 static int hf_tn3270_ap_ro
;
1543 static int hf_tn3270_ap_co
;
1544 static int hf_tn3270_ap_fo
;
1545 static int hf_tn3270_sdp_ln
;
1546 static int hf_tn3270_sdp_id
;
1547 static int hf_tn3270_db_cavdef
;
1548 static int hf_tn3270_db_cidef
;
1549 static int hf_tn3270_dia_flags
;
1550 static int hf_tn3270_dia_limin
;
1551 static int hf_tn3270_dia_limout
;
1552 static int hf_tn3270_dia_nfs
;
1553 static int hf_tn3270_dia_diafs
;
1554 static int hf_tn3270_dia_diafn
;
1555 static int hf_tn3270_fo_flags
;
1556 static int hf_tn3270_fo_vpos
;
1557 static int hf_tn3270_fo_hpos
;
1558 static int hf_tn3270_fo_hpos0
;
1559 static int hf_tn3270_fo_hpos1
;
1560 static int hf_tn3270_fsad_flags
;
1561 static int hf_tn3270_fsad_limin
;
1562 static int hf_tn3270_fsad_limout
;
1563 static int hf_tn3270_fsad_size
;
1564 static int hf_tn3270_ibm_flags
;
1565 static int hf_tn3270_ibm_limin
;
1566 static int hf_tn3270_ibm_limout
;
1567 static int hf_tn3270_ibm_type
;
1568 static int hf_tn3270_msr_nd
;
1569 static int hf_tn3270_pft_flags
;
1570 static int hf_tn3270_pft_tmo
;
1571 static int hf_tn3270_pft_bmo
;
1572 static int hf_tn3270_ioca_limin
;
1573 static int hf_tn3270_ioca_limout
;
1574 static int hf_tn3270_ioca_type
;
1575 static int hf_tn3270_pc_vo_thickness
;
1576 static int hf_tn3270_pdds_ssid
;
1577 static int hf_tn3270_pdds_refid
;
1578 static int hf_tn3270_srf_fpcbl
;
1579 static int hf_tn3270_spc_epc_flags
;
1580 static int hf_tn3270_sp_spid
;
1581 static int hf_tn3270_sp_size
;
1582 static int hf_tn3270_sp_space
;
1583 static int hf_tn3270_sp_objlist
;
1584 static int hf_tn3270_tp_nt
;
1585 static int hf_tn3270_tp_m
;
1586 static int hf_tn3270_tp_flags
;
1587 static int hf_tn3270_tp_ntt
;
1588 static int hf_tn3270_tp_tlist
;
1589 static int hf_tn3270_t_np
;
1590 static int hf_tn3270_t_vi
;
1591 static int hf_tn3270_t_ai
;
1592 static int hf_tn3270_3270_tranlim
;
1594 static int ett_tn3270
;
1595 static int ett_tn3270e_hdr
;
1597 static int ett_tn3270_field_attribute
;
1598 static int ett_tn3270_field_validation
;
1599 static int ett_tn3270_wcc
;
1600 static int ett_tn3270_usable_area_flags1
;
1601 static int ett_tn3270_usable_area_flags2
;
1602 static int ett_tn3270_query_reply_alphanumeric_flags
;
1603 static int ett_tn3270_character_sets_flags1
;
1604 static int ett_tn3270_character_sets_flags2
;
1605 static int ett_tn3270_character_sets_form
;
1606 static int ett_tn3270_cs_descriptor_flags
;
1607 static int ett_tn3270_color_flags
;
1608 static int ett_tn3270_ccc
;
1609 static int ett_tn3270_msr_state_mask
;
1610 static int ett_tn3270_data_chain_fields
;
1611 static int ett_tn3270_query_list
;
1613 static expert_field ei_tn3270_order_code
;
1614 static expert_field ei_tn3270_command_code
;
1615 static expert_field ei_tn3270_aid
;
1617 static int dissect_orders_and_data(proto_tree
*tn3270_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
, tn3270_conv_info_t
*tn3270_info
);
1618 static int dissect_buffer_address(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int hf
, tn3270_conv_info_t
*tn3270_info
);
1620 typedef struct hf_items
{
1622 int *bitmask_ett_idx_p
;
1624 int * const *bitmask
;
1628 /* Utility Functions */
1631 tn3270_add_hf_items(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
1632 const hf_items
*fields
)
1637 for (i
= 0; fields
[i
].hf_idx_p
; i
++) {
1638 if (fields
[i
].bitmask
== 0) {
1639 proto_tree_add_item(tn3270_tree
,
1640 *fields
[i
].hf_idx_p
,
1643 fields
[i
].encoding
);
1646 proto_tree_add_bitmask(tn3270_tree
, tvb
, offset
, *fields
[i
].hf_idx_p
,
1647 *fields
[i
].bitmask_ett_idx_p
, fields
[i
].bitmask
, ENC_BIG_ENDIAN
);
1649 offset
+= fields
[i
].length
;
1652 return (offset
- start
);
1656 * offset; tvb offset of next byte of data (first byte of unprocessed data);
1657 * start: tvb offset of beginning of data;
1658 * data_length: total length of data;
1661 dissect_unknown_data(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int start
,
1666 len_left
= (data_length
) - (offset
- start
);
1669 proto_tree_add_item(tn3270_tree
, hf_tn3270_unknown_data
,
1670 tvb
, offset
, len_left
,
1679 add_data_until_next_order_code(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
1682 int length_remaining
= tvb_reported_length_remaining(tvb
, offset
);
1685 * "All order codes have an EBCDIC value in the range of hexadecimal 00
1686 * (X'00') through hexadecimal 3F (X'3F'). Order codes with values in this
1687 * range but not defined in this chapter are rejected."
1688 * However, the code (as originally committed) treats a '0' order code as data.
1691 while (datalen
< length_remaining
) {
1692 unsigned order_code
;
1693 order_code
= tvb_get_uint8(tvb
, offset
+ datalen
);
1694 if ((order_code
> 0) && (order_code
<= OC_MAX
))
1700 /* XXX: Need to handle "Format Control Orders" ?? */
1701 proto_tree_add_item(tn3270_tree
, hf_tn3270_field_data
, tvb
, offset
,
1702 datalen
, ENC_EBCDIC
);
1709 dissect_query_reply_resbytes(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
1714 static const hf_items fields
[] = {
1715 { &hf_tn3270_res_twobytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1716 { NULL
, NULL
, 0, NULL
, 0 }
1720 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
1723 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
1725 return (offset
- start
);
1729 dissect_wcc(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
1732 static int * const wcc_fields
[] = {
1734 &hf_tn3270_wcc_reset
,
1735 &hf_tn3270_wcc_printer1
,
1736 &hf_tn3270_wcc_printer2
,
1737 &hf_tn3270_wcc_start_printer
,
1738 &hf_tn3270_wcc_sound_alarm
,
1739 &hf_tn3270_wcc_keyboard_restore
,
1740 &hf_tn3270_wcc_reset_mdt
,
1744 /* Qualifier and DeviceType */
1745 proto_tree_add_bitmask_text(tn3270_tree
, tvb
, offset
, 1, "Write Control Character: ", "None",
1746 ett_tn3270_wcc
, wcc_fields
, ENC_BIG_ENDIAN
, 0);
1752 dissect_3270_field_validation(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
1756 static int * const byte
[] = {
1757 &hf_tn3270_field_validation_mandatory_fill
,
1758 &hf_tn3270_field_validation_mandatory_entry
,
1759 &hf_tn3270_field_validation_trigger
,
1763 proto_tree_add_bitmask_text(tn3270_tree
, tvb
, 1, 1, "Field Validation: ",
1764 "None", ett_tn3270_field_validation
, byte
, ENC_BIG_ENDIAN
, 0);
1768 return (offset
- start
);
1773 dissect_3270_field_attribute(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
1777 static int * const byte
[] = {
1778 &hf_tn3270_fa_graphic_convert
,
1779 &hf_tn3270_fa_protected
,
1780 &hf_tn3270_fa_numeric
,
1781 &hf_tn3270_fa_display
,
1782 &hf_tn3270_fa_reserved
,
1783 &hf_tn3270_fa_modified
,
1788 proto_tree_add_bitmask(tn3270_tree
, tvb
, offset
, hf_tn3270_field_attribute
,
1789 ett_tn3270_field_attribute
, byte
, ENC_BIG_ENDIAN
);
1793 return (offset
- start
);
1796 /* 8.7 - Copy Control Code */
1798 dissect_ccc(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
1802 static int * const byte
[] = {
1803 &hf_tn3270_ccc_coding
,
1804 &hf_tn3270_ccc_printout
,
1805 &hf_tn3270_ccc_start_print
,
1806 &hf_tn3270_ccc_sound_alarm
,
1807 &hf_tn3270_ccc_copytype
,
1811 proto_tree_add_bitmask(tn3270_tree
, tvb
, offset
, hf_tn3270_ccc
,
1812 ett_tn3270_ccc
, byte
, ENC_BIG_ENDIAN
);
1816 return (offset
- start
);
1819 /* End - Utility Functions */
1821 /* Start: Handle Structured Fields */
1823 /* --------------------------------------------------- */
1824 /* 5.0 Outbound/Inbound and Outbound Structured Fields */
1825 /* --------------------------------------------------- */
1827 /* 5.5 Activate Partition - Search for ACTIVATE_PARTITION */
1828 /* 5.6 Begin/End of File - Search for BEGIN_OR_END_OF_FILE */
1829 /* 5.7 Create Partition */
1831 dissect_create_partition(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int sf_body_length
)
1835 static const hf_items fields
[] = {
1836 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1837 { &hf_tn3270_partition_uom
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1838 { &hf_tn3270_partition_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1839 { &hf_tn3270_partition_height
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1840 { &hf_tn3270_partition_width
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1841 { &hf_tn3270_partition_rv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1842 { &hf_tn3270_partition_cv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1843 { &hf_tn3270_partition_hv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1844 { &hf_tn3270_partition_wv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1845 { &hf_tn3270_partition_rw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1846 { &hf_tn3270_partition_cw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1847 { &hf_tn3270_partition_rs
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1848 { &hf_tn3270_partition_res
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1849 { &hf_tn3270_partition_pw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1850 { &hf_tn3270_partition_ph
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1851 { NULL
, NULL
, 0, NULL
, 0 }
1855 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
1858 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
1860 return (offset
- start
);
1863 /* 5.7 Create Partition - Search for CREATE_PARTITION */
1864 /* 5.8 Destroy Partition - Search for DESTROY_PARTITION */
1865 /* 5.9 Erase/Reset - Search for ERASE_OR_RESET */
1866 /* 5.10 Load Color Table - Search for LOAD_COLOR_TABLE */
1868 /* 5.11 Load Format Storage */
1870 dissect_load_format_storage(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int sf_body_length
)
1875 static const hf_items fields
[] = {
1876 { &hf_tn3270_load_format_storage_flags1
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1877 { &hf_tn3270_load_format_storage_flags2
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1878 { &hf_tn3270_load_format_storage_operand
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1879 { &hf_tn3270_load_format_storage_localname
, NULL
, 8, NULL
, ENC_EBCDIC
|ENC_NA
},
1880 { &hf_tn3270_format_group
, NULL
, 6, NULL
, ENC_EBCDIC
|ENC_NA
},
1881 { &hf_tn3270_format_name
, NULL
, 16, NULL
, ENC_EBCDIC
|ENC_NA
},
1882 { NULL
, NULL
, 0, NULL
, 0 }
1885 operand
= tvb_get_uint8(tvb
, offset
+2);
1887 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
1890 if (operand
== LOAD_FORMAT_STORAGE_OPERAND_ADD
) {
1891 int fmtln
= sf_body_length
- (offset
- start
);
1892 proto_tree_add_item(tn3270_tree
, hf_tn3270_load_format_storage_format_data
,
1893 tvb
, offset
, fmtln
, ENC_EBCDIC
);
1897 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
1899 return (offset
- start
);
1902 /* 5.12 Load Line Type - Search for LOAD_LINE_TYPE */
1904 /* 5.13 Load Programmed Symbols (Load PS) */
1906 dissect_load_programmed_symbols(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int sf_body_length
)
1908 int start
= offset
, i
;
1910 int8_t extended_ps_length
;
1912 static const hf_items ps_fields
[] = {
1913 { &hf_tn3270_ps_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1914 { &hf_tn3270_ps_lcid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1915 { &hf_tn3270_ps_char
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1916 { &hf_tn3270_ps_rws
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1917 { NULL
, NULL
, 0, NULL
, 0 }
1920 static const hf_items extended_ps_fields
[] = {
1921 { &hf_tn3270_extended_ps_lw
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1922 { &hf_tn3270_extended_ps_lh
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1923 { &hf_tn3270_extended_ps_subsn
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1924 { &hf_tn3270_extended_ps_color
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1925 { &hf_tn3270_extended_ps_stsubs
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1926 { &hf_tn3270_extended_ps_echar
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1927 { &hf_tn3270_extended_ps_nw
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1928 { &hf_tn3270_extended_ps_nh
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1929 { &hf_tn3270_extended_ps_res
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1930 { NULL
, NULL
, 0, NULL
, 0 }
1933 flags
= tvb_get_uint8(tvb
, offset
);
1934 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
1937 /*If extended flag not set return */
1938 if (!(flags
& 0x80)) {
1939 return (offset
- start
);
1942 extended_ps_length
= tvb_get_uint8(tvb
, offset
);
1943 proto_tree_add_item(tn3270_tree
, hf_tn3270_extended_ps_length
,
1944 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1946 proto_tree_add_item(tn3270_tree
, hf_tn3270_extended_ps_flags
,
1947 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1950 for (i
= 0; i
< extended_ps_length
; ++i
) {
1951 if (extended_ps_fields
[i
].hf_idx_p
== NULL
) {
1952 break; /* Malformed (Bad value for extended_ps_length) ! ToDo: 'expert' */
1954 proto_tree_add_item(tn3270_tree
, *extended_ps_fields
[i
].hf_idx_p
,
1955 tvb
, offset
, extended_ps_fields
[i
].length
,
1956 extended_ps_fields
[i
].encoding
);
1957 offset
+= extended_ps_fields
[i
].length
;
1961 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
1963 return (offset
- start
);
1966 /* 5.14 Modify Partition) */
1968 dissect_modify_partition(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int sf_body_length
)
1972 static const hf_items fields
[] = {
1973 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1974 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1975 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1976 { &hf_tn3270_partition_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1977 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
1978 { &hf_tn3270_resbytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1979 { &hf_tn3270_partition_rv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1980 { &hf_tn3270_partition_cv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1981 { &hf_tn3270_partition_hv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1982 { &hf_tn3270_partition_wv
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1983 { &hf_tn3270_partition_rw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1984 { &hf_tn3270_partition_cw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1985 { &hf_tn3270_partition_rs
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1986 { &hf_tn3270_partition_res
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1987 { &hf_tn3270_partition_pw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1988 { &hf_tn3270_partition_ph
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
1989 { NULL
, NULL
, 0, NULL
, 0 }
1993 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
1996 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
1998 return (offset
- start
);
2001 /* 5.15 Outbound Text Header */
2003 dissect_outbound_text_header(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2009 static const hf_items outbound_text_header_fields1
[] = {
2010 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2011 { &hf_tn3270_outbound_text_header_operation_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2012 { NULL
, NULL
, 0, NULL
, 0 }
2015 static const hf_items outbound_text_header_fields2
[] = {
2016 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2017 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2018 { &hf_tn3270_lvl
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2019 { &hf_tn3270_cro
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2020 { &hf_tn3270_cc
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2021 { NULL
, NULL
, 0, NULL
, 0 }
2024 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2025 outbound_text_header_fields1
);
2026 offset
+= dissect_wcc(tn3270_tree
, tvb
, offset
);
2027 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2028 outbound_text_header_fields2
);
2030 hdr_length
= tvb_get_ntohs(tvb
, offset
);
2032 proto_tree_add_item(tn3270_tree
, hf_tn3270_outbound_text_header_lhdr
,
2033 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2036 proto_tree_add_item(tn3270_tree
, hf_tn3270_outbound_text_header_hdr
,
2037 tvb
, offset
, hdr_length
, ENC_NA
);
2038 offset
+= hdr_length
;
2040 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2042 return (offset
- start
);
2045 /* 5.16 Outbound 3270DS */
2047 dissect_outbound_3270ds(proto_tree
*tn3270_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
,
2048 tn3270_conv_info_t
*tn3270_info
, int sf_body_length
)
2053 proto_tree_add_item(tn3270_tree
,
2054 hf_tn3270_partition_id
,
2060 cmd
= tvb_get_uint8(tvb
, offset
);
2061 proto_tree_add_item(tn3270_tree
,
2062 hf_tn3270_partition_command
,
2070 /* FIXME: the spec is ambiguous at best about what to expect here,
2071 need a live sample to validate. */
2072 offset
+= dissect_ccc(tn3270_tree
, tvb
, offset
);
2073 proto_tree_add_item(tn3270_tree
,
2080 /* XXX: are "local" commands valid for Outbound 3270DS ? */
2090 if ((offset
- start
) < sf_body_length
)
2091 offset
+= dissect_wcc(tn3270_tree
, tvb
, offset
);
2092 if ((offset
- start
) < sf_body_length
)
2093 offset
+= dissect_orders_and_data(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
);
2099 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2101 return (offset
- start
);
2104 /* 5.17 Present Absolute Format */
2106 dissect_present_absolute_format(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2111 proto_tree_add_item(tn3270_tree
,
2112 hf_tn3270_partition_id
,
2118 proto_tree_add_item(tn3270_tree
,
2125 offset
+= dissect_wcc(tn3270_tree
, tvb
, offset
);
2127 proto_tree_add_item(tn3270_tree
,
2128 hf_tn3270_format_name
,
2130 sf_body_length
- (offset
- start
),
2132 offset
+= (sf_body_length
- (offset
- start
));
2134 return (offset
- start
);
2137 /* 5.18 Present Relative Format */
2139 dissect_present_relative_format(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2144 proto_tree_add_item(tn3270_tree
,
2145 hf_tn3270_partition_id
,
2151 proto_tree_add_item(tn3270_tree
,
2158 proto_tree_add_item(tn3270_tree
,
2165 offset
+= dissect_wcc(tn3270_tree
, tvb
, offset
);
2167 proto_tree_add_item(tn3270_tree
,
2168 hf_tn3270_format_name
,
2170 sf_body_length
- (offset
- start
),
2172 offset
+= (sf_body_length
- (offset
- start
));
2174 return (offset
- start
);
2177 /* 5.19 Read Partition */
2179 dissect_read_partition(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2184 proto_tree
*query_list_tree
;
2185 int qcode_list_len
, i
;
2187 proto_tree_add_item(tn3270_tree
,
2188 hf_tn3270_partition_id
,
2194 type
= tvb_get_uint8(tvb
, offset
);
2195 if (type
== 0xFF) { /* Partition ID of 0xFF is escaped with another 0xFF */
2196 /* XXX: removing tn3270 IAX escapes should be handled in the telnet dissector ! */
2198 type
= tvb_get_uint8(tvb
, offset
);
2201 proto_tree_add_item(tn3270_tree
,
2202 hf_tn3270_read_partition_operation_type
,
2208 if (type
== READ_PARTITION_OPTYPE_QUERY_LIST
) { /* 'Query List' */
2209 proto_tree_add_item(tn3270_tree
,
2210 hf_tn3270_read_partition_reqtyp
,
2216 if (sf_body_length
> (offset
- start
)) {
2217 qcode_list_len
= sf_body_length
- (offset
- start
);
2218 query_list_tree
= proto_tree_add_subtree(tn3270_tree
, tvb
, offset
, qcode_list_len
,
2219 ett_tn3270_query_list
, NULL
, "Query List");
2220 for (i
= 0; i
< qcode_list_len
; i
++) {
2221 proto_tree_add_item(query_list_tree
,
2222 hf_tn3270_sf_query_reply
,
2223 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2229 return (offset
- start
);
2232 /*5.20 Request Recovery Data - Search for REQUEST_RECOVERY_DATA*/
2233 /*5.21 Reset Partition - Search for RESET_PARTITION */
2237 dissect_restart(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2242 proto_tree_add_item(tn3270_tree
,
2249 proto_tree_add_item(tn3270_tree
,
2250 hf_tn3270_start_page
,
2256 proto_tree_add_item(tn3270_tree
,
2257 hf_tn3270_start_line
,
2264 proto_tree_add_item(tn3270_tree
,
2267 sf_body_length
- (offset
- start
),
2269 offset
+= (sf_body_length
- (offset
- start
));
2271 return (offset
- start
);
2274 /* 5.23 SCS Data - Search for SCS_DATA */
2275 /* 5.24 Color Table - Search for COLOR_TABLE */
2276 /* 5.25 Format Group - Search for FORMAT_GROUP */
2277 /* 5.26 Set Checkpoint Interval - Search for CHECKPOINT_INTERVAL */
2279 /* 5.27 Set MSR Control */
2281 dissect_set_msr_control(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2286 static int * const byte
[] = {
2287 &hf_tn3270_msr_user
,
2288 &hf_tn3270_msr_locked
,
2289 &hf_tn3270_msr_auto
,
2290 &hf_tn3270_msr_ind1
,
2291 &hf_tn3270_msr_ind2
,
2295 static const hf_items outbound_text_header_fields
[] = {
2296 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2297 { &hf_tn3270_msr_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2298 { &hf_tn3270_msr_state_mask
, &ett_tn3270_msr_state_mask
, 1, byte
, 0 },
2299 { &hf_tn3270_msr_state_value
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2300 { &hf_tn3270_msr_ind_mask
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2301 { &hf_tn3270_msr_ind_value
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2302 { NULL
, NULL
, 0, NULL
, 0 }
2306 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2307 outbound_text_header_fields
);
2309 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2311 return (offset
- start
);
2314 /* 5.28 Set Partition Characteristics */
2316 dissect_set_partition_characteristics_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
2322 static const hf_items sdp1
[] = {
2323 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2324 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2325 { &hf_tn3270_spc_sdp_ot
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2326 { &hf_tn3270_spc_sdp_ob
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2327 { &hf_tn3270_spc_sdp_ol
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2328 { &hf_tn3270_spc_sdp_or
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2329 { NULL
, NULL
, 0, NULL
, 0 }
2332 static const hf_items sdp2
[] = {
2333 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2334 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2335 { &hf_tn3270_spc_sdp_eucflags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2336 { NULL
, NULL
, 0, NULL
, 0 }
2339 static const hf_items sdp3
[] = {
2340 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2341 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2342 { &hf_tn3270_spc_sdp_eucflags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2343 { &hf_tn3270_spc_sdp_eucflags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2344 { NULL
, NULL
, 0, NULL
, 0 }
2348 sdp
= tvb_get_ntohs(tvb
, offset
);
2351 case 0x0601: /*View Outport*/
2352 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2355 case 0x0304: /*Enable User Call Up*/
2356 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2359 case 0x0405: /*Select Base Character Set*/
2360 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2367 return (offset
- start
);
2372 dissect_set_partition_characteristics(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2379 static const hf_items fields
[] = {
2380 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2381 { &hf_tn3270_resbytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2382 { NULL
, NULL
, 0, NULL
, 0 }
2386 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2389 for (i
= 0; i
< 3; i
++) {
2390 offset
+= dissect_set_partition_characteristics_sd_parms(tn3270_tree
, tvb
, offset
);
2391 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
2395 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2397 return (offset
- start
);
2400 /* 5.29 Set Printer Characteristics */
2402 dissect_set_printer_characteristics_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
2408 static const hf_items sdp1
[] = {
2409 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2410 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2411 { &hf_tn3270_spc_sdp_srepc
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2412 { NULL
, NULL
, 0, NULL
, 0 }
2415 sdp
= tvb_get_ntohs(tvb
, offset
);
2418 case 0x0301: /*Early Print Complete*/
2419 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2426 return (offset
- start
);
2431 dissect_set_printer_characteristics(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2438 static const hf_items fields
[] = {
2439 { &hf_tn3270_printer_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2440 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2441 { NULL
, NULL
, 0, NULL
, 0 }
2444 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2447 for (i
= 0; i
< 3; i
++) {
2448 offset
+= dissect_set_printer_characteristics_sd_parms(tn3270_tree
, tvb
, offset
);
2449 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
2453 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2455 return (offset
- start
);
2459 /* 5.30 Set Reply Mode */
2461 dissect_set_reply_mode(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2468 static const hf_items fields
[] = {
2469 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2470 { &hf_tn3270_mode
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2471 { NULL
, NULL
, 0, NULL
, 0 }
2474 type
= tvb_get_uint8(tvb
, offset
+1);
2476 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2479 if (type
== 0x02) { /* 'Query List' */
2480 for (i
= 0; i
< (sf_body_length
-(offset
-start
)); i
++) {
2481 proto_tree_add_item(tn3270_tree
,
2482 hf_tn3270_reply_mode_attr_list
,
2483 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2488 return (offset
- start
);
2491 /* 5.31 Set Window Origin - Search for SET_WINDOW_ORIGIN */
2492 /* 6.6 Type 1 Text Inbound
2493 5.32 Type 1 Text Outbound */
2495 dissect_type_1_text(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2500 static const hf_items fields
[] = {
2501 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2502 { &hf_tn3270_resbytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2503 { NULL
, NULL
, 0, NULL
, 0 }
2506 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2508 proto_tree_add_item(tn3270_tree
,
2509 hf_tn3270_field_data
,
2511 sf_body_length
- (offset
- start
),
2513 offset
+= (sf_body_length
- (offset
- start
));
2515 return (offset
- start
);
2518 /* 5.34 Data Chain */
2520 dissect_data_chain(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2525 static int * const byte
[] = {
2526 &hf_tn3270_data_chain_group
,
2527 &hf_tn3270_data_chain_inbound_control
,
2531 static const hf_items data_chain_fields
[] = {
2532 { &hf_tn3270_data_chain_fields
, &ett_tn3270_data_chain_fields
, 1, byte
, 0 },
2533 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2534 { NULL
, NULL
, 0, NULL
, 0 }
2537 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2540 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2542 return (offset
- start
);
2545 /* 5.35 Destination/Origin - Search for DESTINATION_OR_ORIGIN*/
2547 /* 5.36 Object Control */
2549 dissect_object_control(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2554 static const hf_items fields
[] = {
2555 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2556 { &hf_tn3270_object_control_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2557 { &hf_tn3270_object_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2558 { NULL
, NULL
, 0, NULL
, 0 }
2561 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2564 proto_tree_add_item(tn3270_tree
,
2565 hf_tn3270_type_1_text_outbound_data
,
2567 sf_body_length
- (offset
- start
),
2569 offset
+= (sf_body_length
- (offset
- start
));
2571 return (offset
- start
);
2574 /* 5.37 Object Data - Search for OBJECT_DATA*/
2575 /* 5.38 Object Picture - Search for OBJECT_PICTURE */
2576 /* 5.39 OEM Data - Search for OEM_DATA */
2578 /* 5.40 Save/Restore Format */
2580 dissect_save_or_restore_format(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2585 hf_items fields
[] = {
2586 { &hf_tn3270_save_or_restore_format_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2587 { &hf_tn3270_srf_fpcb
, NULL
, sf_body_length
-1, NULL
, ENC_NA
},
2588 { NULL
, NULL
, 0, NULL
, 0 }
2591 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2594 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2596 return (offset
- start
);
2599 /* 5.41 Select Intelligent Printer Data Stream (IPDS) Mode - Search for SELECT_IPDS_MODE*/
2601 /* -----------------------------------------*/
2602 /* 6.0 CHAPTER 6. INBOUND STRUCTURED FIELDS */
2603 /* -----------------------------------------*/
2605 /* 6.2 Exception/Status */
2607 dissect_exception_or_status_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
2613 static const hf_items sdp1
[] = {
2614 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2615 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2616 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2617 { &hf_tn3270_sdp_excode
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2618 { NULL
, NULL
, 0, NULL
, 0 }
2621 static const hf_items sdp2
[] = {
2622 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2623 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2624 { &hf_tn3270_sdp_statcode
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2625 { NULL
, NULL
, 0, NULL
, 0 }
2628 static const hf_items sdp3
[] = {
2629 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2630 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2631 { &hf_tn3270_format_group
, NULL
, 16, NULL
, ENC_EBCDIC
|ENC_NA
},
2632 { &hf_tn3270_format_name
, NULL
, 16, NULL
, ENC_EBCDIC
|ENC_NA
},
2633 { NULL
, NULL
, 0, NULL
, 0 }
2636 static const hf_items sdp4
[] = {
2637 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2638 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2639 { &hf_tn3270_sdp_ngl
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2640 { &hf_tn3270_sdp_nml
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2641 { &hf_tn3270_sdp_nlml
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2642 { &hf_tn3270_sdp_stor
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
2643 { NULL
, NULL
, 0, NULL
, 0 }
2646 static const hf_items sdp5
[] = {
2647 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2648 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2649 { &hf_tn3270_format_group
, NULL
, 16, NULL
, ENC_EBCDIC
|ENC_NA
},
2650 { &hf_tn3270_sdp_nml
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2651 { NULL
, NULL
, 0, NULL
, 0 }
2654 sdp
= tvb_get_ntohs(tvb
, offset
);
2657 case 0x0601: /*Auxiliary Device Exception*/
2658 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2661 case 0x0402: /*Auxiliary Device status*/
2662 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2665 case 0x2203: /*Failing Format status*/
2666 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2669 case 0x0C04: /*Format status*/
2670 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2673 case 0x1405: /*Group status*/
2674 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2681 return (offset
- start
);
2686 dissect_exception_or_status(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2689 int start
= offset
, i
;
2691 static const hf_items fields
[] = {
2692 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2693 { &hf_tn3270_exception_or_status_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2694 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2695 { NULL
, NULL
, 0, NULL
, 0 }
2698 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2701 for (i
= 0; i
< 5; i
++) {
2702 offset
+= dissect_exception_or_status_sd_parms(tn3270_tree
, tvb
, offset
);
2703 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
2707 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2709 return (offset
- start
);
2712 /* 6.3 Inbound Text Header */
2714 dissect_inbound_text_header(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2719 static const hf_items outbound_text_header_fields
[] = {
2720 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2721 { &hf_tn3270_aid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2722 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2723 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2724 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2725 { &hf_tn3270_lvl
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2726 { &hf_tn3270_cro
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2727 { &hf_tn3270_cc
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2728 { &hf_tn3270_rw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2729 { &hf_tn3270_cw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2730 { &hf_tn3270_hw
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2731 { &hf_tn3270_ww
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2732 { NULL
, NULL
, 0, NULL
, 0 }
2736 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2737 outbound_text_header_fields
);
2739 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2741 return (offset
- start
);
2744 /* 6.4 Inbound 3270DS */
2746 dissect_inbound_3270ds(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2747 tn3270_conv_info_t
*tn3270_info
, int sf_body_length
)
2751 static const hf_items fields1
[] = {
2752 { &hf_tn3270_partition_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2753 { &hf_tn3270_aid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2754 { NULL
, NULL
, 0, NULL
, 0 }
2757 hf_items fields2
[] = {
2758 { &hf_tn3270_field_data
, NULL
, sf_body_length
- 4, NULL
, ENC_EBCDIC
|ENC_NA
},
2759 { NULL
, NULL
, 0, NULL
, 0 }
2762 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
, fields1
);
2763 offset
+= dissect_buffer_address(tn3270_tree
, tvb
, offset
, hf_tn3270_cursor_address
, tn3270_info
);
2764 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
, fields2
);
2766 return (offset
- start
);
2771 /* 6.5 Recovery Data */
2773 dissect_recovery_data(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2779 static const hf_items fields
[] = {
2780 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2781 { &hf_tn3270_recovery_data_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2782 { &hf_tn3270_sld
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2783 { &hf_tn3270_charset
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2784 { &hf_tn3270_vertical
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2785 { &hf_tn3270_v_offset
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2786 { &hf_tn3270_v_sequence
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2787 { &hf_tn3270_v_length
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2788 { &hf_tn3270_spd
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2789 { &hf_tn3270_horizon
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2790 { &hf_tn3270_h_offset
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2791 { &hf_tn3270_h_sequence
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2792 { &hf_tn3270_h_length
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2793 { &hf_tn3270_color
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2794 { &hf_tn3270_hilite
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2795 { &hf_tn3270_pages
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2796 { &hf_tn3270_lines
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2797 { &hf_tn3270_checkpoint
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2798 { &hf_tn3270_c_offset
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2799 { &hf_tn3270_c_sequence
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2800 { &hf_tn3270_c_seqoff
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2801 { &hf_tn3270_c_scsoff
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2802 { &hf_tn3270_prime
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2803 { NULL
, NULL
, 0, NULL
, 0 }
2807 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2810 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2812 return (offset
- start
);
2815 /* 6.6 Query Reply (Type 1 Text Inbound) - See above*/
2816 /* 6.7 and 6.8 Query Reply - Introductory Matter */
2818 /* 6.9 Query Reply (Alphanumeric Partitions) */
2820 dissect_query_reply_alphanumeric_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
2826 static const hf_items sdp1
[] = {
2827 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2828 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2829 { &hf_tn3270_ap_cm
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2830 { &hf_tn3270_ap_ro
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2831 { &hf_tn3270_ap_co
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2832 { &hf_tn3270_ap_fo
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2833 { NULL
, NULL
, 0, NULL
, 0 }
2837 sdp
= tvb_get_ntohs(tvb
, offset
);
2840 case 0x0702: /*Buffer Allocation*/
2841 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2848 return (offset
- start
);
2853 dissect_query_reply_alphanumeric(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2858 static int * const byte
[] = {
2859 &hf_tn3270_ap_vertical_scrolling
,
2860 &hf_tn3270_ap_horizontal_scrolling
,
2861 &hf_tn3270_ap_apres1
,
2866 &hf_tn3270_ap_apres2
,
2870 static const hf_items fields
[] = {
2871 { &hf_tn3270_ap_na
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2872 { &hf_tn3270_ap_m
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2873 { &hf_tn3270_query_reply_alphanumeric_flags
, &ett_tn3270_query_reply_alphanumeric_flags
, 1, byte
, 0 },
2874 { NULL
, NULL
, 0, NULL
, 0 }
2877 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2880 offset
+= dissect_query_reply_alphanumeric_sd_parms(tn3270_tree
, tvb
, offset
);
2882 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
2884 return (offset
- start
);
2887 /* 6.10 Query Reply (Auxiliary Device) - Search for QUERY_REPLY_AUXILIARY_DEVICE */
2888 /* 6.11 Query Reply (BEGIN/End of File ) - Search for QUERY_REPLY_BEGIN_OR_END_OF_FILE */
2890 /* 6.12 Query Reply (Character Sets) */
2892 dissect_query_reply_character_sets(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
2896 int flagbyte1
, flagbyte2
;
2898 static int * const byte1
[] = {
2910 static int * const byte2
[] = {
2918 static int * const byte3
[] = {
2919 &hf_tn3270_cs_form_type1
,
2920 &hf_tn3270_cs_form_type2
,
2921 &hf_tn3270_cs_form_type3
,
2922 &hf_tn3270_cs_form_type4
,
2923 &hf_tn3270_cs_form_type5
,
2924 &hf_tn3270_cs_form_type6
,
2925 &hf_tn3270_cs_form_type8
,
2929 static int * const byte4
[] = {
2930 &hf_tn3270_cs_ds_load
,
2931 &hf_tn3270_cs_ds_triple
,
2932 &hf_tn3270_cs_ds_char
,
2933 &hf_tn3270_cs_ds_cb
,
2938 static const hf_items fields
[] = {
2939 { &hf_tn3270_character_sets_flags1
, &ett_tn3270_character_sets_flags1
, 1, byte1
, 0 },
2940 { &hf_tn3270_character_sets_flags2
, &ett_tn3270_character_sets_flags2
, 1, byte2
, 0 },
2941 { &hf_tn3270_sdw
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2942 { &hf_tn3270_sdh
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2943 { &hf_tn3270_form
, &ett_tn3270_character_sets_form
, 1, byte3
, 0 },
2944 { &hf_tn3270_formres
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2945 { &hf_tn3270_formres
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2946 { &hf_tn3270_formres
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2947 { &hf_tn3270_cs_dl
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2948 { NULL
, NULL
, 0, NULL
, 0 }
2951 static const hf_items descriptors
[] = {
2952 { &hf_tn3270_cs_descriptor_set
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2953 { &hf_tn3270_cs_descriptor_flags
, &ett_tn3270_cs_descriptor_flags
, 1, byte4
, 0 },
2954 { &hf_tn3270_lcid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2955 { NULL
, NULL
, 0, NULL
, 0 }
2958 static const hf_items sw_sh
[] = {
2959 { &hf_tn3270_sw
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2960 { &hf_tn3270_sh
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2961 { NULL
, NULL
, 0, NULL
, 0 }
2964 static const hf_items subsn
[] = {
2965 { &hf_tn3270_ssubsn
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2966 { &hf_tn3270_esubsn
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
2967 { NULL
, NULL
, 0, NULL
, 0 }
2970 static const hf_items gf
[] = {
2971 { &hf_tn3270_ccsgid
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
2972 { NULL
, NULL
, 0, NULL
, 0 }
2975 static const hf_items cf
[] = {
2976 { &hf_tn3270_ccsid
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
2977 { NULL
, NULL
, 0, NULL
, 0 }
2980 flagbyte1
= tvb_get_uint8(tvb
, offset
);
2981 flagbyte2
= tvb_get_uint8(tvb
, offset
+1);
2983 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2986 while ((offset
- start
) < sf_body_length
) {
2988 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2991 if (flagbyte1
& QR_CS_MS
) {
2992 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
2996 if (flagbyte1
& QR_CS_CH2
) {
2997 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3001 if (flagbyte1
& QR_CS_GF
) {
3002 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3006 if (flagbyte2
& QR_CS_CF
) {
3007 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3011 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3013 return (offset
- start
);
3016 /* 6.13 Query Reply (Color) */
3018 dissect_query_reply_color_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
3024 static const hf_items sdp1
[] = {
3025 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3026 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3027 { &hf_tn3270_db_cavdef
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3028 { &hf_tn3270_db_cidef
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3029 { NULL
, NULL
, 0, NULL
, 0 }
3033 sdp
= tvb_get_ntohs(tvb
, offset
);
3036 case 0x0402: /*Default Background Color*/
3037 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3044 return (offset
- start
);
3049 dissect_query_reply_color(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3056 static int * const byte
[] = {
3057 &hf_tn3270_c_prtblk
,
3061 static const hf_items fields
[] = {
3062 { &hf_tn3270_color_flags
, &ett_tn3270_color_flags
, 1, byte
, 0 },
3063 { &hf_tn3270_c_np
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3064 { NULL
, NULL
, 0, NULL
, 0 }
3068 np
= tvb_get_uint8(tvb
, offset
+1);
3069 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3072 for (i
=0; i
< np
; i
++) {
3073 if (tvb_get_uint8(tvb
, offset
) == 0xFF) {
3076 proto_tree_add_item(tn3270_tree
,
3082 if (tvb_get_uint8(tvb
, offset
) == 0xFF) {
3085 proto_tree_add_item(tn3270_tree
,
3092 offset
+= dissect_query_reply_color_sd_parms(tn3270_tree
, tvb
, offset
);
3094 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3096 return (offset
- start
);
3100 /* 6.36 - Query Reply (OEM Auxiliary Device) Self-Defining Parameters */
3102 dissect_daid_sd_parm(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
3107 static const hf_items sdp1
[] = {
3108 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3109 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3110 { &hf_tn3270_sdp_daid
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3111 { NULL
, NULL
, 0, NULL
, 0 }
3114 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3116 return (offset
- start
);
3121 dissect_pclk_sd_parm(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
3126 static const hf_items sdp1
[] = {
3127 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3128 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3129 { &hf_tn3270_oem_sdp_pclk_vers
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3130 { NULL
, NULL
, 0, NULL
, 0 }
3133 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3135 return (offset
- start
);
3140 dissect_query_reply_oem_auxiliary_device_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
3147 static const hf_items sdp1
[] = {
3148 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3149 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3150 { &hf_tn3270_sdp_daid
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3151 { NULL
, NULL
, 0, NULL
, 0 }
3154 static const hf_items sdp2
[] = {
3155 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3156 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3157 { &hf_tn3270_oem_sdp_ll_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3158 { &hf_tn3270_oem_sdp_ll_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3160 { NULL
, NULL
, 0, NULL
, 0 }
3163 static const hf_items sdp3
[] = {
3164 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3165 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3166 { &hf_tn3270_oem_sdp_pclk_vers
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3167 { NULL
, NULL
, 0, NULL
, 0 }
3171 sdp_len
= tvb_get_uint8(tvb
, offset
);
3172 if ((sdp_len
!= 0x04) && (sdp_len
!= 0x06)) {
3176 sdp
= tvb_get_uint8(tvb
, offset
+1);
3180 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3184 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3188 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3195 return (offset
- start
);
3199 /* 6.14 - Query Reply (Cooperative Processing Requestor) */
3201 dissect_query_reply_cooperative(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3206 static const hf_items fields
[] = {
3207 { &hf_tn3270_res_twobytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3208 { &hf_tn3270_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3209 { &hf_tn3270_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3210 { &hf_tn3270_featl
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3211 { &hf_tn3270_feats
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3212 { NULL
, NULL
, 0, NULL
, 0 }
3216 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3220 /*FIXME: Need to see this in action to dissect in detail */
3221 proto_tree_add_item(tn3270_tree
,
3222 hf_tn3270_field_data
,
3224 sf_body_length
- (offset
-start
),
3226 offset
+= (sf_body_length
- (offset
- start
));
3228 /* Uses same Self-Defining Parm as OEM Auxiliary Device */
3229 offset
+= dissect_query_reply_oem_auxiliary_device_sd_parms(tn3270_tree
, tvb
, offset
);
3232 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3234 return (offset
- start
);
3237 /* 6.15 - Query Reply (Data Chaining) */
3239 dissect_query_reply_data_chaining(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3244 static const hf_items fields
[] = {
3245 { &hf_tn3270_dc_dir
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3246 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3247 { NULL
, NULL
, 0, NULL
, 0 }
3250 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3253 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3255 return (offset
- start
);
3258 /* 6.16 - Query Reply (Data Streams) */
3261 dissect_query_reply_data_streams(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3267 proto_tree_add_item(tn3270_tree
, hf_tn3270_ds_default_sfid
, tvb
, offset
, 1,
3271 for (i
=0; i
< (sf_body_length
-(offset
-start
)); i
++) {
3272 proto_tree_add_item(tn3270_tree
,
3279 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3281 return (offset
- start
);
3284 /* 6.17 - Query Reply (DBCS Asia) */
3287 dissect_query_reply_dbcs_asia_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
3294 static const hf_items sdp1
[] = {
3295 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3296 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3297 { &hf_tn3270_asia_sdp_sosi_soset
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3298 { NULL
, NULL
, 0, NULL
, 0 }
3301 static const hf_items sdp2
[] = {
3302 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3303 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3304 { &hf_tn3270_asia_sdp_ic_func
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3305 { NULL
, NULL
, 0, NULL
, 0 }
3308 sdp_len
= tvb_get_uint8(tvb
, offset
);
3309 if (sdp_len
!= 0x03) {
3313 sdp
= tvb_get_uint8(tvb
, offset
+1);
3316 case 0x01: /*SO/SI*/
3317 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3320 case 0x02: /*Input Control*/
3321 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3328 return (offset
- start
);
3333 dissect_query_reply_dbcs_asia(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3340 static const hf_items fields
[] = {
3341 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3342 { NULL
, NULL
, 0, NULL
, 0 }
3346 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3349 for (i
= 0; i
< 3; i
++) {
3350 offset
+= dissect_query_reply_dbcs_asia_sd_parms(tn3270_tree
, tvb
, offset
);
3351 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
3355 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3357 return (offset
- start
);
3360 /* 6.18 - Query Reply (Device Characteristics) */
3362 dissect_query_reply_device_characteristics(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
,
3363 int offset
, int sf_body_length
)
3367 #if 0 /* XXX: I don't think this is correct (i.e., this field is not part of this message) .... */
3368 proto_tree_add_item(tn3270_tree
,
3369 hf_tn3270_sf_outbound_id
,
3376 /* TODO: dissect descriptors */
3377 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3379 return (offset
- start
);
3382 /* 6.19 - Query Reply (Distributed Data Management) */
3384 dissect_query_reply_distributed_data_management(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3387 int start
= offset
, i
;
3391 static const hf_items fields
[] = {
3392 { &hf_tn3270_ddm_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3393 { &hf_tn3270_ddm_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3394 { &hf_tn3270_ddm_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3395 { &hf_tn3270_ddm_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3396 { &hf_tn3270_ddm_nss
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3397 { &hf_tn3270_ddm_ddmss
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3398 { NULL
, NULL
, 0, NULL
, 0 }
3401 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3404 for (i
= 0; i
< 3; i
++) {
3405 sdp
= tvb_get_uint8(tvb
, offset
+1);
3409 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, tvb_get_uint8(tvb
,offset
));
3412 offset
+= dissect_daid_sd_parm(tn3270_tree
, tvb
, offset
);
3415 offset
+= dissect_pclk_sd_parm(tn3270_tree
, tvb
, offset
);
3421 if ((tvb_reported_length_remaining(tvb
, offset
) <= 0) || done
)
3425 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3427 return (offset
- start
);
3430 /* 6.20 - Query Reply (Document Interchange Architecture) */
3432 dissect_query_reply_document_interchange_architecture(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3435 int start
= offset
, sdp
, ln
, i
;
3437 static const hf_items fields
[] = {
3438 { &hf_tn3270_dia_flags
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3439 { &hf_tn3270_dia_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3440 { &hf_tn3270_dia_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3441 { NULL
, NULL
, 0, NULL
, 0 }
3444 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3447 ln
= tvb_get_uint8(tvb
, offset
);
3448 proto_tree_add_item(tn3270_tree
, hf_tn3270_dia_nfs
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3450 for (i
=0; i
< ln
; i
++) {
3451 proto_tree_add_item(tn3270_tree
, hf_tn3270_dia_diafs
, tvb
, offset
, 1,
3454 proto_tree_add_item(tn3270_tree
, hf_tn3270_dia_diafn
, tvb
, offset
, 2,
3459 sdp
= tvb_get_uint8(tvb
, offset
+1);
3460 if (sdp
== 0x01) { /*DAID*/
3461 offset
+= dissect_daid_sd_parm(tn3270_tree
, tvb
, offset
);
3464 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3466 return (offset
- start
);
3469 /* 6.21 - Query Reply (Extended Drawing Routine) */
3471 dissect_query_reply_extended_drawing_routine(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
,
3472 int offset
, int sf_body_length
)
3476 proto_tree_add_item(tn3270_tree
, hf_tn3270_field_data
,tvb
, offset
,
3477 sf_body_length
, ENC_EBCDIC
);
3479 offset
+= sf_body_length
;
3481 return (offset
- start
);
3484 /* 6.22 - Query Reply (Field Outlining) */
3486 dissect_query_reply_field_outlining(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3491 static const hf_items fields
[] = {
3492 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3493 { &hf_tn3270_fo_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3494 { &hf_tn3270_fo_vpos
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3495 { &hf_tn3270_fo_hpos
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3496 { &hf_tn3270_fo_hpos0
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3497 { &hf_tn3270_fo_hpos1
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3498 { NULL
, NULL
, 0, NULL
, 0 }
3501 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3504 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3506 return (offset
- start
);
3509 /* 6.23 - Query Reply (Field Validation) - Search for FIELD_VALIDATION*/
3510 /* 6.24 - Query Reply (Format Presentation) - Search for FORMAT_PRESENTATION*/
3512 /* 6.25 - Query Reply (Format Storage Auxiliary Device)*/
3514 dissect_query_reply_format_storage_aux_device(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3517 int start
= offset
, sdp
;
3519 static const hf_items fields
[] = {
3520 { &hf_tn3270_fsad_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3521 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3522 { &hf_tn3270_fsad_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3523 { &hf_tn3270_fsad_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3524 { NULL
, NULL
, 0, NULL
, 0 }
3527 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3530 sdp
= tvb_get_uint8(tvb
, offset
+1);
3531 if (sdp
== 0x01) { /*DAID*/
3532 offset
+= dissect_daid_sd_parm(tn3270_tree
, tvb
, offset
);
3533 proto_tree_add_item(tn3270_tree
, hf_tn3270_fsad_size
,tvb
, offset
,
3538 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3540 return (offset
- start
);
3543 /* 6.26 - Query Reply (Graphic Color) - Search for GRAPHIC_COLOR*/
3544 /* 6.27 - Query Reply (Graphic Symbol Sets) - Search for GRAPHIC_SYMBOL_SETS*/
3546 /* 6.28 - Query Reply (Highlighting) */
3548 dissect_query_reply_highlighting(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3555 static const hf_items fields
[] = {
3556 { &hf_tn3270_h_np
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3557 { NULL
, NULL
, 0, NULL
, 0 }
3561 np
= tvb_get_uint8(tvb
, offset
);
3562 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3565 for (i
=0; i
< np
; i
++) {
3566 if (tvb_get_uint8(tvb
, offset
) == 0xFF) {
3569 proto_tree_add_item(tn3270_tree
,
3575 if (tvb_get_uint8(tvb
, offset
) == 0xFF) {
3578 proto_tree_add_item(tn3270_tree
,
3586 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3588 return (offset
- start
);
3591 /* 6.29 - Query Reply (IBM Auxiliary Device) */
3593 dissect_query_reply_ibm_aux_device(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3596 int start
= offset
, i
, sdp
;
3599 static const hf_items fields
[] = {
3600 { &hf_tn3270_ibm_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3601 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3602 { &hf_tn3270_ibm_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3603 { &hf_tn3270_ibm_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3604 { &hf_tn3270_ibm_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3605 { NULL
, NULL
, 0, NULL
, 0 }
3608 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3611 for (i
= 0; i
< 3; i
++) {
3612 sdp
= tvb_get_uint8(tvb
, offset
+1);
3614 case 0x02: /*Printer Name*/
3615 /*TODO: Printer Name */
3616 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, tvb_get_uint8(tvb
,offset
));
3619 offset
+= dissect_daid_sd_parm(tn3270_tree
, tvb
, offset
);
3622 offset
+= dissect_pclk_sd_parm(tn3270_tree
, tvb
, offset
);
3628 if ((tvb_reported_length_remaining(tvb
, offset
) <= 0) || done
)
3632 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3634 return (offset
- start
);
3637 /* 6.30 - Query Reply (Image) */
3639 /* 6.31 - Query Reply (Implicit Partitions) */
3641 dissect_query_reply_implicit_partitions_sd_parms(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
3648 static const hf_items sdp1
[] = {
3649 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3650 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3651 { &hf_tn3270_ip_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3652 { &hf_tn3270_ipdd_wd
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3653 { &hf_tn3270_ipdd_hd
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3654 { &hf_tn3270_ipdd_wa
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3655 { &hf_tn3270_ipdd_ha
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3656 { NULL
, NULL
, 0, NULL
, 0 }
3659 static const hf_items sdp2
[] = {
3660 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3661 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3662 { &hf_tn3270_ip_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3663 { &hf_tn3270_ippd_dpbs
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
3664 { &hf_tn3270_ippd_apbs
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
3665 { NULL
, NULL
, 0, NULL
, 0 }
3668 static const hf_items sdp3
[] = {
3669 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3670 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3671 { &hf_tn3270_ip_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3672 { &hf_tn3270_ipccd_wcd
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3673 { &hf_tn3270_ipccd_hcd
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3674 { &hf_tn3270_ipccd_wca
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3675 { &hf_tn3270_ipccd_hca
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3676 { NULL
, NULL
, 0, NULL
, 0 }
3679 sdp_len
= tvb_get_uint8(tvb
, offset
);
3680 if (sdp_len
!= 0x0B) {
3684 sdp
= tvb_get_uint8(tvb
, offset
+1);
3687 case QR_IP_SDP_DISPLAY
:
3688 /* XXX: Save default and alternate screen size info as reported ? */
3689 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3692 case QR_IP_SDP_PRINTER
:
3693 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3696 case QR_IP_SDP_CHARACTER
:
3697 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3704 return (offset
- start
);
3709 dissect_query_reply_implicit_partitions(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3715 static const hf_items fields
[] = {
3716 { &hf_tn3270_ip_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3717 { &hf_tn3270_ip_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3718 { NULL
, NULL
, 0, NULL
, 0 }
3721 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3724 for (i
= 0; i
< 3; i
++) {
3726 len
= dissect_query_reply_implicit_partitions_sd_parms(tn3270_tree
, tvb
, offset
);
3727 if ((len
== 0) || (tvb_reported_length_remaining(tvb
, offset
) <= 0))
3732 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3734 return (offset
- start
);
3737 /* 6.32 - Query Reply (IOCA Auxiliary Device) */
3739 dissect_query_reply_ioca_aux_device(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3744 static const hf_items fields
[] = {
3745 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3746 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3747 { &hf_tn3270_ioca_limin
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3748 { &hf_tn3270_ioca_limout
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3749 { &hf_tn3270_ioca_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3750 { NULL
, NULL
, 0, NULL
, 0 }
3753 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3756 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3758 return (offset
- start
);
3761 /* 6.33 - Query Reply (Line Type) - Search for LINE_TYPE*/
3763 /* 6.34 - Query Reply (MSR Control) */
3765 dissect_query_reply_msr_control(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3770 static const hf_items fields
[] = {
3771 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3772 { &hf_tn3270_msr_nd
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3773 { &hf_tn3270_msr_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3774 { NULL
, NULL
, 0, NULL
, 0 }
3777 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3779 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3781 return (offset
- start
);
3784 /* 6.35 - Query Reply (Null) - Search for QUERY_REPLY_NULL */
3786 /* 6.36 - Query Reply (OEM Auxiliary Device) */
3788 dissect_query_reply_oem_auxiliary_device(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3794 static const hf_items fields
[] = {
3795 { &hf_tn3270_resbyte
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3796 { &hf_tn3270_oem_dsref
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3797 { &hf_tn3270_oem_dtype
, NULL
, 8, NULL
, ENC_EBCDIC
|ENC_NA
},
3798 { &hf_tn3270_oem_uname
, NULL
, 8, NULL
, ENC_EBCDIC
|ENC_NA
},
3799 { NULL
, NULL
, 0, NULL
, 0 }
3802 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3805 for (i
= 0; i
< 3; i
++) {
3806 offset
+= dissect_query_reply_oem_auxiliary_device_sd_parms(tn3270_tree
, tvb
, offset
);
3807 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
3811 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3813 return (offset
- start
);
3816 /* 6.37 - Query Reply (Paper Feed Techniques) */
3818 dissect_query_reply_paper_feed_techniques(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3823 static const hf_items fields
[] = {
3824 { &hf_tn3270_pft_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3825 { &hf_tn3270_pft_tmo
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3826 { &hf_tn3270_pft_bmo
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3827 { NULL
, NULL
, 0, NULL
, 0 }
3830 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3832 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3834 return (offset
- start
);
3837 /* 6.38 - Query Reply (Partition Characteristics) */
3839 dissect_query_reply_partition_characteristics(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3842 int start
= offset
, i
, sdp
;
3845 static const hf_items fields
[] = {
3846 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3847 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3848 { NULL
, NULL
, 0, NULL
, 0 }
3851 for (i
= 0; i
< 2; i
++) {
3852 sdp
= tvb_get_uint8(tvb
, offset
+1);
3854 case 0x01: /*Viewport Outline*/
3855 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3857 proto_tree_add_item(tn3270_tree
, hf_tn3270_pc_vo_thickness
,
3858 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3861 case 0x03: /*Enable User Call-Up*/
3862 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3869 if ((tvb_reported_length_remaining(tvb
, offset
) <= 0) || done
)
3873 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3875 return (offset
- start
);
3878 /* 6.39 - Query Reply (Port) - Search for QUERY_REPLY_PORT */
3879 /* 6.40 - Query Reply (Procedure) - Search for QUERY_REPLY_PROCEDURE */
3881 /* 6.41 - Query Reply ((Product Defined Data Stream) */
3883 dissect_query_reply_product_defined_data_stream(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3886 int start
= offset
, sdp
;
3888 static const hf_items fields
[] = {
3889 { &hf_tn3270_resbytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3890 { &hf_tn3270_pdds_refid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3891 { &hf_tn3270_pdds_ssid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
3892 { NULL
, NULL
, 0, NULL
, 0 }
3895 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3898 sdp
= tvb_get_uint8(tvb
, offset
+1);
3899 if (sdp
== 0x01) { /*DAID*/
3900 offset
+= dissect_daid_sd_parm(tn3270_tree
, tvb
, offset
);
3903 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3905 return (offset
- start
);
3908 /* 6.42 - Query Reply (Modes) */
3910 dissect_query_reply_modes(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3916 for (i
=0; i
< sf_body_length
; i
++) {
3917 proto_tree_add_item(tn3270_tree
,
3925 return (offset
- start
);
3928 /* 6.43 - Query Reply (RPQ Names) */
3930 dissect_query_reply_rpq_names(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3936 static const hf_items fields
[] = {
3937 { &hf_tn3270_rpq_device
, NULL
, 4, NULL
, ENC_EBCDIC
|ENC_NA
},
3938 { &hf_tn3270_rpq_mid
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
3939 { NULL
, NULL
, 0, NULL
, 0 }
3942 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3945 rpql
= tvb_get_uint8(tvb
, offset
);
3947 proto_tree_add_item(tn3270_tree
,
3954 proto_tree_add_item(tn3270_tree
,
3961 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3963 return (offset
- start
);
3966 /* 6.44 - Query Reply (Save/Restore Format) */
3968 dissect_query_reply_save_or_restore_format(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3973 static const hf_items fields
[] = {
3974 { &hf_tn3270_srf_fpcbl
, NULL
, 1, NULL
, ENC_NA
},
3975 { NULL
, NULL
, 0, NULL
, 0 }
3978 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
3981 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
3983 return (offset
- start
);
3986 /* 6.45 - Query Reply (Segment) - Search for QUERY_REPLY_SEGMENT */
3988 /* 6.46 - Query Reply ((Settable Printer Characteristics) */
3990 dissect_query_reply_settable_printer_characteristics(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
3993 int start
= offset
, sdp
;
3995 static const hf_items fields
[] = {
3996 { &hf_tn3270_resbytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
3997 { NULL
, NULL
, 0, NULL
, 0 }
4000 static const hf_items fields2
[] = {
4001 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4002 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4003 { NULL
, NULL
, 0, NULL
, 0 }
4006 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4009 sdp
= tvb_get_uint8(tvb
, offset
+1);
4010 if (sdp
== 0x01) { /*Early Print Complete*/
4011 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4013 proto_tree_add_item(tn3270_tree
, hf_tn3270_spc_epc_flags
, tvb
, offset
,
4018 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
4020 return (offset
- start
);
4023 /* 6.47 - Query Reply (Storage Pools) */
4025 dissect_query_reply_storage_pools(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4028 int start
= offset
, sdp
, i
;
4030 static const hf_items fields2
[] = {
4031 { &hf_tn3270_sdp_ln
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4032 { &hf_tn3270_sdp_id
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4033 { &hf_tn3270_sp_spid
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4034 { &hf_tn3270_sp_size
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
4035 { &hf_tn3270_sp_space
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
4036 { NULL
, NULL
, 0, NULL
, 0 }
4039 sdp
= tvb_get_uint8(tvb
, offset
+1);
4040 if (sdp
== 0x01) { /* Storage Pool Characteristics */
4041 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4043 for (i
=0; i
< (sf_body_length
-(offset
-start
)); i
+=2) {
4044 proto_tree_add_item(tn3270_tree
, hf_tn3270_sp_objlist
,
4045 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4050 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
4052 return (offset
- start
);
4055 /* 6.48 - Query Reply (Summary) */
4057 dissect_query_reply_summary(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4062 int length_remaining
= tvb_reported_length_remaining(tvb
, offset
);
4064 for (i
=0; i
< sf_body_length
; i
++) {
4065 if (datalen
>= length_remaining
) {
4068 proto_tree_add_item(tn3270_tree
,
4069 hf_tn3270_sf_query_reply
,
4070 tvb
, offset
+ datalen
,
4075 datalen
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
+datalen
, offset
, sf_body_length
);
4080 /* 6.49 - Query Reply (Text Partitions) */
4082 dissect_query_reply_text_partitions(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4085 int start
= offset
, len
, i
;
4087 static const hf_items fields
[] = {
4088 { &hf_tn3270_tp_nt
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4089 { &hf_tn3270_tp_m
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
4090 { &hf_tn3270_tp_flags
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4091 { NULL
, NULL
, 0, NULL
, 0 }
4094 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4097 len
= tvb_get_uint8(tvb
, offset
);
4098 proto_tree_add_item(tn3270_tree
, hf_tn3270_tp_ntt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4101 for (i
=0; i
< len
; i
++) {
4102 proto_tree_add_item(tn3270_tree
, hf_tn3270_tp_tlist
,
4103 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4107 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
4109 return (offset
- start
);
4112 /* 6.50 - Query Reply (Transparency) */
4114 dissect_query_reply_transparency(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4117 int start
= offset
, i
, len
;
4119 len
= tvb_get_uint8(tvb
, offset
);
4120 proto_tree_add_item(tn3270_tree
, hf_tn3270_t_np
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4123 for (i
=0; i
< len
; i
+=2) {
4124 proto_tree_add_item(tn3270_tree
, hf_tn3270_t_vi
,
4125 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4127 proto_tree_add_item(tn3270_tree
, hf_tn3270_t_ai
,
4128 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4132 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
4134 return (offset
- start
);
4137 /* 6.51 - Query Reply Usable Area */
4139 dissect_query_reply_usable_area(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4145 static int * const byte1
[] = {
4146 &hf_tn3270_ua_reserved1
,
4147 &hf_tn3270_ua_page_printer
,
4148 &hf_tn3270_ua_reserved2
,
4149 &hf_tn3270_ua_hard_copy
,
4150 &hf_tn3270_ua_addressing
,
4154 static int * const byte2
[] = {
4155 &hf_tn3270_ua_variable_cells
,
4156 &hf_tn3270_ua_characters
,
4157 &hf_tn3270_ua_cell_units
,
4161 static const hf_items fields
[] = {
4162 { &hf_tn3270_usable_area_flags1
, &ett_tn3270_usable_area_flags1
, 1, byte1
, 0 },
4163 { &hf_tn3270_usable_area_flags2
, &ett_tn3270_usable_area_flags1
, 1, byte2
, 0 },
4164 { &hf_tn3270_ua_width_cells_pels
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
4165 { &hf_tn3270_ua_height_cells_pels
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
4166 { &hf_tn3270_ua_uom_cells_pels
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4167 { &hf_tn3270_ua_xr
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
4168 { &hf_tn3270_ua_yr
, NULL
, 4, NULL
, ENC_BIG_ENDIAN
},
4169 { &hf_tn3270_ua_aw
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4170 { &hf_tn3270_ua_ah
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4171 { &hf_tn3270_ua_buffsz
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
4172 { NULL
, NULL
, 0, NULL
, 0 }
4175 static const hf_items fields2
[] = {
4176 { &hf_tn3270_ua_xmin
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4177 { &hf_tn3270_ua_ymin
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4178 { &hf_tn3270_ua_xmax
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4179 { &hf_tn3270_ua_ymax
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
4180 { NULL
, NULL
, 0, NULL
, 0 }
4183 vcp
= tvb_get_uint8(tvb
, offset
+1);
4185 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4188 if ((vcp
& QR_UA_VARIABLE_CELLS
) != 0) {
4189 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4193 /*TODO: self defining parms */
4194 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
4196 return (offset
- start
);
4199 /* 6.52 - Query Reply 3270 IPDS */
4201 dissect_query_reply_3270_ipds(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4206 static const hf_items fields
[] = {
4207 { &hf_tn3270_resbytes
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
4208 { &hf_tn3270_3270_tranlim
, NULL
, 2, NULL
, ENC_BIG_ENDIAN
},
4209 { NULL
, NULL
, 0, NULL
, 0 }
4212 offset
+= tn3270_add_hf_items(tn3270_tree
, tvb
, offset
,
4214 offset
+= dissect_unknown_data(tn3270_tree
, tvb
, offset
, start
, sf_body_length
);
4216 return (offset
- start
);
4219 /* sf_body_length is the total length of the structured field including the sf_len and sf_id fields */
4220 /* call only with valid sf_id */
4222 process_inbound_structured_field(proto_tree
*sf_tree
, tvbuff_t
*tvb
, int offset
,
4223 tn3270_conv_info_t
*tn3270_info
, unsigned sf_id
, int sf_body_length
)
4225 int start
= offset
; /* start of structured field param(s) */
4228 case SF_IB_EXCEPTION_OR_STATUS
:
4229 offset
+= dissect_exception_or_status(sf_tree
, tvb
, offset
, sf_body_length
);
4231 case SF_IB_INBOUND_TEXT_HEADER
:
4232 offset
+= dissect_inbound_text_header(sf_tree
, tvb
, offset
, sf_body_length
);
4234 case SF_IB_INBOUND_3270DS
:
4235 offset
+= dissect_inbound_3270ds(sf_tree
, tvb
, offset
, tn3270_info
, sf_body_length
);
4237 case SF_IB_RECOVERY_DATA
:
4238 offset
+= dissect_recovery_data(sf_tree
, tvb
, offset
, sf_body_length
);
4240 case SF_IB_TYPE_1_TEXT_INBOUND
:
4241 offset
+= dissect_type_1_text(sf_tree
, tvb
, offset
, sf_body_length
);
4243 case SF_IB_QUERY_REPLY_ALPHANUMERIC_PARTITIONS
:
4244 offset
+= dissect_query_reply_alphanumeric(sf_tree
, tvb
, offset
, sf_body_length
);
4246 case SF_IB_QUERY_REPLY_AUXILIARY_DEVICE
:
4247 case SF_IB_QUERY_REPLY_BEGIN_OR_END_OF_FILE
:
4248 offset
+= dissect_query_reply_resbytes(sf_tree
, tvb
, offset
, sf_body_length
);
4250 case SF_IB_QUERY_REPLY_CHARACTER_SETS
:
4251 offset
+= dissect_query_reply_character_sets(sf_tree
, tvb
, offset
, sf_body_length
);
4253 case SF_IB_QUERY_REPLY_COLOR
:
4254 offset
+= dissect_query_reply_color(sf_tree
, tvb
, offset
, sf_body_length
);
4256 case SF_IB_QUERY_REPLY_COOPERATIVE_PROCESSING_REQUESTOR
:
4257 offset
+= dissect_query_reply_cooperative(sf_tree
, tvb
, offset
, sf_body_length
);
4259 case SF_IB_QUERY_REPLY_DATA_CHAINING
:
4260 offset
+= dissect_query_reply_data_chaining(sf_tree
, tvb
, offset
, sf_body_length
);
4262 case SF_IB_QUERY_REPLY_DATA_STREAMS
:
4263 offset
+= dissect_query_reply_data_streams(sf_tree
, tvb
, offset
, sf_body_length
);
4265 case SF_IB_QUERY_REPLY_DBCS_ASIA
:
4266 offset
+= dissect_query_reply_dbcs_asia(sf_tree
, tvb
, offset
, sf_body_length
);
4268 case SF_IB_QUERY_REPLY_DEVICE_CHARACTERISTICS
:
4269 /*TODO: implement this beast */
4270 offset
+= dissect_query_reply_device_characteristics(sf_tree
, tvb
, offset
, sf_body_length
);
4272 case SF_IB_QUERY_REPLY_SUMMARY
:
4273 offset
+= dissect_query_reply_summary(sf_tree
, tvb
, offset
, sf_body_length
);
4275 case SF_IB_QUERY_REPLY_USABLE_AREA
:
4276 offset
+= dissect_query_reply_usable_area(sf_tree
, tvb
, offset
, sf_body_length
);
4278 case SF_IB_QUERY_REPLY_HIGHLIGHTING
:
4279 offset
+= dissect_query_reply_highlighting(sf_tree
, tvb
, offset
, sf_body_length
);
4281 case SF_IB_QUERY_REPLY_REPLY_MODES
:
4282 offset
+= dissect_query_reply_modes(sf_tree
, tvb
, offset
, sf_body_length
);
4284 case SF_IB_QUERY_REPLY_DISTRIBUTED_DATA_MANAGEMENT
:
4285 offset
+= dissect_query_reply_distributed_data_management(sf_tree
, tvb
, offset
, sf_body_length
);
4287 case SF_IB_QUERY_REPLY_RPQ_NAMES
:
4288 offset
+= dissect_query_reply_rpq_names(sf_tree
, tvb
, offset
, sf_body_length
);
4290 case SF_IB_QUERY_REPLY_IMPLICIT_PARTITION
:
4291 offset
+= dissect_query_reply_implicit_partitions(sf_tree
, tvb
, offset
, sf_body_length
);
4293 case SF_IB_QUERY_REPLY_OEM_AUXILIARY_DEVICE
:
4294 offset
+= dissect_query_reply_oem_auxiliary_device(sf_tree
, tvb
, offset
, sf_body_length
);
4296 case SF_IB_QUERY_REPLY_DOCUMENT_INTERCHANGE_ARCHITECTURE
:
4297 offset
+= dissect_query_reply_document_interchange_architecture(sf_tree
, tvb
, offset
, sf_body_length
);
4299 case SF_IB_QUERY_REPLY_EXTENDED_DRAWING_ROUTINE
:
4300 offset
+= dissect_query_reply_extended_drawing_routine(sf_tree
, tvb
, offset
, sf_body_length
);
4302 case SF_IB_QUERY_REPLY_FIELD_OUTLINING
:
4303 offset
+= dissect_query_reply_field_outlining(sf_tree
, tvb
, offset
, sf_body_length
);
4305 case SF_IB_QUERY_REPLY_FIELD_VALIDATION
:
4306 offset
+= dissect_3270_field_validation(sf_tree
, tvb
, offset
);
4308 case SF_IB_QUERY_REPLY_FORMAT_STORAGE_AUXILIARY_DEVICE
:
4309 offset
+= dissect_query_reply_format_storage_aux_device(sf_tree
, tvb
, offset
, sf_body_length
);
4311 case SF_IB_QUERY_REPLY_GRAPHIC_COLOR
:
4312 case SF_IB_QUERY_REPLY_GRAPHIC_SYMBOL_SETS
:
4313 case SF_IB_QUERY_REPLY_IMAGE
:
4314 case SF_IB_QUERY_REPLY_LINE_TYPE
:
4315 case SF_IB_QUERY_REPLY_PROCEDURE
:
4316 case SF_IB_QUERY_REPLY_SEGMENT
:
4317 /* Not an error - just has a data field like 'extended drawing'*/
4318 offset
+= dissect_query_reply_extended_drawing_routine(sf_tree
, tvb
, offset
, sf_body_length
);
4320 case SF_IB_QUERY_REPLY_IBM_AUXILIARY_DEVICE
:
4321 offset
+= dissect_query_reply_ibm_aux_device(sf_tree
, tvb
, offset
, sf_body_length
);
4323 case SF_IB_QUERY_REPLY_IOCA_AUXILIARY_DEVICE
:
4324 offset
+= dissect_query_reply_ioca_aux_device(sf_tree
, tvb
, offset
, sf_body_length
);
4326 case SF_IB_QUERY_REPLY_MSR_CONTROL
:
4327 offset
+= dissect_query_reply_msr_control(sf_tree
, tvb
, offset
, sf_body_length
);
4329 case SF_IB_QUERY_REPLY_FORMAT_PRESENTATION
:
4330 case SF_IB_QUERY_REPLY_NULL
:
4331 case SF_IB_QUERY_REPLY_PORT
:
4332 /* This field is always empty */
4334 case SF_IB_QUERY_REPLY_PAPER_FEED_TECHNIQUES
:
4335 offset
+= dissect_query_reply_paper_feed_techniques(sf_tree
, tvb
, offset
, sf_body_length
);
4337 case SF_IB_QUERY_REPLY_PARTITION_CHARACTERISTICS
:
4338 offset
+= dissect_query_reply_partition_characteristics(sf_tree
, tvb
, offset
, sf_body_length
);
4340 case SF_IB_QUERY_REPLY_PRODUCT_DEFINED_DATA_STREAM
:
4341 offset
+= dissect_query_reply_product_defined_data_stream(sf_tree
, tvb
, offset
, sf_body_length
);
4343 case SF_IB_QUERY_REPLY_SAVE_OR_RESTORE_FORMAT
:
4344 offset
+= dissect_query_reply_save_or_restore_format(sf_tree
, tvb
, offset
, sf_body_length
);
4346 case SF_IB_QUERY_REPLY_SETTABLE_PRINTER_CHARACTERISTICS
:
4347 offset
+= dissect_query_reply_settable_printer_characteristics(sf_tree
, tvb
, offset
, sf_body_length
);
4349 case SF_IB_QUERY_REPLY_STORAGE_POOLS
:
4350 offset
+= dissect_query_reply_storage_pools(sf_tree
, tvb
, offset
, sf_body_length
);
4352 case SF_IB_QUERY_REPLY_TEXT_PARTITIONS
:
4353 offset
+= dissect_query_reply_text_partitions(sf_tree
, tvb
, offset
, sf_body_length
);
4355 case SF_IB_QUERY_REPLY_TRANSPARENCY
:
4356 offset
+= dissect_query_reply_transparency(sf_tree
, tvb
, offset
, sf_body_length
);
4358 case SF_IB_QUERY_REPLY_3270_IPDS
:
4359 offset
+= dissect_query_reply_3270_ipds(sf_tree
, tvb
, offset
, sf_body_length
);
4362 DISSECTOR_ASSERT_NOT_REACHED();
4366 return (offset
- start
);
4370 /* sf_body_length is the total length of the structured field including the sf_len and sf_id fields */
4371 /* call only with valid sf_id */
4373 process_outbound_structured_field(proto_tree
*sf_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
,
4374 tn3270_conv_info_t
*tn3270_info
, unsigned sf_id
, int sf_body_length
)
4376 int start
= offset
; /* start of structured field param(s) */
4379 case SF_OB_READ_PARTITION
:
4380 offset
+= dissect_read_partition(sf_tree
, tvb
, offset
, sf_body_length
);
4382 case SF_OB_ACTIVATE_PARTITION
:
4383 case SF_OB_DESTROY_PARTITION
:
4384 case SF_OB_RESET_PARTITION
:
4385 proto_tree_add_item(sf_tree
,
4386 hf_tn3270_partition_id
,
4392 case SF_OB_CREATE_PARTITION
:
4393 offset
+= dissect_create_partition(sf_tree
, tvb
, offset
, sf_body_length
);
4395 case SF_OB_ERASE_OR_RESET
:
4396 /* Bit 0: 0= Use default screen size; 1= use alternate screen size */
4397 /* XXX: Not really valid: See comment under dissect_outbound_stream(). */
4398 if ((tvb_get_uint8(tvb
, offset
) & 0x80) != 0) {
4399 tn3270_info
->rows
= tn3270_info
->altrows
;
4400 tn3270_info
->cols
= tn3270_info
->altcols
;
4403 tn3270_info
->rows
= 24;
4404 tn3270_info
->cols
= 80;
4406 proto_tree_add_bits_item(sf_tree
,
4407 hf_tn3270_erase_flags
,
4413 case SF_OB_LOAD_PROGRAMMED_SYMBOLS
:
4414 offset
+= dissect_load_programmed_symbols(sf_tree
, tvb
, offset
, sf_body_length
);
4416 case SF_OB_OUTBOUND_3270DS
:
4417 offset
+= dissect_outbound_3270ds(sf_tree
, pinfo
, tvb
, offset
, tn3270_info
, sf_body_length
);
4419 case SF_OB_PRESENT_ABSOLUTE_FORMAT
:
4420 offset
+= dissect_present_absolute_format(sf_tree
, tvb
, offset
, sf_body_length
);
4422 case SF_OB_PRESENT_RELATIVE_FORMAT
:
4423 offset
+= dissect_present_relative_format(sf_tree
, tvb
, offset
, sf_body_length
);
4425 case SF_OB_SCS_DATA
:
4426 proto_tree_add_item(sf_tree
,
4427 hf_tn3270_partition_id
,
4432 proto_tree_add_item(sf_tree
,
4435 (sf_body_length
- (offset
- start
)),
4437 offset
+= (sf_body_length
- (offset
- start
));
4439 case SF_OB_SET_REPLY_MODE
:
4440 offset
+= dissect_set_reply_mode(sf_tree
, tvb
, offset
, sf_body_length
);
4442 case SF_OB_SELECT_FORMAT_GROUP
:
4443 proto_tree_add_item(sf_tree
,
4444 hf_tn3270_partition_id
,
4449 proto_tree_add_item(sf_tree
,
4450 hf_tn3270_format_group
,
4452 (sf_body_length
- (offset
- start
)),
4454 offset
+= (sf_body_length
- (offset
- start
));
4456 case SF_OB_SET_WINDOW_ORIGIN
:
4457 proto_tree_add_item(sf_tree
,
4458 hf_tn3270_partition_id
,
4463 proto_tree_add_item(sf_tree
,
4464 hf_tn3270_partition_rw
,
4469 proto_tree_add_item(sf_tree
,
4470 hf_tn3270_partition_cw
,
4476 case SF_OB_BEGIN_OR_END_OF_FILE
:
4477 proto_tree_add_item(sf_tree
,
4478 hf_tn3270_partition_id
,
4483 /*TODO: use bits_text */
4484 proto_tree_add_bits_item(sf_tree
,
4485 hf_tn3270_begin_end_flags1
,
4490 proto_tree_add_item(sf_tree
,
4491 hf_tn3270_begin_end_flags2
,
4497 case SF_OB_LOAD_COLOR_TABLE
:
4498 /* Refer to related graphics docs !*/
4499 proto_tree_add_item(sf_tree
,
4500 hf_tn3270_load_color_command
,
4504 offset
+= sf_body_length
;
4506 case SF_OB_LOAD_FORMAT_STORAGE
:
4507 offset
+= dissect_load_format_storage(sf_tree
, tvb
, offset
, sf_body_length
);
4509 case SF_OB_LOAD_LINE_TYPE
:
4510 /* Refer to related graphics docs !*/
4511 proto_tree_add_item(sf_tree
,
4512 hf_tn3270_load_line_type_command
,
4516 offset
+= sf_body_length
;
4518 case SF_OB_MODIFY_PARTITION
:
4519 offset
+= dissect_modify_partition(sf_tree
, tvb
, offset
, sf_body_length
);
4521 case SF_OB_OUTBOUND_TEXT_HEADER
:
4522 offset
+= dissect_outbound_text_header(sf_tree
, tvb
, offset
, sf_body_length
);
4524 case SF_OB_REQUEST_RECOVERY_DATA
:
4525 proto_tree_add_item(sf_tree
,
4533 offset
+= dissect_restart(sf_tree
, tvb
, offset
, sf_body_length
);
4535 case SF_OB_SELECT_COLOR_TABLE
:
4536 proto_tree_add_item(sf_tree
,
4537 hf_tn3270_color_command
,
4543 case SF_OB_SET_CHECKPOINT_INTERVAL
:
4544 proto_tree_add_item(sf_tree
,
4550 proto_tree_add_item(sf_tree
,
4557 case SF_OB_SET_MSR_CONTROL
:
4558 offset
+= dissect_set_msr_control(sf_tree
, tvb
, offset
, sf_body_length
);
4560 case SF_OB_SET_PARTITION_CHARACTERISTICS
:
4561 offset
+= dissect_set_partition_characteristics(sf_tree
, tvb
, offset
, sf_body_length
);
4563 case SF_OB_SET_PRINTER_CHARACTERISTICS
:
4564 offset
+= dissect_set_printer_characteristics(sf_tree
, tvb
, offset
, sf_body_length
);
4566 case SF_OB_TYPE_1_TEXT_OUTBOUND
:
4567 offset
+= dissect_type_1_text(sf_tree
, tvb
, offset
, sf_body_length
);
4570 DISSECTOR_ASSERT_NOT_REACHED();
4574 return (offset
- start
);
4577 /* sf_body_length is the total length of the structured field including the sf_len and sf_id fields */
4578 /* call only with valid sf_id */
4580 process_outbound_inbound_structured_field(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4581 tn3270_conv_info_t
*tn3270_info _U_
, unsigned sf_id
, int sf_body_length
)
4586 case SF_OB_IB_DATA_CHAIN
:
4587 offset
+= dissect_data_chain(tn3270_tree
, tvb
, offset
, sf_body_length
);
4589 case SF_OB_IB_DESTINATION_OR_ORIGIN
:
4590 proto_tree_add_item(tn3270_tree
,
4591 hf_tn3270_destination_or_origin_flags_input_control
,
4596 proto_tree_add_item(tn3270_tree
,
4602 proto_tree_add_item(tn3270_tree
,
4603 hf_tn3270_destination_or_origin_doid
,
4609 case SF_OB_IB_OBJECT_DATA
:
4610 case SF_OB_IB_OBJECT_CONTROL
:
4611 case SF_OB_IB_OBJECT_PICTURE
:
4612 case SF_OB_IB_OEM_DATA
: /* FIXME: Not really but same layout */
4613 offset
+= dissect_object_control(tn3270_tree
, tvb
, offset
, sf_body_length
);
4615 case SF_OB_IB_SAVE_OR_RESTORE_FORMAT
:
4616 offset
+= dissect_save_or_restore_format(tn3270_tree
, tvb
, offset
, sf_body_length
);
4618 case SF_OB_IB_SELECT_IPDS_MODE
:
4619 proto_tree_add_item(tn3270_tree
,
4627 DISSECTOR_ASSERT_NOT_REACHED();
4631 return (offset
- start
);
4635 display_sf_hdr(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
,
4636 int sf_length
, unsigned sf_id
, unsigned sf_id_len
, const char *sf_id_str
)
4638 proto_tree
*sf_tree
;
4640 sf_tree
= proto_tree_add_subtree_format(tn3270_tree
, tvb
, offset
, sf_length
,
4641 ett_sf
, NULL
, "Structured Field: %s", sf_id_str
);
4643 proto_tree_add_item(sf_tree
,
4644 hf_tn3270_sf_length
,
4649 proto_tree_add_uint_format_value(sf_tree
,
4650 (sf_id_len
== 1) ? hf_tn3270_sf_single_byte_id
: hf_tn3270_sf_double_byte_id
,
4651 tvb
, offset
+2, sf_id_len
,
4652 sf_id
, "%s (0x%0*x)", sf_id_str
, sf_id_len
*2, sf_id
);
4658 dissect_structured_fields(proto_tree
*tn3270_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
,
4659 tn3270_conv_info_t
*tn3270_info
, bool direction_inbound
)
4661 proto_tree
*sf_tree
;
4666 const char *sf_id_str
;
4670 while (tvb_reported_length_remaining(tvb
, offset
) >= 2) {
4672 /* Handle NULL bytes until we find a length value */
4673 /* XXX: An earlier version of the code for structured field */
4674 /* processing did this check only for inbound structured */
4675 /* fields. Should the same be done in this code which */
4676 /* combines handling for both inbound and outbound */
4677 /* structured fields ? */
4678 if ((sf_length
= tvb_get_ntohs(tvb
, offset
)) == 0) {
4679 proto_tree_add_item(tn3270_tree
,
4688 sf_id
= tvb_get_uint8(tvb
, offset
+2);
4690 if ((sf_id
== 0x0F) ||
4693 sf_id
= (sf_id
<< 8) + tvb_get_uint8(tvb
, offset
+3);
4697 sf_id_str
= try_val_to_str(sf_id
, direction_inbound
?
4698 vals_inbound_structured_fields
: vals_outbound_structured_fields
);
4699 if (sf_id_str
!= NULL
) {
4700 sf_tree
= display_sf_hdr(tn3270_tree
, tvb
, offset
,
4701 sf_length
, sf_id
, sf_id_len
, sf_id_str
);
4702 offset
+= (sf_id_len
+ 2);
4703 if (direction_inbound
) {
4704 offset
+= process_inbound_structured_field(sf_tree
, tvb
, offset
, tn3270_info
, sf_id
, sf_length
-2-sf_id_len
);
4707 offset
+= process_outbound_structured_field(sf_tree
, pinfo
, tvb
, offset
, tn3270_info
, sf_id
, sf_length
-2-sf_id_len
);
4712 /* Not found above: See if an "outbound-inbound" field */
4713 sf_id_str
= try_val_to_str(sf_id
, vals_outbound_inbound_structured_fields
);
4714 if (sf_id_str
!= NULL
) {
4715 sf_tree
= display_sf_hdr(tn3270_tree
, tvb
, offset
,
4716 sf_length
, sf_id
, sf_id_len
, sf_id_str
);
4717 offset
+= (sf_id_len
+ 2);
4718 offset
+= process_outbound_inbound_structured_field(sf_tree
, tvb
, offset
, tn3270_info
, sf_id
, sf_length
-2-sf_id_len
);
4723 sf_id_str
= wmem_strdup_printf(pinfo
->pool
, "Unknown [%0*x]", sf_id_len
*2, sf_id
);
4724 display_sf_hdr(tn3270_tree
, tvb
, offset
, sf_length
,
4725 sf_length
, sf_id_len
, sf_id_str
);
4726 offset
+= sf_length
;
4729 return (offset
- start
);
4733 /* Start: Handle WCC, Orders and Data */
4736 dissect_stop_address(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
4741 proto_tree_add_item(tn3270_tree
,
4742 hf_tn3270_stop_address
,
4747 is_oc_ge
= tvb_get_uint8(tvb
, offset
);
4748 if (is_oc_ge
!= OC_GE
) {
4749 proto_tree_add_item(tn3270_tree
,
4750 hf_tn3270_character_code
,
4757 return (offset
- start
);
4761 * From section "4.3.3 Set Buffer Address (SBA)" of the IBM document
4768 * XXX - what about 16-bit addressing?
4770 #define SBA_ADDRESS_FORMAT_MASK 0xC000
4771 #define SBA_ADDRESS_MASK_SHIFT 14
4772 #define SBA_ADDRESS_FORMAT(address) (((address) & SBA_ADDRESS_FORMAT_MASK) >> SBA_ADDRESS_MASK_SHIFT)
4774 #define SBA_ADDRESS_VALUE_MASK 0x3FFF
4775 #define SBA_ADDRESS_VALUE(address) ((address) & SBA_ADDRESS_VALUE_MASK)
4777 #define SBA_14_BIT_BINARY 0x0
4778 #define SBA_12_BIT_CODED_1 0x1
4779 #define SBA_RESERVED 0x2
4780 #define SBA_12_BIT_CODED_2 0x3
4783 dissect_buffer_address(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
, int hf
, tn3270_conv_info_t
*tn3270_info
)
4786 uint16_t buffer_addr
;
4787 uint16_t address_format
, address_value
;
4789 uint8_t rowsx
= tn3270_info
->rows
;
4790 uint8_t colsx
= tn3270_info
->cols
;
4792 buffer_addr
= tvb_get_ntohs(tvb
, offset
);
4793 address_format
= SBA_ADDRESS_FORMAT(buffer_addr
);
4794 address_value
= SBA_ADDRESS_VALUE(buffer_addr
);
4797 * XXX - put the address format and address value into the protocol
4798 * tree as bitfields under these items?
4800 switch (address_format
) {
4802 case SBA_14_BIT_BINARY
:
4803 proto_tree_add_uint_format_value(tn3270_tree
,
4807 "14-bit address, %u = row %u, column %u [assuming a %ux%u display] (0x%04x)",
4809 (address_value
/ colsx
) + 1,
4810 (address_value
% colsx
) + 1,
4815 case SBA_12_BIT_CODED_1
:
4816 case SBA_12_BIT_CODED_2
:
4818 * This is a wacky encoding. At least as I read the IBM document
4819 * in question, the lower 6 bits of the first byte of the SBA
4820 * address, and the lower 6 bits of the second byte of the SBA
4821 * address, are combined into a 12-bit binary address. The upper
4822 * 2 bits of the first byte are the address format; the upper 2
4823 * bits of the second byte are ignored.
4825 b1
= (address_value
>> 8) & 0x3F;
4826 b2
= (address_value
>> 0) & 0x3F;
4827 address_value
= (b1
<< 6) | b2
;
4828 proto_tree_add_uint_format_value(tn3270_tree
,
4832 "12-bit address, %u = row %u, column %u [assuming a %ux%u display] (0x%04x)",
4834 (address_value
/ colsx
) + 1,
4835 (address_value
% colsx
) + 1,
4841 proto_tree_add_uint_format_value(tn3270_tree
,
4845 "Reserved (0x%04x)",
4851 return (offset
- start
);
4855 dissect_field_attribute_pair(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
4860 attribute_type
= tvb_get_uint8(tvb
, offset
);
4861 proto_tree_add_item(tn3270_tree
,
4862 hf_tn3270_attribute_type
,
4867 switch (attribute_type
) {
4868 case AT_ALL_CHARACTER_ATTRIBUTES
:
4869 proto_tree_add_item(tn3270_tree
,
4870 hf_tn3270_all_character_attributes
,
4876 case AT_T3270_FIELD_ATTRIBUTE
:
4877 offset
+= dissect_3270_field_attribute(tn3270_tree
, tvb
, offset
);
4879 case AT_EXTENDED_HIGHLIGHTING
:
4880 proto_tree_add_item(tn3270_tree
,
4881 hf_tn3270_extended_highlighting
,
4887 case AT_FOREGROUND_COLOR
:
4888 case AT_BACKGROUND_COLOR
:
4889 proto_tree_add_item(tn3270_tree
,
4896 case AT_CHARACTER_SET
:
4897 proto_tree_add_item(tn3270_tree
,
4898 hf_tn3270_character_set
,
4904 case AT_FIELD_OUTLINING
:
4905 proto_tree_add_item(tn3270_tree
,
4906 hf_tn3270_field_outlining
,
4912 case AT_TRANSPARENCY
:
4913 proto_tree_add_item(tn3270_tree
,
4914 hf_tn3270_transparency
,
4920 case AT_FIELD_VALIDATION
:
4921 offset
+= dissect_3270_field_validation(tn3270_tree
, tvb
, offset
);
4925 return (offset
- start
);
4929 dissect_field_attribute_pairs(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
4935 no_of_pairs
= tvb_get_uint8(tvb
, offset
);
4936 proto_tree_add_item(tn3270_tree
,
4937 hf_tn3270_number_of_attributes
,
4943 for (i
=0; i
< no_of_pairs
; i
++) {
4944 offset
+= dissect_field_attribute_pair(tn3270_tree
, tvb
, offset
);
4947 return (offset
- start
);
4951 dissect_orders_and_data(proto_tree
*tn3270_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
, tn3270_conv_info_t
*tn3270_info
)
4959 /* XXX: '0' is treated as data; See comment under add_data_until_next_order_code() */
4960 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
4961 order_code
= tvb_get_uint8(tvb
, offset
);
4962 if ((order_code
> 0) && (order_code
<= OC_MAX
)) { /* XXX: also 0xFF ?? */
4963 item
= proto_tree_add_item(tn3270_tree
,
4964 hf_tn3270_order_code
,
4970 switch (order_code
) {
4972 offset
+= dissect_3270_field_attribute(tn3270_tree
, tvb
, offset
);
4976 offset
+= dissect_field_attribute_pairs(tn3270_tree
, tvb
, offset
);
4979 offset
+= dissect_field_attribute_pair(tn3270_tree
, tvb
, offset
);
4983 offset
+= dissect_stop_address(tn3270_tree
, tvb
, offset
);
4986 proto_tree_add_item(tn3270_tree
,
4987 hf_tn3270_character_code
,
4994 offset
+= dissect_buffer_address(tn3270_tree
, tvb
, offset
, hf_tn3270_buffer_address
, tn3270_info
);
4996 case OC_PT
: /* XXX: This case was previously commented out; I don't know why */
5000 expert_add_info(pinfo
, item
, &ei_tn3270_order_code
);
5005 offset
+= add_data_until_next_order_code(tn3270_tree
, tvb
, offset
);
5009 return (offset
- start
);
5012 /* End: Handle WCC, Orders and Data */
5016 dissect_tn3270e_header(proto_tree
*tn3270_tree
, tvbuff_t
*tvb
, int offset
)
5019 proto_tree
*tn3270e_hdr_tree
;
5023 static const hf_items fields
[] = {
5024 { &hf_tn3270_tn3270e_data_type
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
5025 { &hf_tn3270_tn3270e_request_flag
, NULL
, 1, NULL
, ENC_BIG_ENDIAN
},
5026 { NULL
, NULL
, 0, NULL
, 0 }
5029 data_type
= tvb_get_uint8(tvb
, offset
);
5031 tn3270e_hdr_tree
= proto_tree_add_subtree_format(tn3270_tree
, tvb
, offset
, -1,
5032 ett_tn3270e_hdr
, &pi
, "TN3270E Header (Data Type: %s)",
5033 val_to_str_const(data_type
, vals_tn3270_header_data_types
, "Unknown"));
5035 offset
+= tn3270_add_hf_items(tn3270e_hdr_tree
, tvb
, offset
,
5038 case TN3270E_3270_DATA
:
5039 case TN3270E_SCS_DATA
:
5040 proto_tree_add_item(tn3270e_hdr_tree
, hf_tn3270_tn3270e_response_flag_3270_SCS
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5042 case TN3270E_RESPONSE
:
5043 proto_tree_add_item(tn3270e_hdr_tree
, hf_tn3270_tn3270e_response_flag_response
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5045 case TN3270E_BIND_IMAGE
:
5046 case TN3270E_NVT_DATA
:
5047 case TN3270E_REQUEST
:
5048 case TN3270E_SSCP_LU_DATA
:
5049 case TN3270E_UNBIND
:
5051 proto_tree_add_item(tn3270e_hdr_tree
, hf_tn3270_tn3270e_response_flag_unused
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5056 proto_tree_add_item(tn3270e_hdr_tree
, hf_tn3270_tn3270e_seq_number
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5059 switch (data_type
) {
5060 case TN3270E_BIND_IMAGE
:
5061 case TN3270E_NVT_DATA
:
5062 case TN3270E_REQUEST
:
5063 case TN3270E_RESPONSE
:
5064 case TN3270E_SCS_DATA
:
5065 case TN3270E_SSCP_LU_DATA
:
5066 case TN3270E_UNBIND
:
5067 proto_tree_add_item(tn3270e_hdr_tree
, hf_tn3270_tn3270e_header_data
, tvb
, offset
, -1, ENC_EBCDIC
);
5068 offset
+= tvb_reported_length_remaining(tvb
, offset
);
5074 proto_item_set_len(pi
, offset
- start
);
5076 return (offset
- start
);
5079 /* Detect and Handle Direction of Stream */
5081 dissect_outbound_stream(proto_tree
*tn3270_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
, tn3270_conv_info_t
*tn3270_info
)
5088 command_code
= tvb_get_uint8(tvb
, offset
);
5090 /* XXX: Storing rows/cols each time they change is not valid */
5091 /* since packets can (will be) randomly selected for dissection */
5092 /* after the initial dissection pass. In actuality screen size */
5093 /* "state" needs to be associated in some manner with each */
5094 /* frame of a conversation. */
5095 switch (command_code
) {
5098 tn3270_info
->rows
= 24;
5099 tn3270_info
->cols
= 80;
5103 tn3270_info
->rows
= tn3270_info
->altrows
;
5104 tn3270_info
->cols
= tn3270_info
->altcols
;
5110 item
= proto_tree_add_item(tn3270_tree
,
5111 hf_tn3270_command_code
,
5117 switch (command_code
) {
5127 offset
+= dissect_wcc(tn3270_tree
, tvb
, offset
);
5128 offset
+= dissect_orders_and_data(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
);
5132 offset
+= dissect_structured_fields(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
, false);
5142 expert_add_info(pinfo
, item
, &ei_tn3270_command_code
);
5146 return (offset
- start
);
5150 /* INBOUND DATA STREAM (DISPLAY -> MAINFRAME PROGRAM) */
5151 /* Dissect tvb as inbound */
5153 dissect_inbound_stream(proto_tree
*tn3270_tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
, tn3270_conv_info_t
*tn3270_info
)
5160 aid
= tvb_get_uint8(tvb
, offset
);
5161 item
= proto_tree_add_item(tn3270_tree
,
5168 case AID_STRUCTURED_FIELD
:
5169 offset
+= dissect_structured_fields(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
, true);
5172 case AID_PA2_KEY_CNCL
:
5175 /* Certain AID bytes need not be followed by anything */
5176 /* XXX: Is this the correct/complete set of AID bytes for this case ? */
5177 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
5180 case AID_READ_PARTITION_AID
:
5181 case AID_NO_AID_GENERATED
:
5182 case AID_NO_AID_GENERATED_PRINTER_ONLY
:
5183 case AID_TRIGGER_ACTION
:
5184 case AID_TEST_REQ_AND_SYS_REQ
:
5209 case AID_CLEAR_PARTITION_KEY
:
5211 case AID_SELECTOR_PEN_ATTENTION
:
5212 case AID_OPERATOR_ID_READER
:
5213 case AID_MAG_READER_NUMBER
:
5214 offset
+= dissect_buffer_address(tn3270_tree
, tvb
, offset
, hf_tn3270_cursor_address
, tn3270_info
);
5215 offset
+= dissect_orders_and_data(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
);
5218 expert_add_info(pinfo
, item
, &ei_tn3270_aid
);
5223 return (offset
- start
);
5228 dissect_tn3270(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
5230 proto_tree
*tn3270_tree
;
5233 conversation_t
*conversation
;
5234 tn3270_conv_info_t
*tn3270_info
= NULL
;
5236 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "TN3270");
5238 pinfo
->fd
->encoding
= PACKET_CHAR_ENC_CHAR_EBCDIC
;
5240 /* Do we have a conversation for this connection? */
5241 conversation
= find_conversation_pinfo(pinfo
, 0);
5242 if (conversation
!= NULL
) {
5243 /* Do we already have a type and mechanism? */
5244 tn3270_info
= (tn3270_conv_info_t
*)conversation_get_proto_data(conversation
, proto_tn3270
);
5247 if (tn3270_info
== NULL
)
5250 pi
= proto_tree_add_item(tree
, proto_tn3270
, tvb
, offset
, -1, ENC_NA
);
5251 tn3270_tree
= proto_item_add_subtree(pi
, ett_tn3270
);
5252 col_clear(pinfo
->cinfo
, COL_INFO
);
5254 if (tn3270_info
->extended
) {
5255 offset
+= dissect_tn3270e_header(tn3270_tree
, tvb
, offset
);
5258 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
5261 if (pinfo
->srcport
== tn3270_info
->outbound_port
) {
5262 col_set_str(pinfo
->cinfo
, COL_INFO
, "TN3270 Data from Mainframe");
5265 col_set_str(pinfo
->cinfo
, COL_INFO
, "TN3270 Data to Mainframe");
5269 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
5270 if (pinfo
->srcport
== tn3270_info
->outbound_port
) {
5271 offset
+= dissect_outbound_stream(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
);
5274 offset
+= dissect_inbound_stream(tn3270_tree
, pinfo
, tvb
, offset
, tn3270_info
);
5279 return tvb_captured_length(tvb
);
5283 add_tn3270_conversation(packet_info
*pinfo
, int tn3270e
, int model
)
5285 conversation_t
*conversation
;
5286 tn3270_conv_info_t
*tn3270_info
;
5288 conversation
= find_or_create_conversation(pinfo
);
5291 * Do we already have a type and mechanism?
5293 tn3270_info
= (tn3270_conv_info_t
*)conversation_get_proto_data(conversation
, proto_tn3270
);
5294 if (tn3270_info
== NULL
) {
5295 /* No. Attach that information to the conversation, and add
5296 * it to the list of information structures.
5298 tn3270_info
= wmem_new(wmem_file_scope(), tn3270_conv_info_t
);
5300 tn3270_info
->outbound_port
= pinfo
->destport
;
5302 conversation_add_proto_data(conversation
, proto_tn3270
, tn3270_info
);
5305 /* The maximum rows/cols is tied to the 3270 model number */
5309 tn3270_info
->altrows
= 24;
5310 tn3270_info
->altcols
= 80;
5313 tn3270_info
->altrows
= 32;
5314 tn3270_info
->altcols
= 80;
5317 tn3270_info
->altrows
= 43;
5318 tn3270_info
->altcols
= 80;
5321 tn3270_info
->altrows
= 27;
5322 tn3270_info
->altcols
= 132;
5325 tn3270_info
->rows
= 24;
5326 tn3270_info
->cols
= 80;
5328 tn3270_info
->extended
= tn3270e
;
5333 find_tn3270_conversation(packet_info
*pinfo
)
5335 conversation_t
*conversation
= NULL
;
5336 tn3270_conv_info_t
*tn3270_info
= NULL
;
5339 * Do we have a conversation for this connection?
5341 conversation
= find_conversation_pinfo(pinfo
, 0);
5342 if (conversation
!= NULL
) {
5343 tn3270_info
= (tn3270_conv_info_t
*)conversation_get_proto_data(conversation
, proto_tn3270
);
5344 if (tn3270_info
!= NULL
) {
5346 * Do we already have a type and mechanism?
5355 proto_register_tn3270(void)
5357 static hf_register_info hf
[] = {
5358 { &hf_tn3270_command_code
,
5360 "tn3270.command_code",
5361 FT_UINT8
, BASE_HEX
, VALS(vals_command_codes
), 0x0,
5364 { &hf_tn3270_sf_length
,
5365 { "Structured Field Length",
5367 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5371 /* 3.4 Write Control Characters */
5372 { &hf_tn3270_wcc_nop
,
5375 FT_BOOLEAN
, 8, NULL
, WCC_NOP
,
5378 { &hf_tn3270_wcc_reset
,
5381 FT_BOOLEAN
, 8, NULL
, WCC_RESET
,
5384 { &hf_tn3270_wcc_printer1
,
5386 "tn3270.wcc.printer1",
5387 FT_BOOLEAN
, 8, NULL
, WCC_PRINTER1
,
5390 { &hf_tn3270_wcc_printer2
,
5392 "tn3270.wcc.printer2",
5393 FT_BOOLEAN
, 8, NULL
, WCC_PRINTER2
,
5396 { &hf_tn3270_wcc_start_printer
,
5397 { "WCC Start Printer",
5398 "tn3270.wcc.start_printer",
5399 FT_BOOLEAN
, 8, NULL
, WCC_START_PRINTER
,
5402 { &hf_tn3270_wcc_sound_alarm
,
5403 { "WCC Sound Alarm",
5404 "tn3270.wcc.sound_alarm",
5405 FT_BOOLEAN
, 8, NULL
, WCC_SOUND_ALARM
,
5408 { &hf_tn3270_wcc_keyboard_restore
,
5409 { "WCC Keyboard Restore",
5410 "tn3270.wcc.keyboard_restore",
5411 FT_BOOLEAN
, 8, NULL
, WCC_KEYBOARD_RESTORE
,
5414 { &hf_tn3270_wcc_reset_mdt
,
5416 "tn3270.wcc.reset_mdt",
5417 FT_BOOLEAN
, 8, NULL
, WCC_RESET_MDT
,
5421 /* 8.7 Copy Control Codes (CCC) */
5423 { "Copy Control Code",
5425 FT_UINT8
, BASE_HEX
, NULL
, 0,
5428 { &hf_tn3270_ccc_coding
,
5430 "tn3270.ccc_coding",
5431 FT_UINT8
, BASE_HEX
, NULL
, CCC_GRAPHIC_CONVERT_MASK
,
5434 { &hf_tn3270_ccc_printout
,
5435 { "Printout Format",
5436 "tn3270.ccc_printout",
5437 FT_UINT8
, BASE_HEX
, VALS(ccc_vals_printout_format
), CCC_PRINT_BITS_MASK
,
5440 { &hf_tn3270_ccc_start_print
,
5441 { "The start-print bit",
5442 "tn3270.ccc_start_print",
5443 FT_BOOLEAN
, 8, NULL
, CCC_START_PRINT
,
5446 { &hf_tn3270_ccc_sound_alarm
,
5447 { "The sound-alarm bit",
5448 "tn3270.ccc_sound_alarm",
5449 FT_BOOLEAN
, 8, NULL
, CCC_SOUND_ALARM
,
5452 { &hf_tn3270_ccc_copytype
,
5453 { "Type of Data to be Copied",
5454 "tn3270.ccc_copytype",
5455 FT_UINT8
, BASE_HEX
, VALS(ccc_vals_copytype
), CCC_ATTRIBUTE_BITS_MASK
,
5459 /* 4.4.1 Field Attributes */
5460 { &hf_tn3270_field_attribute
,
5461 { "3270 Field Attribute",
5462 "tn3270.field_attribute",
5463 FT_UINT8
, BASE_HEX
, NULL
, 0,
5466 { &hf_tn3270_fa_graphic_convert
,
5467 { "Graphic Convert",
5468 "tn3270.fa.graphic_convert",
5469 FT_UINT8
, BASE_HEX
, NULL
, FA_GRAPHIC_CONVERT_MASK
,
5472 { &hf_tn3270_fa_protected
,
5474 "tn3270.fa.protected",
5475 FT_BOOLEAN
, 8, NULL
, FA_PROTECTED
,
5478 { &hf_tn3270_fa_numeric
,
5480 "tn3270.fa.numeric",
5481 FT_BOOLEAN
, 8, NULL
, FA_NUMERIC
,
5484 { &hf_tn3270_fa_display
,
5486 "tn3270.fa.display",
5487 FT_UINT8
, BASE_HEX
, VALS(vals_fa_display
), FA_DISPLAY_BITS_MASK
,
5490 { &hf_tn3270_fa_reserved
,
5492 "tn3270.fa.reserved",
5493 FT_BOOLEAN
, 8, NULL
, FA_RESERVED
,
5496 { &hf_tn3270_fa_modified
,
5498 "tn3270.fa.modified",
5499 FT_BOOLEAN
, 8, NULL
, FA_MODIFIED
,
5504 { &hf_tn3270_order_code
,
5506 "tn3270.order_code",
5507 FT_UINT8
, BASE_HEX
, VALS(vals_order_codes
), 0x0,
5510 { &hf_tn3270_character_code
,
5512 "tn3270.character_code",
5513 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5516 { &hf_tn3270_stop_address
,
5518 "tn3270.stop_address",
5519 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5522 { &hf_tn3270_attribute_type
,
5524 "tn3270.attribute_type",
5525 FT_UINT8
, BASE_HEX
, VALS(vals_attribute_types
), 0x0,
5528 { &hf_tn3270_extended_highlighting
,
5529 { "Extended Highlighting",
5530 "tn3270.extended_highlighting",
5531 FT_UINT8
, BASE_HEX
, VALS(vals_at_extended_highlighting
), 0x0,
5537 FT_UINT8
, BASE_HEX
, VALS(vals_at_color_identifications
), 0x0,
5540 { &hf_tn3270_character_set
,
5542 "tn3270.character_set",
5543 FT_UINT8
, BASE_RANGE_STRING
|BASE_HEX
, RVALS(rvals_at_character_set
), 0x0,
5546 { &hf_tn3270_field_outlining
,
5547 { "Field Outlining",
5548 "tn3270.field_outlining",
5549 FT_UINT8
, BASE_HEX
, VALS(vals_at_field_outlining
), 0x0,
5552 { &hf_tn3270_transparency
,
5554 "tn3270.transparency",
5555 FT_UINT8
, BASE_HEX
, VALS(vals_at_transparency
), 0x0,
5559 { &hf_tn3270_field_validation_mandatory_fill
,
5560 { "3270 Field validation_mandatory_fill",
5561 "tn3270.field_validation_mandatory_fill",
5562 FT_BOOLEAN
, 8, TFS(&tn3270_field_validation_mandatory_fill
), AT_FV_MANDATORY_FILL
,
5565 { &hf_tn3270_field_validation_mandatory_entry
,
5566 { "3270 Field validation_mandatory_entry",
5567 "tn3270.field_validation_mandatory_entry",
5568 FT_BOOLEAN
, 8, TFS(&tn3270_field_validation_mandatory_entry
), AT_FV_MANDATORY_ENTRY
,
5571 { &hf_tn3270_field_validation_trigger
,
5572 { "3270 Field validation_trigger",
5573 "tn3270.field_validation_trigger",
5574 FT_BOOLEAN
, 8, TFS(&tn3270_field_validation_trigger
), AT_FV_TRIGGER
,
5578 { &hf_tn3270_all_character_attributes
,
5579 { "all_character_attributes",
5580 "tn3270.all_character_attributes",
5581 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5585 { "Attention Identification",
5587 FT_UINT8
, BASE_HEX
, VALS(vals_attention_identification_bytes
), 0x0,
5591 { &hf_tn3270_buffer_address
,
5593 "tn3270.buffer_address",
5594 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
5598 /* Self Defining Parameters */
5599 { &hf_tn3270_sdp_ln
,
5600 { "Length of this Self-Defining Parameter",
5602 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
5605 { &hf_tn3270_sdp_id
,
5606 { "Self-Defining Parameter ID",
5608 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5611 /* Self Defining Parameters */
5613 /* 5.6 - Begin/End of File */
5614 { &hf_tn3270_begin_end_flags1
,
5615 { "Begin End Flags1",
5616 "tn3270.begin_end_flags1",
5617 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5620 { &hf_tn3270_begin_end_flags2
,
5621 { "Begin End Flags2",
5622 "tn3270.begin_end_flags2",
5623 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5626 /* END - 5.6 - Begin/End of File */
5628 /* 5.7 - Create Partition */
5629 { &hf_tn3270_partition_id
,
5631 "tn3270.partition_id",
5632 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5635 { &hf_tn3270_partition_uom
,
5636 { "The unit of measure and address mode",
5637 "tn3270.partition_uom",
5638 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5641 { &hf_tn3270_partition_flags
,
5643 "tn3270.partition_flags",
5644 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5647 { &hf_tn3270_partition_height
,
5648 { "The height of the presentation space",
5649 "tn3270.partition_height",
5650 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5653 { &hf_tn3270_partition_width
,
5654 { "The width of the presentation space",
5655 "tn3270.partition_width",
5656 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5659 { &hf_tn3270_partition_rv
,
5660 { "The y, or row, origin of the viewport relative to the top edge of the usable area",
5661 "tn3270.partition_rv",
5662 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5665 { &hf_tn3270_partition_cv
,
5666 { "The x, or column, origin of the viewport relative to the left side of the usable area",
5667 "tn3270.partition_cv",
5668 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5671 { &hf_tn3270_partition_hv
,
5672 { "The height of the viewport",
5673 "tn3270.partition_hv",
5674 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5677 { &hf_tn3270_partition_wv
,
5678 { "The width of the viewport",
5679 "tn3270.partition_wv",
5680 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5683 { &hf_tn3270_partition_rw
,
5684 { "The y, or row, origin of the window relative to the top edge of the presentation space",
5685 "tn3270.partition_rw",
5686 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5689 { &hf_tn3270_partition_cw
,
5690 { "The x, or column, origin of the window relative to the left edge of the presentation space",
5691 "tn3270.partition_cw",
5692 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5695 { &hf_tn3270_partition_rs
,
5696 { "The number of units to be scrolled in a vertical multiple scroll",
5697 "tn3270.partition_rs",
5698 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5701 { &hf_tn3270_partition_res
,
5703 "tn3270.partition_res",
5704 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5707 { &hf_tn3270_partition_pw
,
5708 { "The number of points in the horizontal direction in a character cell in this presentation space",
5709 "tn3270.partition_pw",
5710 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5713 { &hf_tn3270_partition_ph
,
5714 { "The number of points in the vertical direction in a character cell in this presentation space",
5715 "tn3270.partition_ph",
5716 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5720 { &hf_tn3270_partition_command
,
5721 { "Partition Command",
5722 "tn3270.partition_command",
5723 FT_UINT8
, BASE_HEX
, VALS(vals_command_codes
), 0x0,
5726 /* End - 5.7 - Create Partition */
5728 /* 5.9 - Erase/Reset */
5729 { &hf_tn3270_erase_flags
,
5731 "tn3270.erase_flags",
5732 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5735 /* End - 5.9 - Erase/Reset */
5737 /* 5.10 - Load Color Table */
5738 { &hf_tn3270_load_color_command
,
5740 "tn3270.load_color_command",
5741 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5744 /* End - 5.10 - Load Color Table */
5746 /* 5.11 - Load Format Storage */
5747 { &hf_tn3270_load_format_storage_flags1
,
5749 "tn3270.load_format_storage_flags1",
5750 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5753 { &hf_tn3270_load_format_storage_flags2
,
5754 { "Flags (Reserved)",
5755 "tn3270.load_format_storage_flags2",
5756 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5759 { &hf_tn3270_load_format_storage_operand
,
5761 "tn3270.load_format_storage_operand",
5762 FT_UINT8
, BASE_HEX
, VALS(vals_load_storage_format_operand
), 0x0,
5765 { &hf_tn3270_load_format_storage_localname
,
5766 { "Local name for user selectable formats",
5767 "tn3270.load_format_storage_localname",
5768 FT_STRING
, BASE_NONE
, NULL
, 0x0,
5771 { &hf_tn3270_format_group
,
5772 { "Format Group name",
5773 "tn3270.format_group_name",
5774 FT_STRING
, BASE_NONE
, NULL
, 0x0,
5777 { &hf_tn3270_format_name
,
5779 "tn3270.format_name",
5780 FT_STRING
, BASE_NONE
, NULL
, 0x0,
5783 { &hf_tn3270_load_format_storage_format_data
,
5785 "tn3270.load_format_storage_format_data",
5786 FT_STRING
, BASE_NONE
, NULL
, 0x0,
5788 /* END - 5.11 - Load Format Storage */
5790 /* 5.12 - Load Line Type */
5791 { &hf_tn3270_load_line_type_command
,
5792 { "Line Type Command",
5793 "tn3270.load_line_type_command",
5794 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5798 /* 5.13 - Load Programmed Symbols */
5799 { &hf_tn3270_ps_flags
,
5802 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5805 { &hf_tn3270_ps_lcid
,
5806 { "Local character set ID",
5808 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5811 { &hf_tn3270_ps_char
,
5812 { "Beginning code point X'41' through X'FE'",
5814 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5817 { &hf_tn3270_ps_rws
,
5818 { "Loadable Character Set RWS Number",
5820 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5823 { &hf_tn3270_extended_ps_length
,
5824 { "Length of parameters for extended form, including the length parameter",
5825 "tn3270.extended_ps_length",
5826 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5829 { &hf_tn3270_extended_ps_flags
,
5831 "tn3270.extended_ps_flags",
5832 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5835 { &hf_tn3270_extended_ps_lw
,
5836 { "Number of X-units in character cell (width of character matrixes)",
5837 "tn3270.extended_ps_lw",
5838 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5841 { &hf_tn3270_extended_ps_lh
,
5842 { "Number of Y-units in character cell (depth of character matrixes)",
5843 "tn3270.extended_ps_lh",
5844 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5847 { &hf_tn3270_extended_ps_subsn
,
5849 "tn3270.extended_ps_subsn",
5850 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5853 { &hf_tn3270_extended_ps_color
,
5855 "tn3270.extended_ps_color",
5856 FT_UINT8
, BASE_HEX
, VALS(vals_at_color_identifications
), 0x0,
5859 { &hf_tn3270_extended_ps_stsubs
,
5860 { "Starting Subsection Identifier",
5861 "tn3270.extended_ps_stsubs",
5862 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5865 { &hf_tn3270_extended_ps_echar
,
5866 { "Ending code point",
5867 "tn3270.extended_ps_echar",
5868 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5871 { &hf_tn3270_extended_ps_nw
,
5872 { "Number of width pairs",
5873 "tn3270.extended_ps_nw",
5874 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5877 { &hf_tn3270_extended_ps_nh
,
5878 { "Number of height pairs",
5879 "tn3270.extended_ps_nh",
5880 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5883 { &hf_tn3270_extended_ps_res
,
5885 "tn3270.extended_ps_res",
5886 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5889 /* END - 5.13 - Load Programmed Symbols */
5891 /* 5.15 - Outbound Text Header */
5892 /* Note: some of these entries multiply used */
5893 { &hf_tn3270_outbound_text_header_operation_type
,
5894 { "Outbound Text Operation Type",
5895 "tn3270.outbound_text_operation_type",
5896 FT_UINT8
, BASE_HEX
, VALS(vals_command_codes
), 0x0,
5902 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
5906 { "Cursor row offset",
5908 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5912 { "Cursor column offset",
5914 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5917 { &hf_tn3270_outbound_text_header_lhdr
,
5918 { "Header length includes itself",
5919 "tn3270.outbound_text_header_lhdr",
5920 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5923 { &hf_tn3270_outbound_text_header_hdr
,
5924 { "Initial format controls",
5925 "tn3270.outbound_text_header_hdr",
5926 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5929 /* END - 5.15 - Outbound Text Header */
5931 /* 5.16 - Outbound 3270DS */
5935 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
5938 /* END - 5.16 - Outbound 3270DS */
5940 /* 5.17 - Present Absolute Format */
5942 { "Format Presentation Command",
5944 FT_UINT8
, BASE_HEX
, VALS(vals_command_codes
), 0x0,
5947 /* END - 5.17 - Present Absolute Format */
5949 /* 5.18 - Present Relative Format */
5951 { "Format Offset Value",
5953 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5956 /* End - 5.18 - Present Relative Format */
5958 /* 5.19 - Read Partition */
5959 { &hf_tn3270_read_partition_operation_type
,
5960 { "Read Partition Operation Type",
5961 "tn3270.read_partition_optyp",
5962 FT_UINT8
, BASE_HEX
, VALS(vals_read_partition_operation_type
), 0x0,
5965 { &hf_tn3270_read_partition_reqtyp
,
5966 { "Read Partition Request Type",
5967 "tn3270.read_partition_reqtyp",
5968 FT_UINT8
, BASE_HEX
, VALS(vals_read_partition_reqtype
), READ_PARTITION_REQTYPE_MASK
,
5971 /* End - 5.19 - Read Partition */
5973 /* 5.22 - Restart */
5974 { &hf_tn3270_start_page
,
5975 { "Number of pages to skip on restart",
5976 "tn3270.start_page",
5977 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5980 { &hf_tn3270_start_line
,
5981 { "Number of lines to skip on page for restart",
5982 "tn3270.start_line",
5983 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5986 { &hf_tn3270_scs_data
,
5987 { "SCS data (noncompressed and noncompacted) to set up for restart",
5989 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5992 /* End - 5.22 - Restart */
5994 /* 5.24 - Select Color Table */
5995 { &hf_tn3270_color_command
,
5997 "tn3270.color_command",
5998 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6001 /* 5.24 - Select Color Table */
6003 /* 5.26 - Set Checkpoint Interval */
6004 { &hf_tn3270_interval
,
6005 { "Checkpoint interval",
6007 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6008 "Specifies the number of pages in the interval between terminal checkpoints", HFILL
}
6010 /* End - 5.26 - Set Checkpoint Interval */
6012 /* 5.27 - Set MSR Interval */
6013 { &hf_tn3270_msr_type
,
6016 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6019 { &hf_tn3270_msr_state_mask
,
6021 "tn3270.msr_state_mask",
6022 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6025 { &hf_tn3270_msr_user
,
6028 FT_BOOLEAN
, 8, NULL
, 0x80,
6031 { &hf_tn3270_msr_locked
,
6033 "tn3270.msr.locked",
6034 FT_BOOLEAN
, 8, NULL
, 0x40,
6037 { &hf_tn3270_msr_auto
,
6040 FT_BOOLEAN
, 8, NULL
, 0x20,
6043 { &hf_tn3270_msr_ind1
,
6044 { "Audible Ind 1 Suppress",
6046 FT_BOOLEAN
, 8, NULL
, 0x10,
6049 { &hf_tn3270_msr_ind2
,
6050 { "Audible Ind 2 Suppress",
6052 FT_BOOLEAN
, 8, NULL
, 0x08,
6055 { &hf_tn3270_msr_state_value
,
6056 { "State Value", "tn3270.msr_state_value",
6057 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6060 { &hf_tn3270_msr_ind_mask
,
6062 "tn3270.msr_ind_mask",
6063 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6066 { &hf_tn3270_msr_ind_value
,
6067 { "Indicator Value",
6068 "tn3270.msr_ind_value",
6069 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6072 /* END - 5.27 - Set MSR Interval */
6074 /* 5.28 - Set Partition Characteristics */
6075 { &hf_tn3270_spc_sdp_ot
,
6076 { "Top edge outline thickness",
6077 "tn3270.spc_sdp_ot",
6078 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6081 { &hf_tn3270_spc_sdp_ob
,
6082 { "Bottom edge outline thickness",
6083 "tn3270.spc_sdp_ob",
6084 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6087 { &hf_tn3270_spc_sdp_ol
,
6088 { "Left edge outline thickness",
6089 "tn3270.spc_sdp_ol",
6090 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6093 { &hf_tn3270_spc_sdp_or
,
6094 { "Right edge outline thickness",
6095 "tn3270.spc_sdp_or",
6096 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6099 { &hf_tn3270_spc_sdp_eucflags
,
6101 "tn3270.spc_sdp_eucflags",
6102 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6105 /* END - 5.28 - Set Partition Characteristics */
6107 /* 5.29 - Set Printer Characteristics */
6108 { &hf_tn3270_printer_flags
,
6110 "tn3270.printer_flags",
6111 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6114 { &hf_tn3270_spc_sdp_srepc
,
6115 { "Set/Reset Early Print Complete",
6116 "tn3270.spc_sdp_srepc",
6117 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6120 /* END - 5.29 - Set Printer Characteristics */
6122 /* 5.30 - Set Reply Mode */
6123 /* hf_tn3270_mode also used for 6.42: Query Reply (modes) */
6127 FT_UINT8
, BASE_HEX
, VALS(vals_reply_modes
), 0x0,
6130 { &hf_tn3270_reply_mode_attr_list
,
6131 { "Type codes for the attribute types",
6132 "tn3270.reply_mode_attr_list",
6133 FT_UINT8
, BASE_HEX
, VALS(vals_attribute_types
), 0x0,
6136 /* END - 5.30 - Set Reply Mode */
6138 /* 5.34 - Data Chain */
6139 { &hf_tn3270_data_chain_fields
,
6140 { "Data Chain Fields",
6141 "tn3270.data_chain_fields",
6142 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6145 { &hf_tn3270_data_chain_group
,
6146 { "Data Chain Group",
6147 "tn3270.data_chain_group",
6148 FT_UINT8
, BASE_HEX
, VALS(vals_data_chain_group
), DATA_CHAIN_GROUP_MASK
,
6151 { &hf_tn3270_data_chain_inbound_control
,
6152 { "Data Chain Inbound Control",
6153 "tn3270.data_chain_inbound_control",
6154 FT_UINT8
, BASE_HEX
, VALS(vals_data_chain_inbound_control
), DATA_CHAIN_INBOUND_CONTROL_MASK
,
6157 /* END - 5.34 - Data Chain */
6159 /* 5.35 - Destination/Origin */
6160 { &hf_tn3270_destination_or_origin_flags_input_control
,
6162 "tn3270.destination_or_origin_flags_input_control",
6163 FT_UINT8
, BASE_HEX
, VALS(vals_destination_or_origin_flags_input_control
), DESTINATION_OR_ORIGIN_FLAGS_INPUT_CONTROL_MASK
,
6166 { &hf_tn3270_destination_or_origin_doid
,
6168 "tn3270.destination_or_origin_doid",
6169 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6172 /* END - 5.35 - Destination/Origin */
6175 /* 5.36 - Object Control */
6176 { &hf_tn3270_object_control_flags
,
6178 "tn3270.object_control_flags",
6179 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6182 { &hf_tn3270_object_type
,
6184 "tn3270.object_type",
6185 FT_UINT8
, BASE_HEX
, VALS(vals_oc_type
), 0x0,
6188 /* END - 5.36 - Object Control */
6190 /* 5.40 - Save/Restore Format */
6191 { &hf_tn3270_save_or_restore_format_flags
,
6193 "tn3270.save_or_restore_format_flags",
6194 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6197 { &hf_tn3270_srf_fpcb
,
6198 { "Contents of the FPCB that is to be saved or restored",
6200 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6204 /* 5.40 - Save/Restore Format */
6205 { &hf_tn3270_type_1_text_outbound_data
,
6206 { "Type 1 text outbound data",
6207 "tn3270.type_1_text_outbound_data",
6208 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6212 /* 6.2 - Exception/Status */
6213 { &hf_tn3270_exception_or_status_flags
,
6215 "tn3270.exception_or_status_flags",
6216 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6219 { &hf_tn3270_sdp_excode
,
6221 "tn3270.sdp_excode",
6222 FT_UINT16
, BASE_DEC
, VALS(vals_sdp_excode
), 0x0,
6225 { &hf_tn3270_sdp_statcode
,
6227 "tn3270.sdp_statcode",
6228 FT_UINT16
, BASE_DEC
, VALS(vals_sdp_statcode
), 0x0,
6231 { &hf_tn3270_sdp_ngl
,
6232 { "Number of groups currently assigned",
6234 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6237 { &hf_tn3270_sdp_nml
,
6238 { "Number of formats currently loaded",
6240 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6243 { &hf_tn3270_sdp_nlml
,
6244 { "Number of local names used",
6246 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6249 { &hf_tn3270_sdp_stor
,
6250 { "Amount of format storage space available (KB)",
6252 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6255 /* 6.2 - Exception/Status */
6257 /* 6.3 - Inbound Text Header */
6261 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6265 { "Row offset of window origin",
6267 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6273 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6277 { "Column Offset of Window Origin",
6279 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6282 /* END - 6.3 - Inbound Text Header */
6284 /* 6.4 Inbound 3270DS */
6285 { &hf_tn3270_cursor_address
,
6287 "tn3270.cursor_address",
6288 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6291 /* END - 6.4 Inbound 3270DS */
6293 /* 6.5 - Recovery Data */
6294 { &hf_tn3270_recovery_data_flags
,
6296 "tn3270.recovery_data_flags",
6297 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6301 { "SLD -- Set line density parameter in effect at the checkpoint",
6303 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6306 { &hf_tn3270_charset
,
6307 { "Character set parameter of Set Attribute control in effect at the checkpoint",
6309 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6312 { &hf_tn3270_vertical
,
6313 { "Byte offset from Checkpoint Interval structured field to the Set Vertical Format control in effect for the checkpoint",
6315 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6318 { &hf_tn3270_v_offset
,
6319 { "Byte offset within the string control byte string or the SVF character",
6321 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6324 { &hf_tn3270_v_sequence
,
6325 { "RU sequence number",
6326 "tn3270.v_sequence",
6327 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6330 { &hf_tn3270_v_length
,
6331 { "Length of the SVF character string required for restart",
6333 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6337 { "Set Primary Density parameter in effect at the checkpoint",
6339 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6342 { &hf_tn3270_horizon
,
6343 { "Byte offset from Checkpoint Interval structured field to the Set Horizontal Format control in effect for the checkpoint",
6345 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6348 { &hf_tn3270_h_offset
,
6349 { "Byte offset from Checkpoint Interval structured field to the Set Horizontal Format control in effect for the checkpoint",
6351 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6354 { &hf_tn3270_h_sequence
,
6355 { "RU sequence number",
6356 "tn3270.h_sequence",
6357 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6360 { &hf_tn3270_h_length
,
6361 { "Length of the SHF character string required for restart",
6363 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6366 { &hf_tn3270_hilite
,
6369 FT_UINT8
, BASE_HEX
, VALS(vals_at_extended_highlighting
), 0x0,
6373 { "Number of pages printed since the checkpoint",
6375 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6379 { "Number of lines printed since the checkpoint",
6381 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6384 { &hf_tn3270_checkpoint
,
6385 { "Byte offset from Set Checkpoint Interval structured field to the first"
6386 " character after the code point or character that caused an eject to the"
6387 " checkpointed page",
6388 "tn3270.checkpoint",
6389 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6392 { &hf_tn3270_c_offset
,
6393 { "Byte offset within the String Control Byte string or structured field of"
6394 " the checkpointed character",
6396 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6399 { &hf_tn3270_c_sequence
,
6400 { "RU sequence number of the RU containing the checkpoint character",
6401 "tn3270.c_sequence",
6402 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6405 { &hf_tn3270_c_seqoff
,
6406 { "Byte offset within the RU of the checkpointed character",
6408 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6411 { &hf_tn3270_c_scsoff
,
6412 { "Byte offset within the parameterized SCS control code (for example, TRN) of the checkpointed character.",
6414 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6418 { "Prime compression character",
6420 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6423 /* END - 6.5 - Recovery Data */
6425 /* 6.9 - Query Reply (Alphanumeric Partitions) */
6427 { "Max number of alphanumeric partitions",
6429 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6433 { "Total available partition storage",
6435 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6438 { &hf_tn3270_query_reply_alphanumeric_flags
,
6441 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6444 { &hf_tn3270_ap_vertical_scrolling
,
6445 { "Vertical Scrolling Supported",
6446 "tn3270.ap_vertical_scrolling",
6447 FT_BOOLEAN
, 8, NULL
, QR_AP_VERTWIN
,
6450 { &hf_tn3270_ap_horizontal_scrolling
,
6451 { "Horizontal Scrolling Supported",
6452 "tn3270.ap_horizontal_scrolling",
6453 FT_BOOLEAN
, 8, NULL
, QR_AP_HORWIN
,
6456 { &hf_tn3270_ap_apres1
,
6459 FT_BOOLEAN
, 8, NULL
, QR_AP_APRES1
,
6462 { &hf_tn3270_ap_apa
,
6463 { "All Points addressability supported",
6465 FT_BOOLEAN
, 8, NULL
, QR_AP_APA_FLG
,
6469 { "Partition protection supported",
6471 FT_BOOLEAN
, 8, NULL
, QR_AP_PROT
,
6475 { "Presentation space local copy supported",
6477 FT_BOOLEAN
, 8, NULL
, QR_AP_LCOPY
,
6481 { "Modify Partition supported",
6483 FT_BOOLEAN
, 8, NULL
, QR_AP_MODPART
,
6486 { &hf_tn3270_ap_apres2
,
6489 FT_BOOLEAN
, 8, NULL
, QR_AP_APRES2
,
6494 { "Character multiplier",
6496 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6502 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6506 { "Column overhead",
6508 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6514 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6517 /* END - 6.9 - Query Reply (Alphanumeric Partitions) */
6519 /* 6.12 - Query Reply (Character Sets) */
6520 { &hf_tn3270_character_sets_flags1
,
6522 "tn3270.character_sets_flags1",
6523 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6527 { "Graphic Escape supported",
6529 FT_BOOLEAN
, 8, NULL
, QR_CS_ALT
,
6533 { "Multiple LCIDs are supported",
6535 FT_BOOLEAN
, 8, NULL
, QR_CS_MULTID
,
6538 { &hf_tn3270_cs_lps
,
6539 { "Load PSSF is supported",
6541 FT_BOOLEAN
, 8, NULL
, QR_CS_LOADABLE
,
6544 { &hf_tn3270_cs_lpse
,
6545 { "Load PS EXTENDED is supported",
6547 FT_BOOLEAN
, 8, NULL
, QR_CS_EXT
,
6551 { "More than one size of character slot is supported",
6553 FT_BOOLEAN
, 8, NULL
, QR_CS_MS
,
6556 { &hf_tn3270_cs_ch2
,
6557 { "Two-byte coded character sets are supported",
6559 FT_BOOLEAN
, 8, NULL
, QR_CS_CH2
,
6563 { "CGCSGID is present",
6565 FT_BOOLEAN
, 8, NULL
, QR_CS_GF
,
6568 { &hf_tn3270_cs_res
,
6571 FT_BOOLEAN
, 8, NULL
, QR_CS_CSRES
,
6575 { &hf_tn3270_character_sets_flags2
,
6577 "tn3270.character_sets_flags2",
6578 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6581 { &hf_tn3270_cs_res2
,
6584 FT_BOOLEAN
, 8, NULL
, QR_CS_CSRES2
,
6587 { &hf_tn3270_cs_pscs
,
6588 { "Load PS slot size match not required",
6590 FT_BOOLEAN
, 8, NULL
, QR_CS_PSCS
,
6593 { &hf_tn3270_cs_res3
,
6596 FT_BOOLEAN
, 8, NULL
, QR_CS_CSRES3
,
6602 FT_BOOLEAN
, 8, NULL
, QR_CS_CF
,
6607 { "Default character slot width",
6609 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6613 { "Default character slot height",
6615 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6621 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6624 { &hf_tn3270_formres
,
6625 { "Form Types (Reserved)",
6627 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6630 { &hf_tn3270_cs_form_type1
,
6632 "tn3270.cs_form_type1",
6633 FT_BOOLEAN
, 8, NULL
, 0x80,
6634 "the first 2 bytes contain a 16-bit vertical slice,"
6635 " the following 16 bytes contain 8-bit horizontal slices. For a 9"
6636 " x 12 character matrix the last 4 bytes contain binary zero.", HFILL
}
6638 { &hf_tn3270_cs_form_type2
,
6639 { "18-byte form (COMPRESSED)",
6640 "tn3270.cs_form_type2",
6641 FT_BOOLEAN
, 8, NULL
, 0x40,
6642 "the first 2 bytes contain a 16-bit vertical slice,"
6643 " the following 16 bytes contain 8-bit horizontal slices. For a 9"
6644 " x 12 character matrix the last 4 bytes contain binary zero. (COMPRESSED)", HFILL
}
6646 { &hf_tn3270_cs_form_type3
,
6647 { "Row loading (from top to bottom)",
6648 "tn3270.cs_form_type3",
6649 FT_BOOLEAN
, 8, NULL
, 0x20,
6652 { &hf_tn3270_cs_form_type4
,
6653 { "Row loading (from top to bottom) (Compressed)",
6654 "tn3270.cs_form_type4",
6655 FT_BOOLEAN
, 8, NULL
, 0x10,
6658 { &hf_tn3270_cs_form_type5
,
6659 { "Column loading (from left to right)",
6660 "tn3270.cs_form_type5",
6661 FT_BOOLEAN
, 8, NULL
, 0x08,
6664 { &hf_tn3270_cs_form_type6
,
6665 { "Column loading (from left to right) (Compressed)",
6666 "tn3270.cs_form_type6",
6667 FT_BOOLEAN
, 8, NULL
, 0x04,
6670 { &hf_tn3270_cs_form_type8
,
6672 "tn3270.cs_form_type8",
6673 FT_BOOLEAN
, 8, NULL
, 0x02,
6677 { "Length of each descriptor",
6679 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6683 { &hf_tn3270_cs_descriptor_set
,
6684 { "Device Specific Character Set ID (PS store No.)",
6685 "tn3270.cs_descriptor_set",
6686 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6689 { &hf_tn3270_cs_descriptor_flags
,
6691 "tn3270.cs_descriptor_flags",
6692 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6695 { &hf_tn3270_cs_ds_load
,
6696 { "Loadable character set",
6697 "tn3270.cs_ds_load",
6698 FT_BOOLEAN
, 8, NULL
, 0x80,
6701 { &hf_tn3270_cs_ds_triple
,
6702 { "Triple-plane character set",
6703 "tn3270.cs_ds_triple",
6704 FT_BOOLEAN
, 8, NULL
, 0x40,
6707 { &hf_tn3270_cs_ds_char
,
6708 { "Double-Byte coded character set",
6709 "tn3270.cs_ds_char",
6710 FT_BOOLEAN
, 8, NULL
, 0x20,
6713 { &hf_tn3270_cs_ds_cb
,
6714 { "No LCID compare",
6716 FT_BOOLEAN
, 8, NULL
, 0x10,
6721 { "Local character set ID (alias)",
6723 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6727 { "Width of the character slots in this characterset.",
6729 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6733 { "Height of the character slots in this character set.",
6735 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6738 { &hf_tn3270_ssubsn
,
6739 { "Starting subsection.",
6741 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6744 { &hf_tn3270_esubsn
,
6745 { "Ending subsection.",
6747 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6750 { &hf_tn3270_ccsgid
,
6751 { "Coded Graphic Character Set Identifier.",
6753 FT_UINT64
, BASE_HEX
, NULL
, 0x0,
6757 { "Coded Character Set Identifier.",
6759 FT_UINT64
, BASE_HEX
, NULL
, 0x0,
6762 /* END - 6.12 - Query Reply (Character Sets) */
6764 /* 6.13 - Query Reply (Color) */
6765 { &hf_tn3270_color_flags
,
6767 "tn3270.color_flags",
6768 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6771 { &hf_tn3270_c_prtblk
,
6772 { "Printer only - black ribbon is loaded",
6774 FT_BOOLEAN
, 8, NULL
, 0x40,
6778 { "Length of color attribute list",
6780 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6784 { "Color attribute value accepted by the device",
6786 FT_UINT8
, BASE_HEX
, VALS(vals_at_color_identifications
), 0x0,
6790 { "Color identifier",
6792 FT_UINT8
, BASE_HEX
, VALS(vals_at_color_identifications
), 0x0,
6795 { &hf_tn3270_db_cavdef
,
6796 { "Default color attribute value",
6798 FT_UINT8
, BASE_HEX
, VALS(vals_at_color_identifications
), 0x0,
6801 { &hf_tn3270_db_cidef
,
6802 { "Default background color identifier",
6804 FT_UINT8
, BASE_HEX
, VALS(vals_at_color_identifications
), 0x0,
6807 /* END - 6.13 - Query Reply (Color) */
6809 /* 6.14 - Query Reply (Cooperative Processing Requestor) */
6811 { "Maximum CPR bytes/transmission allowed inbound",
6813 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6816 { &hf_tn3270_limout
,
6817 { "Maximum CPR bytes/transmission allowed outbound",
6819 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6823 { "Length (in bytes) of feature information that follows",
6825 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6829 { "CPR length and feature flags",
6831 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6834 /* END - 6.14 - Query Reply (Cooperative Processing Requestor) */
6836 /* 6.15 - Query Reply (Data Chaining) */
6837 { &hf_tn3270_dc_dir
,
6838 { "Indicates which direction can use the Data Chain structured field.",
6840 FT_UINT8
, BASE_HEX
, VALS(vals_data_chaining_dir
), 0xC0,
6843 /* END - 6.15 - Query Reply (Data Chaining) */
6845 /* 6.16 - Query Reply (Data Streams) */
6846 { &hf_tn3270_ds_default_sfid
,
6847 { "Default Data Stream",
6848 "tn3270.ds_default_sfid",
6849 FT_UINT8
, BASE_HEX
, VALS(vals_data_streams
), 0x0,
6852 { &hf_tn3270_ds_sfid
,
6853 { "Supported Data Stream",
6855 FT_UINT8
, BASE_HEX
, VALS(vals_data_streams
), 0x0,
6858 /* END - 6.16 - Query Reply (Data Streams) */
6860 /* 6.17 - Query Reply (DBCS Asia) */
6861 { &hf_tn3270_asia_sdp_sosi_soset
,
6862 { "Set ID of the Shift Out (SO) character set",
6863 "tn3270.asia_sdp_sosi_soset",
6864 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6867 { &hf_tn3270_asia_sdp_ic_func
,
6868 { "SO/SI Creation supported",
6869 "tn3270.asia_sdp_ic_func",
6870 FT_BOOLEAN
, 8, NULL
, 0x01,
6873 /* END - 6.17 - Query Reply (DBCS Asia) */
6875 /* 6.19 - Query Reply (Distributed Data Management) */
6876 { &hf_tn3270_ddm_flags
,
6877 { "Flags (Reserved)",
6879 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6882 { &hf_tn3270_ddm_limin
,
6883 { "Maximum DDM bytes/transmission allowed inbound",
6885 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6888 { &hf_tn3270_ddm_limout
,
6889 { "Maximum DDM bytes/transmission allowed outbound",
6890 "tn3270.ddm_limout",
6891 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6894 { &hf_tn3270_ddm_nss
,
6895 { "Number of subsets supported",
6897 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6900 { &hf_tn3270_ddm_ddmss
,
6901 { "DDM subset identifier",
6903 FT_UINT8
, BASE_HEX
, VALS(vals_qr_ddm
), 0x0,
6906 /* END - 6.19 - Query Reply (Distributed Data Management) */
6908 /* 6.20 - Query Reply (Document Interchange Architecture) */
6909 { &hf_tn3270_dia_flags
,
6910 { "Flags (Reserved)",
6912 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6915 { &hf_tn3270_dia_limin
,
6916 { "Maximum DIA bytes/transmission allowed inbound",
6918 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6921 { &hf_tn3270_dia_limout
,
6922 { "Maximum DIA bytes/transmission allowed outbound",
6923 "tn3270.dia_limout",
6924 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6927 { &hf_tn3270_dia_nfs
,
6928 { "Number of subsets supported",
6930 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6933 { &hf_tn3270_dia_diafs
,
6934 { "DIA function set identifier",
6936 FT_UINT8
, BASE_HEX
, VALS(vals_qr_dia
), 0x0,
6939 { &hf_tn3270_dia_diafn
,
6940 { "DIA function set number",
6942 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6945 /* END - 6.20 - Query Reply (Document Interchange Architecture) */
6947 /* 6.22 - Query Reply (Field Outlining) */
6948 { &hf_tn3270_fo_flags
,
6951 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6954 { &hf_tn3270_fo_vpos
,
6955 { "Location of vertical line",
6957 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6960 { &hf_tn3270_fo_hpos
,
6961 { "Location of overline/underline",
6963 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6966 { &hf_tn3270_fo_hpos0
,
6967 { "Location of overline in case of separation",
6969 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6972 { &hf_tn3270_fo_hpos1
,
6973 { "Location of underline in case of separation",
6975 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6978 /* END - 6.22 - Query Reply (Field Outlining) */
6980 /* 6.25 - Query Reply (Format Storage Auxiliary Device) */
6981 { &hf_tn3270_fsad_flags
,
6983 "tn3270.fsad_flags",
6984 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6987 { &hf_tn3270_fsad_limin
,
6988 { "Reserved for LIMIN parameter. Must be set to zeros.",
6989 "tn3270.fsad_limin",
6990 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6993 { &hf_tn3270_fsad_limout
,
6994 { "Maximum bytes of format storage data per transmission allowed outbound.",
6995 "tn3270.fsad_limout",
6996 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6999 { &hf_tn3270_fsad_size
,
7000 { "Size of the format storage space",
7002 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7005 /* END - 6.25 - Query Reply (Format Storage Auxiliary Device) */
7007 /* 6.28 - Query Reply (Highlighting) */
7009 { "Number of attribute-value/action pairs",
7011 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7015 { "Data stream attribute value accepted",
7017 FT_UINT8
, BASE_HEX
, VALS(vals_at_extended_highlighting
), 0x0,
7021 { "Data stream action",
7023 FT_UINT8
, BASE_HEX
, VALS(vals_at_extended_highlighting
), 0x0,
7026 /* END - Query Reply (Highlighting) */
7028 /* 6.29 - Query Reply (IBM Auxiliary Device) */
7029 { &hf_tn3270_ibm_flags
,
7032 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7035 { &hf_tn3270_ibm_limin
,
7036 { "Inbound message size limit",
7038 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7041 { &hf_tn3270_ibm_limout
,
7042 { "Outbound message size limit",
7043 "tn3270.ibm_limout",
7044 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7047 { &hf_tn3270_ibm_type
,
7048 { "Type of IBM Auxiliary Device",
7050 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7053 /* END - 6.29 - Query Reply (IBM Auxiliary Device) */
7055 /* 6.31 - Query Reply (Implicit Partitions) */
7056 { &hf_tn3270_ip_flags
,
7057 { "Flags (Reserved)",
7059 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7062 { &hf_tn3270_ipdd_wd
,
7063 { "Width of the Implicit Partition default screen size (in character cells)",
7065 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7068 { &hf_tn3270_ipdd_hd
,
7069 { "Height of the Implicit Partition default screen size",
7071 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7074 { &hf_tn3270_ipdd_wa
,
7075 { "Width of the Implicit Partition alternate screen size",
7077 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7080 { &hf_tn3270_ipdd_ha
,
7081 { "Height of the Implicit Partition alternate screen size",
7083 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7086 { &hf_tn3270_ippd_dpbs
,
7087 { "Default printer buffer size (in character cells)",
7089 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
7092 { &hf_tn3270_ippd_apbs
,
7093 { "Default printer buffer size (in character cells)",
7095 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
7098 { &hf_tn3270_ipccd_wcd
,
7099 { "Width of the character cell for the Implicit Partition default screen size",
7101 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7104 { &hf_tn3270_ipccd_hcd
,
7105 { "Height of the character cell for the Implicit Partition default screen size",
7107 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7110 { &hf_tn3270_ipccd_wca
,
7111 { "Width of the character cell for the Implicit Partition alternate screen size",
7113 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7116 { &hf_tn3270_ipccd_hca
,
7117 { "Height of the character cell for the Implicit Partition alternate screen size",
7119 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7122 /* END - Query Reply (Implicit Partitions) */
7124 /* 6.32 - Query Reply (IOCA Auxiliary Device) */
7125 { &hf_tn3270_ioca_limin
,
7126 { "Max IOCA bytes/inbound transmission",
7127 "tn3270.ioca_limin",
7128 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7131 { &hf_tn3270_ioca_limout
,
7132 { "Max IOCA bytes/outbound transmission",
7133 "tn3270.ioca_limout",
7134 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7137 { &hf_tn3270_ioca_type
,
7138 { "Type of IOCA Auxiliary Device",
7140 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7143 /* END - 6.32 - Query Reply (IOCA Auxiliary Device) */
7145 /* 6.34 - Query Reply (MSR Control) */
7146 { &hf_tn3270_msr_nd
,
7147 { "Number of MSR device types",
7149 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7152 /* END - 6.34 - Query Reply (MSR Control) */
7154 /* 6.36 - Query Reply (OEM Auxiliary Device) */
7155 { &hf_tn3270_oem_dsref
,
7156 { "Data stream reference identifier",
7158 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7161 { &hf_tn3270_oem_dtype
,
7164 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7167 { &hf_tn3270_oem_uname
,
7168 { "User assigned name",
7170 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7173 { &hf_tn3270_sdp_daid
,
7174 { "Destination/Origin ID",
7175 "tn3270.oem_sdp_daid_doid",
7176 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7179 { &hf_tn3270_oem_sdp_ll_limin
,
7180 { "Maximum OEM dsf bytes/transmission allowed inbound",
7181 "tn3270.oem_sdp_ll_limin",
7182 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7185 { &hf_tn3270_oem_sdp_ll_limout
,
7186 { "Maximum OEM dsf bytes/transmission allowed outbound",
7187 "tn3270.oem_sdp_ll_limout",
7188 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7191 { &hf_tn3270_oem_sdp_pclk_vers
,
7192 { "Protocol version",
7193 "tn3270.oem_sdp_pclk_vers",
7194 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7197 /* END - 6.36 - Query Reply (OEM Auxiliary Device) */
7199 /* 6.37 - Query Reply (Paper Feed Techniques) */
7200 { &hf_tn3270_pft_flags
,
7203 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7206 { &hf_tn3270_pft_tmo
,
7207 { "Top margin offset in 1/1440ths of an inch",
7209 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7212 { &hf_tn3270_pft_bmo
,
7213 { "Bottom margin offset in 1/1440ths of an inch",
7215 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7218 /* END - 6.37 - Query Reply (Paper Feed Techniques) */
7220 /* 6.38 - Query Reply (Partition Characteristics) */
7221 { &hf_tn3270_pc_vo_thickness
,
7223 "tn3270.pc_vo_thickness",
7224 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7227 /* END- 6.38 - Query Reply (Partition Characteristics) */
7229 /* 6.41 - Query Reply (Product Defined Data Stream) */
7230 { &hf_tn3270_pdds_refid
,
7231 { "Reference identifier",
7232 "tn3270.pdds_refid",
7233 FT_UINT8
, BASE_HEX
, VALS(vals_qr_pdds_refid
), 0x0,
7236 { &hf_tn3270_pdds_ssid
,
7237 { "Subset identifier",
7239 FT_UINT8
, BASE_HEX
, VALS(vals_qr_pdds_ssid
), 0x0,
7242 /* END - 6.41 - Query Reply (Product Defined Data Stream) */
7244 /* 6.43 - Query Reply (RPQ Names) */
7245 { &hf_tn3270_rpq_device
,
7246 { "Device type identifier",
7247 "tn3270.rpq_device",
7248 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7251 { &hf_tn3270_rpq_mid
,
7252 { "Model type identifier",
7254 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
7257 { &hf_tn3270_rpq_rpql
,
7258 { "Length of RPQ name (including this byte)",
7260 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7263 { &hf_tn3270_rpq_name
,
7266 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7269 /* END - Query Reply (Names) */
7271 /* 6.44 - Query Reply (Save or Restore Format) */
7272 { &hf_tn3270_srf_fpcbl
,
7273 { "Format parameter control block length",
7275 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7278 /* END - 6.44 - Query Reply (Save or Restore Format) */
7280 /* 6.45 - Query Reply (Settable Printer Characteristics) */
7281 { &hf_tn3270_spc_epc_flags
,
7283 "tn3270.spc_epc_flags",
7284 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7287 /* END - 6.45 - Query Reply (Settable Printer Characteristics) */
7289 /* 6.47 - Query Reply (Storage Pools) */
7290 { &hf_tn3270_sp_spid
,
7291 { "Storage pool identity",
7293 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7296 { &hf_tn3270_sp_size
,
7297 { "Size of this storage pool when empty",
7299 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
7302 { &hf_tn3270_sp_space
,
7303 { "Space available in this storage pool",
7305 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
7308 { &hf_tn3270_sp_objlist
,
7309 { "Identifiers of objects housed in this storage pool",
7310 "tn3270.sp_objlist",
7311 FT_UINT16
, BASE_HEX
, VALS(vals_sp_objlist
), 0x0,
7314 /* END - 6.47 - Query Reply (Storage Pools) */
7316 /* 6.49 - Query Reply (Text Partitions) */
7318 { "Maximum number of text partitions",
7320 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7324 { "Maximum partition size",
7326 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7329 { &hf_tn3270_tp_flags
,
7332 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7335 { &hf_tn3270_tp_ntt
,
7336 { "Number of text types supported",
7338 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7341 { &hf_tn3270_tp_tlist
,
7342 { "List of types supported",
7344 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7347 /* END - 6.49 - Query Reply (Text Partitions) */
7349 /* 6.50 - Query Reply (Transparency) */
7351 { "Number of pairs",
7353 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7357 { "Data stream attribute value accepted",
7359 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7363 { "Associated action value",
7365 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7368 /* END - 6.50 - Query Reply (Transparency) */
7370 /* 6.51 Query Reply Usable Area */
7371 { &hf_tn3270_usable_area_flags1
,
7372 {"Usable Area Flags",
7373 "tn3270.query_reply_usable_area_flags1",
7374 FT_UINT8
, BASE_HEX
, NULL
, 0,
7377 { &hf_tn3270_ua_reserved1
,
7380 FT_BOOLEAN
, 8, NULL
, QR_UA_RESERVED1
,
7383 { &hf_tn3270_ua_page_printer
,
7385 "tn3270.ua_page_printer",
7386 FT_BOOLEAN
, 8, NULL
, QR_UA_PAGE_PRINTER
,
7389 { &hf_tn3270_ua_reserved2
,
7392 FT_BOOLEAN
, 8, NULL
, QR_UA_RESERVED2
,
7395 { &hf_tn3270_ua_hard_copy
,
7397 "tn3270.ua_hard_copy",
7398 FT_BOOLEAN
, 8, NULL
, QR_UA_HARD_COPY
,
7401 { &hf_tn3270_ua_addressing
,
7402 { "Usable Area Addressing",
7403 "tn3270.ua_addressing",
7404 FT_UINT8
, BASE_HEX
, VALS(vals_usable_area_addr_mode
), QR_UA_ADDR_MODE_MASK
,
7407 { &hf_tn3270_usable_area_flags2
,
7408 { "Usable Area Flags",
7409 "tn3270.query_reply_usable_area_flags2",
7410 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7413 { &hf_tn3270_ua_variable_cells
,
7415 "tn3270.ua_variable_cells",
7416 FT_BOOLEAN
, 8, TFS(&tn3270_tfs_ua_variable_cells
), QR_UA_VARIABLE_CELLS
,
7419 { &hf_tn3270_ua_characters
,
7421 "tn3270.ua_characters",
7422 FT_BOOLEAN
, 8, TFS(&tn3270_tfs_ua_characters
), QR_UA_CHARACTERS
,
7425 { &hf_tn3270_ua_cell_units
,
7427 "tn3270.ua_cell_units",
7428 FT_BOOLEAN
, 8, TFS(&tn3270_tfs_ua_cell_units
), QR_UA_CELL_UNITS
,
7431 { &hf_tn3270_ua_width_cells_pels
,
7432 { "Width of usable area in cells/pels",
7433 "tn3270.ua_width_cells_pels",
7434 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7437 { &hf_tn3270_ua_height_cells_pels
,
7438 { "Height of usable area in cells/pels",
7439 "tn3270.ua_height_cells_pels",
7440 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7443 { &hf_tn3270_ua_uom_cells_pels
,
7444 { "Units of measure for cells/pels",
7445 "tn3270.ua_uom_cells_pels",
7446 FT_UINT8
, BASE_HEX
, VALS(vals_usable_area_uom
), 0x0,
7450 { "Distance between points in X direction as a fraction",
7452 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7453 "measured in UNITS, with 2-byte numerator and 2-byte denominator", HFILL
}
7456 { "Distance between points in Y direction as a fraction",
7458 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7459 "measured in UNITS, with 2-byte numerator and 2-byte denominator", HFILL
}
7462 { "Number of X units in default cell",
7464 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7468 { "Number of Y units in default cell",
7470 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7473 { &hf_tn3270_ua_buffsz
,
7474 { "Character buffer size (bytes)",
7476 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7479 { &hf_tn3270_ua_xmin
,
7480 { "Minimum number of X units in variable cell",
7482 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7485 { &hf_tn3270_ua_ymin
,
7486 { "Minimum number of Y units in variable cell",
7488 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7491 { &hf_tn3270_ua_xmax
,
7492 { "Maximum number of X units in variable cell",
7494 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7497 { &hf_tn3270_ua_ymax
,
7498 { "Maximum number of Y units in variable cell",
7500 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7503 /* End - 6.51 Query Reply Usable Area */
7505 /* 6.52 - Query Reply (3270 IPDS) */
7506 { &hf_tn3270_3270_tranlim
,
7507 { "Maximum transmission size allowed outbound",
7508 "tn3270.3270_tranlim",
7509 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7512 /* END - 6.52 - Query Reply (3270 IPDS) */
7515 { &hf_tn3270_field_data
,
7517 "tn3270.field_data",
7518 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7519 "tn3270.field_data", HFILL
}
7521 { &hf_tn3270_number_of_attributes
,
7522 { "Number of Attributes",
7523 "tn3270.number_of_attributes",
7524 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7527 { &hf_tn3270_resbyte
,
7528 { "Flags (Reserved)",
7530 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7533 { &hf_tn3270_resbytes
,
7534 { "Flags (Reserved)",
7536 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
7539 { &hf_tn3270_res_twobytes
,
7540 { "Flags (Reserved)",
7541 "tn3270.res_twobytes",
7542 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
7545 { &hf_tn3270_sf_single_byte_id
,
7546 { "Structured Field",
7548 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7551 { &hf_tn3270_sf_double_byte_id
,
7552 { "Structured Field",
7554 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
7557 { &hf_tn3270_sf_query_reply
,
7559 "tn3270.sf_query_reply",
7560 FT_UINT8
, BASE_HEX
, VALS(vals_sf_query_replies
), 0x0,
7564 { "Trailing Null (Possible Mainframe/Emulator Bug)",
7566 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7569 { &hf_tn3270_unknown_data
,
7570 { "Unknown Data (Possible Mainframe/Emulator Bug)",
7571 "tn3270.unknown_data",
7572 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
7576 /* TN3270E - Header Fields */
7577 { &hf_tn3270_tn3270e_data_type
,
7578 { "TN3270E Data Type",
7579 "tn3270.tn3270e_data_type",
7580 FT_UINT8
, BASE_HEX
, VALS(vals_tn3270_header_data_types
), 0x0,
7583 { &hf_tn3270_tn3270e_request_flag
,
7584 { "TN3270E Request Flag",
7585 "tn3270.tn3270e_request_flag",
7586 FT_UINT8
, BASE_HEX
, VALS(vals_tn3270_header_request_flags
), 0x0,
7589 { &hf_tn3270_tn3270e_response_flag_3270_SCS
,
7590 { "TN3270E Response Flag",
7591 "tn3270.tn3270e_response_flag",
7592 FT_UINT8
, BASE_HEX
, VALS(vals_tn3270_header_response_flags_3270_SCS
), 0x0,
7595 { &hf_tn3270_tn3270e_response_flag_response
,
7596 { "TN3270E Response Flag",
7597 "tn3270.tn3270e_response_flag",
7598 FT_UINT8
, BASE_HEX
, VALS(vals_tn3270_header_response_flags_response
), 0x0,
7601 { &hf_tn3270_tn3270e_response_flag_unused
,
7602 { "TN3270E Response Flag",
7603 "tn3270.tn3270e_response_flag",
7604 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
7607 { &hf_tn3270_tn3270e_seq_number
,
7608 { "TN3270E Seq Number",
7609 "tn3270.tn3270e_seq_number",
7610 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7613 { &hf_tn3270_tn3270e_header_data
,
7614 { "TN3270E Header Data",
7615 "tn3270.tn3270e_header_data",
7616 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7621 static int *ett
[] = {
7625 &ett_tn3270_field_attribute
,
7626 &ett_tn3270_field_validation
,
7627 &ett_tn3270_usable_area_flags1
,
7628 &ett_tn3270_usable_area_flags2
,
7629 &ett_tn3270_query_reply_alphanumeric_flags
,
7630 &ett_tn3270_character_sets_flags1
,
7631 &ett_tn3270_character_sets_flags2
,
7632 &ett_tn3270_character_sets_form
,
7633 &ett_tn3270_cs_descriptor_flags
,
7634 &ett_tn3270_color_flags
,
7637 &ett_tn3270_msr_state_mask
,
7638 &ett_tn3270_data_chain_fields
,
7639 &ett_tn3270_query_list
7642 static ei_register_info ei
[] = {
7643 { &ei_tn3270_order_code
, { "tn3270.order_code.bogus", PI_PROTOCOL
, PI_WARN
, "Bogus value", EXPFILL
}},
7644 { &ei_tn3270_command_code
, { "tn3270.command_code.bogus", PI_PROTOCOL
, PI_WARN
, "Bogus value", EXPFILL
}},
7645 { &ei_tn3270_aid
, { "tn3270.aid.bogus", PI_PROTOCOL
, PI_WARN
, "Bogus value", EXPFILL
}},
7648 expert_module_t
* expert_tn3270
;
7650 proto_tn3270
= proto_register_protocol("TN3270 Protocol", "TN3270", "tn3270");
7651 register_dissector("tn3270", dissect_tn3270
, proto_tn3270
);
7652 proto_register_field_array(proto_tn3270
, hf
, array_length(hf
));
7653 proto_register_subtree_array(ett
, array_length(ett
));
7654 expert_tn3270
= expert_register_protocol(proto_tn3270
);
7655 expert_register_field_array(expert_tn3270
, ei
, array_length(ei
));
7665 * indent-tabs-mode: nil
7668 * ex: set shiftwidth=2 tabstop=8 expandtab:
7669 * :indentSize=2:tabSize=8:noTabs=true: