- remove debugging #ifdef
[obnox/wireshark/wip.git] / packet-mapi.c
index 6912c20f75e2e711220566659b5f68b8b43cd012..5a75090276796437e609339f27eb826b61b8014f 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-mapi.c
  * Routines for MSX mapi packet dissection
  *
- * $Id: packet-mapi.c,v 1.4 2000/01/07 22:05:32 guy Exp $
+ * $Id: packet-mapi.c,v 1.8 2000/08/07 03:20:51 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -48,13 +48,15 @@ static int hf_mapi_response = -1;
 
 static gint ett_mapi = -1;
 
-void
+#define TCP_PORT_MAPI                  1065
+
+static void
 dissect_mapi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 {
        proto_tree      *mapi_tree, *ti;
 
        if (check_col(fd, COL_PROTOCOL))
-       col_add_str(fd, COL_PROTOCOL, "MAPI");
+               col_add_str(fd, COL_PROTOCOL, "MAPI");
 
        if (check_col(fd, COL_INFO))
        {
@@ -64,21 +66,21 @@ dissect_mapi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 
        if (tree) 
        {
-               ti = proto_tree_add_item(tree, proto_mapi, offset, END_OF_FRAME, NULL);
+               ti = proto_tree_add_item(tree, proto_mapi, NullTVB, offset, END_OF_FRAME, FALSE);
                mapi_tree = proto_item_add_subtree(ti, ett_mapi);
 
                if (pi.match_port == pi.destport)
                {
-                       proto_tree_add_item_hidden(mapi_tree, hf_mapi_request,
+                       proto_tree_add_boolean_hidden(mapi_tree, hf_mapi_request, NullTVB,
                                                   offset, END_OF_FRAME, TRUE);
-                       proto_tree_add_text(mapi_tree, offset, 
+                       proto_tree_add_text(mapi_tree, NullTVB, offset, 
                                END_OF_FRAME, "Request: <opaque data>" );
                }
                else
                {
-                       proto_tree_add_item_hidden(mapi_tree, hf_mapi_response,
+                       proto_tree_add_boolean_hidden(mapi_tree, hf_mapi_response, NullTVB,
                                                   offset, END_OF_FRAME, TRUE);
-                       proto_tree_add_text(mapi_tree, offset, 
+                       proto_tree_add_text(mapi_tree, NullTVB, offset, 
                                END_OF_FRAME, "Response: <opaque data>");
                }
        }
@@ -106,3 +108,9 @@ proto_register_mapi(void)
        proto_register_field_array(proto_mapi, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
 }
+
+void
+proto_reg_handoff_mapi(void)
+{
+       old_dissector_add("tcp.port", TCP_PORT_MAPI, dissect_mapi);
+}