Prep a few more dissectors to receive their string data through dissector data.
authorMichael Mann <mmann78@netscape.net>
Sat, 2 Nov 2013 13:05:58 +0000 (13:05 -0000)
committerMichael Mann <mmann78@netscape.net>
Sat, 2 Nov 2013 13:05:58 +0000 (13:05 -0000)
svn path=/trunk/; revision=53045

epan/dissectors/packet-http-urlencoded.c
epan/dissectors/packet-isup.c
epan/dissectors/packet-l1-events.c
epan/dissectors/packet-media.c
epan/dissectors/packet-multipart.c

index c4fea32689304f368e92778af821921e551bc456..4e89e43ca2f9eb2b9e9c34818b7db71a19c1058d 100644 (file)
@@ -133,8 +133,8 @@ get_form_key_value(tvbuff_t *tvb, char **ptr, int offset, char stop)
 }
 
 
-static void
-dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
 {
        proto_tree      *url_tree;
        proto_tree      *sub;
@@ -147,12 +147,18 @@ dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                /*
                 * No information from "match_string"
                 */
-               data_name = (char *)(pinfo->private_data);
+               data_name = (char *)data;
                if (! (data_name && data_name[0])) {
                        /*
-                        * No information from "private_data"
+                        * No information from dissector data
                         */
-                       data_name = NULL;
+                       data_name = (char *)(pinfo->private_data);
+                       if (! (data_name && data_name[0])) {
+                               /*
+                                * No information from "private_data"
+                                */
+                               data_name = NULL;
+                       }
                }
        }
 
@@ -190,6 +196,8 @@ dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                proto_item_set_len(ti, offset - start_offset);
        }
+
+       return tvb_length(tvb);
 }
 
 void
@@ -211,7 +219,7 @@ proto_register_http_urlencoded(void)
        proto_urlencoded = proto_register_protocol("HTML Form URL Encoded", "URL Encoded Form Data", "urlencoded-form");
        hfi_urlencoded = proto_registrar_get_nth(proto_urlencoded);
 
-       form_urlencoded_handle = register_dissector("urlencoded-form", dissect_form_urlencoded, proto_urlencoded);
+       form_urlencoded_handle = new_register_dissector("urlencoded-form", dissect_form_urlencoded, proto_urlencoded);
 
        proto_register_fields(proto_urlencoded, hfi, array_length(hfi));
        proto_register_subtree_array(ett, array_length(ett));
index 234ee17dcb163c2232814bae6ed0a0c4eaf5c9ea..3bd53254478e4d66f509158f9ba870784f7fd701 100644 (file)
@@ -10734,8 +10734,8 @@ dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   col_set_fence(pinfo->cinfo, COL_INFO);
 }
 
-static void
-dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
 {
 /* Set up structures needed to add the protocol subtree and manage it */
   proto_item *ti;
@@ -10762,7 +10762,7 @@ dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
       message_tvb = tvb_new_subset_remaining(tvb, 0);
       dissect_ansi_isup_message(message_tvb, pinfo, isup_tree, ISUP_ITU_STANDARD_VARIANT);
-      return;
+      return tvb_length(tvb);
     } else if(strstr(content_type_parameter_str,"spirou")) {
       isup_standard = ITU_STANDARD;
       itu_isup_variant = ISUP_FRENCH_VARIANT;
@@ -10824,6 +10824,7 @@ dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
   message_tvb = tvb_new_subset_remaining(tvb, 0);
   dissect_isup_message(message_tvb, pinfo, isup_tree, itu_isup_variant);
+  return tvb_length(tvb);
 }
 /* ---------------------------------------------------- stats tree
 */
@@ -12181,7 +12182,7 @@ proto_reg_handoff_isup(void)
   dissector_handle_t application_isup_handle;
 
   isup_handle = create_dissector_handle(dissect_isup, proto_isup);
-  application_isup_handle = create_dissector_handle(dissect_application_isup, proto_isup);
+  application_isup_handle = new_create_dissector_handle(dissect_application_isup, proto_isup);
   dissector_add_uint("mtp3.service_indicator", MTP_SI_ISUP, isup_handle);
   dissector_add_string("media_type","application/isup", application_isup_handle);
   dissector_add_string("tali.opcode", "isot", isup_handle);
