aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2013-12-10 22:08:07 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2013-12-10 22:08:07 +0000
commit20c7414c71174df33ede6e89cd98e99b662e2174 (patch)
treeb793316e144123a5e1f615e77e12cb84c560ad4c /epan
parent67912bf79899fd4accc3ff16ebb902a5a35aaf45 (diff)
use large positve values for illegal DVB-SI string encodings
interpret encoding fields as UINT32 so that the displayed value matches the actual bytes in the packet svn path=/trunk/; revision=53927
Diffstat (limited to 'epan')
-rw-r--r--epan/charsets.h8
-rw-r--r--epan/dissectors/packet-dvbci.c11
-rw-r--r--epan/dissectors/packet-mpeg-descriptor.c4
3 files changed, 12 insertions, 11 deletions
diff --git a/epan/charsets.h b/epan/charsets.h
index a4bc4ced40..71caa967b9 100644
--- a/epan/charsets.h
+++ b/epan/charsets.h
@@ -34,10 +34,6 @@ extern "C" {
#endif /* __cplusplus */
typedef enum {
- DVB_ENCODING_INVALID = -3, /* length invalid */
- DVB_ENCODING_RESERVED = -2, /* reserved by spec */
-
- DVB_ENCODING_UNKNOWN = -1, /* not defined by spec */
DVB_ENCODING_LATIN = 0,
DVB_ENCODING_ISO_8859_5,
@@ -70,6 +66,10 @@ typedef enum {
DVB_ENCODING_EXT_ISO_8859_13 = DVB_ENCODING_EXT_BASE | 13,
DVB_ENCODING_EXT_ISO_8859_14 = DVB_ENCODING_EXT_BASE | 14,
DVB_ENCODING_EXT_ISO_8859_15 = DVB_ENCODING_EXT_BASE | 15,
+
+ DVB_ENCODING_INVALID = G_MAXUINT32-3, /* length invalid */
+ DVB_ENCODING_RESERVED = G_MAXUINT32-2, /* reserved by spec */
+ DVB_ENCODING_UNKNOWN = G_MAXUINT32-1, /* not defined by spec */
} dvb_encoding_e;
extern const value_string dvb_string_encoding_vals[];
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c
index 92a1c085f9..43e7a72993 100644
--- a/epan/dissectors/packet-dvbci.c
+++ b/epan/dissectors/packet-dvbci.c
@@ -2223,7 +2223,8 @@ dissect_si_string(tvbuff_t *tvb, gint offset, gint str_len,
return;
enc_len = dvb_analyze_string_charset(tvb, offset, str_len, &encoding);
- proto_tree_add_int(tree, hf_dvbci_mmi_char_tbl, tvb, offset, enc_len, encoding);
+ proto_tree_add_uint(tree, hf_dvbci_mmi_char_tbl,
+ tvb, offset, enc_len, encoding);
offset += enc_len;
str_len -= enc_len;
@@ -2898,7 +2899,7 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
&ei_dvbci_invalid_char_tbl, tvb, offset, msg_len);
break;
}
- proto_tree_add_int(tree, hf_dvbci_mmi_char_tbl,
+ proto_tree_add_uint(tree, hf_dvbci_mmi_char_tbl,
tvb, offset, enc_len, encoding);
offset += enc_len;
}
@@ -3719,7 +3720,7 @@ dissect_dvbci_payload_opp(guint32 tag, gint len_field _U_,
tvb_reported_length_remaining(tvb, offset));
break;
}
- proto_tree_add_int(tree, hf_dvbci_opp_char_tbl,
+ proto_tree_add_uint(tree, hf_dvbci_opp_char_tbl,
tvb, offset, enc_len, encoding);
offset += enc_len;
@@ -5282,7 +5283,7 @@ proto_register_dvbci(void)
},
{ &hf_dvbci_mmi_char_tbl,
{ "Character table", "dvb-ci.mmi.char_tbl",
- FT_INT32, BASE_DEC, VALS(dvb_string_encoding_vals), 0, NULL, HFILL}
+ FT_UINT32, BASE_HEX, VALS(dvb_string_encoding_vals), 0, NULL, HFILL}
},
{ &hf_dvbci_blind_ans,
{ "Blind answer flag", "dvb-ci.mmi.blind_ans",
@@ -5653,7 +5654,7 @@ proto_register_dvbci(void)
},
{ &hf_dvbci_opp_char_tbl,
{ "Character table", "dvb-ci.opp.char_tbl",
- FT_INT32, BASE_DEC, VALS(dvb_string_encoding_vals), 0, NULL, HFILL}
+ FT_UINT32, BASE_HEX, VALS(dvb_string_encoding_vals), 0, NULL, HFILL}
},
{ &hf_dvbci_sdt_rst_trusted,
{ "SDT running status trusted", "dvb-ci.opp.sdt_rst_trusted",
diff --git a/epan/dissectors/packet-mpeg-descriptor.c b/epan/dissectors/packet-mpeg-descriptor.c
index dd79c99918..b808e39405 100644
--- a/epan/dissectors/packet-mpeg-descriptor.c
+++ b/epan/dissectors/packet-mpeg-descriptor.c
@@ -1212,7 +1212,7 @@ proto_mpeg_descriptor_dissect_short_event(tvbuff_t *tvb, guint offset, proto_tre
if (name_len>0) {
enc_len = dvb_analyze_string_charset(tvb, offset, name_len, &encoding);
- proto_tree_add_int(tree, hf_mpeg_descr_short_event_name_encoding, tvb, offset, enc_len, encoding);
+ proto_tree_add_uint(tree, hf_mpeg_descr_short_event_name_encoding, tvb, offset, enc_len, encoding);
proto_tree_add_item(tree, hf_mpeg_descr_short_event_name,
tvb, offset+enc_len, name_len-enc_len, dvb_enc_to_item_enc(encoding));
}
@@ -3515,7 +3515,7 @@ proto_register_mpeg_descriptor(void)
{ &hf_mpeg_descr_short_event_name_encoding, {
"Event Name Encoding", "mpeg_descr.short_evt.name_enc",
- FT_INT32, BASE_DEC, VALS(dvb_string_encoding_vals), 0, NULL, HFILL
+ FT_UINT32, BASE_HEX, VALS(dvb_string_encoding_vals), 0, NULL, HFILL
} },
{ &hf_mpeg_descr_short_event_name, {