aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-h263p.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-h263p.c')
-rw-r--r--epan/dissectors/packet-h263p.c65
1 files changed, 22 insertions, 43 deletions
diff --git a/epan/dissectors/packet-h263p.c b/epan/dissectors/packet-h263p.c
index baf965b611..7992234c1d 100644
--- a/epan/dissectors/packet-h263p.c
+++ b/epan/dissectors/packet-h263p.c
@@ -26,32 +26,28 @@
void proto_reg_handoff_h263P(void);
void proto_register_h263P(void);
-static int proto_h263P = -1;
+static int proto_h263P;
/* H.263 RFC 4629 fields */
-static int hf_h263P_payload = -1;
-static int hf_h263P_rr = -1;
-static int hf_h263P_pbit = -1;
-static int hf_h263P_vbit = -1;
-static int hf_h263P_plen = -1;
-static int hf_h263P_pebit = -1;
-static int hf_h263P_tid = -1;
-static int hf_h263P_trun = -1;
-static int hf_h263P_s = -1;
-static int hf_h263P_extra_hdr = -1;
-/* static int hf_h263P_PSC = -1; */
-/* static int hf_h263P_TR = -1; */
+static int hf_h263P_payload;
+static int hf_h263P_rr;
+static int hf_h263P_pbit;
+static int hf_h263P_vbit;
+static int hf_h263P_plen;
+static int hf_h263P_pebit;
+static int hf_h263P_tid;
+static int hf_h263P_trun;
+static int hf_h263P_s;
+static int hf_h263P_extra_hdr;
+/* static int hf_h263P_PSC; */
+/* static int hf_h263P_TR; */
/* H.263-1998 fields defining a sub tree */
-static gint ett_h263P = -1;
-static gint ett_h263P_extra_hdr = -1;
-static gint ett_h263P_payload = -1;
-static gint ett_h263P_data = -1;
-
-/* The dynamic payload type which will be dissected as H.263-1998/H.263-2000 */
-
-static range_t *temp_dynamic_payload_type_range = NULL;
+static gint ett_h263P;
+static gint ett_h263P_extra_hdr;
+static gint ett_h263P_payload;
+static gint ett_h263P_data;
static dissector_handle_t h263P_handle;
@@ -192,21 +188,9 @@ dissect_h263P( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
void
proto_reg_handoff_h263P(void)
{
- static range_t *dynamic_payload_type_range;
- static gboolean h263P_prefs_initialized = FALSE;
-
- if (!h263P_prefs_initialized) {
- dissector_add_string("rtp_dyn_payload_type","H263-1998", h263P_handle);
- dissector_add_string("rtp_dyn_payload_type","H263-2000", h263P_handle);
- h263P_prefs_initialized = TRUE;
- }
- else {
- dissector_delete_uint_range("rtp.pt", dynamic_payload_type_range, h263P_handle);
- wmem_free(wmem_epan_scope(), dynamic_payload_type_range);
- }
- dynamic_payload_type_range = range_copy(wmem_epan_scope(), temp_dynamic_payload_type_range);
- range_remove_value(wmem_epan_scope(), &dynamic_payload_type_range, 0);
- dissector_add_uint_range("rtp.pt", dynamic_payload_type_range, h263P_handle);
+ dissector_add_string("rtp_dyn_payload_type","H263-1998", h263P_handle);
+ dissector_add_string("rtp_dyn_payload_type","H263-2000", h263P_handle);
+ dissector_add_uint_range_with_preference("rtp.pt", "", h263P_handle);
}
@@ -385,14 +369,9 @@ proto_register_h263P(void)
proto_register_field_array(proto_h263P, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- h263P_module = prefs_register_protocol(proto_h263P, proto_reg_handoff_h263P);
+ h263P_module = prefs_register_protocol(proto_h263P, NULL);
- prefs_register_range_preference(h263P_module,
- "dynamic.payload.type",
- "H.263-1998 and H.263-2000 dynamic payload types",
- "Dynamic payload types which will be interpreted as H.263"
- "; values must be in the range 1 - 127",
- &temp_dynamic_payload_type_range, 127);
+ prefs_register_obsolete_preference(h263P_module, "dynamic.payload.type");
h263P_handle = register_dissector("h263P", dissect_h263P, proto_h263P);
}