index f1b1fd42848e3504a63443e18cca775a0a3e9bb8..dca9a6a3c442e4b784632ff8337bb2f82cecb80d 100644 (file)
@@ -47,8 +47,8 @@ static gint proto_l1_events = -1;
 /* Subtrees */
 static gint ett_l1_events = -1;
 
-static void
-dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
 {
        proto_tree      *subtree;
        proto_item      *ti;
@@ -61,12 +61,18 @@ dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                /*
                 * No information from "match_string"
                 */
-               data_name = (char *)(pinfo->private_data);
+               data_name = (char *)data;
                if (! (data_name && data_name[0])) {
                        /*
-                        * No information from "private_data"
+                        * No information from dissector data
                         */
-                       data_name = NULL;
+                       data_name = (char *)(pinfo->private_data);
+                       if (! (data_name && data_name[0])) {
+                               /*
+                                * No information from "private_data"
+                                */
+                               data_name = NULL;
+                       }
                }
        }
 
@@ -111,6 +117,8 @@ dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        offset = next_offset;
                }
        }
+
+       return tvb_length(tvb);
 }
 
 void
@@ -126,7 +134,7 @@ proto_register_l1_events(void)
                        "Layer 1 Event Messages", /* Long name */
                        "Layer 1 Events",         /* Short name */
                        "data-l1-events");              /* Filter name */
-       register_dissector("data-l1-events", dissect_l1_events, proto_l1_events);
+       new_register_dissector("data-l1-events", dissect_l1_events, proto_l1_events);
 }
 
 void
index a4c80310d43f57d9b8c7854152f6505bedb41778..9de3b935d3b45d36ab13479f4bd22ace4589fae1 100644 (file)
@@ -40,15 +40,15 @@ int proto_media = -1;
 static gint ett_media = -1;
 static heur_dissector_list_t heur_subdissector_list;
 
-static void
-dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree)
+static int
+dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree, void* data)
 {
     int bytes;
     proto_item *ti;
     proto_tree *media_tree = 0;
 
-    if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL)) {
-        return;
+    if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, data)) {
+        return tvb_length(tvb);
     }
 
     /* Add media type to the INFO column if it is visible */
@@ -75,6 +75,8 @@ dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree)
             }
         }
     }
+
+    return tvb_length(tvb);
 }
 
 void
@@ -89,7 +91,7 @@ proto_register_media(void)
         "Media",        /* short name */
         "media"         /* abbrev */
         );
-    register_dissector("media", dissect_media, proto_media);
+    new_register_dissector("media", dissect_media, proto_media);
     register_heur_dissector_list("media", &heur_subdissector_list);
     proto_register_subtree_array(ett, array_length(ett));
 
index 7baffacf4e9f776ba045264f695185d1865e1580..a1794c71812cab7d0fb5a3c466d0c3f5b72010cf 100644 (file)
@@ -797,8 +797,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
  * Call this method to actually dissect the multipart body.
  * NOTE - Only do so if a boundary string has been found!
  */
-static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
-        proto_tree *tree)
+static int dissect_multipart(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
 {
     proto_tree *subtree = NULL;
     proto_item *ti = NULL;
@@ -816,7 +815,7 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
                 "The multipart dissector could not find "
                 "the required boundary parameter.");
         call_dissector(data_handle, tvb, pinfo, tree);
-        return;
+        return tvb_length(tvb);
     }
     boundary = (guint8 *)m_info->boundary;
     boundary_len = m_info->boundary_length;
@@ -853,7 +852,7 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
         call_dissector(data_handle, tvb, pinfo, subtree);
         /* Clean up the dynamically allocated memory */
         cleanup_multipart_info(m_info);
-        return;
+        return tvb_length(tvb);
     }
     /*
      * Process the encapsulated bodies
@@ -864,7 +863,7 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
         if (header_start == -1) {
             /* Clean up the dynamically allocated memory */
             cleanup_multipart_info(m_info);
-            return;
+            return tvb_length(tvb);
         }
     }
     /*
@@ -877,7 +876,7 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
     }
     /* Clean up the dynamically allocated memory */
     cleanup_multipart_info(m_info);
-    return;
+    return tvb_length(tvb);
 }
 
 /* Returns index of method in multipart_headers */
@@ -1059,7 +1058,7 @@ proto_reg_handoff_multipart(void)
     /*
      * Handle for multipart dissection
      */
-    multipart_handle = create_dissector_handle(
+    multipart_handle = new_create_dissector_handle(
             dissect_multipart, proto_multipart);
 
     dissector_add_string("media_type",