Ethereal-dev: [Ethereal-dev] [PATCH] subdissector handoffs in packet-dcerpc.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Tim Potter <tpot@xxxxxxxxx>
Date: Mon, 12 Nov 2001 14:27:07 +1100
Just a couple of small mods to packet-dcerpc.c:

 - implemented handoff request and reply functions for subdissectors
 - don't print out the subprotocol name in the info column as it is
   duplicated in the protocol column.


Regards,

Tim.
Index: packet-dcerpc.c
===================================================================
RCS file: /cvsroot/ethereal/packet-dcerpc.c,v
retrieving revision 1.12
diff -u -r1.12 packet-dcerpc.c
--- packet-dcerpc.c	2001/10/05 20:25:41	1.12
+++ packet-dcerpc.c	2001/11/12 03:24:35
@@ -431,7 +431,7 @@
     dcerpc_uuid_value *sub_proto;
     int length;
     proto_item *sub_item;
-    proto_tree *sub_tree;
+    proto_tree *sub_tree = NULL;
     dcerpc_sub_dissector *proc;
     gchar *name = NULL;
 
@@ -468,15 +468,22 @@
         name = "Unknown?!";
 
     if (check_col (pinfo->fd, COL_INFO)) {
-        col_add_fstr (pinfo->fd, COL_INFO, "%s %s:%s(...)",
-                      is_rqst ? "rqst" : "rply",
-                      sub_proto->name, name);
+        col_add_fstr (pinfo->fd, COL_INFO, "%s %s(...)",
+                      is_rqst ? "rqst" : "rply", name);
     }
 
     if (check_col (pinfo->fd, COL_PROTOCOL)) {
         col_set_str (pinfo->fd, COL_PROTOCOL, sub_proto->name);
     }
-    /* FIXME: call approp. dissector */
+
+    if (is_rqst) {
+            if (proc->dissect_rqst)
+                    return proc->dissect_rqst(tvb, offset, pinfo, sub_tree);
+    } else {
+            if (proc->dissect_resp)
+                    return proc->dissect_resp(tvb, offset, pinfo, sub_tree);
+    }
+
     return 0;
 }