Rename some enumeration constants; Do some minor code simplification & reformatting.
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Feb 2012 15:42:50 +0000 (15:42 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Feb 2012 15:42:50 +0000 (15:42 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41138 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-dvb-ipdc.c

index cbd1528..de78e5c 100644 (file)
@@ -42,11 +42,11 @@ static gint ett_ipdc = -1;
 
 
 enum {
-    SUB_FLUTE,
-    SUB_MAX,
+    DVB_IPDC_SUB_FLUTE,
+    DVB_IPDC_SUB_MAX,
 };
 
-static dissector_handle_t sub_handles[SUB_MAX];
+static dissector_handle_t sub_handles[DVB_IPDC_SUB_MAX];
 
 #define UDP_PORT_IPDC_ESG_BOOTSTRAP 9214
 
@@ -55,26 +55,23 @@ static dissector_handle_t sub_handles[SUB_MAX];
 static void
 dissect_ipdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-    tvbuff_t *next_tvb;
-    guint16 len;
+    tvbuff_t   *next_tvb;
     proto_tree *esg_tree = NULL;
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPDC");
     col_clear(pinfo->cinfo, COL_INFO);
 
     /* call into flute */
-    len = tvb_reported_length_remaining(tvb, 0);
-
     if (tree) {
         proto_item *ti;
 
-        ti = proto_tree_add_protocol_format(tree, proto_ipdc, tvb, 0, len,
-            "ESG Bootstrap");
+        ti = proto_tree_add_protocol_format(tree, proto_ipdc, tvb, 0, -1,
+                                            "ESG Bootstrap");
         esg_tree = proto_item_add_subtree(ti, ett_ipdc);
     }
 
-    next_tvb = tvb_new_subset(tvb, 0, len, len);
-    call_dissector(sub_handles[SUB_FLUTE], next_tvb, pinfo, esg_tree);
+    next_tvb = tvb_new_subset_remaining(tvb, 0);
+    call_dissector(sub_handles[DVB_IPDC_SUB_FLUTE], next_tvb, pinfo, esg_tree);
 }
 
 void
@@ -82,8 +79,8 @@ proto_register_dvb_ipdc(void)
 {
     static hf_register_info hf[] = {
         {&hf_ipdc_esg_bootstrap_xml,
-            {"ESG Provider Discovery", "ipdc.bootstrap",
-            FT_STRING, BASE_NONE, NULL, 0x0, "List of ESG Providers", HFILL}}
+         {"ESG Provider Discovery", "ipdc.bootstrap",
+          FT_STRING, BASE_NONE, NULL, 0x0, "List of ESG Providers", HFILL}}
     };
 
     static gint *ett[] = {
@@ -91,7 +88,7 @@ proto_register_dvb_ipdc(void)
     };
 
     proto_ipdc = proto_register_protocol("ETSI IPDC Bootstrap",
-        "ESG Bootstrap", "dvb_ipdc");
+                                         "ESG Bootstrap", "dvb_ipdc");
     proto_register_field_array(proto_ipdc, hf, array_length(hf));
     proto_register_subtree_array(ett, array_length(ett));
 
@@ -103,7 +100,7 @@ proto_reg_handoff_dvb_ipdc(void)
 {
     dissector_handle_t ipdc_handle;
 
-    sub_handles[SUB_FLUTE] = find_dissector("alc");
+    sub_handles[DVB_IPDC_SUB_FLUTE] = find_dissector("alc");
 
     ipdc_handle = create_dissector_handle(dissect_ipdc, proto_ipdc);
     dissector_add_uint("udp.port", UDP_PORT_IPDC_ESG_BOOTSTRAP, ipdc_handle);