diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-09-26 17:18:10 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-09-26 17:18:10 +0000 |
commit | a303eebd46a265ea7449fda367627d1b47d3b909 (patch) | |
tree | f39d463c496b9e3dfc15860c8b837164d753704c | |
parent | 9c526561bbac6c9f6f043c8dc800e56aea1aeb4f (diff) |
Get rid of check_col() and use ENC.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39151 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | epan/dissectors/packet-dnp.c | 212 | ||||
-rw-r--r-- | epan/dissectors/packet-dplay.c | 239 | ||||
-rw-r--r-- | epan/dissectors/packet-dpnss-link.c | 25 | ||||
-rw-r--r-- | epan/dissectors/packet-drda.c | 23 | ||||
-rw-r--r-- | epan/dissectors/packet-per.h | 2 |
5 files changed, 241 insertions, 260 deletions
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index b961cbc690..05fb0fc80d 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -1237,19 +1237,19 @@ dnp3_al_process_iin(tvbuff_t *tvb, int offset, proto_tree *al_tree) proto_item_append_text(tiin, " (0x%04x)", al_iin); iin_tree = proto_item_add_subtree(tiin, ett_dnp3_al_iin); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_rst, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_dt, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_dol, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_tsr, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cls3d, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cls2d, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cls1d, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_bmsg, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cc, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_oae, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_ebo, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_pioor, tvb, offset, 2, FALSE); - proto_tree_add_item(iin_tree, hf_dnp3_al_iin_obju, tvb, offset, 2, FALSE); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_rst, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_dt, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_dol, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_tsr, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cls3d, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cls2d, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cls1d, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_bmsg, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_cc, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_oae, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_ebo, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_pioor, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(iin_tree, hf_dnp3_al_iin_obju, tvb, offset, 2, ENC_BIG_ENDIAN); } /*****************************************************************/ @@ -1271,32 +1271,32 @@ dnp3_al_obj_procindex(tvbuff_t *tvb, int offset, guint8 al_objq_index, guint32 * break; case AL_OBJQL_IDX_1O: *al_ptaddr = tvb_get_guint8(tvb, offset); - proto_tree_add_item(item_tree, hf_dnp3_al_index8, tvb, offset, 1, TRUE); + proto_tree_add_item(item_tree, hf_dnp3_al_index8, tvb, offset, 1, ENC_LITTLE_ENDIAN); indexbytes = 1; break; case AL_OBJQL_IDX_2O: *al_ptaddr = tvb_get_letohs(tvb, offset); - proto_tree_add_item(item_tree, hf_dnp3_al_index16, tvb, offset, 2, TRUE); + proto_tree_add_item(item_tree, hf_dnp3_al_index16, tvb, offset, 2, ENC_LITTLE_ENDIAN); indexbytes = 2; break; case AL_OBJQL_IDX_4O: *al_ptaddr = tvb_get_letohl(tvb, offset); - proto_tree_add_item(item_tree, hf_dnp3_al_index32, tvb, offset, 4, TRUE); + proto_tree_add_item(item_tree, hf_dnp3_al_index32, tvb, offset, 4, ENC_LITTLE_ENDIAN); indexbytes = 4; break; case AL_OBJQL_IDX_1OS: *al_ptaddr = tvb_get_guint8(tvb, offset); - proto_tree_add_item(item_tree, hf_dnp3_al_size8, tvb, offset, 1, TRUE); + proto_tree_add_item(item_tree, hf_dnp3_al_size8, tvb, offset, 1, ENC_LITTLE_ENDIAN); indexbytes = 1; break; case AL_OBJQL_IDX_2OS: *al_ptaddr = tvb_get_letohs(tvb, offset); - proto_tree_add_item(item_tree, hf_dnp3_al_size16, tvb, offset, 2, TRUE); + proto_tree_add_item(item_tree, hf_dnp3_al_size16, tvb, offset, 2, ENC_LITTLE_ENDIAN); indexbytes = 2; break; case AL_OBJQL_IDX_4OS: *al_ptaddr = tvb_get_letohl(tvb, offset); - proto_tree_add_item(item_tree, hf_dnp3_al_size32, tvb, offset, 4, TRUE); + proto_tree_add_item(item_tree, hf_dnp3_al_size32, tvb, offset, 4, ENC_LITTLE_ENDIAN); indexbytes = 4; break; } @@ -1407,14 +1407,14 @@ dnp3_al_obj_quality(tvbuff_t *tvb, int offset, guint8 al_ptflags, proto_tree *po } if (quality_tree != NULL) { - proto_tree_add_item(quality_tree, hf7, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf6, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf5, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf4, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf3, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf2, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf1, tvb, offset, 1, TRUE); - proto_tree_add_item(quality_tree, hf0, tvb, offset, 1, TRUE); + proto_tree_add_item(quality_tree, hf7, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf6, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf5, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf4, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf3, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf2, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf1, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(quality_tree, hf0, tvb, offset, 1, ENC_LITTLE_ENDIAN); } proto_item_append_text(point_item, ")"); } @@ -1501,8 +1501,8 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree val_to_str_ext_const(al_objq_index, &dnp3_al_objq_index_vals_ext, "Unknown Index Type"), val_to_str_ext_const(al_objq_code, &dnp3_al_objq_code_vals_ext, "Unknown Code Type")); qualifier_tree = proto_item_add_subtree(qualifier_item, ett_dnp3_al_obj_qualifier); - proto_tree_add_item(qualifier_tree, hf_dnp3_al_objq_index, tvb, offset, 1, FALSE); - proto_tree_add_item(qualifier_tree, hf_dnp3_al_objq_code, tvb, offset, 1, FALSE); + proto_tree_add_item(qualifier_tree, hf_dnp3_al_objq_index, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(qualifier_tree, hf_dnp3_al_objq_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1516,68 +1516,68 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree num_items = ( tvb_get_guint8(tvb, offset+1) - tvb_get_guint8(tvb, offset) + 1); PROTO_ITEM_SET_GENERATED(range_item); al_ptaddr = tvb_get_guint8(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_start8, tvb, offset, 1, TRUE); - proto_tree_add_item(range_tree, hf_dnp3_al_range_stop8, tvb, offset + 1, 1, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_start8, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(range_tree, hf_dnp3_al_range_stop8, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); rangebytes = 2; break; case AL_OBJQL_CODE_SSI16: /* 16-bit Start and Stop Indices in Range Field */ num_items = ( tvb_get_letohs(tvb, offset+2) - tvb_get_letohs(tvb, (offset)) + 1); PROTO_ITEM_SET_GENERATED(range_item); al_ptaddr = tvb_get_letohs(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_start16, tvb, offset, 2, TRUE); - proto_tree_add_item(range_tree, hf_dnp3_al_range_stop16, tvb, offset + 2, 2, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_start16, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(range_tree, hf_dnp3_al_range_stop16, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); rangebytes = 4; break; case AL_OBJQL_CODE_SSI32: /* 32-bit Start and Stop Indices in Range Field */ num_items = ( tvb_get_letohl(tvb, offset+4) - tvb_get_letohl(tvb, offset) + 1); PROTO_ITEM_SET_GENERATED(range_item); al_ptaddr = tvb_get_letohl(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_start32, tvb, offset, 4, TRUE); - proto_tree_add_item(range_tree, hf_dnp3_al_range_stop32, tvb, offset + 4, 4, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_start32, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(range_tree, hf_dnp3_al_range_stop32, tvb, offset + 4, 4, ENC_LITTLE_ENDIAN); rangebytes = 8; break; case AL_OBJQL_CODE_AA8: /* 8-bit Absolute Address in Range Field */ num_items = 1; PROTO_ITEM_SET_GENERATED(range_item); al_ptaddr = tvb_get_guint8(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_abs8, tvb, offset, 1, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_abs8, tvb, offset, 1, ENC_LITTLE_ENDIAN); rangebytes = 1; break; case AL_OBJQL_CODE_AA16: /* 16-bit Absolute Address in Range Field */ num_items = 1; PROTO_ITEM_SET_GENERATED(range_item); al_ptaddr = tvb_get_letohs(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_abs16, tvb, offset, 2, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_abs16, tvb, offset, 2, ENC_LITTLE_ENDIAN); rangebytes = 2; break; case AL_OBJQL_CODE_AA32: /* 32-bit Absolute Address in Range Field */ num_items = 1; PROTO_ITEM_SET_GENERATED(range_item); al_ptaddr = tvb_get_letohl(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_abs32, tvb, offset, 4, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_abs32, tvb, offset, 4, ENC_LITTLE_ENDIAN); rangebytes = 4; break; case AL_OBJQL_CODE_SF8: /* 8-bit Single Field Quantity in Range Field */ num_items = tvb_get_guint8(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_quant8, tvb, offset, 1, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_quant8, tvb, offset, 1, ENC_LITTLE_ENDIAN); rangebytes = 1; proto_item_set_len(range_item, rangebytes); break; case AL_OBJQL_CODE_SF16: /* 16-bit Single Field Quantity in Range Field */ num_items = tvb_get_letohs(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_quant16, tvb, offset, 2, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_quant16, tvb, offset, 2, ENC_LITTLE_ENDIAN); rangebytes = 2; proto_item_set_len(range_item, rangebytes); break; case AL_OBJQL_CODE_SF32: /* 32-bit Single Field Quantity in Range Field */ num_items = tvb_get_letohl(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_quant32, tvb, offset, 4, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_quant32, tvb, offset, 4, ENC_LITTLE_ENDIAN); rangebytes = 4; proto_item_set_len(range_item, rangebytes); break; case AL_OBJQL_CODE_FF: /* 8 bit object count in Range Field */ num_items = tvb_get_guint8(tvb, offset); - proto_tree_add_item(range_tree, hf_dnp3_al_range_quant8, tvb, offset, 1, TRUE); + proto_tree_add_item(range_tree, hf_dnp3_al_range_quant8, tvb, offset, 1, ENC_LITTLE_ENDIAN); rangebytes = 1; proto_item_set_len(range_item, rangebytes); } @@ -1829,7 +1829,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree data_pos += 4; al_ctlobj_stat = tvb_get_guint8(tvb, data_pos); - proto_tree_add_item(point_item, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, TRUE); + proto_tree_add_item(point_item, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, ENC_LITTLE_ENDIAN); ctl_status_str = val_to_str_ext(al_ctlobj_stat, &dnp3_al_ctl_status_vals_ext, "Invalid Status (0x%02x)"); data_pos += 1; @@ -1855,25 +1855,25 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree case AL_OBJ_AO_32OPB: al_val32 = tvb_get_letohl(tvb, data_pos); proto_item_append_text(point_item, ", Value: %u", al_val32); - proto_tree_add_item(point_tree, hf_dnp3_al_anaout32, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaout32, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; case AL_OBJ_AO_16OPB: al_val32 = tvb_get_letohs(tvb, data_pos); proto_item_append_text(point_item, ", Value: %u", al_val32); - proto_tree_add_item(point_tree, hf_dnp3_al_anaout16, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaout16, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; break; case AL_OBJ_AO_FLTOPB: al_valflt = tvb_get_letohieee_float(tvb, data_pos); proto_item_append_text(point_item, ", Value: %g", al_valflt); - proto_tree_add_item(point_tree, hf_dnp3_al_anaoutflt, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaoutflt, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; case AL_OBJ_AO_DBLOPB: al_valdbl = tvb_get_letohieee_double(tvb, data_pos); proto_item_append_text(point_item, ", Value: %g", al_valdbl); - proto_tree_add_item(point_tree, hf_dnp3_al_anaoutdbl, tvb, data_pos, 8, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaoutdbl, tvb, data_pos, 8, ENC_LITTLE_ENDIAN); data_pos += 8; break; } @@ -1882,7 +1882,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_ctlobj_stat = tvb_get_guint8(tvb, data_pos); ctl_status_str = val_to_str_ext(al_ctlobj_stat, &dnp3_al_ctl_status_vals_ext, "Invalid Status (0x%02x)"); proto_item_append_text(point_item, " [Status: %s (0x%02x)]", ctl_status_str, al_ctlobj_stat); - proto_tree_add_item(point_tree, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, ENC_LITTLE_ENDIAN); data_pos += 1; proto_item_set_len(point_item, data_pos - offset); @@ -1971,7 +1971,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_val32 = tvb_get_letohl(tvb, data_pos); proto_item_append_text(point_item, ", Count: %u", al_val32); - proto_tree_add_item(point_tree, hf_dnp3_al_cnt32, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_cnt32, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; @@ -1996,7 +1996,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_val16 = tvb_get_letohs(tvb, data_pos); proto_item_append_text(point_item, ", Count: %u", al_val16); - proto_tree_add_item(point_tree, hf_dnp3_al_cnt16, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_cnt16, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; break; } @@ -2079,7 +2079,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_val32 = tvb_get_letohl(tvb, data_pos); proto_item_append_text(point_item, ", Value: %u", al_val32); - proto_tree_add_item(point_tree, hf_dnp3_al_ana32, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_ana32, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; @@ -2091,7 +2091,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_val16 = tvb_get_letohs(tvb, data_pos); proto_item_append_text(point_item, ", Value: %u", al_val16); - proto_tree_add_item(point_tree, hf_dnp3_al_ana16, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_ana16, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; break; @@ -2105,7 +2105,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_valflt = tvb_get_letohieee_float(tvb, data_pos); proto_item_append_text(point_item, ", Value: %g", al_valflt); - proto_tree_add_item(point_tree, hf_dnp3_al_anaflt, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaflt, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; @@ -2118,7 +2118,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_valdbl = tvb_get_letohieee_double(tvb, data_pos); proto_item_append_text(point_item, ", Value: %g", al_valdbl); - proto_tree_add_item(point_tree, hf_dnp3_al_anadbl, tvb, data_pos, 8, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anadbl, tvb, data_pos, 8, ENC_LITTLE_ENDIAN); data_pos += 8; break; } @@ -2170,7 +2170,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_val32 = tvb_get_letohl(tvb, data_pos); proto_item_append_text(point_item, ", Value: %u", al_val32); - proto_tree_add_item(point_tree, hf_dnp3_al_anaout32, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaout32, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; @@ -2180,7 +2180,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_val16 = tvb_get_letohs(tvb, data_pos); proto_item_append_text(point_item, ", Value: %u", al_val16); - proto_tree_add_item(point_tree, hf_dnp3_al_anaout16, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaout16, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; break; @@ -2190,7 +2190,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_valflt = tvb_get_letohieee_float(tvb, data_pos); proto_item_append_text(point_item, ", Value: %g", al_valflt); - proto_tree_add_item(point_tree, hf_dnp3_al_anaoutflt, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaoutflt, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; break; @@ -2200,7 +2200,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree al_valdbl = tvb_get_letohieee_double(tvb, data_pos); proto_item_append_text(point_item, ", Value: %g", al_valdbl); - proto_tree_add_item(point_tree, hf_dnp3_al_anaoutdbl, tvb, data_pos, 8, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_anaoutdbl, tvb, data_pos, 8, ENC_LITTLE_ENDIAN); data_pos += 8; break; } @@ -2302,25 +2302,25 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree data_pos += 2; /* Auth Key */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_auth, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_auth, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; /* File Size */ if (al_file_ctrl_mode == AL_OBJ_FILE_MODE_WRITE || al_file_ctrl_mode == AL_OBJ_FILE_MODE_APPEND) { - proto_tree_add_item(point_tree, hf_dnp3_al_file_size, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_size, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); } data_pos += 4; /* Mode */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_mode, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_mode, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; /* Max Block Size */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_maxblk, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_maxblk, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; /* Request ID */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_reqID, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_reqID, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; /* Filename */ @@ -2337,29 +2337,29 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree case AL_OBJ_FILE_STAT: /* File Control - File Status (Obj:70, Var:04) */ /* File Handle */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_handle, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_handle, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; /* File Size */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_size, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_size, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; /* Max Block Size */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_maxblk, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_maxblk, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; /* Request ID */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_reqID, tvb, data_pos, 2, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_reqID, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; /* Status code */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_status, tvb, data_pos, 1, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_status, tvb, data_pos, 1, ENC_LITTLE_ENDIAN); data_pos += 1; /* Optional text */ file_data_size = al_ptaddr - (data_pos - offset - indexbytes); if ((file_data_size) > 0) { - proto_tree_add_item(point_tree, hf_dnp3_al_file_data, tvb, data_pos, file_data_size, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_data, tvb, data_pos, file_data_size, ENC_LITTLE_ENDIAN); data_pos += file_data_size; } @@ -2371,7 +2371,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree case AL_OBJ_FILE_TRANS: /* File Control - File Transport (Obj:70, Var:05) */ /* File Handle */ - proto_tree_add_item(point_tree, hf_dnp3_al_file_handle, tvb, data_pos, 4, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_handle, tvb, data_pos, 4, ENC_LITTLE_ENDIAN); data_pos += 4; /* File block (bits 0 - 30) and last block flag (bit 31) */ @@ -2382,7 +2382,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree /* File data */ file_data_size = al_ptaddr - (data_pos - offset - indexbytes); if ((file_data_size) > 0) { - proto_tree_add_item(point_tree, hf_dnp3_al_file_data, tvb, data_pos, file_data_size, TRUE); + proto_tree_add_item(point_tree, hf_dnp3_al_file_data, tvb, data_pos, file_data_size, ENC_LITTLE_ENDIAN); data_pos += file_data_size; } @@ -2486,12 +2486,10 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) al_func = tvb_get_guint8(tvb, (offset+1)); func_code_str = val_to_str_ext(al_func, &dnp3_al_func_vals_ext, "Unknown function (0x%02x)"); - if (check_col(pinfo->cinfo, COL_INFO)) { - /* Clear out lower layer info */ - col_clear(pinfo->cinfo, COL_INFO); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%s", func_code_str); - col_set_fence(pinfo->cinfo, COL_INFO); - } + /* Clear out lower layer info */ + col_clear(pinfo->cinfo, COL_INFO); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%s", func_code_str); + col_set_fence(pinfo->cinfo, COL_INFO); /* format up the text representation */ ti = proto_tree_add_text(tree, tvb, offset, data_len, "Application Layer: ("); @@ -2518,7 +2516,7 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_boolean(field_tree, hf_dnp3_al_fin, tvb, offset, 1, al_ctl); proto_tree_add_boolean(field_tree, hf_dnp3_al_con, tvb, offset, 1, al_ctl); proto_tree_add_boolean(field_tree, hf_dnp3_al_uns, tvb, offset, 1, al_ctl); - proto_tree_add_item(field_tree, hf_dnp3_al_seq, tvb, offset, 1, FALSE); + proto_tree_add_item(field_tree, hf_dnp3_al_seq, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; #if 0 @@ -2561,12 +2559,10 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* Update the col info if there were class reads */ - if (check_col(pinfo->cinfo, COL_INFO) && (al_class > 0)) { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Class "); - for (i = 0; i < 4; i++) { - if (al_class & (1 << i)) { - col_append_fstr(pinfo->cinfo, COL_INFO, "%u", i); - } + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Class "); + for (i = 0; i < 4; i++) { + if (al_class & (1 << i)) { + col_append_fstr(pinfo->cinfo, COL_INFO, "%u", i); } } @@ -2759,15 +2755,13 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) func_code_str = val_to_str(dl_func, dl_prm ? dnp3_ctl_func_pri_vals : dnp3_ctl_func_sec_vals, "Unknown function (0x%02x)"); - if (check_col(pinfo->cinfo, COL_INFO)) { - /* Make sure source and dest are always in the info column */ - col_append_fstr(pinfo->cinfo, COL_INFO, "from %u to %u", dl_src, dl_dst); - col_set_fence(pinfo->cinfo, COL_INFO); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "len=%u, %s", dl_len, func_code_str); - } + /* Make sure source and dest are always in the info column */ + col_append_fstr(pinfo->cinfo, COL_INFO, "from %u to %u", dl_src, dl_dst); + col_set_fence(pinfo->cinfo, COL_INFO); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "len=%u, %s", dl_len, func_code_str); /* create display subtree for the protocol */ - ti = proto_tree_add_item(tree, proto_dnp3, tvb, offset, -1, FALSE); + ti = proto_tree_add_item(tree, proto_dnp3, tvb, offset, -1, ENC_BIG_ENDIAN); dnp3_tree = proto_item_add_subtree(ti, ett_dnp3); /* Create Subtree for Data Link Layer */ @@ -2789,11 +2783,11 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dl_tree = proto_item_add_subtree(tdl, ett_dnp3_dl); /* start bytes */ - proto_tree_add_item(dl_tree, hf_dnp3_start, tvb, offset, 2, FALSE); + proto_tree_add_item(dl_tree, hf_dnp3_start, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* add length field */ - proto_tree_add_item(dl_tree, hf_dnp3_len, tvb, offset, 1, FALSE); + proto_tree_add_item(dl_tree, hf_dnp3_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Add Control Byte Subtree */ @@ -2817,24 +2811,24 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Add Control Byte Subtree Items */ if (dl_prm) { - proto_tree_add_item(field_tree, hf_dnp3_ctl_dir, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_prm, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_fcb, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_fcv, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_prifunc, tvb, offset, 1, FALSE); + proto_tree_add_item(field_tree, hf_dnp3_ctl_dir, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_prm, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_fcb, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_fcv, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_prifunc, tvb, offset, 1, ENC_BIG_ENDIAN); } else { - proto_tree_add_item(field_tree, hf_dnp3_ctl_dir, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_prm, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_dfc, tvb, offset, 1, TRUE); - proto_tree_add_item(field_tree, hf_dnp3_ctl_secfunc, tvb, offset, 1, FALSE); + proto_tree_add_item(field_tree, hf_dnp3_ctl_dir, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_prm, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_dfc, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(field_tree, hf_dnp3_ctl_secfunc, tvb, offset, 1, ENC_BIG_ENDIAN); } offset += 1; /* add destination and source addresses */ - proto_tree_add_item(dl_tree, hf_dnp3_dst, tvb, offset, 2, TRUE); + proto_tree_add_item(dl_tree, hf_dnp3_dst, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; - proto_tree_add_item(dl_tree, hf_dnp3_src, tvb, offset, 2, TRUE); + proto_tree_add_item(dl_tree, hf_dnp3_src, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* and header CRC */ @@ -2846,7 +2840,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else { hidden_item = proto_tree_add_boolean(dl_tree, hf_dnp_hdr_CRC_bad, tvb, - offset, 2, TRUE); + offset, 2, ENC_LITTLE_ENDIAN); PROTO_ITEM_SET_HIDDEN(hidden_item); proto_tree_add_uint_format(dl_tree, hf_dnp_hdr_CRC, tvb, offset, 2, dl_crc, "CRC: 0x%04x [incorrect, should be 0x%04x]", @@ -2877,7 +2871,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tr_tree = proto_item_add_subtree(tc, ett_dnp3_tr_ctl); proto_tree_add_boolean(tr_tree, hf_dnp3_tr_fin, tvb, offset, 1, tr_ctl); proto_tree_add_boolean(tr_tree, hf_dnp3_tr_fir, tvb, offset, 1, tr_ctl); - proto_tree_add_item(tr_tree, hf_dnp3_tr_seq, tvb, offset, 1, FALSE); + proto_tree_add_item(tr_tree, hf_dnp3_tr_seq, tvb, offset, 1, ENC_BIG_ENDIAN); /* Allocate AL chunk tree */ al_chunks = proto_tree_add_text(tr_tree, tvb, offset + 1, -1, "Application data chunks"); @@ -2987,14 +2981,12 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (next_tvb) { /* Reassembled */ /* We have the complete payload */ - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Reassembled Application Layer"); + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Reassembled Application Layer"); } else { /* We don't have the complete reassembled payload. */ - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Transport Layer fragment %u ", tr_seq); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Transport Layer fragment %u ", tr_seq); } } diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c index 902a624cdc..66a29adb22 100644 --- a/epan/dissectors/packet-dplay.c +++ b/epan/dissectors/packet-dplay.c @@ -457,10 +457,10 @@ static gint dissect_sockaddr_in(proto_tree *tree, tvbuff_t *tvb, gint offset) sa_item = proto_tree_add_text(tree, tvb, offset, 16, "DirectPlay sockaddr_in structure"); sa_tree = proto_item_add_subtree(sa_item, ett_dplay_sockaddr); - proto_tree_add_item(sa_tree, hf_dplay_saddr_af, tvb, offset, 2, TRUE); offset += 2; - proto_tree_add_item(sa_tree, hf_dplay_saddr_port, tvb, offset, 2, FALSE); offset += 2; - proto_tree_add_item(sa_tree, hf_dplay_saddr_ip, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(sa_tree, hf_dplay_saddr_padding, tvb, offset, 8, FALSE); offset += 8; + proto_tree_add_item(sa_tree, hf_dplay_saddr_af, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; + proto_tree_add_item(sa_tree, hf_dplay_saddr_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; + proto_tree_add_item(sa_tree, hf_dplay_saddr_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(sa_tree, hf_dplay_saddr_padding, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; return offset; } @@ -472,8 +472,8 @@ static gint dissect_session_desc(proto_tree *tree, tvbuff_t *tvb, gint offset) flags = tvb_get_letohl(tvb, offset+4); - proto_tree_add_item(tree, hf_dplay_sess_desc_length, tvb, offset, 4, TRUE); offset += 4; - flags_item = proto_tree_add_item(tree, hf_dplay_sess_desc_flags, tvb, offset, 4, TRUE); + proto_tree_add_item(tree, hf_dplay_sess_desc_length, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + flags_item = proto_tree_add_item(tree, hf_dplay_sess_desc_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_dplay_sess_desc_flags); proto_tree_add_boolean(flags_tree, hf_dplay_flags_no_sess_desc_changes, tvb, offset, 4, flags); proto_tree_add_boolean(flags_tree, hf_dplay_flags_acqire_voice, tvb, offset, 4, flags); @@ -495,18 +495,18 @@ static gint dissect_session_desc(proto_tree *tree, tvbuff_t *tvb, gint offset) proto_tree_add_boolean(flags_tree, hf_dplay_flags_no_create_players, tvb, offset, 4, flags); offset += 4; - proto_tree_add_item(tree, hf_dplay_instance_guid, tvb, offset, 16, FALSE); offset += 16; - proto_tree_add_item(tree, hf_dplay_game_guid, tvb, offset, 16, FALSE); offset += 16; - proto_tree_add_item(tree, hf_dplay_max_players, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_curr_players, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_name_ptr, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_passwd_ptr, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_desc_reserved_1, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_desc_reserved_2, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_desc_user_1, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_desc_user_2, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_desc_user_3, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sess_desc_user_4, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_instance_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; + proto_tree_add_item(tree, hf_dplay_game_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; + proto_tree_add_item(tree, hf_dplay_max_players, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_curr_players, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_name_ptr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_passwd_ptr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_desc_reserved_1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_desc_reserved_2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_desc_user_1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_desc_user_2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_desc_user_3, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sess_desc_user_4, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } @@ -519,10 +519,10 @@ static gint dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset) gint size; size = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_size, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; flags = tvb_get_letohl(tvb, offset); - flags_item = proto_tree_add_item(tree, hf_dplay_pp_flags, tvb, offset, 4, TRUE); + flags_item = proto_tree_add_item(tree, hf_dplay_pp_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_dplay_pp_flags); proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_sending, tvb, offset, 4, flags); proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_in_group, tvb, offset, 4, flags); @@ -530,23 +530,23 @@ static gint dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset) proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_sysplayer, tvb, offset, 4, flags); offset += 4; - proto_tree_add_item(tree, hf_dplay_pp_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sn_len = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_short_name_len, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_short_name_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; ln_len = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_long_name_len, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_long_name_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; sd_len = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_sp_data_size, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_sp_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; pd_len = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_player_data_size, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_player_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; num_players = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_num_players, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_num_players, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; - proto_tree_add_item(tree, hf_dplay_pp_system_player, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_pp_fixed_size, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_pp_dialect, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_pp_unknown_1, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_system_player, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_fixed_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_dialect, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_unknown_1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (sn_len) offset = display_unicode_string(tree, hf_dplay_pp_short_name, tvb, offset); @@ -554,21 +554,21 @@ static gint dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset) if (ln_len) offset = display_unicode_string(tree, hf_dplay_pp_long_name, tvb, offset); - proto_tree_add_item(tree, hf_dplay_pp_sp_data, tvb, offset, sd_len, FALSE); + proto_tree_add_item(tree, hf_dplay_pp_sp_data, tvb, offset, sd_len, ENC_BIG_ENDIAN); offset += sd_len; if (pd_len) { - proto_tree_add_item(tree, hf_dplay_pp_player_data, tvb, offset, pd_len, FALSE); + proto_tree_add_item(tree, hf_dplay_pp_player_data, tvb, offset, pd_len, ENC_BIG_ENDIAN); offset += pd_len; } for (i=0; i < num_players; ++i) { - proto_tree_add_item(tree, hf_dplay_pp_player_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_player_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } /* Size seems to miss the unknown empty dword */ if (size + 4 > offset) { - proto_tree_add_item(tree, hf_dplay_pp_parent_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_pp_parent_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } return offset; @@ -608,18 +608,18 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g proto_tree *flags_tree = NULL, *im_tree = NULL; gint len; - proto_tree_add_item(tree, hf_dplay_spp_size, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_spp_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; flags = tvb_get_letohl(tvb, offset); is_sysplayer = flags & 0x00000001; - flags_item = proto_tree_add_item(tree, hf_dplay_spp_flags, tvb, offset, 4, TRUE); + flags_item = proto_tree_add_item(tree, hf_dplay_spp_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_dplay_spp_flags); proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_sending, tvb, offset, 4, flags); proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_in_group, tvb, offset, 4, flags); proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_nameserver, tvb, offset, 4, flags); proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_sysplayer, tvb, offset, 4, flags); offset += 4; - proto_tree_add_item(tree, hf_dplay_spp_id, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_spp_id, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; info_mask = tvb_get_letohl(tvb, offset); @@ -631,7 +631,7 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g have_parent_id = (info_mask & 0x00000100) >> 8; shortcut_count_type = (info_mask & 0x00000600) >> 9; - im_item = proto_tree_add_item(tree, hf_dplay_spp_player_info_mask, tvb, offset, 4, TRUE); + im_item = proto_tree_add_item(tree, hf_dplay_spp_player_info_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN); im_tree = proto_item_add_subtree(im_item, ett_dplay_spp_info_mask); proto_tree_add_uint(im_tree, hf_dplay_spp_have_short_name, tvb, offset, 4, have_short_name); @@ -644,9 +644,9 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g offset+=4; if (is_sysplayer) { - proto_tree_add_item(tree, hf_dplay_spp_dialect, tvb, offset, 4, TRUE); + proto_tree_add_item(tree, hf_dplay_spp_dialect, tvb, offset, 4, ENC_LITTLE_ENDIAN); } else { - proto_tree_add_item(tree, hf_dplay_spp_sys_player_id, tvb, offset, 4, FALSE); + proto_tree_add_item(tree, hf_dplay_spp_sys_player_id, tvb, offset, 4, ENC_BIG_ENDIAN); } offset += 4; @@ -660,17 +660,17 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g if (pd_length_type) { len = spp_get_value(pd_length_type, tvb, offset, &player_data_length); - proto_tree_add_item(tree, hf_dplay_spp_player_data_length, tvb, offset, len, TRUE); + proto_tree_add_item(tree, hf_dplay_spp_player_data_length, tvb, offset, len, ENC_LITTLE_ENDIAN); offset += len; - proto_tree_add_item(tree, hf_dplay_spp_player_data, tvb, offset, player_data_length, FALSE); + proto_tree_add_item(tree, hf_dplay_spp_player_data, tvb, offset, player_data_length, ENC_BIG_ENDIAN); offset += player_data_length; } if (sp_length_type) { len = spp_get_value(sp_length_type, tvb, offset, &sp_data_length); - proto_tree_add_item(tree, hf_dplay_spp_sp_data_length, tvb, offset, len, TRUE); + proto_tree_add_item(tree, hf_dplay_spp_sp_data_length, tvb, offset, len, ENC_LITTLE_ENDIAN); offset += len; - proto_tree_add_item(tree, hf_dplay_spp_sp_data, tvb, offset, sp_data_length, FALSE); + proto_tree_add_item(tree, hf_dplay_spp_sp_data, tvb, offset, sp_data_length, ENC_BIG_ENDIAN); offset += sp_data_length; } @@ -678,25 +678,25 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g guint32 i; len = spp_get_value(player_count_type, tvb, offset, &player_count); - proto_tree_add_item(tree, hf_dplay_spp_player_count, tvb, offset, len, TRUE); + proto_tree_add_item(tree, hf_dplay_spp_player_count, tvb, offset, len, ENC_LITTLE_ENDIAN); offset += len; for (i=0; i < player_count; ++i) { - proto_tree_add_item(tree, hf_dplay_spp_player_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_spp_player_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } if (have_parent_id) { - proto_tree_add_item(tree, hf_dplay_spp_parent_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_spp_parent_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } if (shortcut_count_type) { guint32 i; len = spp_get_value(shortcut_count_type, tvb, offset, &shortcut_count); - proto_tree_add_item(tree, hf_dplay_spp_shortcut_count, tvb, offset, len, TRUE); + proto_tree_add_item(tree, hf_dplay_spp_shortcut_count, tvb, offset, len, ENC_LITTLE_ENDIAN); offset += len; for (i=0; i < shortcut_count; ++i) { - proto_tree_add_item(tree, hf_dplay_spp_shortcut_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_spp_shortcut_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } @@ -705,12 +705,12 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g static gint dissect_security_desc(proto_tree *tree, tvbuff_t *tvb, gint offset) { - proto_tree_add_item(tree, hf_dplay_sd_size, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sd_flags, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sd_sspi, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sd_capi, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sd_capi_type, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_sd_enc_alg, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_sd_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sd_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sd_sspi, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sd_capi, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sd_capi_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_sd_enc_alg, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; return offset; } @@ -726,9 +726,9 @@ static gint dissect_dplay_header(proto_tree *tree, tvbuff_t *tvb, gint offset) proto_tree_add_uint(tree, hf_dplay_token, tvb, offset, 4, token); offset += 4; offset = dissect_sockaddr_in(tree, tvb, offset); - proto_tree_add_item(tree, hf_dplay_play_str, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_command, tvb, offset, 2, TRUE); offset += 2; - proto_tree_add_item(tree, hf_dplay_proto_dialect, tvb, offset, 2, TRUE); offset += 2; + proto_tree_add_item(tree, hf_dplay_play_str, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_command, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; + proto_tree_add_item(tree, hf_dplay_proto_dialect, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } @@ -738,7 +738,7 @@ static gint dissect_type01_message(proto_tree *tree, tvbuff_t *tvb, gint offset) offset = dissect_session_desc(tree, tvb, offset); name_offset = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_01_name_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_01_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (name_offset != 0) { offset = display_unicode_string(tree, hf_dplay_type_01_game_name, tvb, offset); @@ -756,10 +756,10 @@ static gint dissect_type02_message(proto_tree *tree, tvbuff_t *tvb, gint offset) passwd_offset = tvb_get_letohl(tvb, offset + 16); flags = tvb_get_letohl(tvb, offset + 20); - proto_tree_add_item(tree, hf_dplay_type_02_game_guid, tvb, offset, 16, FALSE); offset += 16; - proto_tree_add_item(tree, hf_dplay_type_02_password_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_02_game_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; + proto_tree_add_item(tree, hf_dplay_type_02_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; - flags_item = proto_tree_add_item(tree, hf_dplay_type_02_flags, tvb, offset, 4, TRUE); + flags_item = proto_tree_add_item(tree, hf_dplay_type_02_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_dplay_type02_flags); proto_tree_add_boolean(flags_tree, hf_enum_sess_flag_passwd, tvb, offset, 4, flags); proto_tree_add_boolean(flags_tree, hf_enum_sess_flag_all, tvb, offset, 4, flags); @@ -779,7 +779,7 @@ static gint dissect_type05_message(proto_tree *tree, tvbuff_t *tvb, gint offset) guint32 flags; flags = tvb_get_letohl(tvb, offset); - flag_item = proto_tree_add_item(tree, hf_dplay_type_05_flags, tvb, offset, 4, TRUE); + flag_item = proto_tree_add_item(tree, hf_dplay_type_05_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); flag_tree = proto_item_add_subtree(flag_item, ett_dplay_type05_flags); proto_tree_add_boolean(flag_tree, hf_dplay_type_05_secure, tvb, offset, 4, flags); proto_tree_add_boolean(flag_tree, hf_dplay_type_05_unknown, tvb, offset, 4, flags); @@ -794,16 +794,16 @@ static gint dissect_type07_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint32 sspi_offset, capi_offset; - proto_tree_add_item(tree, hf_dplay_type_07_dpid, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_07_dpid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset = dissect_security_desc(tree, tvb, offset); sspi_offset = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_07_sspi_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_07_sspi_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; capi_offset = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_07_capi_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_07_capi_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_07_hresult, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_07_hresult, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (sspi_offset) { offset = display_unicode_string(tree, hf_dplay_type_07_sspi, tvb, offset); @@ -819,12 +819,12 @@ static gint dissect_player_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint32 pp_ofs; - proto_tree_add_item(tree, hf_dplay_multi_id_to, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_multi_player_id, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_multi_group_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_multi_id_to, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_multi_player_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_multi_group_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; pp_ofs = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_multi_create_offset, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_multi_password_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_multi_create_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_multi_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (pp_ofs) offset = dissect_packed_player(tree, tvb, offset); if (tvb_bytes_exist(tvb, offset, 2)) @@ -836,12 +836,12 @@ static gint dissect_type0f_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint32 data_size; - proto_tree_add_item(tree, hf_dplay_type_0f_id_to, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_0f_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_0f_id_to, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_0f_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; data_size = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_0f_data_size, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_0f_data_offset, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_0f_data, tvb, offset, data_size, FALSE); + proto_tree_add_item(tree, hf_dplay_type_0f_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_0f_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_0f_data, tvb, offset, data_size, ENC_BIG_ENDIAN); offset += data_size; return offset; @@ -851,18 +851,18 @@ static gint dissect_type13_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint32 pp_ofs, pw_ofs; - proto_tree_add_item(tree, hf_dplay_type_13_id_to, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_13_player_id, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_13_group_id, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_13_id_to, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_13_player_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_13_group_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; pp_ofs = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_13_create_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_13_create_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; pw_ofs = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_13_password_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_13_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (pp_ofs) offset = dissect_packed_player(tree, tvb, offset); if (pw_ofs) offset = display_unicode_string(tree, hf_dplay_type_13_password, tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_13_tick_count, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_13_tick_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; return offset; } @@ -874,20 +874,20 @@ static gint dissect_type15_message(proto_tree *tree, tvbuff_t *tvb, gint offset) proto_tree *enc_tree = NULL; second_message_type = tvb_get_letohs(tvb, 72); - proto_tree_add_item(tree, hf_dplay_message_guid, tvb, offset, 16, FALSE); offset += 16; - proto_tree_add_item(tree, hf_dplay_type_15_packet_idx, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_15_data_size, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_15_offset, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_15_total_packets, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_15_msg_size, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_15_packet_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_message_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; + proto_tree_add_item(tree, hf_dplay_type_15_packet_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_15_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_15_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_15_total_packets, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_15_msg_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_15_packet_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; enc_item = proto_tree_add_text(tree, tvb, offset, -1, "DirectPlay encapsulated packet"); enc_tree = proto_item_add_subtree(enc_item, ett_dplay_enc_packet); - proto_tree_add_item(enc_tree, hf_dplay_play_str_2, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(enc_tree, hf_dplay_command_2, tvb, offset, 2, TRUE); offset += 2; - proto_tree_add_item(enc_tree, hf_dplay_proto_dialect_2, tvb, offset, 2, TRUE); offset += 2; + proto_tree_add_item(enc_tree, hf_dplay_play_str_2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(enc_tree, hf_dplay_command_2, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; + proto_tree_add_item(enc_tree, hf_dplay_proto_dialect_2, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; switch(second_message_type) { @@ -919,8 +919,8 @@ static gint dissect_type15_message(proto_tree *tree, tvbuff_t *tvb, gint offset) static gint dissect_ping_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { - proto_tree_add_item(tree, hf_dplay_ping_id_from, tvb, offset, 4, FALSE); offset += 4; - proto_tree_add_item(tree, hf_dplay_ping_tick_count, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_ping_id_from, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_ping_tick_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; return offset; } @@ -929,11 +929,11 @@ static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { guint32 sn_ofs, pw_ofs; - proto_tree_add_item(tree, hf_dplay_type_1a_id_to, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_1a_id_to, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; sn_ofs = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_1a_sess_name_ofs, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_1a_sess_name_ofs, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; pw_ofs = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_1a_password_ofs, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_1a_password_ofs, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; offset = dissect_session_desc(tree, tvb, offset); if (sn_ofs) { @@ -954,15 +954,15 @@ static gint dissect_type29_message(proto_tree *tree, tvbuff_t *tvb, gint offset) gint i; player_count = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_29_player_count, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_player_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; group_count = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_29_group_count, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_29_packed_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_group_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_packed_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; shortcut_count = tvb_get_letohl(tvb, offset); - proto_tree_add_item(tree, hf_dplay_type_29_shortcut_count, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_29_description_offset, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_29_name_offset, tvb, offset, 4, TRUE); offset += 4; - proto_tree_add_item(tree, hf_dplay_type_29_password_offset, tvb, offset, 4, TRUE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_shortcut_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_description_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_29_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; offset = dissect_session_desc(tree, tvb, offset); offset = display_unicode_string(tree, hf_dplay_type_29_game_name, tvb, offset); @@ -1002,7 +1002,7 @@ static gint dissect_type29_message(proto_tree *tree, tvbuff_t *tvb, gint offset) static gint dissect_type2f_message(proto_tree *tree, tvbuff_t *tvb, gint offset) { - proto_tree_add_item(tree, hf_dplay_type_2f_dpid, tvb, offset, 4, FALSE); offset += 4; + proto_tree_add_item(tree, hf_dplay_type_2f_dpid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } @@ -1032,18 +1032,15 @@ static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPLAY"); - if(check_col(pinfo->cinfo,COL_INFO)) - { - if(message_type == 0x0015) - col_add_fstr(pinfo->cinfo,COL_INFO, "%s: %s, holding a %s", - val_to_str(proto_version, dplay_proto_dialect_val, "Unknown (0x%04x)"), - val_to_str(message_type, dplay_command_val, "Unknown (0x%04x)"), - val_to_str(second_message_type, dplay_command_val, "Unknown (0x%04x)")); - else - col_add_fstr(pinfo->cinfo,COL_INFO, "%s: %s", - val_to_str(proto_version, dplay_proto_dialect_val, "Unknown (0x%04x)"), - val_to_str(message_type, dplay_command_val, "Unknown (0x%04x)")); - } + if(message_type == 0x0015) + col_add_fstr(pinfo->cinfo,COL_INFO, "%s: %s, holding a %s", + val_to_str(proto_version, dplay_proto_dialect_val, "Unknown (0x%04x)"), + val_to_str(message_type, dplay_command_val, "Unknown (0x%04x)"), + val_to_str(second_message_type, dplay_command_val, "Unknown (0x%04x)")); + else + col_add_fstr(pinfo->cinfo,COL_INFO, "%s: %s", + val_to_str(proto_version, dplay_proto_dialect_val, "Unknown (0x%04x)"), + val_to_str(message_type, dplay_command_val, "Unknown (0x%04x)")); if(tree) { @@ -1055,7 +1052,7 @@ static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *dplay_data = NULL; gint offset = 0; - dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, 0, -1, FALSE); + dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, 0, -1, ENC_BIG_ENDIAN); dplay_tree = proto_item_add_subtree(dplay_item, ett_dplay); header_item = proto_tree_add_text(dplay_tree, tvb, offset, DPLAY_HEADER_OFFSET, "DirectPlay header"); dplay_header = proto_item_add_subtree(header_item, ett_dplay_header); @@ -1139,7 +1136,7 @@ static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tr proto_tree *data_tree = NULL; gint offset = 0; - dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, offset, -1, FALSE); + dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, offset, -1, ENC_BIG_ENDIAN); dplay_tree = proto_item_add_subtree(dplay_item, ett_dplay); data_item = proto_tree_add_text(dplay_tree, tvb, offset, -1, "Message content"); data_tree = proto_item_add_subtree(data_item, ett_dplay_data); @@ -1153,7 +1150,7 @@ static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tr offset = dissect_sockaddr_in(data_tree, tvb, offset); /* Now there's two dplay IDs iff the session desc does not have the * "short player message" flag set */ - proto_tree_add_item(data_tree, hf_dplay_player_msg, tvb, offset, -1, FALSE); + proto_tree_add_item(data_tree, hf_dplay_player_msg, tvb, offset, -1, ENC_BIG_ENDIAN); } } diff --git a/epan/dissectors/packet-dpnss-link.c b/epan/dissectors/packet-dpnss-link.c index 42e77b8812..2c490c9a58 100644 --- a/epan/dissectors/packet-dpnss-link.c +++ b/epan/dissectors/packet-dpnss-link.c @@ -107,29 +107,28 @@ dissect_dpnss_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) uton = pinfo->pseudo_header->l1event.uton; /* Make entries in src and dst column */ - if (check_col(pinfo->cinfo, COL_DEF_SRC)) - col_set_str(pinfo->cinfo, COL_DEF_SRC, uton?"TE":"NT"); - if (check_col(pinfo->cinfo, COL_DEF_DST)) - col_set_str(pinfo->cinfo, COL_DEF_DST, uton?"NT":"TE"); - item = proto_tree_add_item(tree, proto_dpnss_link, tvb, 0, -1, FALSE); + col_set_str(pinfo->cinfo, COL_DEF_SRC, uton?"TE":"NT"); + col_set_str(pinfo->cinfo, COL_DEF_DST, uton?"NT":"TE"); + + item = proto_tree_add_item(tree, proto_dpnss_link, tvb, 0, -1, ENC_BIG_ENDIAN); dpnss_link_tree = proto_item_add_subtree(item, ett_dpnss_link); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_framegroup, - tvb, 0, 1, FALSE); + tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_crbit, - tvb, 0, 1, FALSE); + tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_extension, - tvb, 0, 1, FALSE); + tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_reserved, - tvb, 1, 1, FALSE); + tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_dlcId, - tvb, 1, 1, FALSE); + tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_dlcIdNr, - tvb, 1, 1, FALSE); + tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_extension, - tvb, 1, 1, FALSE); + tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_control_frameType, - tvb, 2, 1, FALSE); + tvb, 2, 1, ENC_BIG_ENDIAN); octet = tvb_get_guint8(tvb, 2); switch (octet){ case FRAME_TYPE_UI_EVEN: diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c index ce6961f2a7..a8d0fd6b46 100644 --- a/epan/dissectors/packet-drda.c +++ b/epan/dissectors/packet-drda.c @@ -686,14 +686,12 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) gint iLengthParam; col_set_str(pinfo->cinfo, COL_PROTOCOL, "DRDA"); - if (check_col(pinfo->cinfo, COL_INFO)) - { - /* This is a trick to know whether this is the first PDU in this packet or not */ - if (iPreviousFrameNumber != (gint) pinfo->fd->num) - col_clear(pinfo->cinfo, COL_INFO); - else - col_append_str(pinfo->cinfo, COL_INFO, " | "); - } + /* This is a trick to know whether this is the first PDU in this packet or not */ + if (iPreviousFrameNumber != (gint) pinfo->fd->num) + col_clear(pinfo->cinfo, COL_INFO); + else + col_append_str(pinfo->cinfo, COL_INFO, " | "); + iPreviousFrameNumber = pinfo->fd->num; /* There may be multiple DRDA commands in one frame */ while ((guint) (offset + 10) <= tvb_length(tvb)) @@ -703,12 +701,9 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* iCommandEnd is the length of the packet up to the end of the current command */ iCommandEnd += iLength; - if (check_col(pinfo->cinfo, COL_INFO)) - { - if (offset > 0) - col_append_str(pinfo->cinfo, COL_INFO, " | "); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext(iCommand, &drda_opcode_abbr_ext, "Unknown (0x%02x)")); - } + if (offset > 0) + col_append_str(pinfo->cinfo, COL_INFO, " | "); + col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext(iCommand, &drda_opcode_abbr_ext, "Unknown (0x%02x)")); if (tree) { diff --git a/epan/dissectors/packet-per.h b/epan/dissectors/packet-per.h index 54e0abd2c1..0c3c95a96b 100644 --- a/epan/dissectors/packet-per.h +++ b/epan/dissectors/packet-per.h @@ -29,9 +29,7 @@ #define PER_NOT_DECODED_YET(x) \ proto_tree_add_text(tree, tvb, 0, 0, "something unknown here [%s]",x); \ -if (check_col(actx->pinfo->cinfo, COL_INFO)){ \ col_append_fstr(actx->pinfo->cinfo, COL_INFO, "[UNKNOWN PER: %s]", x); \ -} \ tvb_get_guint8(tvb, 9999); typedef int (*per_type_fn)(tvbuff_t*, int, asn1_ctx_t*, proto_tree*, int); |