diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dfilter/semcheck.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-drda.c | 38 | ||||
-rw-r--r-- | epan/dissectors/packet-tn3270.c | 1056 | ||||
-rw-r--r-- | epan/dissectors/packet-tn5250.c | 997 | ||||
-rw-r--r-- | epan/ftypes/ftype-string.c | 38 | ||||
-rw-r--r-- | epan/ftypes/ftypes.h | 1 | ||||
-rw-r--r-- | epan/libwireshark.def | 2 | ||||
-rw-r--r-- | epan/proto.c | 70 | ||||
-rw-r--r-- | epan/tvbuff.c | 33 | ||||
-rw-r--r-- | epan/tvbuff.h | 13 |
10 files changed, 1110 insertions, 1141 deletions
diff --git a/epan/dfilter/semcheck.c b/epan/dfilter/semcheck.c index e3904f0bf7..8f8cc28f59 100644 --- a/epan/dfilter/semcheck.c +++ b/epan/dfilter/semcheck.c @@ -114,7 +114,6 @@ compatible_ftypes(ftenum_t a, ftenum_t b) case FT_STRING: case FT_STRINGZ: - case FT_EBCDIC: case FT_UINT_STRING: switch (b) { case FT_STRING: @@ -171,7 +170,6 @@ mk_fvalue_from_val_string(header_field_info *hfinfo, char *s) case FT_UINT_BYTES: case FT_STRING: case FT_STRINGZ: - case FT_EBCDIC: case FT_UINT_STRING: case FT_UINT64: case FT_INT64: @@ -283,7 +281,6 @@ is_bytes_type(enum ftenum type) case FT_IPXNET: case FT_STRING: case FT_STRINGZ: - case FT_EBCDIC: case FT_UINT_STRING: case FT_BOOLEAN: case FT_FRAMENUM: diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c index 55feb841df..ce6961f2a7 100644 --- a/epan/dissectors/packet-drda.c +++ b/epan/dissectors/packet-drda.c @@ -38,7 +38,13 @@ * Documentation: * DRDA Version 3 Vol. 3: Distributed Relational Database Architecture, * Open Group. -* Reference for Remote DRDA Requesters and Servers, IBM. +* Version 3 is no longer available; for the latest version, see +* +* http://www.opengroup.org/dbiop/ +* +* Reference for Remote DRDA Requesters and Servers, IBM. +* +* https://www-304.ibm.com/support/docview.wss?uid=pub1sc18985301 */ #ifdef HAVE_CONFIG_H @@ -711,7 +717,7 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *drda_tree_sub; proto_item *ti; - ti = proto_tree_add_item(tree, proto_drda, tvb, offset, -1, FALSE); + ti = proto_tree_add_item(tree, proto_drda, tvb, offset, -1, ENC_NA); proto_item_append_text(ti, " (%s)", val_to_str_ext(iCommand, &drda_opcode_vals_ext, "Unknown (0x%02x)")); drdaroot_tree = proto_item_add_subtree(ti, ett_drda); @@ -719,14 +725,14 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(ti, " (%s)", val_to_str_ext(iCommand, &drda_opcode_abbr_ext, "Unknown (0x%02x)")); drda_tree = proto_item_add_subtree(ti, ett_drda_ddm); - proto_tree_add_item(drda_tree, hf_drda_ddm_length, tvb, offset + 0, 2, FALSE); - proto_tree_add_item(drda_tree, hf_drda_ddm_magic, tvb, offset + 2, 1, FALSE); + proto_tree_add_item(drda_tree, hf_drda_ddm_length, tvb, offset + 0, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(drda_tree, hf_drda_ddm_magic, tvb, offset + 2, 1, ENC_BIG_ENDIAN); iFormatFlags = tvb_get_guint8(tvb, offset + 3); iDSSType = iFormatFlags & 0x0F; iDSSFlags = iFormatFlags >> 4; - ti = proto_tree_add_item(drda_tree, hf_drda_ddm_format, tvb, offset + 3, 1, FALSE); + ti = proto_tree_add_item(drda_tree, hf_drda_ddm_format, tvb, offset + 3, 1, ENC_BIG_ENDIAN); drda_tree_sub = proto_item_add_subtree(ti, ett_drda_ddm_format); proto_tree_add_boolean(drda_tree_sub, hf_drda_ddm_fmt_reserved, tvb, offset + 3, 1, iDSSFlags); @@ -735,9 +741,9 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_boolean(drda_tree_sub, hf_drda_ddm_fmt_samecorr, tvb, offset + 3, 1, iDSSFlags); proto_tree_add_uint(drda_tree_sub, hf_drda_ddm_fmt_dsstyp, tvb, offset + 3, 1, iDSSType); - proto_tree_add_item(drda_tree, hf_drda_ddm_rc, tvb, offset + 4, 2, FALSE); - proto_tree_add_item(drda_tree, hf_drda_ddm_length2, tvb, offset + 6, 2, FALSE); - proto_tree_add_item(drda_tree, hf_drda_ddm_codepoint, tvb, offset + 8, 2, FALSE); + proto_tree_add_item(drda_tree, hf_drda_ddm_rc, tvb, offset + 4, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(drda_tree, hf_drda_ddm_length2, tvb, offset + 6, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(drda_tree, hf_drda_ddm_codepoint, tvb, offset + 8, 2, ENC_BIG_ENDIAN); /* The number of attributes is variable */ for (offset += 10; offset < iCommandEnd; ) @@ -752,18 +758,18 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_text(drdaroot_tree, tvb, offset, iLengthParam, DRDA_TEXT_PARAM); proto_item_append_text(ti, " (%s)", val_to_str_ext(iParameterCP, &drda_opcode_vals_ext, "Unknown (0x%02x)")); drda_tree_sub = proto_item_add_subtree(ti, ett_drda_param); - proto_tree_add_item(drda_tree_sub, hf_drda_param_length, tvb, offset, 2, FALSE); - proto_tree_add_item(drda_tree_sub, hf_drda_param_codepoint, tvb, offset + 2, 2, FALSE); - proto_tree_add_item(drda_tree_sub, hf_drda_param_data, tvb, offset + 4, iLengthParam - 4, FALSE); - proto_tree_add_item(drda_tree_sub, hf_drda_param_data_ebcdic, tvb, offset + 4, iLengthParam - 4, FALSE); + proto_tree_add_item(drda_tree_sub, hf_drda_param_length, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(drda_tree_sub, hf_drda_param_codepoint, tvb, offset + 2, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(drda_tree_sub, hf_drda_param_data, tvb, offset + 4, iLengthParam - 4, ENC_UTF_8|ENC_NA); + proto_tree_add_item(drda_tree_sub, hf_drda_param_data_ebcdic, tvb, offset + 4, iLengthParam - 4, ENC_EBCDIC|ENC_NA); if (iCommand == DRDA_CP_SQLSTT) { /* Extract SQL statement from packet */ tvbuff_t* next_tvb = NULL; next_tvb = tvb_new_subset(tvb, offset + 4, iLengthParam - 4, iLengthParam - 4); add_new_data_source(pinfo, next_tvb, "SQL statement"); - proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement, next_tvb, 0, iLengthParam - 5, FALSE); - proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement_ebcdic, next_tvb, 0, iLengthParam - 4, FALSE); + proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement, next_tvb, 0, iLengthParam - 5, ENC_UTF_8|ENC_NA); + proto_tree_add_item(drdaroot_tree, hf_drda_sqlstatement_ebcdic, next_tvb, 0, iLengthParam - 4, ENC_EBCDIC|ENC_NA); } } offset += iLengthParam; @@ -870,13 +876,13 @@ proto_register_drda(void) { "Data (ASCII)", "drda.param.data", FT_STRING, BASE_NONE, NULL, 0x0, "Param data left as ASCII for display", HFILL }}, { &hf_drda_param_data_ebcdic, - { "Data (EBCDIC)", "drda.param.data.ebcdic", FT_EBCDIC, BASE_NONE, NULL, 0x0, "Param data converted from EBCDIC to ASCII for display", HFILL }}, + { "Data (EBCDIC)", "drda.param.data.ebcdic", FT_STRING, BASE_NONE, NULL, 0x0, "Param data converted from EBCDIC to ASCII for display", HFILL }}, { &hf_drda_sqlstatement, { "SQL statement (ASCII)", "drda.sqlstatement", FT_STRING, BASE_NONE, NULL, 0x0, "SQL statement left as ASCII for display", HFILL }}, { &hf_drda_sqlstatement_ebcdic, - { "SQL statement (EBCDIC)", "drda.sqlstatement.ebcdic", FT_EBCDIC, BASE_NONE, NULL, 0x0, "SQL statement converted from EBCDIC to ASCII for display", HFILL }} + { "SQL statement (EBCDIC)", "drda.sqlstatement.ebcdic", FT_STRING, BASE_NONE, NULL, 0x0, "SQL statement converted from EBCDIC to ASCII for display", HFILL }} }; static gint *ett[] = { diff --git a/epan/dissectors/packet-tn3270.c b/epan/dissectors/packet-tn3270.c index a3af20b553..9d246e62da 100644 --- a/epan/dissectors/packet-tn3270.c +++ b/epan/dissectors/packet-tn3270.c @@ -964,6 +964,14 @@ static const value_string vals_query_replies[] = { #define CSRES7 0x01 +/* 6.15 Query Reply (Data Chaining) */ +static const value_string vals_data_chaining_dir[] = { + { 0x00, "Both" }, + { 0x40, "From device only" }, + { 0x80, "To device only" }, + { 0x00, NULL } +}; + /* 6.16 Query Reply (Data Streams) */ #define SCS 0x00 #define DCAL2 0x01 @@ -1541,6 +1549,7 @@ typedef struct hf_items { gint bitmask_ett; int length; const int **bitmask; + gint encoding; } hf_items; /* Utility Functions */ @@ -1558,7 +1567,7 @@ tn3270_add_hf_items(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, fields[i].hf, tvb, offset, fields[i].length, - FALSE); + fields[i].encoding); } else { proto_tree_add_bitmask(tn3270_tree, tvb, offset, fields[i].hf, fields[i].bitmask_ett, fields[i].bitmask, FALSE); @@ -1579,7 +1588,7 @@ dissect_unknown_data(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint s if (len_left > 0) { proto_tree_add_item(tn3270_tree, hf_tn3270_unknown_data, tvb, offset, len_left, - FALSE); + ENC_NA); return len_left; } return 0; @@ -1616,7 +1625,7 @@ add_data_until_next_order_code(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offs if (datalen) { proto_tree_add_item(tn3270_tree, hf_tn3270_field_data, tvb, offset, - datalen, FALSE); + datalen, ENC_EBCDIC|ENC_NA); } return datalen; } @@ -1629,8 +1638,8 @@ dissect_query_reply_resbytes(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_items fields[] = { - { hf_tn3270_res_twobytes, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_res_twobytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -1750,22 +1759,22 @@ dissect_create_partition(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gi int start=offset; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_partition_uom, 0, 1, 0 }, - { hf_tn3270_partition_flags, 0, 1, 0 }, - { hf_tn3270_partition_height, 0, 2, 0 }, - { hf_tn3270_partition_width, 0, 2, 0 }, - { hf_tn3270_partition_rv, 0, 2, 0 }, - { hf_tn3270_partition_cv, 0, 2, 0 }, - { hf_tn3270_partition_hv, 0, 2, 0 }, - { hf_tn3270_partition_wv, 0, 2, 0 }, - { hf_tn3270_partition_rw, 0, 2, 0 }, - { hf_tn3270_partition_cw, 0, 2, 0 }, - { hf_tn3270_partition_rs, 0, 2, 0 }, - { hf_tn3270_partition_res, 0, 2, 0 }, - { hf_tn3270_partition_pw, 0, 2, 0 }, - { hf_tn3270_partition_ph, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_uom, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_height, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_width, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_rv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_cv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_hv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_wv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_rw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_cw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_rs, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_res, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_pw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_ph, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -1790,13 +1799,13 @@ dissect_load_format_storage(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, int operand; hf_items fields[] = { - { hf_tn3270_load_format_storage_flags1, 0, 1, 0 }, - { hf_tn3270_load_format_storage_flags2, 0, 1, 0 }, - { hf_tn3270_load_format_storage_operand, 0, 1, 0 }, - { hf_tn3270_load_format_storage_localname, 0, 8, 0 }, - { hf_tn3270_format_group, 0, 6, 0 }, - { hf_tn3270_format_name, 0, 16, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_load_format_storage_flags1, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_load_format_storage_flags2, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_load_format_storage_operand, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_load_format_storage_localname, 0, 8, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn3270_format_group, 0, 6, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn3270_format_name, 0, 16, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; operand = tvb_get_guint8(tvb, offset+2); @@ -1807,7 +1816,7 @@ dissect_load_format_storage(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, if (operand == ADD) { int fmtln = ((sf_length - 4) - (offset - start)); proto_tree_add_item(tn3270_tree, hf_tn3270_load_format_storage_format_data, - tvb, offset, fmtln, FALSE); + tvb, offset, fmtln, ENC_EBCDIC|ENC_NA); offset+=fmtln; } @@ -1826,24 +1835,24 @@ dissect_load_programmed_symbols(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off gint8 flags; gint8 extended_ps_length; hf_items ps_fields[] = { - { hf_tn3270_ps_flags, 0, 1, 0 }, - { hf_tn3270_ps_lcid, 0, 1, 0 }, - { hf_tn3270_ps_char, 0, 1, 0 }, - { hf_tn3270_ps_rws, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ps_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ps_lcid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ps_char, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ps_rws, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items extended_ps_fields[] = { - { hf_tn3270_extended_ps_lw, 0, 1, 0 }, - { hf_tn3270_extended_ps_lh, 0, 1, 0 }, - { hf_tn3270_extended_ps_subsn, 0, 1, 0 }, - { hf_tn3270_extended_ps_color, 0, 1, 0 }, - { hf_tn3270_extended_ps_stsubs, 0, 1, 0 }, - { hf_tn3270_extended_ps_echar, 0, 1, 0 }, - { hf_tn3270_extended_ps_nw, 0, 1, 0 }, - { hf_tn3270_extended_ps_nh, 0, 1, 0 }, - { hf_tn3270_extended_ps_res, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_extended_ps_lw, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_lh, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_subsn, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_color, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_stsubs, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_echar, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_nw, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_nh, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_extended_ps_res, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; flags = tvb_get_guint8(tvb, offset); @@ -1857,15 +1866,16 @@ dissect_load_programmed_symbols(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off extended_ps_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(tn3270_tree, hf_tn3270_extended_ps_length, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_extended_ps_flags, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; for (i = 0; i < extended_ps_length; ++i) { proto_tree_add_item(tn3270_tree, extended_ps_fields[i].hf, - tvb, offset, extended_ps_fields[i].length, FALSE); + tvb, offset, extended_ps_fields[i].length, + extended_ps_fields[i].encoding); offset+=extended_ps_fields[i].length; } @@ -1882,23 +1892,23 @@ dissect_modify_partition(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gi int start=offset; hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_partition_flags, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_resbytes, 0, 2, 0 }, - { hf_tn3270_partition_rv, 0, 2, 0 }, - { hf_tn3270_partition_cv, 0, 2, 0 }, - { hf_tn3270_partition_hv, 0, 2, 0 }, - { hf_tn3270_partition_wv, 0, 2, 0 }, - { hf_tn3270_partition_rw, 0, 2, 0 }, - { hf_tn3270_partition_cw, 0, 2, 0 }, - { hf_tn3270_partition_rs, 0, 2, 0 }, - { hf_tn3270_partition_res, 0, 2, 0 }, - { hf_tn3270_partition_pw, 0, 2, 0 }, - { hf_tn3270_partition_ph, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_rv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_cv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_hv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_wv, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_rw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_cw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_rs, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_res, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_pw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_partition_ph, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -1919,18 +1929,18 @@ dissect_outbound_text_header(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset gint16 hdr_length; hf_items outbound_text_header_fields1[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_operation_type, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_operation_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items outbound_text_header_fields2[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_lvl, 0, 1, 0 }, - { hf_tn3270_cro, 0, 2, 0 }, - { hf_tn3270_cc, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_lvl, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cro, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cc, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -1942,11 +1952,11 @@ dissect_outbound_text_header(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hdr_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tn3270_tree, hf_tn3270_outbound_text_header_lhdr, - tvb, offset, 2, FALSE); + tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(tn3270_tree, hf_tn3270_outbound_text_header_hdr, - tvb, offset, hdr_length, FALSE); + tvb, offset, hdr_length, ENC_BIG_ENDIAN); offset+=hdr_length; offset += dissect_unknown_data(tn3270_tree, tvb, offset, start, sf_length); @@ -1966,7 +1976,7 @@ dissect_outbound_3270ds(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; cmd = tvb_get_guint8(tvb, offset); @@ -1974,7 +1984,7 @@ dissect_outbound_3270ds(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_partition_command, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; /* FIXME: the spec is ambiguous at best about what to expect here, @@ -1986,7 +1996,7 @@ dissect_outbound_3270ds(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_bsc, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; break; case W: @@ -2023,14 +2033,14 @@ dissect_present_absolute_format(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_fpc, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset+=dissect_wcc(tn3270_tree, tvb, offset); @@ -2039,7 +2049,7 @@ dissect_present_absolute_format(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off hf_tn3270_format_name, tvb, offset, (sf_length - 5), - FALSE); + ENC_EBCDIC|ENC_NA); offset+=(sf_length - 5); return (offset - start); } @@ -2055,21 +2065,21 @@ dissect_present_relative_format(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_fov, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(tn3270_tree, hf_tn3270_fpc, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_wcc(tn3270_tree, tvb, offset); @@ -2078,7 +2088,7 @@ dissect_present_relative_format(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off hf_tn3270_format_name, tvb, offset, (sf_length - 7), - FALSE); + ENC_EBCDIC|ENC_NA); offset+=(sf_length - 7); return (offset - start); } @@ -2098,7 +2108,7 @@ dissect_read_partition(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; type = tvb_get_guint8(tvb, offset); @@ -2111,7 +2121,7 @@ dissect_read_partition(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_operation_type, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; if (type == 0x03) { /* 'Query List' */ @@ -2119,7 +2129,7 @@ dissect_read_partition(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_reqtyp, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; if (sf_length > 6) { @@ -2130,7 +2140,7 @@ dissect_read_partition(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, for (i = 0; i < qcode_list_len; i++) { proto_tree_add_item(query_list_tree, hf_tn3270_sf_query_reply, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } } @@ -2152,21 +2162,21 @@ dissect_restart(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_resbyte, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_start_page, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(tn3270_tree, hf_tn3270_start_line, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; @@ -2174,7 +2184,7 @@ dissect_restart(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_scs_data, tvb, offset, (sf_length - 9), - FALSE); + ENC_NA); offset+=(sf_length - 9); return (offset - start); @@ -2202,13 +2212,13 @@ dissect_set_msr_control(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, }; hf_items outbound_text_header_fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_msr_type, 0, 1, 0 }, - { hf_tn3270_msr_state_mask, ett_tn3270_msr_state_mask, 1, byte }, - { hf_tn3270_msr_state_value, 1, 1, 0 }, - { hf_tn3270_msr_ind_mask, 1, 1, 0 }, - { hf_tn3270_msr_ind_value, 1, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_msr_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_msr_state_mask, ett_tn3270_msr_state_mask, 1, byte, 0 }, + { hf_tn3270_msr_state_value, 1, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_msr_ind_mask, 1, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_msr_ind_value, 1, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2229,28 +2239,28 @@ dissect_set_partition_characteristics_sd_parms(proto_tree *tn3270_tree, tvbuff_t guint16 sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_spc_sdp_ot, 0, 1, 0 }, - { hf_tn3270_spc_sdp_ob, 0, 1, 0 }, - { hf_tn3270_spc_sdp_ol, 0, 1, 0 }, - { hf_tn3270_spc_sdp_or, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_ot, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_ob, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_ol, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_or, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_spc_sdp_eucflags, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_eucflags, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp3[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_spc_sdp_eucflags, 0, 1, 0 }, - { hf_tn3270_spc_sdp_eucflags, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_eucflags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_eucflags, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2286,9 +2296,9 @@ dissect_set_partition_characteristics(proto_tree *tn3270_tree, tvbuff_t *tvb, gi int i; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_resbytes, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2315,10 +2325,10 @@ dissect_set_printer_characteristics_sd_parms(proto_tree *tn3270_tree, tvbuff_t * guint16 sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_spc_sdp_srepc, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spc_sdp_srepc, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; sdp = tvb_get_ntohs(tvb, offset); @@ -2345,9 +2355,9 @@ dissect_set_printer_characteristics(proto_tree *tn3270_tree, tvbuff_t *tvb, gint int i; hf_items fields[] = { - { hf_tn3270_printer_flags, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_printer_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2372,11 +2382,12 @@ dissect_set_reply_mode(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, { int start=offset; int type; + gint i; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_mode, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_mode, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; type = tvb_get_guint8(tvb, offset+1); @@ -2385,12 +2396,12 @@ dissect_set_reply_mode(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, fields); if (type == 0x02) { /* 'Query List' */ - proto_tree_add_item(tn3270_tree, - hf_tn3270_reply_mode_attr_list, - tvb, offset, - (sf_length - 5), - FALSE); - offset+=(sf_length - 5); + for (i = 5; i < sf_length; i++) { + proto_tree_add_item(tn3270_tree, + hf_tn3270_reply_mode_attr_list, + tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + } } return (offset - start); } @@ -2405,9 +2416,9 @@ dissect_type_1_text(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, int start=offset; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_resbytes, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2416,7 +2427,7 @@ dissect_type_1_text(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_field_data, tvb, offset, (sf_length - 7), - FALSE); + ENC_EBCDIC|ENC_NA); offset+=(sf_length - 7); return (offset - start); } @@ -2432,10 +2443,10 @@ dissect_object_control(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, int start=offset; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_object_control_flags, 0, 1, 0 }, - { hf_tn3270_object_type, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_object_control_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_object_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2445,7 +2456,7 @@ dissect_object_control(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_type_1_text_outbound_data, tvb, offset, (sf_length - 7), - FALSE); + ENC_NA); offset+=(sf_length - 7); return (offset - start); } @@ -2462,9 +2473,9 @@ dissect_save_or_restore_format(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offs int start=offset; hf_items fields[] = { - { hf_tn3270_save_or_restore_format_flags, 0, 1, 0 }, - { hf_tn3270_srf_fpcb, 0, (sf_length-5), 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_save_or_restore_format_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_srf_fpcb, 0, (sf_length-5), 0, ENC_NA }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2490,44 +2501,44 @@ dissect_exception_or_status_sd_parms(proto_tree *tn3270_tree, tvbuff_t *tvb, gin guint16 sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_sdp_excode, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_excode, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_sdp_statcode, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_statcode, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp3[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_format_group, 0, 16, 0 }, - { hf_tn3270_format_name, 0, 16, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_format_group, 0, 16, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn3270_format_name, 0, 16, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; hf_items sdp4[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_sdp_ngl, 0, 2, 0 }, - { hf_tn3270_sdp_nml, 0, 2, 0 }, - { hf_tn3270_sdp_nlml, 0, 2, 0 }, - { hf_tn3270_sdp_stor, 0, 4, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_ngl, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_nml, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_nlml, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_stor, 0, 4, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp5[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_format_group, 0, 16, 0 }, - { hf_tn3270_sdp_nml, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_format_group, 0, 16, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn3270_sdp_nml, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; sdp = tvb_get_ntohs(tvb, offset); @@ -2567,10 +2578,10 @@ dissect_exception_or_status(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, int start=offset, i; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_exception_or_status_flags, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_exception_or_status_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2595,19 +2606,19 @@ dissect_inbound_text_header(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, int start=offset; hf_items outbound_text_header_fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_aid, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_lvl, 0, 1, 0 }, - { hf_tn3270_cro, 0, 2, 0 }, - { hf_tn3270_cc, 0, 2, 0 }, - { hf_tn3270_rw, 0, 2, 0 }, - { hf_tn3270_cw, 0, 2, 0 }, - { hf_tn3270_hw, 0, 2, 0 }, - { hf_tn3270_ww, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_aid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_lvl, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cro, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cc, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_rw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_hw, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ww, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2627,12 +2638,12 @@ dissect_inbound_3270ds(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, int start=offset; hf_items fields[] = { - { hf_tn3270_partition_id, 0, 1, 0 }, - { hf_tn3270_aid, 0, 1, 0 }, - { hf_tn3270_cursor_x, 0, 1, 0 }, - { hf_tn3270_cursor_y, 0, 1, 0 }, - { hf_tn3270_field_data, 0, (sf_length - 8), 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_partition_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_aid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cursor_x, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cursor_y, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_field_data, 0, (sf_length - 8), 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2652,30 +2663,30 @@ dissect_recovery_data(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_recovery_data_flags, 1, 1, 0 }, - { hf_tn3270_sld, 0, 1, 0 }, - { hf_tn3270_charset, 0, 1, 0 }, - { hf_tn3270_vertical, 0, 2, 0 }, - { hf_tn3270_v_offset, 0, 2, 0 }, - { hf_tn3270_v_sequence, 0, 2, 0 }, - { hf_tn3270_v_length, 0, 2, 0 }, - { hf_tn3270_spd, 0, 2, 0 }, - { hf_tn3270_horizon, 0, 2, 0 }, - { hf_tn3270_h_offset, 0, 2, 0 }, - { hf_tn3270_h_sequence, 0, 2, 0 }, - { hf_tn3270_h_length, 0, 2, 0 }, - { hf_tn3270_color, 0, 1, 0 }, - { hf_tn3270_hilite, 0, 1, 0 }, - { hf_tn3270_pages, 0, 2, 0 }, - { hf_tn3270_lines, 0, 2, 0 }, - { hf_tn3270_checkpoint, 0, 2, 0 }, - { hf_tn3270_c_offset, 0, 2, 0 }, - { hf_tn3270_c_sequence, 0, 2, 0 }, - { hf_tn3270_c_seqoff, 0, 2, 0 }, - { hf_tn3270_c_scsoff, 0, 2, 0 }, - { hf_tn3270_prime, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_recovery_data_flags, 1, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sld, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_charset, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_vertical, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_v_offset, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_v_sequence, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_v_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_spd, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_horizon, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_h_offset, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_h_sequence, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_h_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_color, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_hilite, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_pages, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_lines, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_checkpoint, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_c_offset, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_c_sequence, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_c_seqoff, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_c_scsoff, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_prime, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2699,13 +2710,13 @@ dissect_query_reply_alphanumeric_sd_parms(proto_tree *tn3270_tree, tvbuff_t *tvb guint16 sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_ap_cm, 0, 1, 0 }, - { hf_tn3270_ap_ro, 0, 1, 0 }, - { hf_tn3270_ap_co, 0, 1, 0 }, - { hf_tn3270_ap_fo, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ap_cm, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ap_ro, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ap_co, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ap_fo, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2743,10 +2754,10 @@ dissect_query_reply_alphanumeric(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of }; hf_items fields[] = { - { hf_tn3270_ap_na, 0, 1, 0 }, - { hf_tn3270_ap_m, 0, 2, 0 }, - { hf_tn3270_query_reply_alphanumeric_flags, ett_tn3270_query_reply_alphanumeric_flags, 1, byte }, - { 0, 0, 0, 0 }, + { hf_tn3270_ap_na, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ap_m, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_query_reply_alphanumeric_flags, ett_tn3270_query_reply_alphanumeric_flags, 1, byte, 0 }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2811,45 +2822,45 @@ dissect_query_reply_character_sets(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_items fields[] = { - { hf_tn3270_character_sets_flags1, ett_tn3270_character_sets_flags1, 1, byte1 }, - { hf_tn3270_character_sets_flags2, ett_tn3270_character_sets_flags2, 1, byte2 }, - { hf_tn3270_sdw, 0, 1, 0 }, - { hf_tn3270_sdh, 0, 1, 0 }, - { hf_tn3270_form, ett_tn3270_character_sets_form, 1, byte3 }, - { hf_tn3270_formres, 0, 1, 0 }, - { hf_tn3270_formres, 0, 1, 0 }, - { hf_tn3270_formres, 0, 1, 0 }, - { hf_tn3270_cs_dl, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_character_sets_flags1, ett_tn3270_character_sets_flags1, 1, byte1, 0 }, + { hf_tn3270_character_sets_flags2, ett_tn3270_character_sets_flags2, 1, byte2, 0 }, + { hf_tn3270_sdw, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdh, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_form, ett_tn3270_character_sets_form, 1, byte3, 0 }, + { hf_tn3270_formres, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_formres, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_formres, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cs_dl, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items descriptors[] = { - { hf_tn3270_cs_descriptor_set, 0, 1, 0 }, - { hf_tn3270_cs_descriptor_flags, ett_tn3270_cs_descriptor_flags, 1, byte4 }, - { hf_tn3270_lcid, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_cs_descriptor_set, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_cs_descriptor_flags, ett_tn3270_cs_descriptor_flags, 1, byte4, 0 }, + { hf_tn3270_lcid, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sw_sh[] = { - { hf_tn3270_sw, 0, 1, 0 }, - { hf_tn3270_sh, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sw, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sh, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items subsn[] = { - { hf_tn3270_ssubsn, 0, 1, 0 }, - { hf_tn3270_esubsn, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ssubsn, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_esubsn, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items gf[] = { - { hf_tn3270_ccsgid, 0, 4, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ccsgid, 0, 4, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items cf[] = { - { hf_tn3270_ccsid, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ccsid, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; flagbyte1 = tvb_get_guint8(tvb, offset); @@ -2897,11 +2908,11 @@ dissect_query_reply_color_sd_parms(proto_tree *tn3270_tree, tvbuff_t *tvb, gint guint16 sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_db_cavdef, 0, 1, 0 }, - { hf_tn3270_db_cidef, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_db_cavdef, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_db_cidef, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2934,9 +2945,9 @@ dissect_query_reply_color(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, }; hf_items fields[] = { - { hf_tn3270_color_flags, ett_tn3270_color_flags, 1, byte }, - { hf_tn3270_c_np, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_color_flags, ett_tn3270_color_flags, 1, byte, 0 }, + { hf_tn3270_c_np, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -2952,7 +2963,7 @@ dissect_query_reply_color(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_c_cav, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; if (tvb_get_guint8(tvb, offset) == 0xFF) { offset++; @@ -2961,7 +2972,7 @@ dissect_query_reply_color(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_c_ci, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } offset += dissect_query_reply_color_sd_parms(tn3270_tree, tvb, offset); @@ -2980,10 +2991,10 @@ dissect_daid_sd_parm(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) int start=offset; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_sdp_daid, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_daid, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -2999,10 +3010,10 @@ dissect_pclk_sd_parm(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) int start=offset; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_oem_sdp_pclk_vers, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_oem_sdp_pclk_vers, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -3020,26 +3031,26 @@ dissect_query_reply_oem_auxiliary_device_sd_parms(proto_tree *tn3270_tree, tvbuf int sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_sdp_daid, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_daid, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_oem_sdp_ll_limin, 0, 2, 0 }, - { hf_tn3270_oem_sdp_ll_limout, 0, 2, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_oem_sdp_ll_limin, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_oem_sdp_ll_limout, 0, 2, 0, ENC_BIG_ENDIAN }, - { 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0 } }; hf_items sdp3[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_oem_sdp_pclk_vers, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_oem_sdp_pclk_vers, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -3079,12 +3090,12 @@ dissect_query_reply_cooperative(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off int start=offset; hf_items fields[] = { - { hf_tn3270_res_twobytes, 0, 2, 0 }, - { hf_tn3270_limin, 0, 2, 0 }, - { hf_tn3270_limout, 0, 2, 0 }, - { hf_tn3270_featl, 0, 1, 0 }, - { hf_tn3270_feats, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_res_twobytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_limin, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_limout, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_featl, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_feats, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -3096,7 +3107,7 @@ dissect_query_reply_cooperative(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off hf_tn3270_field_data, tvb, offset, (sf_length - 13), - FALSE); + ENC_EBCDIC|ENC_NA); offset+=(sf_length - 13); /* Uses same Self-Defining Parm as OEM Auxiliary Device */ @@ -3122,9 +3133,9 @@ dissect_query_reply_data_chaining(proto_tree *tn3270_tree, tvbuff_t *tvb, gint o }; hf_items fields[] = { - { hf_tn3270_dc_dir_flags, ett_tn3270_dc_dir_flags, 1, byte1 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_dc_dir_flags, ett_tn3270_dc_dir_flags, 1, byte1, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -3145,13 +3156,13 @@ dissect_query_reply_data_streams(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of int i; proto_tree_add_item(tn3270_tree, hf_tn3270_ds_default_sfid, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); for (i=0; i < (sf_length - 4); i++) { proto_tree_add_item(tn3270_tree, hf_tn3270_ds_sfid, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } offset += dissect_unknown_data(tn3270_tree, tvb, offset, start, sf_length); @@ -3169,17 +3180,17 @@ dissect_query_reply_dbcs_asia_sd_parms(proto_tree *tn3270_tree, tvbuff_t *tvb, g int sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_asia_sdp_sosi_soset, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_asia_sdp_sosi_soset, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_asia_sdp_ic_func, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_asia_sdp_ic_func, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; sdp_len = tvb_get_guint8(tvb, offset); @@ -3213,8 +3224,8 @@ dissect_query_reply_dbcs_asia(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offse int i; hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -3243,7 +3254,7 @@ dissect_query_reply_device_characteristics(proto_tree *tn3270_tree, tvbuff_t *tv hf_tn3270_sf_outbound_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; /* TODO: dissect descriptors */ @@ -3262,13 +3273,13 @@ dissect_query_reply_distributed_data_management(proto_tree *tn3270_tree, tvbuff_ int done = 0; hf_items fields[] = { - { hf_tn3270_ddm_flags,0, 1, 0 }, - { hf_tn3270_ddm_flags,0, 1, 0 }, - { hf_tn3270_ddm_limin,0, 2, 0 }, - { hf_tn3270_ddm_limout,0, 2, 0 }, - { hf_tn3270_ddm_nss,0, 1, 0 }, - { hf_tn3270_ddm_ddmss,0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ddm_flags,0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ddm_flags,0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ddm_limin,0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ddm_limout,0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ddm_nss,0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ddm_ddmss,0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -3308,23 +3319,23 @@ dissect_query_reply_document_interchange_architecture(proto_tree *tn3270_tree, t int start=offset, sdp, ln, i; hf_items fields[] = { - { hf_tn3270_dia_flags, 0, 2, 0 }, - { hf_tn3270_dia_limin, 0, 2, 0 }, - { hf_tn3270_dia_limout, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_dia_flags, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_dia_limin, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_dia_limout, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); ln = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tn3270_tree, hf_tn3270_dia_nfs,tvb, offset, 1, FALSE); + proto_tree_add_item(tn3270_tree, hf_tn3270_dia_nfs,tvb, offset, 1, ENC_BIG_ENDIAN); for (i=0; i < ln; i++) { proto_tree_add_item(tn3270_tree, hf_tn3270_dia_diafs, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_dia_diafn, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset++; } @@ -3346,7 +3357,7 @@ dissect_query_reply_extended_drawing_routine(proto_tree *tn3270_tree, tvbuff_t * int start=offset; proto_tree_add_item(tn3270_tree, hf_tn3270_field_data ,tvb, offset, - (sf_length-4), FALSE); + (sf_length-4), ENC_EBCDIC|ENC_NA); offset += (sf_length - 4); @@ -3361,13 +3372,13 @@ dissect_query_reply_field_outlining(proto_tree *tn3270_tree, tvbuff_t *tvb, gint int start=offset; hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_fo_flags, 0, 1, 0 }, - { hf_tn3270_fo_vpos, 0, 1, 0 }, - { hf_tn3270_fo_hpos, 0, 1, 0 }, - { hf_tn3270_fo_hpos0, 0, 1, 0 }, - { hf_tn3270_fo_hpos1, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fo_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fo_vpos, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fo_hpos, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fo_hpos0, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fo_hpos1, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3388,11 +3399,11 @@ dissect_query_reply_format_storage_aux_device(proto_tree *tn3270_tree, tvbuff_t int start=offset, sdp; hf_items fields[] = { - { hf_tn3270_fsad_flags, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_fsad_limin, 0, 2, 0 }, - { hf_tn3270_fsad_limout, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_fsad_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fsad_limin, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_fsad_limout, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3401,7 +3412,7 @@ dissect_query_reply_format_storage_aux_device(proto_tree *tn3270_tree, tvbuff_t if (sdp == 0x01) { /*DAID*/ offset += dissect_daid_sd_parm(tn3270_tree, tvb, offset); proto_tree_add_item(tn3270_tree, hf_tn3270_fsad_size ,tvb, offset, - 2, FALSE); + 2, ENC_BIG_ENDIAN); offset+=2; } @@ -3423,8 +3434,8 @@ dissect_query_reply_highlighting(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of int np; hf_items fields[] = { - { hf_tn3270_h_np, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_h_np, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -3440,7 +3451,7 @@ dissect_query_reply_highlighting(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of hf_tn3270_h_vi, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; if (tvb_get_guint8(tvb, offset) == 0xFF) { offset++; @@ -3449,7 +3460,7 @@ dissect_query_reply_highlighting(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of hf_tn3270_h_ai, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } @@ -3467,12 +3478,12 @@ dissect_query_reply_ibm_aux_device(proto_tree *tn3270_tree, tvbuff_t *tvb, gint int done = 0; hf_items fields[] = { - { hf_tn3270_ibm_flags, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_ibm_limin, 0, 2, 0 }, - { hf_tn3270_ibm_limout, 0, 2, 0 }, - { hf_tn3270_ibm_type, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ibm_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ibm_limin, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ibm_limout, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ibm_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3515,34 +3526,34 @@ dissect_query_reply_implicit_partitions_sd_parms(proto_tree *tn3270_tree, tvbuff int sdp; hf_items sdp1[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_ip_flags, 0, 1, 0 }, - { hf_tn3270_ipdd_wd, 0, 2, 0 }, - { hf_tn3270_ipdd_hd, 0, 2, 0 }, - { hf_tn3270_ipdd_wa, 0, 2, 0 }, - { hf_tn3270_ipdd_ha, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ip_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipdd_wd, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipdd_hd, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipdd_wa, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipdd_ha, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_ip_flags, 0, 1, 0 }, - { hf_tn3270_ippd_dpbs, 0, 4, 0 }, - { hf_tn3270_ippd_apbs, 0, 4, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ip_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ippd_dpbs, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ippd_apbs, 0, 4, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items sdp3[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_ip_flags, 0, 1, 0 }, - { hf_tn3270_ipccd_wcd, 0, 2, 0 }, - { hf_tn3270_ipccd_hcd, 0, 2, 0 }, - { hf_tn3270_ipccd_wca, 0, 2, 0 }, - { hf_tn3270_ipccd_hca, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ip_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipccd_wcd, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipccd_hcd, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipccd_wca, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ipccd_hca, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; sdp_len = tvb_get_guint8(tvb, offset); @@ -3581,9 +3592,9 @@ dissect_query_reply_implicit_partitions(proto_tree *tn3270_tree, tvbuff_t *tvb, int i; hf_items fields[] = { - { hf_tn3270_ip_flags, 0, 1, 0 }, - { hf_tn3270_ip_flags, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ip_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ip_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -3608,12 +3619,12 @@ dissect_query_reply_ioca_aux_device(proto_tree *tn3270_tree, tvbuff_t *tvb, gint int start=offset; hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_ioca_limin, 0, 2, 0 }, - { hf_tn3270_ioca_limout, 0, 2, 0 }, - { hf_tn3270_ioca_type, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ioca_limin, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ioca_limout, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ioca_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3633,10 +3644,10 @@ dissect_query_reply_msr_control(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off int start=offset; hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_msr_nd, 0, 1, 0 }, - { hf_tn3270_msr_type, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_msr_nd, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_msr_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3656,11 +3667,11 @@ dissect_query_reply_oem_auxiliary_device(proto_tree *tn3270_tree, tvbuff_t *tvb, int i; hf_items fields[] = { - { hf_tn3270_resbyte, 0, 1, 0 }, - { hf_tn3270_oem_dsref, 0, 1, 0 }, - { hf_tn3270_oem_dtype, 0, 8, 0 }, - { hf_tn3270_oem_uname, 0, 8, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_oem_dsref, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_oem_dtype, 0, 8, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn3270_oem_uname, 0, 8, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -3685,10 +3696,10 @@ dissect_query_reply_paper_feed_techniques(proto_tree *tn3270_tree, tvbuff_t *tvb int start=offset; hf_items fields[] = { - { hf_tn3270_pft_flags, 0, 1, 0 }, - { hf_tn3270_pft_tmo, 0, 2, 0 }, - { hf_tn3270_pft_bmo, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_pft_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_pft_tmo, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_pft_bmo, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3706,9 +3717,9 @@ dissect_query_reply_partition_characteristics(proto_tree *tn3270_tree, tvbuff_t int done = 0; hf_items fields[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; for (i = 0; i < 2; i++) { @@ -3717,7 +3728,7 @@ dissect_query_reply_partition_characteristics(proto_tree *tn3270_tree, tvbuff_t case 0x01: /*Viewport Outline*/ offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); proto_tree_add_item(tn3270_tree, hf_tn3270_pc_vo_thickness, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; break; case 0x03: /*Enable User Call-Up*/ @@ -3747,10 +3758,10 @@ dissect_query_reply_product_defined_data_stream(proto_tree *tn3270_tree, tvbuff_ int start=offset, sdp; hf_items fields[] = { - { hf_tn3270_resbytes, 0, 2, 0 }, - { hf_tn3270_pdds_refid, 0, 1, 0 }, - { hf_tn3270_pdds_ssid, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_pdds_refid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_pdds_ssid, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3778,7 +3789,7 @@ dissect_query_reply_modes(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_mode, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } offset += dissect_unknown_data(tn3270_tree, tvb, offset, start, sf_length); @@ -3795,9 +3806,9 @@ dissect_query_reply_rpq_names(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offse int rpql; hf_items fields[] = { - { hf_tn3270_rpq_device,0, 4, 0 }, - { hf_tn3270_rpq_mid,0, 4, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_rpq_device,0, 4, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn3270_rpq_mid,0, 4, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, @@ -3809,14 +3820,14 @@ dissect_query_reply_rpq_names(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offse hf_tn3270_rpq_rpql, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_rpq_name, tvb, offset, (rpql - 1), - FALSE); + ENC_EBCDIC|ENC_NA); offset+=(rpql-1); offset += dissect_unknown_data(tn3270_tree, tvb, offset, start, sf_length); @@ -3832,8 +3843,8 @@ dissect_query_reply_save_or_restore_format(proto_tree *tn3270_tree, tvbuff_t *tv int start=offset; hf_items fields[] = { - { hf_tn3270_srf_fpcbl, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_srf_fpcbl, 0, 1, 0, ENC_NA }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3853,14 +3864,14 @@ dissect_query_reply_settable_printer_characteristics(proto_tree *tn3270_tree, tv int start=offset, sdp; hf_items fields[] = { - { hf_tn3270_resbytes, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items fields2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -3869,7 +3880,7 @@ dissect_query_reply_settable_printer_characteristics(proto_tree *tn3270_tree, tv if (sdp == 0x01) { /*Early Print Complete*/ offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields2); proto_tree_add_item(tn3270_tree, hf_tn3270_spc_epc_flags, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset++; } @@ -3886,12 +3897,12 @@ dissect_query_reply_storage_pools(proto_tree *tn3270_tree, tvbuff_t *tvb, gint o int start=offset, sdp, i; hf_items fields2[] = { - { hf_tn3270_sdp_ln, 0, 1, 0 }, - { hf_tn3270_sdp_id, 0, 1, 0 }, - { hf_tn3270_sp_spid, 0, 1, 0 }, - { hf_tn3270_sp_size, 0, 4, 0 }, - { hf_tn3270_sp_space, 0, 4, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_sdp_ln, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sdp_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sp_spid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sp_size, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_sp_space, 0, 4, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; sdp = tvb_get_guint8(tvb, offset+1); @@ -3899,7 +3910,7 @@ dissect_query_reply_storage_pools(proto_tree *tn3270_tree, tvbuff_t *tvb, gint o offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields2); for (i=0; i < (sf_length - 4); i+=2) { proto_tree_add_item(tn3270_tree, hf_tn3270_sp_objlist, - tvb, offset, 2, FALSE); + tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; } } @@ -3925,7 +3936,7 @@ dissect_query_reply_summary(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, hf_tn3270_sf_query_reply, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } offset += dissect_unknown_data(tn3270_tree, tvb, offset, start, sf_length); @@ -3940,21 +3951,21 @@ dissect_query_reply_text_partitions(proto_tree *tn3270_tree, tvbuff_t *tvb, gint int start=offset, len, i; hf_items fields[] = { - { hf_tn3270_tp_nt, 0, 1, 0 }, - { hf_tn3270_tp_m, 0, 2, 0 }, - { hf_tn3270_tp_flags, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_tp_nt, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_tp_m, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_tp_flags, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); len = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tn3270_tree, hf_tn3270_tp_ntt, tvb, offset, 1, FALSE); + proto_tree_add_item(tn3270_tree, hf_tn3270_tp_ntt, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; for (i=0; i < len; i++) { proto_tree_add_item(tn3270_tree, hf_tn3270_tp_tlist, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } @@ -3971,15 +3982,15 @@ dissect_query_reply_transparency(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of int start=offset, i, len; len = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tn3270_tree, hf_tn3270_t_np, tvb, offset, 1, FALSE); + proto_tree_add_item(tn3270_tree, hf_tn3270_t_np, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; for (i=0; i < len; i+=2) { proto_tree_add_item(tn3270_tree, hf_tn3270_t_vi, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_t_ai, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } @@ -4013,25 +4024,25 @@ dissect_query_reply_usable_area(proto_tree *tn3270_tree, tvbuff_t *tvb, gint off }; hf_items fields[] = { - { hf_tn3270_usable_area_flags1, ett_tn3270_usable_area_flags1, 1, byte1 }, - { hf_tn3270_usable_area_flags2, ett_tn3270_usable_area_flags1, 1, byte2 }, - { hf_tn3270_ua_width_cells_pels, 0, 2, 0 }, - { hf_tn3270_ua_height_cells_pels, 0, 2, 0 }, - { hf_tn3270_ua_uom_cells_pels, 0, 1, 0 }, - { hf_tn3270_ua_xr, 0, 4, 0 }, - { hf_tn3270_ua_yr, 0, 4, 0 }, - { hf_tn3270_ua_aw, 0, 1, 0 }, - { hf_tn3270_ua_ah, 0, 1, 0 }, - { hf_tn3270_ua_buffsz, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_usable_area_flags1, ett_tn3270_usable_area_flags1, 1, byte1, 0 }, + { hf_tn3270_usable_area_flags2, ett_tn3270_usable_area_flags1, 1, byte2, 0 }, + { hf_tn3270_ua_width_cells_pels, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_height_cells_pels, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_uom_cells_pels, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_xr, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_yr, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_aw, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_ah, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_buffsz, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items fields2[] = { - { hf_tn3270_ua_xmin, 0, 1, 0 }, - { hf_tn3270_ua_ymin, 0, 1, 0 }, - { hf_tn3270_ua_xmax, 0, 1, 0 }, - { hf_tn3270_ua_ymax, 0, 1, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_ua_xmin, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_ymin, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_xmax, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_ua_ymax, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; vcp = tvb_get_guint8(tvb, offset+1); @@ -4058,9 +4069,9 @@ dissect_query_reply_3270_ipds(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offse int start=offset; hf_items fields[] = { - { hf_tn3270_resbytes, 0, 2, 0 }, - { hf_tn3270_3270_tranlim, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_resbytes, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_3270_tranlim, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn3270_add_hf_items(tn3270_tree, tvb, offset, fields); @@ -4081,13 +4092,13 @@ process_in_out_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of hf_tn3270_data_chain_bitmask, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_resbyte, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case DESTINATION_OR_ORIGIN: @@ -4095,19 +4106,19 @@ process_in_out_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of hf_tn3270_destination_or_origin_bitmask, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_resbyte, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_sf_inbound_outbound_id, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; break; case OBJECT_DATA: @@ -4124,7 +4135,7 @@ process_in_out_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint of hf_tn3270_resbytes, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; break; default: @@ -4145,7 +4156,7 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_double_byte_sf_id, tvb, offset-1, 2, - FALSE); + ENC_BIG_ENDIAN); offset++; switch (full_sf_id) { case BEGIN_OR_END_OF_FILE: @@ -4153,20 +4164,20 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; /*TODO: use bits_text */ proto_tree_add_bits_item(tn3270_tree, hf_tn3270_begin_end_flags1, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_bits_item(tn3270_tree, hf_tn3270_begin_end_flags2, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case LOAD_COLOR_TABLE: @@ -4175,7 +4186,7 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_load_color_command, tvb, offset, (sf_length - 4), - FALSE); + ENC_NA); offset+=(sf_length - 4); break; case LOAD_FORMAT_STORAGE: @@ -4187,7 +4198,7 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_load_line_type_command, tvb, offset, (sf_length - 4), - FALSE); + ENC_NA); offset+=(sf_length - 4); break; case MODIFY_PARTITION: @@ -4201,7 +4212,7 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_resbyte, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case RESTART: @@ -4212,7 +4223,7 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_color_command, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; break; case SET_CHECKPOINT_INTERVAL: @@ -4220,13 +4231,13 @@ process_double_byte_sf(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset, gint hf_tn3270_resbyte, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_interval, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; break; case SET_MSR_CONTROL: @@ -4265,10 +4276,10 @@ dissect_outbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_tn3270_sf_length, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; sf_id = tvb_get_guint8(tvb, offset); - ti = proto_tree_add_item(tn3270_tree, hf_tn3270_sf_outbound_id, tvb, offset, 1, FALSE); + ti = proto_tree_add_item(tn3270_tree, hf_tn3270_sf_outbound_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; sf_tree = proto_item_add_subtree(ti, ett_sf); switch (sf_id) { @@ -4286,7 +4297,7 @@ dissect_outbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case CREATE_PARTITION: @@ -4297,7 +4308,7 @@ dissect_outbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_tn3270_erase_flags, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case LOAD_PROGRAMMED_SYMBOLS: @@ -4317,13 +4328,13 @@ dissect_outbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(sf_tree, hf_tn3270_scs_data, tvb, offset, (sf_length - 4), - FALSE); + ENC_NA); offset+=(sf_length - 4); break; case SET_REPLY_MODE: @@ -4334,13 +4345,13 @@ dissect_outbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(sf_tree, hf_tn3270_format_group, tvb, offset, (sf_length - 4), - FALSE); + ENC_EBCDIC|ENC_NA); offset+=(sf_length - 4); break; case SET_WINDOW_ORIGIN: @@ -4348,19 +4359,19 @@ dissect_outbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint hf_tn3270_partition_id, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(sf_tree, hf_tn3270_partition_rw, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; proto_tree_add_item(sf_tree, hf_tn3270_partition_cw, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; break; default: @@ -4387,7 +4398,7 @@ dissect_inbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint o hf_tn3270_null, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; sf_length = tvb_get_ntohs(tvb, offset); } @@ -4396,11 +4407,11 @@ dissect_inbound_structured_fields(proto_tree *tn3270_tree, tvbuff_t *tvb, gint o hf_tn3270_sf_length, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; sf_id = tvb_get_ntohs(tvb, offset); - ti = proto_tree_add_item(tn3270_tree, hf_tn3270_sf_inbound_id, tvb, offset, 2, FALSE); + ti = proto_tree_add_item(tn3270_tree, hf_tn3270_sf_inbound_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; sf_tree = proto_item_add_subtree(ti, ett_sf); switch (sf_id) { @@ -4557,7 +4568,7 @@ dissect_stop_address(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_stop_address, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset++; is_ge = tvb_get_guint8(tvb, offset); if (is_ge != GE) { @@ -4565,7 +4576,7 @@ dissect_stop_address(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_character_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } @@ -4674,7 +4685,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_attribute_type, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; switch (attribute_type) { case ALL_CHARACTER_ATTRIBUTES: @@ -4682,7 +4693,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_all_character_attributes, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case T3270_FIELD_ATTRIBUTE: @@ -4693,7 +4704,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_extended_highlighting, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case FOREGROUND_COLOR: @@ -4702,7 +4713,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_color, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case CHARACTER_SET: @@ -4710,7 +4721,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_character_set, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case FIELD_OUTLINING: @@ -4718,7 +4729,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_field_outlining, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case TRANSPARENCY: @@ -4726,7 +4737,7 @@ dissect_field_attribute_pair(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset hf_tn3270_transparency, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case FIELD_VALIDATION: @@ -4749,7 +4760,7 @@ dissect_field_attribute_pairs(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offse hf_tn3270_number_of_attributes, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; for (i=0; i < no_of_pairs; i++) { @@ -4772,7 +4783,7 @@ dissect_orders_and_data(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_order_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; switch (order_code) { case SF: @@ -4794,7 +4805,7 @@ dissect_orders_and_data(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_character_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case SBA: @@ -4834,11 +4845,11 @@ dissect_tn3270e_header(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) int len = 0; hf_items fields[] = { - { hf_tn3270_tn3270e_data_type, 0, 1, 0 }, - { hf_tn3270_tn3270e_request_flag, 0, 1, 0 }, - { hf_tn3270_tn3270e_response_flag_3270_SCS, 0, 1, 0 }, - { hf_tn3270_tn3270e_seq_number, 0, 2, 0 }, - { 0, 0, 0, 0 }, + { hf_tn3270_tn3270e_data_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_tn3270e_request_flag, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_tn3270e_response_flag_3270_SCS, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn3270_tn3270e_seq_number, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; data_type = tvb_get_guint8(tvb, offset); @@ -4855,7 +4866,7 @@ dissect_tn3270e_header(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) case TN3270E_SSCP_LU_DATA: case TN3270E_UNBIND: len = tvb_length_remaining(tvb, offset); - proto_tree_add_item(tn3270_tree, hf_tn3270_tn3270e_header_data, tvb, offset, len, FALSE); + proto_tree_add_item(tn3270_tree, hf_tn3270_tn3270e_header_data, tvb, offset, len, ENC_EBCDIC|ENC_NA); offset += len; break; default: @@ -4885,7 +4896,7 @@ dissect_outbound_stream(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; /* WCC */ offset += dissect_wcc(tn3270_tree, tvb, offset); @@ -4897,7 +4908,7 @@ dissect_outbound_stream(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_outbound_structured_fields(tn3270_tree, tvb, offset); break; @@ -4923,7 +4934,7 @@ dissect_inbound_stream(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_aid, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; switch (aid) { case STRUCTURED_FIELD: @@ -4971,14 +4982,14 @@ dissect_inbound_stream(proto_tree *tn3270_tree, tvbuff_t *tvb, gint offset) hf_tn3270_cursor_x, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tn3270_tree, hf_tn3270_cursor_y, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_orders_and_data(tn3270_tree, tvb, offset); break; @@ -5017,7 +5028,7 @@ dissect_tn3270(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; if (tree) { - ti = proto_tree_add_item(tree, proto_tn3270, tvb, offset, -1, FALSE); + ti = proto_tree_add_item(tree, proto_tn3270, tvb, offset, -1, ENC_NA); tn3270_tree = proto_item_add_subtree(ti, ett_tn3270); col_clear(pinfo->cinfo, COL_INFO); @@ -5356,7 +5367,7 @@ proto_register_tn3270(void) /* 5.10 - Load Color Table */ { &hf_tn3270_load_color_command, { "Command", "tn3270.load_color_command", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* End - 5.10 - Load Color Table */ @@ -5375,26 +5386,26 @@ proto_register_tn3270(void) NULL, HFILL }}, { &hf_tn3270_load_format_storage_localname, { "Local name for user selectable formats", "tn3270.load_format_storage_localname", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn3270_format_group, { "Format Group name", "tn3270.format_group_name", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn3270_format_name, { "Format name", "tn3270.format_name", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn3270_load_format_storage_format_data, { "Format data", "tn3270.load_format_storage_format_data", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* END - 5.11 - Load Format Storage */ /* 5.12 - Load Line Type */ { &hf_tn3270_load_line_type_command, { "Line Type Command", "tn3270.load_line_type_command", - FT_UINT8, BASE_HEX, NULL, 0x0, + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* 5.13 - Load Programmed Symbols */ @@ -5666,7 +5677,7 @@ proto_register_tn3270(void) { &hf_tn3270_type_1_text_outbound_data, { "Type 1 text outbound data", "tn3270.type_1_text_outbound_data", - FT_UINT8, BASE_HEX, NULL, 0x0, + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* 6.2 - Exception/Status */ @@ -6070,17 +6081,8 @@ proto_register_tn3270(void) /* 6.15 - Query Reply (Data Chaining) */ { &hf_tn3270_dc_dir_flags, { "Indicates which direction can use the Data Chain structured field.", "tn3270.dc_dir_flags", - FT_UINT8, BASE_HEX, NULL, 0x0, + FT_UINT8, BASE_HEX, VALS(vals_data_chaining_dir), 0xC0, NULL, HFILL }}, - { &hf_tn3270_dc_both, - { "Both", - "tn3270.dc_both", FT_BOOLEAN, 8, NULL, 0x00, NULL, HFILL }}, - { &hf_tn3270_dc_from_device, - { "From Device Only", - "tn3270.dc_device", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, - { &hf_tn3270_dc_to_device, - { "To Device Only", - "tn3270.dc_to_device", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, /* END - 6.15 - Query Reply (Data Chaining) */ /* 6.16 - Query Reply (Data Streams) */ @@ -6306,11 +6308,11 @@ proto_register_tn3270(void) NULL, HFILL }}, { &hf_tn3270_oem_dtype, { "Device type", "tn3270.oem_dtype", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn3270_oem_uname, { "User assigned name", "tn3270.oem_uname", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn3270_sdp_daid, { "Destination/Origin ID", "tn3270.oem_sdp_daid_doid", @@ -6366,7 +6368,7 @@ proto_register_tn3270(void) /* 6.43 - Query Reply (RPQ Names) */ { &hf_tn3270_rpq_device, { "Device type identifier", "tn3270.rpq_device", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn3270_rpq_mid, { "Model type identifier", "tn3270.rpq_mid", @@ -6378,7 +6380,7 @@ proto_register_tn3270(void) NULL, HFILL }}, { &hf_tn3270_rpq_name, { "RPQ name", "tn3270.rpq_name", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* END - Query Reply (Names) */ @@ -6550,7 +6552,7 @@ proto_register_tn3270(void) NULL, HFILL }}, { &hf_tn3270_field_data, { "Field Data", "tn3270.field_data", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, "tn3270.field_data", HFILL }}, { &hf_tn3270_number_of_attributes, { "Number of Attributes", "tn3270.number_of_attributes", @@ -6590,7 +6592,7 @@ proto_register_tn3270(void) NULL, HFILL }}, { &hf_tn3270_unknown_data, { "Unknown Data (Possible Mainframe/Emulator Bug)", "tn3270.unknown_data", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /*TN3270E - Header Fields */ @@ -6612,7 +6614,7 @@ proto_register_tn3270(void) NULL, HFILL }}, { &hf_tn3270_tn3270e_header_data, { "TN3270E Header Data", "tn3270.tn3270e_header_data", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; diff --git a/epan/dissectors/packet-tn5250.c b/epan/dissectors/packet-tn5250.c index eb7f84e6b2..13dde8acb4 100644 --- a/epan/dissectors/packet-tn5250.c +++ b/epan/dissectors/packet-tn5250.c @@ -5,6 +5,7 @@ * 5494 Remote Control Unit - Functions Reference * Release 3.0 Document Number SC30-3533-04 * Chapters 12, 15, 16 + * http://publibfp.dhe.ibm.com/cgi-bin/bookmgr/BOOKS/co2e2001/CCONTENTS * * Copyright 2009, Robert Hogan <robert@roberthogan.net> * @@ -14,7 +15,6 @@ * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -28,7 +28,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ @@ -2909,6 +2908,7 @@ typedef struct hf_items { gint bitmask_ett; int length; const int **bitmask; + gint encoding; } hf_items; /* Utility Functions */ @@ -2979,7 +2979,7 @@ tn5250_add_hf_items(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, offset++; } proto_tree_add_item(tn5250_tree, fields[i].hf, tvb, offset, - fields[i].length, FALSE); + fields[i].length, fields[i].encoding); } else { proto_tree_add_bitmask(tn5250_tree, tvb, offset, fields[i].hf, fields[i].bitmask_ett, fields[i].bitmask, FALSE); @@ -3000,7 +3000,7 @@ dissect_unknown_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, if (len_left > 0) { proto_tree_add_item(tn5250_tree, hf_tn5250_unknown_data, tvb, offset, - len_left, FALSE); + len_left, ENC_NA); return len_left; } return 0; @@ -3023,9 +3023,9 @@ dissect_wcc(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items wcc_fields[] = { - { hf_tn5250_wtd_ccc1, 0, 1, 0 }, - { hf_tn5250_wtd_ccc2, ett_tn5250_wcc, 1, wcc_byte }, - { 0, 0, 0, 0 } + { hf_tn5250_wtd_ccc1, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wtd_ccc2, ett_tn5250_wcc, 1, wcc_byte, 0 }, + { 0, 0, 0, 0, 0 } }; offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, wcc_fields); @@ -3038,9 +3038,9 @@ static guint32 dissect_row_column(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) { int start = offset; - proto_tree_add_item(tn5250_tree, hf_tn5250_buffer_x, tvb, offset, 1, FALSE); + proto_tree_add_item(tn5250_tree, hf_tn5250_buffer_x, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - proto_tree_add_item(tn5250_tree, hf_tn5250_buffer_y, tvb, offset, 1, FALSE); + proto_tree_add_item(tn5250_tree, hf_tn5250_buffer_y, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return (offset - start); @@ -3061,12 +3061,12 @@ dissect_erase_to_address(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) dissect_row_column(tn5250_tree, tvb, offset); length = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tn5250_tree, hf_tn5250_length, tvb, offset, 1, FALSE); + proto_tree_add_item(tn5250_tree, hf_tn5250_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; for (i=1; i < length; i++) { proto_tree_add_item(tn5250_tree, hf_tn5250_attribute_type, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; } @@ -3109,15 +3109,15 @@ dissect_start_of_header(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items start_of_header_fields[] = { - { hf_tn5250_soh_length, 0, 1, 0 }, - { hf_tn5250_soh_flags, ett_tn5250_soh_mask, 1, byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_soh_resq, 1, 1, 0 }, - { hf_tn5250_soh_err, 1, 1, 0 }, - { hf_tn5250_soh_pf24to17, ett_tn5250_soh_pf24to17_mask, 1, byte1 }, - { hf_tn5250_soh_pf16to9, ett_tn5250_soh_pf16to9_mask, 1, byte2 }, - { hf_tn5250_soh_pf8to1, ett_tn5250_soh_pf8to1_mask, 1, byte3 }, - { 0, 0, 0, 0 } + { hf_tn5250_soh_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_soh_flags, ett_tn5250_soh_mask, 1, byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_soh_resq, 1, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_soh_err, 1, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_soh_pf24to17, ett_tn5250_soh_pf24to17_mask, 1, byte1, 0 }, + { hf_tn5250_soh_pf16to9, ett_tn5250_soh_pf16to9_mask, 1, byte2, 0 }, + { hf_tn5250_soh_pf8to1, ett_tn5250_soh_pf8to1_mask, 1, byte3, 0 }, + { 0, 0, 0, 0, 0 } }; @@ -3136,12 +3136,12 @@ dissect_twobyte_length_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint off length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tn5250_tree, hf_tn5250_length_twobyte, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; if (tvb_reported_length_remaining(tvb, offset) >= length) { proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset, - length, FALSE); + length, ENC_EBCDIC|ENC_NA); offset+=length; } else { offset += dissect_unknown_data(tn5250_tree, tvb, offset, start, length); @@ -3166,7 +3166,7 @@ dissect_field_attribute_pair(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset attribute_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tn5250_tree, hf_tn5250_attribute_type, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; switch (attribute_type) { case EXTENDED_PRIMARY_ATTRIBUTES: @@ -3176,12 +3176,12 @@ dissect_field_attribute_pair(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset break; case EXTENDED_FOREGROUND_COLOR_ATTRIBUTES: proto_tree_add_item(tn5250_tree, hf_tn5250_foreground_color_attr, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; break; case EXTENDED_IDEOGRAPHIC_ATTRIBUTES: proto_tree_add_item(tn5250_tree, hf_tn5250_ideographic_attr, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset++; break; default: @@ -3227,9 +3227,9 @@ dissect_start_of_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items outbound_text_header_fields[] = { - { hf_tn5250_ffw, ett_tn5250_soh_mask, 1, byte }, - { hf_tn5250_ffw, ett_tn5250_soh_mask, 1, byte1 }, - { 0, 0, 0, 0 } + { hf_tn5250_ffw, ett_tn5250_soh_mask, 1, byte, 0 }, + { hf_tn5250_ffw, ett_tn5250_soh_mask, 1, byte1, 0 }, + { 0, 0, 0, 0, 0 } }; ffw = tvb_get_guint8(tvb, offset); @@ -3251,7 +3251,7 @@ dissect_start_of_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) case POINTER_DEVICE_SELECTION_ENTRY_FIELD: case TRANSPARENCY_ENTRY_FIELD: proto_tree_add_item(tn5250_tree, hf_tn5250_fcw, tvb, offset, - 2, FALSE); + 2, ENC_BIG_ENDIAN); offset+=2; break; default: @@ -3269,11 +3269,11 @@ dissect_start_of_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) offset++; } else { proto_tree_add_item(tn5250_tree, hf_tn5250_fa_color, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset++; } proto_tree_add_item(tn5250_tree, hf_tn5250_length_twobyte, tvb, offset, - 2, FALSE); + 2, ENC_BIG_ENDIAN); offset+=2; return (offset - start); @@ -3295,12 +3295,12 @@ dissect_create_window(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items cw_fields[] = { - { hf_tn5250_wdsf_cw_flag1, ett_tn5250_wdsf_cw_mask, 1, byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_wd, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_ww, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_cw_flag1, ett_tn5250_wdsf_cw_mask, 1, byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_wd, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_ww, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *cw_bp_flag1[] = { @@ -3311,20 +3311,20 @@ dissect_create_window(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) hf_items cwbp_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_flag1, ett_tn5250_wdsf_cw_bp_mask, 1, cw_bp_flag1 }, - { hf_tn5250_wdsf_cw_bp_mba, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_cba, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_ulbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_tbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_urbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_lbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_rbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_llbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_bbc, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_bp_lrbc, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_bp_flag1, ett_tn5250_wdsf_cw_bp_mask, 1, cw_bp_flag1, 0 }, + { hf_tn5250_wdsf_cw_bp_mba, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_bp_cba, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_bp_ulbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_tbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_urbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_lbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_rbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_llbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_bbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_cw_bp_lrbc, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; static const int *cw_tf_flag1[] = { @@ -3336,13 +3336,13 @@ dissect_create_window(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) hf_items cw_tf_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_tf_flag, ett_tn5250_wdsf_cw_tf_mask, 1, cw_tf_flag1 }, - { hf_tn5250_wdsf_cw_tf_mba, 0, 1, 0 }, - { hf_tn5250_wdsf_cw_tf_cba, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_tf_flag, ett_tn5250_wdsf_cw_tf_mask, 1, cw_tf_flag1, 0 }, + { hf_tn5250_wdsf_cw_tf_mba, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cw_tf_cba, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, cw_fields); @@ -3356,7 +3356,7 @@ dissect_create_window(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) length = tvb_get_guint8(tvb,offset); offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, cw_tf_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_cw_tf_text, tvb, offset, - (length - 6), FALSE); + (length - 6), ENC_EBCDIC|ENC_NA); offset += (guint32)((length - 6)); default: done = 1; @@ -3406,25 +3406,25 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_fields[] = { - { hf_tn5250_wdsf_ds_flag1, ett_tn5250_wdsf_ds_mask, 1, ds_flag1 }, - { hf_tn5250_wdsf_ds_flag2, ett_tn5250_wdsf_ds_mask, 1, ds_flag2 }, - { hf_tn5250_wdsf_ds_flag3, ett_tn5250_wdsf_ds_mask, 1, ds_flag3 }, - { hf_tn5250_wdsf_ds_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_gdc, ett_tn5250_wdsf_ds_mask, 1, ds_gdc }, - { hf_tn5250_wdsf_ds_nws, ett_tn5250_wdsf_ds_mask, 1, ds_nws }, - { hf_tn5250_wdsf_ds_nws_wout, ett_tn5250_wdsf_ds_mask, 1, ds_nws }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_textsize, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_rows, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_columns, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_padding, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_numeric_sep, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_country_sel, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cancel_aid, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_totalrows, 0, 4, 0 }, - { hf_tn5250_wdsf_ds_sliderpos, 0, 4, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_ds_flag1, ett_tn5250_wdsf_ds_mask, 1, ds_flag1, 0 }, + { hf_tn5250_wdsf_ds_flag2, ett_tn5250_wdsf_ds_mask, 1, ds_flag2, 0 }, + { hf_tn5250_wdsf_ds_flag3, ett_tn5250_wdsf_ds_mask, 1, ds_flag3, 0 }, + { hf_tn5250_wdsf_ds_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_gdc, ett_tn5250_wdsf_ds_mask, 1, ds_gdc, 0 }, + { hf_tn5250_wdsf_ds_nws, ett_tn5250_wdsf_ds_mask, 1, ds_nws, 0 }, + { hf_tn5250_wdsf_ds_nws_wout, ett_tn5250_wdsf_ds_mask, 1, ds_nws, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_textsize, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_rows, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_columns, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_padding, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_numeric_sep, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_country_sel, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_cancel_aid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_totalrows, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sliderpos, 0, 4, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *ds_ct_flag1[] = { @@ -3449,16 +3449,16 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_ct_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ct_flag1, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag1 }, - { hf_tn5250_wdsf_ds_ct_flag2, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag2 }, - { hf_tn5250_wdsf_ds_ct_flag3, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag3 }, - { hf_tn5250_wdsf_ds_ct_mnemonic_offset, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ct_aid, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ct_numeric_onebyte, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ct_numeric_twobyte, 0, 2, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_ct_flag1, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag1, 0 }, + { hf_tn5250_wdsf_ds_ct_flag2, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag2, 0 }, + { hf_tn5250_wdsf_ds_ct_flag3, ett_tn5250_wdsf_ds_ct_mask, 1, ds_ct_flag3, 0 }, + { hf_tn5250_wdsf_ds_ct_mnemonic_offset, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_ct_aid, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_ct_numeric_onebyte, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_ct_numeric_twobyte, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *ds_mbs_flag[] = { @@ -3468,16 +3468,16 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_mbs_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_mbs_flag, ett_tn5250_wdsf_ds_mbs_mask, 1, ds_mbs_flag }, - { hf_tn5250_wdsf_ds_mbs_start_column, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_mbs_end_column, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_mbs_start_column, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_mbs_monochrome_sep, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_mbs_color_sep, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_mbs_sep_char, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_mbs_flag, ett_tn5250_wdsf_ds_mbs_mask, 1, ds_mbs_flag, 0 }, + { hf_tn5250_wdsf_ds_mbs_start_column, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_mbs_end_column, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_mbs_start_column, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_mbs_monochrome_sep, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_mbs_color_sep, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_mbs_sep_char, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; static const int *ds_cpda_flag[] = { @@ -3487,26 +3487,26 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_cpda_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_flag1, ett_tn5250_wdsf_ds_cpda_mask, 1, ds_cpda_flag }, - { hf_tn5250_wdsf_ds_cpda_monochrome_sel_avail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_sel_avail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_sel_selected, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_sel_selected, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_sel_unavail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_sel_unavail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_avail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_avail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_selected, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_selected, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_unavail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_unavail, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_indicator, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_indicator, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_monochrome_unavail_indicator, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_cpda_color_unavail_indicator, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_flag1, ett_tn5250_wdsf_ds_cpda_mask, 1, ds_cpda_flag, 0 }, + { hf_tn5250_wdsf_ds_cpda_monochrome_sel_avail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_sel_avail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_sel_selected, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_sel_selected, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_sel_unavail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_sel_unavail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_avail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_avail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_selected, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_selected, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_unavail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_unavail, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_indicator, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_indicator, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_monochrome_unavail_indicator, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_cpda_color_unavail_indicator, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *ds_ci_flag[] = { @@ -3515,13 +3515,13 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_ci_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ci_flag1, ett_tn5250_wdsf_ds_ci_mask, 1, ds_ci_flag }, - { hf_tn5250_wdsf_ds_ci_left_push, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ci_right_push, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_ci_first_choice, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_ci_flag1, ett_tn5250_wdsf_ds_ci_mask, 1, ds_ci_flag, 0 }, + { hf_tn5250_wdsf_ds_ci_left_push, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_ci_right_push, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_ci_first_choice, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; static const int *ds_sbi_flag[] = { @@ -3530,18 +3530,18 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_sbi_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_flag1, ett_tn5250_wdsf_ds_sbi_mask, 1, ds_sbi_flag }, - { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_color_top_highlight, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_top_character, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_bottom_character, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_empty_character, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_slider_character, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_flag1, ett_tn5250_wdsf_ds_sbi_mask, 1, ds_sbi_flag, 0 }, + { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_color_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_top_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_sbi_bottom_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_sbi_empty_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_sbi_slider_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_fields); @@ -3555,15 +3555,15 @@ dissect_define_selection(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, ds_ct_fields); if (digit_selection & DS_NUMERIC_SELECTION_SINGLE_DIGIT) { proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_ds_ct_numeric_onebyte, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } else if (digit_selection & DS_NUMERIC_SELECTION_DOUBLE_DIGIT) { proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_ds_ct_numeric_twobyte, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } proto_tree_add_item(tn5250_tree, hf_tn5250_wdsf_ds_ct_text, tvb, offset, - (length - (offset - start)), FALSE); + (length - (offset - start)), ENC_EBCDIC|ENC_NA); offset += (guint32)((length - (offset - start))); break; case DS_MENU_BAR_SEPARATOR: @@ -3599,12 +3599,12 @@ dissect_define_scrollbar(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items dsb_fields[] = { - { hf_tn5250_wdsf_dsb_flag1, ett_tn5250_wdsf_dsb_mask, 1, dsb_byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_wdsf_sbi_total_scroll, 0, 4, 0 }, - { hf_tn5250_wdsf_sbi_sliderpos, 0, 4, 0 }, - { hf_tn5250_wdsf_sbi_rowscols, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_dsb_flag1, ett_tn5250_wdsf_dsb_mask, 1, dsb_byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_sbi_total_scroll, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_sbi_sliderpos, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_sbi_rowscols, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *ds_sbi_flag[] = { @@ -3613,18 +3613,18 @@ dissect_define_scrollbar(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items ds_sbi_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_flag1, ett_tn5250_wdsf_ds_sbi_mask, 1, ds_sbi_flag }, - { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_color_top_highlight, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_top_character, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_bottom_character, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_empty_character, 0, 1, 0 }, - { hf_tn5250_wdsf_ds_sbi_slider_character, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_flag1, ett_tn5250_wdsf_ds_sbi_mask, 1, ds_sbi_flag, 0 }, + { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_color_top_highlight, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_monochrome_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_color_top_highlight_shaft, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_ds_sbi_top_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_sbi_bottom_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_sbi_empty_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_wdsf_ds_sbi_slider_character, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; @@ -3661,14 +3661,14 @@ dissect_draw_erase_gridlines(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset }; hf_items deg_fields[] = { - { hf_tn5250_wdsf_deg_partition, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_flag1, ett_tn5250_wdsf_deg_mask, 1, deg_byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_flag2, ett_tn5250_wdsf_deg_mask, 1, deg_byte2 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_default_color, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_default_line, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_deg_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_flag1, ett_tn5250_wdsf_deg_mask, 1, deg_byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_flag2, ett_tn5250_wdsf_deg_mask, 1, deg_byte2, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_default_color, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_default_line, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -3678,17 +3678,17 @@ dissect_draw_erase_gridlines(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset }; hf_items deg_ms_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_minor_type, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_flag1, ett_tn5250_wdsf_deg_ms_mask, 1, deg_ms_byte }, - { hf_tn5250_wdsf_deg_ms_start_row, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_start_column, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_horizontal_dimension, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_vertical_dimension, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_default_color, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_line_repeat, 0, 1, 0 }, - { hf_tn5250_wdsf_deg_ms_line_interval, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_flag1, ett_tn5250_wdsf_deg_ms_mask, 1, deg_ms_byte, 0 }, + { hf_tn5250_wdsf_deg_ms_start_row, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_start_column, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_horizontal_dimension, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_vertical_dimension, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_default_color, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_line_repeat, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_deg_ms_line_interval, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, deg_fields); @@ -3722,10 +3722,10 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse int done = 0, ln_left = 0, i = 0; hf_items standard_fields[] = { - { hf_tn5250_sf_length, 0, 2, 0 }, - { hf_tn5250_sf_class, 0, 1, 0 }, - { hf_tn5250_sf_type, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *rgw_byte[] = { @@ -3736,10 +3736,10 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse }; hf_items rgw_fields[] = { - { hf_tn5250_wdsf_rgw_flag1, ett_tn5250_wdsf_rgw_mask, 1, rgw_byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_rgw_flag1, ett_tn5250_wdsf_rgw_mask, 1, rgw_byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *ragc_byte[] = { @@ -3749,10 +3749,10 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse }; hf_items ragc_fields[] = { - { hf_tn5250_wdsf_ragc_flag1, ett_tn5250_wdsf_ragc_mask, 1, ragc_byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_ragc_flag1, ett_tn5250_wdsf_ragc_mask, 1, ragc_byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *wdf_byte[] = { @@ -3762,9 +3762,9 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse }; hf_items wdf_fields[] = { - { hf_tn5250_wdsf_wdf_flag1, ett_tn5250_wdsf_wdf_mask, 1, wdf_byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_wdf_flag1, ett_tn5250_wdsf_wdf_mask, 1, wdf_byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *pmb_byte[] = { @@ -3775,20 +3775,20 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse }; hf_items pmb_fields[] = { - { hf_tn5250_wdsf_pmb_flag1, ett_tn5250_wdsf_pmb_mask, 1, pmb_byte }, - { hf_tn5250_wdsf_pmb_first_mouse_event, 0, 1, 0 }, - { hf_tn5250_wdsf_pmb_second_mouse_event, 0, 1, 0 }, - { hf_tn5250_aid, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_pmb_flag1, ett_tn5250_wdsf_pmb_mask, 1, pmb_byte, 0 }, + { hf_tn5250_wdsf_pmb_first_mouse_event, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_pmb_second_mouse_event, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_aid, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items cgl_fields[] = { - { hf_tn5250_wdsf_cgl_partition, 0, 1, 0 }, - { hf_tn5250_wdsf_cgl_start_row, 0, 1, 0 }, - { hf_tn5250_wdsf_cgl_start_column, 0, 1, 0 }, - { hf_tn5250_wdsf_cgl_rectangle_width, 0, 1, 0 }, - { hf_tn5250_wdsf_cgl_rectangle_height, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wdsf_cgl_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cgl_start_row, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cgl_start_column, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cgl_rectangle_width, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wdsf_cgl_rectangle_height, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; length = tvb_get_ntohs(tvb,offset); @@ -3805,9 +3805,9 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse case REMOVE_GUI_SELECTION_FIELD: case REMOVE_GUI_SCROLL_BAR_FIELD: proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset +=2; break; case REMOVE_GUI_WINDOW: @@ -3825,14 +3825,14 @@ dissect_wdsf_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offse case WRITE_DATA: offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, wdf_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset, - (length - 6), FALSE); + (length - 6), ENC_EBCDIC|ENC_NA); offset += (guint32)((length - 6)); break; case PROGRAMMABLE_MOUSE_BUTTONS: proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset +=2; ln_left = length - (offset - start); for (i = 0; i < ln_left; i+=4) { @@ -3888,7 +3888,7 @@ dissect_tn5250_ra_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) if (offset > start) { proto_tree_add_item(tn5250_tree, hf_tn5250_repeated_character, - tvb, start, (offset - start), FALSE); + tvb, start, (offset - start), ENC_EBCDIC|ENC_NA); } return (offset - start); @@ -3911,7 +3911,7 @@ dissect_tn5250_orders_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs case TN5250_MC: case TN5250_SBA: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_row_column(cc_tree, tvb, offset); @@ -3919,7 +3919,7 @@ dissect_tn5250_orders_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs break; case TN5250_RA: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_row_column(cc_tree, tvb, offset); @@ -3927,35 +3927,35 @@ dissect_tn5250_orders_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs break; case TN5250_EA: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_erase_to_address(cc_tree, tvb, offset); break; case TN5250_SOH: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_start_of_header(cc_tree, tvb, offset); break; case TN5250_TD: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_twobyte_length_and_data(cc_tree, tvb, offset); break; case TN5250_WEA: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_field_attribute_pair(cc_tree, tvb, offset); break; case TN5250_SF: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_start_of_field(cc_tree, tvb, offset); @@ -3963,7 +3963,7 @@ dissect_tn5250_orders_and_data(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs break; case TN5250_WDSF: ti = proto_tree_add_item(tn5250_tree, hf_tn5250_order_code, tvb, - offset, 1, FALSE); + offset, 1, ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); offset += dissect_wdsf_structured_field(cc_tree, tvb, offset); @@ -3990,13 +3990,13 @@ dissect_save_partial_screen(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items save_partial_screen_fields[] = { - { hf_tn5250_soh_length, 0, 1, 0 }, - { hf_tn5250_sps_flag1, ett_tn5250_sps_mask, 1, byte }, - { hf_tn5250_sps_top_row, 0, 1, 0 }, - { hf_tn5250_sps_left_column, 0, 1, 0 }, - { hf_tn5250_sps_window_depth, 0, 1, 0 }, - { hf_tn5250_sps_window_width, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_soh_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sps_flag1, ett_tn5250_sps_mask, 1, byte, 0 }, + { hf_tn5250_sps_top_row, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sps_left_column, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sps_window_depth, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sps_window_width, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; length = tvb_get_guint8(tvb, offset); @@ -4023,10 +4023,10 @@ dissect_roll(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items roll_fields[] = { - { hf_tn5250_roll_flag1, ett_tn5250_roll_mask, 1, byte }, - { hf_tn5250_roll_top_line, 0, 1, 0 }, - { hf_tn5250_roll_bottom_line, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_roll_flag1, ett_tn5250_roll_mask, 1, byte, 0 }, + { hf_tn5250_roll_top_line, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_roll_bottom_line, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -4059,17 +4059,17 @@ dissect_write_single_structured_field_minor_fields(proto_tree *tn5250_tree, }; hf_items wsc_customization_kbc_fields[] = { - { hf_tn5250_sf_length, 0, 1, 0}, - { hf_tn5250_wssf_wsc_minor_type, 0, 1, 0}, - { hf_tn5250_wssf_kbc_flag1, ett_tn5250_wssf_kbc_mask, 1, byte_wssf_kbc_flag1 }, - { 0, 0, 0, 0 } + { hf_tn5250_sf_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_wsc_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_kbc_flag1, ett_tn5250_wssf_kbc_mask, 1, byte_wssf_kbc_flag1, 0 }, + { 0, 0, 0, 0, 0 } }; hf_items wsc_customization_cc_fields[] = { - { hf_tn5250_sf_length, 0, 1, 0}, - { hf_tn5250_wssf_wsc_minor_type, 0, 1, 0}, - { hf_tn5250_wssf_cc_flag1, ett_tn5250_wssf_cc_mask, 1, byte_wssf_cc_flag1 }, - { 0, 0, 0, 0 } + { hf_tn5250_sf_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_wsc_minor_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_cc_flag1, ett_tn5250_wssf_cc_mask, 1, byte_wssf_cc_flag1, 0 }, + { 0, 0, 0, 0, 0 } }; while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) { @@ -4139,44 +4139,44 @@ dissect_write_single_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, hf_items standard_fields[] = { - { hf_tn5250_sf_length, 0, 2, 0 }, - { hf_tn5250_sf_class, 0, 1, 0 }, - { hf_tn5250_sf_type, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items wsc_customization_fields[] = { - { hf_tn5250_wssf_flag1, 0, 1, 0 }, - { hf_tn5250_wssf_flag2, ett_tn5250_wssf_mask, 1, byte }, - { 0, 0, 0, 0 } + { hf_tn5250_wssf_flag1, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_flag2, ett_tn5250_wssf_mask, 1, byte, 0 }, + { 0, 0, 0, 0, 0 } }; hf_items wsc_image_control_fields[] = { - { hf_tn5250_wssf_ifc_flag1, ett_tn5250_wssf_ifc_mask, 1, ifc_byte }, - { hf_tn5250_wssf_ifc_flag2, ett_tn5250_wssf_ifc_mask, 1, ifc_byte2 }, - { hf_tn5250_wssf_ifc_image_format, 0, 2, 0 }, - { hf_tn5250_wssf_ifc_viewport_location_row, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_viewport_location_col, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_viewport_size_row, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_viewport_size_col, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_scaling, 0, 2, 0 }, - { hf_tn5250_wssf_ifc_viewimage_location_row, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_viewimage_location_col, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_rotation, 0, 2, 0 }, - { hf_tn5250_wssf_ifc_foreground_color, 0, 1, 0 }, - { hf_tn5250_wssf_ifc_background_color, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wssf_ifc_flag1, ett_tn5250_wssf_ifc_mask, 1, ifc_byte, 0 }, + { hf_tn5250_wssf_ifc_flag2, ett_tn5250_wssf_ifc_mask, 1, ifc_byte2, 0 }, + { hf_tn5250_wssf_ifc_image_format, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_viewport_location_row, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_viewport_location_col, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_viewport_size_row, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_viewport_size_col, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_scaling, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_viewimage_location_row, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_viewimage_location_col, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_rotation, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_foreground_color, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wssf_ifc_background_color, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items wsc_image_download_fields[] = { - { hf_tn5250_wssf_ifd_flag1, ett_tn5250_wssf_ifd_mask, 1, ifd_byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_length, 0, 2, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wssf_ifd_flag1, ett_tn5250_wssf_ifd_mask, 1, ifd_byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; length = tvb_get_ntohs(tvb,offset); @@ -4195,7 +4195,7 @@ dissect_write_single_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, wsc_image_control_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ifc_imagefax_name, tvb, offset, - (length - (start + offset)), FALSE); + (length - (start + offset)), ENC_EBCDIC|ENC_NA); if (length > (start + offset)) offset += (guint32)(length - (start + offset)); break; @@ -4204,27 +4204,27 @@ dissect_write_single_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, wsc_image_download_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ifd_imagefax_name, tvb, offset, - namelength, FALSE); + namelength, ENC_EBCDIC|ENC_NA); offset += namelength; proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ifd_imagefax_data, tvb, offset, - (length - (start + offset)), FALSE); + (length - (start + offset)), ENC_NA); if (length > (start + offset)) offset += (guint32)(length - (start + offset)); break; case VIDEO_AUDIO_CONTROLS: proto_tree_add_item(tn5250_tree, hf_tn5250_vac_prefix, tvb, offset, - 2, FALSE); + 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tn5250_tree, hf_tn5250_vac_data, tvb, offset, - 4, FALSE); + 4, ENC_BIG_ENDIAN); offset += 2; break; case TRUE_TRANSPARENCY_WRITE: proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ttw_flag, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset ++; proto_tree_add_item(tn5250_tree, hf_tn5250_wssf_ttw_data, tvb, offset, - (length - (start + offset)), FALSE); + (length - (start + offset)), ENC_NA); if (length > (start + offset)) offset += (guint32)(length - (start + offset)); break; @@ -4247,10 +4247,10 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs int length, type, done = 0, used = 0; hf_items standard_fields[] = { - { hf_tn5250_sf_length, 0, 2, 0 }, - { hf_tn5250_sf_class, 0, 1, 0 }, - { hf_tn5250_sf_type, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *qss_byte1[] = { @@ -4266,22 +4266,22 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items qss_fields[] = { - { hf_tn5250_wsf_qss_flag1, ett_tn5250_wsf_qss_mask, 1, qss_byte1 }, - { hf_tn5250_wsf_qss_flag2, ett_tn5250_wsf_qss_mask, 1, qss_byte2 }, - { 0, 0, 0, 0 } + { hf_tn5250_wsf_qss_flag1, ett_tn5250_wsf_qss_mask, 1, qss_byte1, 0 }, + { hf_tn5250_wsf_qss_flag2, ett_tn5250_wsf_qss_mask, 1, qss_byte2, 0 }, + { 0, 0, 0, 0, 0 } }; hf_items dawt_fields[] = { - { hf_tn5250_dawt_length, 0, 1, 0 }, - { hf_tn5250_dawt_char, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dawt_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dawt_char, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; hf_items dckf_fields[] = { - { hf_tn5250_dckf_length, 0, 1, 0 }, - { hf_tn5250_dckf_key_code, 0, 1, 0 }, - { hf_tn5250_dckf_function_code, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dckf_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dckf_key_code, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dckf_function_code, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *rts_byte1[] = { @@ -4291,11 +4291,11 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items rts_fields[] = { - { hf_tn5250_rts_partition, 0, 1, 0 }, - { hf_tn5250_rts_flag1, ett_tn5250_wsf_rts_mask, 1, rts_byte1 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_rts_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_rts_flag1, ett_tn5250_wsf_rts_mask, 1, rts_byte1, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *dpo_byte1[] = { @@ -4317,13 +4317,13 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items dpo_fields[] = { - { hf_tn5250_dpo_partition, 0, 1, 0 }, - { hf_tn5250_dpo_flag1, ett_tn5250_wsf_dpo_mask, 1, dpo_byte1 }, - { hf_tn5250_dpo_flag2, ett_tn5250_wsf_dpo_mask, 1, dpo_byte2 }, - { hf_tn5250_dpo_displace_characters, 0, 3, 0 }, - { hf_tn5250_dpo_start_location_row, 0, 2, 0 }, - { hf_tn5250_dpo_start_location_col, 0, 2, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dpo_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dpo_flag1, ett_tn5250_wsf_dpo_mask, 1, dpo_byte1, 0 }, + { hf_tn5250_dpo_flag2, ett_tn5250_wsf_dpo_mask, 1, dpo_byte2, 0 }, + { hf_tn5250_dpo_displace_characters, 0, 3, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_dpo_start_location_row, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dpo_start_location_col, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *dtsf_byte1[] = { @@ -4348,15 +4348,15 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items dtsf_fields[] = { - { hf_tn5250_dtsf_partition, 0, 1, 0 }, - { hf_tn5250_dtsf_flag1, ett_tn5250_wsf_dtsf_mask, 1, dtsf_byte1 }, - { hf_tn5250_dtsf_flag2, ett_tn5250_wsf_dtsf_mask, 1, dtsf_byte2 }, - { hf_tn5250_dtsf_text_body_height, 0, 2, 0 }, - { hf_tn5250_dtsf_text_body_width, 0, 2, 0 }, - { hf_tn5250_dtsf_line_cmd_field_size, 0, 1, 0 }, - { hf_tn5250_dtsf_location_of_pitch, 0, 1, 0 }, - { hf_tn5250_dtsf_first_line, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dtsf_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dtsf_flag1, ett_tn5250_wsf_dtsf_mask, 1, dtsf_byte1, 0 }, + { hf_tn5250_dtsf_flag2, ett_tn5250_wsf_dtsf_mask, 1, dtsf_byte2, 0 }, + { hf_tn5250_dtsf_text_body_height, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dtsf_text_body_width, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dtsf_line_cmd_field_size, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dtsf_location_of_pitch, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dtsf_first_line, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *dsl_byte1[] = { @@ -4368,20 +4368,20 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items dsl_fields[] = { - { hf_tn5250_dsl_partition, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_dsl_rtl_offset, 0, 1, 0 }, - { hf_tn5250_dsl_offset, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dsl_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsl_rtl_offset, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsl_offset, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items dsl_fields2[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_dsl_flag1, ett_tn5250_wsf_dsl_mask, 1, dsl_byte1 }, - { hf_tn5250_dsl_id, 0, 1, 0 }, - { hf_tn5250_dsl_location, 0, 1, 0 }, - { hf_tn5250_dsl_function, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsl_flag1, ett_tn5250_wsf_dsl_mask, 1, dsl_byte1, 0 }, + { hf_tn5250_dsl_id, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsl_location, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsl_function, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *wts_byte1[] = { @@ -4413,13 +4413,13 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items wts_fields[] = { - { hf_tn5250_wts_partition, 0, 1, 0 }, - { hf_tn5250_wts_flag1, ett_tn5250_wts_mask, 1, wts_byte1 }, - { hf_tn5250_wts_flag2, ett_tn5250_wts_mask, 1, wts_byte2 }, - { hf_tn5250_wts_flag3, ett_tn5250_wts_mask, 1, wts_byte3 }, - { hf_tn5250_wts_home_position_row, 0, 2, 0 }, - { hf_tn5250_wts_home_position_col, 0, 2, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_wts_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wts_flag1, ett_tn5250_wts_mask, 1, wts_byte1, 0 }, + { hf_tn5250_wts_flag2, ett_tn5250_wts_mask, 1, wts_byte2, 0 }, + { hf_tn5250_wts_flag3, ett_tn5250_wts_mask, 1, wts_byte3, 0 }, + { hf_tn5250_wts_home_position_row, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wts_home_position_col, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; static const int *wts_cld_byte1[] = { @@ -4457,32 +4457,32 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items wts_line_data_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, /*FIXME: Could be one or two bytes! */ - { hf_tn5250_wts_cld_flag1, ett_tn5250_wts_mask, 1, wts_cld_byte1 }, - { hf_tn5250_wts_cld_flag2, ett_tn5250_wts_mask, 1, wts_cld_byte2 }, - { hf_tn5250_wts_cld_row, 0, 2, 0 }, - { hf_tn5250_wts_cld_flag3, ett_tn5250_wts_mask, 1, wts_cld_byte3 }, - { hf_tn5250_wts_cld_page_num, 0, 2, 0 }, - { hf_tn5250_wts_cld_lmo, 0, 1, 0 }, - { hf_tn5250_wts_cld_io, 0, 1, 0 }, - { hf_tn5250_wts_cld_sli, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, /*FIXME: Could be one or two bytes! */ + { hf_tn5250_wts_cld_flag1, ett_tn5250_wts_mask, 1, wts_cld_byte1, 0 }, + { hf_tn5250_wts_cld_flag2, ett_tn5250_wts_mask, 1, wts_cld_byte2, 0 }, + { hf_tn5250_wts_cld_row, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wts_cld_flag3, ett_tn5250_wts_mask, 1, wts_cld_byte3, 0 }, + { hf_tn5250_wts_cld_page_num, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wts_cld_lmo, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wts_cld_io, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_wts_cld_sli, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items dsc_fields[] = { - { hf_tn5250_dsc_partition, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_dsc_sk, 0, 1, 0 }, - { hf_tn5250_dsc_ev, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dsc_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsc_sk, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dsc_ev, 0, 1, 0, ENC_EBCDIC|ENC_NA }, + { 0, 0, 0, 0, 0 } }; hf_items dorm_fields[] = { - { hf_tn5250_dorm_length, 0, 1, 0 }, - { hf_tn5250_dorm_ec, 0, 2, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dorm_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dorm_ec, 0, 2, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -4535,28 +4535,28 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs }; hf_items dfdpck_fields[] = { - { hf_tn5250_dfdpck_partition, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_dfdpck_partition, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items dfdpck_core_area_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_dfdpck_data_field, 0, 1, 0 }, - { hf_tn5250_dfdpck_coreflag, ett_tn5250_dfdpck_mask, 1, dfdpck_coreflag }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dfdpck_data_field, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dfdpck_coreflag, ett_tn5250_dfdpck_mask, 1, dfdpck_coreflag, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; hf_items dfdpck_top_row_fields[] = { - { hf_tn5250_length, 0, 1, 0 }, - { hf_tn5250_dfdpck_data_field, 0, 1, 0 }, - { hf_tn5250_dfdpck_toprowflag1, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag1 }, - { hf_tn5250_dfdpck_toprowflag2, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag2 }, - { hf_tn5250_dfdpck_toprowflag3, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag3 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dfdpck_data_field, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_dfdpck_toprowflag1, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag1, 0 }, + { hf_tn5250_dfdpck_toprowflag2, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag2, 0 }, + { hf_tn5250_dfdpck_toprowflag3, ett_tn5250_dfdpck_mask, 1, dfdpck_toprowflag3, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; while (tvb_reported_length_remaining(tvb, offset) > 0 && !done) { @@ -4568,12 +4568,12 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs switch (type) { case PASS_THROUGH: proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset, - (sf_length - (start + offset)), FALSE); + (sf_length - (start + offset)), ENC_EBCDIC|ENC_NA); offset += (guint32)(sf_length - (start + offset)); break; case TN5250_QUERY: proto_tree_add_item(tn5250_tree, hf_tn5250_reserved, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset ++; break; case TN5250_QUERY_STATION_STATE: @@ -4581,24 +4581,24 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs break; case DEFINE_AUDIT_WINDOW__TABLE: proto_tree_add_item(tn5250_tree, hf_tn5250_dawt_id, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); while ((offset - start) < sf_length) { length = tvb_get_guint8(tvb,offset); offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dawt_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_dawt_message, tvb, offset, - (length - 2), FALSE); + (length - 2), ENC_EBCDIC|ENC_NA); offset += length; } break; case DEFINE_COMMAND_KEY_FUNCTION: proto_tree_add_item(tn5250_tree, hf_tn5250_dckf_id, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); while ((offset - start) < sf_length) { length = tvb_get_guint8(tvb,offset); offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dckf_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_dckf_prompt_text, tvb, - offset, (length - 2), FALSE); + offset, (length - 2), ENC_EBCDIC|ENC_NA); offset += length; } break; @@ -4627,7 +4627,7 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs wts_line_data_fields); offset += used; proto_tree_add_item(tn5250_tree, hf_tn5250_wts_cld_li, tvb, offset, - (length - used), FALSE); + (length - used), ENC_EBCDIC|ENC_NA); break; case DEFINE_SPECIAL_CHARACTERS: offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, @@ -4635,25 +4635,25 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs break; case DEFINE_OPERATOR_ERROR_MESSAGES: proto_tree_add_item(tn5250_tree, hf_tn5250_dorm_id, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); while ((offset - start) < sf_length) { length = tvb_get_guint8(tvb,offset); offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, dorm_fields); proto_tree_add_item(tn5250_tree, hf_tn5250_dorm_mt, tvb, offset, - (length - 2), FALSE); + (length - 2), ENC_EBCDIC|ENC_NA); offset += length; } break; case DEFINE_PITCH_TABLE: proto_tree_add_item(tn5250_tree, hf_tn5250_dpt_id, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); while ((offset - start) < sf_length) { length = tvb_get_guint8(tvb,offset); proto_tree_add_item(tn5250_tree, hf_tn5250_length, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); proto_tree_add_item(tn5250_tree, hf_tn5250_dpt_ec, tvb, offset, - length, FALSE); + length, ENC_EBCDIC|ENC_NA); offset += length; } break; @@ -4719,52 +4719,52 @@ dissect_query_reply(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items qr_fields[] = { - { hf_tn5250_sf_length, 0, 2, 0 }, - { hf_tn5250_sf_class, 0, 1, 0 }, - { hf_tn5250_sf_type, 0, 1, 0 }, - { hf_tn5250_qr_flag, ett_tn5250_qr_mask, 1, byte }, - { hf_tn5250_qr_chc, 0, 2, 0 }, - { hf_tn5250_qr_ccl, 0, 3, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_qr_dt, 0, 1, 0 }, - { hf_tn5250_qr_dtc, 0, 4, 0 }, - { hf_tn5250_qr_dm, 0, 3, 0 }, - { hf_tn5250_qr_ki, 0, 1, 0 }, - { hf_tn5250_qr_eki, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_qr_dsn, 0, 4, 0 }, - { hf_tn5250_qr_mni, 0, 2, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_qr_flag1, ett_tn5250_qr_mask, 1, byte1 }, - { hf_tn5250_qr_flag2, ett_tn5250_qr_mask, 1, byte2 }, - { hf_tn5250_qr_flag3, 0, 1, 0 }, - { hf_tn5250_qr_flag4, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_reserved, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_sf_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_class, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sf_type, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_flag, ett_tn5250_qr_mask, 1, byte, 0 }, + { hf_tn5250_qr_chc, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_ccl, 0, 3, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_dt, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_dtc, 0, 4, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_qr_dm, 0, 3, 0, ENC_EBCDIC|ENC_NA }, + { hf_tn5250_qr_ki, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_eki, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_dsn, 0, 4, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_mni, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_flag1, ett_tn5250_qr_mask, 1, byte1, 0 }, + { hf_tn5250_qr_flag2, ett_tn5250_qr_mask, 1, byte2, 0 }, + { hf_tn5250_qr_flag3, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_qr_flag4, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; @@ -4793,14 +4793,14 @@ dissect_tn5250_header(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) }; hf_items fields[] = { - { hf_tn5250_logical_record_length, 0, 2, 0 }, - { hf_tn5250_sna_record_type, 0, 2, 0 }, - { hf_tn5250_reserved, 0, 2, 0 }, - { hf_tn5250_variable_record_length, 0, 1, 0 }, - { hf_tn5250_header_flags, ett_tn5250_header_flags, 1, byte }, - { hf_tn5250_reserved, 0, 1, 0 }, - { hf_tn5250_operation_code, 0, 1, 0 }, - { 0, 0, 0, 0 } + { hf_tn5250_logical_record_length, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_sna_record_type, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_reserved, 0, 2, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_variable_record_length, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_header_flags, ett_tn5250_header_flags, 1, byte, 0 }, + { hf_tn5250_reserved, 0, 1, 0, ENC_BIG_ENDIAN }, + { hf_tn5250_operation_code, 0, 1, 0, ENC_BIG_ENDIAN }, + { 0, 0, 0, 0, 0 } }; error_flag = tvb_get_guint8(tvb, offset+8); @@ -4808,7 +4808,7 @@ dissect_tn5250_header(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) offset += tn5250_add_hf_items(tn5250_tree, tvb, offset, fields); if (error_flag & 0x02) { /*HLP*/ - proto_tree_add_item(tn5250_tree, hf_tn5250_error_code, tvb, offset, 2, FALSE); + proto_tree_add_item(tn5250_tree, hf_tn5250_error_code, tvb, offset, 2, ENC_BIG_ENDIAN); } return (offset - start); @@ -4861,7 +4861,7 @@ dissect_tn5250_data_until_next_command(proto_tree *tn5250_tree, tvbuff_t *tvb, g if (offset > start) { proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, - tvb, start, (offset - start), FALSE); + tvb, start, (offset - start), ENC_EBCDIC|ENC_NA); } return (offset - start); @@ -4878,7 +4878,7 @@ dissect_outbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) /*Escape*/ ti = proto_tree_add_item(tn5250_tree, hf_tn5250_escape_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; cc_tree = proto_item_add_subtree(ti, ett_cc); @@ -4888,19 +4888,19 @@ dissect_outbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) case CLEAR_UNIT: case CLEAR_FORMAT_TABLE: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case CLEAR_UNIT_ALTERNATE: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; - proto_tree_add_item(cc_tree, hf_tn5250_cua_parm, tvb, offset, 1, FALSE); + proto_tree_add_item(cc_tree, hf_tn5250_cua_parm, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; break; case WRITE_TO_DISPLAY: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; /* WCC */ offset += dissect_wcc(cc_tree, tvb, offset); @@ -4908,23 +4908,23 @@ dissect_outbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) break; case WRITE_ERROR_CODE: proto_tree_add_item(cc_tree, hf_tn5250_command_code, - tvb, offset, 1, FALSE); + tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Check for the optional TN5250_IC */ offset += dissect_tn5250_orders_and_data(cc_tree, tvb, offset); /* Add Field Data */ - proto_tree_add_item(cc_tree, hf_tn5250_fa, tvb, offset, 1, FALSE); + proto_tree_add_item(cc_tree, hf_tn5250_fa, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(cc_tree, hf_tn5250_field_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 1, - FALSE); + ENC_EBCDIC|ENC_NA); offset += (guint32)(tvb_reported_length_remaining(tvb, offset) - 1); - proto_tree_add_item(cc_tree, hf_tn5250_fa, tvb, offset, 1, FALSE); + proto_tree_add_item(cc_tree, hf_tn5250_fa, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; break; case RESTORE_SCREEN: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; while (tvb_reported_length_remaining(tvb, offset) > 0) { offset += dissect_outbound_stream(cc_tree, tvb, offset); @@ -4932,20 +4932,20 @@ dissect_outbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) break; case WRITE_ERROR_CODE_TO_WINDOW: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; proto_tree_add_item(cc_tree, hf_tn5250_wectw_start_column, tvb, offset, - 1, FALSE); + 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(cc_tree, hf_tn5250_wectw_end_column, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case READ_INPUT_FIELDS: case READ_MDT_FIELDS: case READ_MDT_ALTERNATE: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_wcc(cc_tree, tvb, offset); break; @@ -4959,53 +4959,53 @@ dissect_outbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset) case READ_MODIFIED_IMMEDIATE_ALTERNATE: case SAVE_SCREEN: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; break; case SAVE_PARTIAL_SCREEN: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_save_partial_screen(cc_tree, tvb, offset); break; case RESTORE_PARTIAL_SCREEN: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(cc_tree, hf_tn5250_length_twobyte, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_tn5250_orders_and_data(cc_tree, tvb, offset); proto_tree_add_item(cc_tree, hf_tn5250_field_data, tvb, offset, - (length - 2), FALSE); + (length - 2), ENC_EBCDIC|ENC_NA); offset++; break; case ROLL: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_roll(cc_tree, tvb, offset); break; case WRITE_SINGLE_STRUCTURED_FIELD: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_write_single_structured_field(cc_tree, tvb, offset); break; case WRITE_STRUCTURED_FIELD: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; offset += dissect_write_structured_field(cc_tree, tvb, offset); break; case COPY_TO_PRINTER: proto_tree_add_item(cc_tree, hf_tn5250_command_code, tvb, offset, 1, - FALSE); + ENC_BIG_ENDIAN); offset++; - proto_tree_add_item(cc_tree, hf_tn5250_ctp_lsid, tvb, offset, 1, FALSE); + proto_tree_add_item(cc_tree, hf_tn5250_ctp_lsid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - proto_tree_add_item(cc_tree, hf_tn5250_ctp_mlpp, tvb, offset, 1, FALSE); + proto_tree_add_item(cc_tree, hf_tn5250_ctp_mlpp, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; break; default: @@ -5026,12 +5026,12 @@ dissect_inbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, gint if (sna_flag & 0x01) { /* Stream contains error code */ proto_tree_add_item(tn5250_tree, hf_tn5250_error_code, tvb, offset, 2, - FALSE); + ENC_BIG_ENDIAN); offset+=2; return (offset - start); } else if (sna_flag & 0x80) { /* Stream contains negative response */ proto_tree_add_item(tn5250_tree, hf_tn5250_negative_response, - tvb, offset, 4, FALSE); + tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; return (offset - start); } @@ -5043,7 +5043,7 @@ dissect_inbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, gint case AID_UNKNOWN_IMAGE_FAX_FORMAT: case AID_IMAGE_FAX_ERROR: proto_tree_add_item(tn5250_tree, hf_tn5250_image_fax_error, tvb, offset, - 2, FALSE); + 2, ENC_BIG_ENDIAN); offset+=2; break; default: @@ -5052,7 +5052,7 @@ dissect_inbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, gint break; } - proto_tree_add_item(tn5250_tree, hf_tn5250_aid, tvb, offset, 1, FALSE); + proto_tree_add_item(tn5250_tree, hf_tn5250_aid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (aid == AID_INBOUND_WRITE_STRUCTURED_FIELD) { @@ -5071,7 +5071,7 @@ dissect_inbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, gint offset += commands; if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(tn5250_tree, hf_tn5250_unknown_data, tvb, offset, - tvb_reported_length_remaining(tvb, offset), FALSE); + tvb_reported_length_remaining(tvb, offset), ENC_NA); offset += tvb_reported_length_remaining(tvb, offset); } return (offset - start); @@ -5082,7 +5082,8 @@ dissect_inbound_stream(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offset, gint /* Anything else is unformatted field data */ if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(tn5250_tree, hf_tn5250_field_data, tvb, offset, - tvb_reported_length_remaining(tvb, offset), FALSE); + tvb_reported_length_remaining(tvb, offset), + ENC_EBCDIC|ENC_NA); offset += tvb_reported_length_remaining(tvb, offset); } @@ -5115,7 +5116,7 @@ dissect_tn5250(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, "TN5250"); - ti = proto_tree_add_item(tree, proto_tn5250, tvb, offset, -1, FALSE); + ti = proto_tree_add_item(tree, proto_tn5250, tvb, offset, -1, ENC_NA); tn5250_tree = proto_item_add_subtree(ti, ett_tn5250); col_clear(pinfo->cinfo, COL_INFO); if (pinfo->srcport == tn5250_info->outbound_port) { @@ -5265,7 +5266,7 @@ proto_register_tn5250(void) /* 15.6.7 Repeat to Address Order */ { &hf_tn5250_repeated_character, { "Repeated Character", "tn5250.repeated_character", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* 15.6.9 Start of Header Order */ @@ -5514,35 +5515,35 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_ulbc, { "Upper Left Border Character", "tn5250.wdsf_cw_bp_ulbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_tbc, { "Top Border Character", "tn5250.wdsf_cw_bp_tbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_urbc, { "Upper Right Border Character", "tn5250.wdsf_cw_bp_urbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_lbc, { "Left Border Character", "tn5250.wdsf_cw_bp_lbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_rbc, { "Right Border Character", "tn5250.wdsf_cw_bp_rbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_llbc, { "Lower Left Border Character", "tn5250.wdsf_cw_bp_llbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_bbc, { "Bottom Border Character", "tn5250.wdsf_cw_bp_bbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_cw_bp_lrbc, { "Lower Right Border Character", "tn5250.wdsf_cw_bp_lrbc", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.6.13.1 Write to Display Structured Field Order - Create Window - Window/Title Footer Minor Structure */ @@ -5570,7 +5571,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_wdsf_cw_tf_text, { "Title Text", "tn5250.wdsf_cw_tf_text", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.6.13.2 Write to Display Structured Field Order - Unrestricted Window Cursor Movement */ @@ -5730,11 +5731,11 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_wdsf_ds_numeric_sep, { "Numeric Separator Character", "tn5250.wdsf_ds_numeric_sep", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_country_sel, { "Country Specific Selection Character", "tn5250.wdsf_ds_country_sel", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_cancel_aid, { "Mouse Pull-Down Cancel AID", "tn5250.wdsf_ds_cancel_aid", @@ -5857,7 +5858,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_wdsf_ds_ct_text, { "Choice Text", "tn5250.wdsf_ds_ct_text", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.6.13.5 Write to Display Structured Field Order - Define Selection Field - Menu Bar Separator Minor Structure*/ @@ -5895,7 +5896,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_wdsf_ds_mbs_sep_char, { "Separator Character", "tn5250.wdsf_ds_mbs_sep_char", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.6.13.5 Write to Display Structured Field Order - Define Selection Field - Choice Presentation Display Attributes Minor Structure*/ @@ -6007,15 +6008,15 @@ proto_register_tn5250(void) { &hf_tn5250_wdsf_ds_ci_left_push, { "Empty Indicator or Left Push Button", "tn5250.wdsf_ds_ci_left_push", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_ci_right_push, { "Selected Indicator or Right Push Button", "tn5250.wdsf_ds_ci_right_push", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_ci_first_choice, { "Character That Replaces the First Choice Text Character for Unavailable Choices On a Monochrome Display", "tn5250.wdsf_ds_ci_first_choice", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.6.13.5 Write to Display Structured Field Order - Define Selection Field - Scroll Bar Indicators Minor Structure*/ @@ -6051,19 +6052,19 @@ proto_register_tn5250(void) { &hf_tn5250_wdsf_ds_sbi_top_character, { "Top Scroll Bar Character", "tn5250.wdsf_ds_sbi_top_character", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_sbi_bottom_character, { "Bottom Scroll Bar Character", "tn5250.wdsf_ds_sbi_bottom_character", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_sbi_empty_character, { "Empty Scroll Bar Character", "tn5250.wdsf_ds_sbi_empty_character", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wdsf_ds_sbi_slider_character, { "Slider Scroll Bar Character", "tn5250.wdsf_ds_sbi_slider_character", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.6.13.6 Write to Display Structured Field Order - Remove GUI Selection Field */ @@ -6504,7 +6505,7 @@ proto_register_tn5250(void) { &hf_tn5250_wssf_ifc_imagefax_name, { "Image/Fax Name", "tn5250.wssf_ifc_imagefax_name", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.26.3 WRITE SINGLE STRUCTURED FIELD Command - IMAGE/FAX DOWNLOAD Command */ @@ -6522,11 +6523,11 @@ proto_register_tn5250(void) { &hf_tn5250_wssf_ifd_imagefax_name, { "Image/Fax Name", "tn5250.wssf_ifd_imagefax_name", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_wssf_ifd_imagefax_data, { "Image/Fax Data", "tn5250.wssf_ifd_imagefax_data", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_image_fax_error, @@ -6549,9 +6550,12 @@ proto_register_tn5250(void) { "Flag", "tn5250.wssf_ttw_flag", FT_UINT8, BASE_HEX, VALS(vals_tn5250_wssf_ttw_flag), 0, NULL, HFILL }}, + /* XXX - the document says "Currently, this command is designed + only to pass ASCII data to some type of ASCII device."; should it + be treated as an ASCII string? */ { &hf_tn5250_wssf_ttw_data, { "Transparent Data", "tn5250.wssf_ttw_data", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27 WRITE STRUCTURED FIELD (WSF) Command */ @@ -6591,11 +6595,11 @@ proto_register_tn5250(void) { &hf_tn5250_dawt_char, { "Character", "tn5250.dawt_char", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_dawt_message, { "Message", "tn5250.dawt_message", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27.4.2 DEFINE COMMAND KEY FUNCTION Command */ @@ -6617,7 +6621,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_dckf_prompt_text, { "Prompt Text", "tn5250.dckf_prompt_text", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27.4.3 READ TEXT SCREEN Command */ @@ -6693,7 +6697,7 @@ proto_register_tn5250(void) { &hf_tn5250_dpo_displace_characters, { "Displaced Characters", "tn5250.dpo_displace_characters", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_tn5250_dpo_start_location_row, @@ -7059,7 +7063,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_wts_cld_li, { "Line Image", "tn5250.wts_cld_li", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27.4.8 DEFINE SPECIAL CHARACTERS Command */ @@ -7073,7 +7077,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_dsc_ev, { "EBCDIC Value", "tn5250.dsc_ev", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27.4.10 DEFINE OPERATOR ERROR MESSAGES Command */ @@ -7092,7 +7096,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_dorm_mt, { "Message Text", "tn5250.dorm_mt", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27.4.11 DEFINE PITCH TABLE Command */ @@ -7102,7 +7106,7 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_dpt_ec, { "EBCDIC Code", "tn5250.dpt_ec", - FT_EBCDIC, BASE_NONE, NULL, 0, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* 15.27.4.12 DEFINE FAKE DP COMMAND KEY FUNCTION Command */ @@ -7303,11 +7307,11 @@ proto_register_tn5250(void) NULL, HFILL }}, { &hf_tn5250_qr_dtc, { "Device Type", "tn5250.qr_dtc", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn5250_qr_dm, { "Device Model", "tn5250.qr_dm", - FT_EBCDIC, BASE_NONE, NULL, 0x0, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn5250_qr_ki, { "Keyboard ID", "tn5250.qr_ki", @@ -7411,7 +7415,7 @@ proto_register_tn5250(void) { &hf_tn5250_length_twobyte, { "Length", "tn5250.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_tn5250_field_data, - { "Field Data", "tn5250.field_data", FT_EBCDIC, BASE_NONE, NULL, 0x0, + { "Field Data", "tn5250.field_data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_tn5250_reserved, { "Flags (Reserved):", "tn5250.reserved", FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(vals_tn5250_reserved), 0, @@ -7517,4 +7521,3 @@ proto_register_tn5250(void) proto_register_subtree_array(ett, array_length(ett)); } - diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c index 03494e1701..11ccdf38a7 100644 --- a/epan/ftypes/ftype-string.c +++ b/epan/ftypes/ftype-string.c @@ -395,43 +395,6 @@ ftype_register_string(void) len, slice, }; - static ftype_t ebcdic_type = { - FT_EBCDIC, /* ftype */ - "FT_EBCDIC", /* name */ - "EBCDIC character string", /* pretty name */ - 0, /* wire_size */ - string_fvalue_new, /* new_value */ - string_fvalue_free, /* free_value */ - val_from_unparsed, /* val_from_unparsed */ - val_from_string, /* val_from_string */ - string_to_repr, /* val_to_string_repr */ - string_repr_len, /* len_string_repr */ - - string_fvalue_set, /* set_value */ - NULL, /* set_value_uinteger */ - NULL, /* set_value_sinteger */ - NULL, /* set_value_integer64 */ - NULL, /* set_value_floating */ - - value_get, /* get_value */ - NULL, /* get_value_uinteger */ - NULL, /* get_value_sinteger */ - NULL, /* get_value_integer64 */ - NULL, /* get_value_floating */ - - cmp_eq, - cmp_ne, - cmp_gt, - cmp_ge, - cmp_lt, - cmp_le, - NULL, /* cmp_bitwise_and */ - cmp_contains, /* cmp_contains */ - CMP_MATCHES, - - len, - slice, - }; static ftype_t uint_string_type = { FT_UINT_STRING, /* ftype */ "FT_UINT_STRING", /* name */ @@ -472,6 +435,5 @@ ftype_register_string(void) ftype_register(FT_STRING, &string_type); ftype_register(FT_STRINGZ, &stringz_type); - ftype_register(FT_EBCDIC, &ebcdic_type); ftype_register(FT_UINT_STRING, &uint_string_type); } diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h index 22cc5f379c..f4ea1ea5bc 100644 --- a/epan/ftypes/ftypes.h +++ b/epan/ftypes/ftypes.h @@ -50,7 +50,6 @@ enum ftenum { FT_RELATIVE_TIME, FT_STRING, FT_STRINGZ, /* for use with proto_tree_add_item() */ - FT_EBCDIC, /* for use with proto_tree_add_item() */ FT_UINT_STRING, /* for use with proto_tree_add_item() */ /*FT_UCS2_LE, */ /* Unicode, 2 byte, Little Endian */ FT_ETHER, diff --git a/epan/libwireshark.def b/epan/libwireshark.def index 4631b0a31f..95e2485537 100644 --- a/epan/libwireshark.def +++ b/epan/libwireshark.def @@ -1096,6 +1096,7 @@ tvb_get_ephemeral_faked_unicode tvb_get_ephemeral_string tvb_get_ephemeral_string_enc tvb_get_ephemeral_stringz +tvb_get_ephemeral_stringz_enc tvb_get_guid tvb_get_guint8 tvb_get_ipv4 @@ -1127,6 +1128,7 @@ tvb_get_ntohs tvb_get_ptr tvb_get_string tvb_get_stringz +tvb_get_stringz_enc tvb_get_unicode_string tvb_ip6_to_str tvb_ip_to_str diff --git a/epan/proto.c b/epan/proto.c index 51afa5ab06..f6eec48928 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -194,9 +194,7 @@ proto_tree_set_time(field_info *fi, nstime_t *value_ptr); static void proto_tree_set_string(field_info *fi, const char* value); static void -proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length); -static void -proto_tree_set_ebcdic_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length); +proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length, gint encoding); static void proto_tree_set_ether(field_info *fi, const guint8* value); static void @@ -1443,7 +1441,8 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, break; case FT_STRING: - proto_tree_set_string_tvb(new_fi, tvb, start, length); + proto_tree_set_string_tvb(new_fi, tvb, start, length, + encoding); break; case FT_STRINGZ: @@ -1458,17 +1457,8 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, * we're putting this item. */ if (length == -1) { - gchar *string_writable; - /* This can throw an exception */ - length = tvb_strsize(tvb, start); - - string_writable = ep_alloc(length); - - tvb_memcpy(tvb, string_writable, start, length); - if ((encoding & ENC_CHARENCODING_MASK) == ENC_EBCDIC) - EBCDIC_to_ASCII(string_writable, length); - string = string_writable; + string = tvb_get_stringz_enc(tvb, start, &length, encoding); } else if (length == 0) { string = "[Empty]"; } else { @@ -1503,38 +1493,34 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree, * we made string values counted * rather than null-terminated.) */ - gchar *string_writable; - - string_writable = tvb_get_ephemeral_string(tvb, start, length); - if ((encoding & ENC_CHARENCODING_MASK) == ENC_EBCDIC) - EBCDIC_to_ASCII(string_writable, length); - string = string_writable; + string = tvb_get_ephemeral_string_enc(tvb, start, length, encoding); } new_fi->length = length; proto_tree_set_string(new_fi, string); break; - case FT_EBCDIC: - proto_tree_set_ebcdic_string_tvb(new_fi, tvb, start, length); - break; - case FT_UINT_STRING: /* * NOTE: to support code written when * proto_tree_add_item() took a gboolean as its * last argument, with FALSE meaning "big-endian" - * and TRUE meaning "little-endian", we treat any - * non-zero value of "encoding" as meaning - * "little-endian". + * and TRUE meaning "little-endian", we any + * non-zero value of "encoding", except for + * ENC_EBCDIC|ENC_BIG_ENDIAN and + * ENC_EBCDIC|ENC_LITTLE_ENDIAN as meaning + * "little-endian UTF-8". * * At some point in the future, we might - * support character encodings in the + * support more character encodings in the * encoding value as well. */ - if (encoding) - encoding = ENC_LITTLE_ENDIAN; + if (encoding != 0 && + encoding != (ENC_EBCDIC|ENC_BIG_ENDIAN) && + encoding != (ENC_EBCDIC|ENC_LITTLE_ENDIAN)) + encoding = ENC_UTF_8|ENC_LITTLE_ENDIAN; n = get_uint_value(tvb, start, length, encoding); - proto_tree_set_string_tvb(new_fi, tvb, start + length, n); + proto_tree_set_string_tvb(new_fi, tvb, start + length, n, + encoding); /* Instead of calling proto_item_set_len(), since we * don't yet have a proto_item, we set the @@ -2627,21 +2613,7 @@ proto_tree_set_string(field_info *fi, const char* value) } static void -proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length) -{ - gchar *string; - - if (length == -1) { - length = tvb_ensure_length_remaining(tvb, start); - } - - string = tvb_get_ephemeral_string(tvb, start, length); - proto_tree_set_string(fi, string); -} - -static void -proto_tree_set_ebcdic_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, - gint length) +proto_tree_set_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, gint length, gint encoding) { gchar *string; @@ -2649,8 +2621,7 @@ proto_tree_set_ebcdic_string_tvb(field_info *fi, tvbuff_t *tvb, gint start, length = tvb_ensure_length_remaining(tvb, start); } - string = tvb_get_ephemeral_string(tvb, start, length); - EBCDIC_to_ASCII(string, length); + string = tvb_get_ephemeral_string_enc(tvb, start, length, encoding); proto_tree_set_string(fi, string); } @@ -3943,7 +3914,6 @@ proto_custom_set(proto_tree* tree, const int field_id, gint occurrence, offset_r = (int)strlen(result); break; - case FT_EBCDIC: case FT_STRING: case FT_STRINGZ: case FT_UINT_STRING: @@ -4771,7 +4741,6 @@ static void tmp_fld_check_assert(header_field_info *hfinfo) { { FT_RELATIVE_TIME, "FT_RELATIVE_TIME" }, { FT_STRING, "FT_STRING" }, { FT_STRINGZ, "FT_STRINGZ" }, - { FT_EBCDIC, "FT_EBCDIC" }, { FT_UINT_STRING, "FT_UINT_STRING" }, { FT_ETHER, "FT_ETHER" }, { FT_BYTES, "FT_BYTES" }, @@ -5287,7 +5256,6 @@ proto_item_fill_label(field_info *fi, gchar *label_str) break; case FT_STRING: case FT_STRINGZ: - case FT_EBCDIC: case FT_UINT_STRING: bytes = fvalue_get(&fi->value); ret = g_snprintf(label_str, ITEM_LABEL_LENGTH, diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 7bbcc7a2bc..a5d2df3330 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -2568,15 +2568,16 @@ tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const gint length) } /* - * Given a tvbuff and an offset, with the offset assumed to refer to - * a null-terminated string, find the length of that string (and throw - * an exception if the tvbuff ends before we find the null), allocate - * a buffer big enough to hold the string, copy the string into it, - * and return a pointer to the string. Also return the length of the + * Given a tvbuff, an offset, and an encoding, with the offset assumed + * to refer to a null-terminated string, find the length of that string + * (and throw an exception if the tvbuff ends before we find the null), + * allocate a buffer big enough to hold the string, copy the string into + * it, and return a pointer to the string; if the encoding is EBCDIC, map + * the string from EBCDIC to ASCII. Also return the length of the * string (including the terminating null) through a pointer. */ guint8 * -tvb_get_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) +tvb_get_stringz_enc(tvbuff_t *tvb, const gint offset, gint *lengthp, gint encoding) { guint size; guint8 *strptr; @@ -2584,10 +2585,19 @@ tvb_get_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) size = tvb_strsize(tvb, offset); strptr = g_malloc(size); tvb_memcpy(tvb, strptr, offset, size); + if ((encoding & ENC_CHARENCODING_MASK) == ENC_EBCDIC) + EBCDIC_to_ASCII(strptr, size); if (lengthp) *lengthp = size; return strptr; } + +guint8 * +tvb_get_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) +{ + return tvb_get_stringz_enc(tvb, offset, lengthp, ENC_UTF_8|ENC_NA); +} + /* * Given a tvbuff and an offset, with the offset assumed to refer to * a null-terminated string, find the length of that string (and throw @@ -2613,6 +2623,7 @@ tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) *lengthp = size; return strptr; } + /* * Given a tvbuff and an offset, with the offset assumed to refer to * a null-terminated string, find the length of that string (and throw @@ -2628,7 +2639,7 @@ tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) * after the current packet has been dissected. */ guint8 * -tvb_get_ephemeral_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) +tvb_get_ephemeral_stringz_enc(tvbuff_t *tvb, const gint offset, gint *lengthp, gint encoding) { guint size; guint8 *strptr; @@ -2636,11 +2647,19 @@ tvb_get_ephemeral_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) size = tvb_strsize(tvb, offset); strptr = ep_alloc(size); tvb_memcpy(tvb, strptr, offset, size); + if ((encoding & ENC_CHARENCODING_MASK) == ENC_EBCDIC) + EBCDIC_to_ASCII(strptr, size); if (lengthp) *lengthp = size; return strptr; } +guint8 * +tvb_get_ephemeral_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp) +{ + return tvb_get_ephemeral_stringz_enc(tvb, offset, lengthp, ENC_UTF_8|ENC_NA); +} + /* * Unicode (UTF-16) version of tvb_get_ephemeral_stringz() * diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 8552e2dc78..cab661f861 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -443,7 +443,8 @@ extern gchar *tvb_format_stringzpad_wsp(tvbuff_t *tvb, const gint offset, const * packet is dissected. * * tvb_get_ephemeral_string_enc() takes a string encoding as well, and - * converts to UTF-8 from the encoding (only UTF-8 and EBCDIC supported) + * converts to UTF-8 from the encoding (only UTF-8 and + * EBCDIC supported) * * tvb_get_ephemeral_unicode_string() Unicode (UTF-16) version of above * @@ -472,6 +473,9 @@ extern guint8 *tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const g * MUST be g_free() by the caller in order not to leak * memory. * + * tvb_get_stringz_enc() takes a string encoding as well, and converts to + * UTF-8 from the encoding (only UTF-8 and EBCDIC supported) + * * tvb_get_const_stringz() returns a constant (unmodifiable) string that does * not need to be freed, instead it will automatically be * freed once the next packet is dissected. It is slightly @@ -481,6 +485,11 @@ extern guint8 *tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const g * instead it will automatically be freed once the next * packet is dissected. * + * tvb_get_ephemeral_stringz_enc() takes a string encoding as well, and + * converts to UTF-8 from the encoding (only UTF-8 and + * EBCDIC supported) + * packet is dissected. + * * tvb_get_ephemeral_unicode_stringz() Unicode (UTF-16) version of above * * tvb_get_seasonal_stringz() returns a string that does not need to be freed, @@ -488,8 +497,10 @@ extern guint8 *tvb_get_seasonal_string(tvbuff_t *tvb, const gint offset, const g * or file is opened. */ extern guint8 *tvb_get_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp); +extern guint8 *tvb_get_stringz_enc(tvbuff_t *tvb, const gint offset, gint *lengthp, gint encoding); extern const guint8 *tvb_get_const_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp); extern guint8 *tvb_get_ephemeral_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp); +extern guint8 *tvb_get_ephemeral_stringz_enc(tvbuff_t *tvb, const gint offset, gint *lengthp, gint encoding); extern gchar *tvb_get_ephemeral_unicode_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding); extern guint8 *tvb_get_seasonal_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp); |