packet-iwarp-ddp-rdmap: make it possible to register "iwarp_ddp_rdmap" payload dissectors
authorStefan Metzmacher <metze@samba.org>
Wed, 19 Sep 2012 13:38:43 +0000 (15:38 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 29 Jan 2014 08:18:23 +0000 (09:18 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
epan/dissectors/packet-iwarp-ddp-rdmap.c

index c363c0f0c8b15912aa79b76849d220c04fcbd45d..1b7d82e8a1ce0d5d7bb6b856caf55d7f603d0c55 100644 (file)
@@ -258,6 +258,16 @@ static const value_string ddp_errcode_untagged_names[] = {
                { 0, NULL }
 };
 
+static heur_dissector_list_t rdmap_heur_subdissector_list;
+
+static void
+dissect_rdmap_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+       if (!dissector_try_heuristic(rdmap_heur_subdissector_list,
+                                   tvb, pinfo, tree, NULL))
+               call_dissector(data_handle,tvb, pinfo, tree);
+}
+
 /* update packet list pane in the GUI */
 static void
 ddp_rdma_packetlist(packet_info *pinfo, gboolean ddp_last_flag,
@@ -603,7 +613,7 @@ dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                                /* display the payload */
                                next_tvb = tvb_new_subset_remaining(tvb, DDP_TAGGED_HEADER_LEN);
-                               call_dissector(data_handle, next_tvb, pinfo, tree);
+                               dissect_rdmap_payload(next_tvb, pinfo, tree);
                        }
 
                } else {
@@ -632,7 +642,7 @@ dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                                /* display the payload */
                                next_tvb = tvb_new_subset_remaining(tvb, DDP_UNTAGGED_HEADER_LEN);
-                               call_dissector(data_handle, next_tvb, pinfo, tree);
+                               dissect_rdmap_payload(next_tvb, pinfo, tree);
                        }
                }
        }
@@ -880,6 +890,9 @@ proto_register_iwarp_ddp_rdmap(void)
        proto_register_field_array(proto_iwarp_ddp_rdmap, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
 
+       register_heur_dissector_list("iwarp_ddp_rdmap",
+                                    &rdmap_heur_subdissector_list);
+
        register_dissector("iwarp_ddp_rdmap", dissect_iwarp_ddp_rdmap,
                        proto_iwarp_ddp_rdmap);
 }