Have the IPX code set "pi.len" and "pi.captured_len" based on the length
[obnox/wireshark/wip.git] / packet-ncp.c
index ca376c09a6727cc8e0cc546c269c741425a81101..3a206f40122100505cce7a9a65acd0dcda7d1ff3 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for NetWare Core Protocol
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  *
- * $Id: packet-ncp.c,v 1.16 1999/07/07 22:51:48 gram Exp $
+ * $Id: packet-ncp.c,v 1.19 1999/09/02 23:17:57 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -43,6 +43,8 @@
 #include "packet-ipx.h"
 #include "packet-ncp.h"
 
+static int proto_ncp = -1;
+
 struct svc_record;
 
 static void
@@ -420,8 +422,7 @@ ncp2222_find(guint8 func, guint8 subfunc)
 }
 
 void
-dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
-       int max_data) {
+dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
 
        proto_tree      *ncp_tree = NULL;
        proto_item      *ti;
@@ -449,8 +450,7 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
        nw_ncp_type = header.type;
 
        if (tree) {
-               ti = proto_tree_add_text(tree, offset, END_OF_FRAME,
-                       "NetWare Core Protocol");
+               ti = proto_tree_add_item(tree, proto_ncp, offset, END_OF_FRAME, NULL);
                ncp_tree = proto_item_add_subtree(ti, ETT_NCP);
 
                proto_tree_add_text(ncp_tree, offset,      2,
@@ -653,7 +653,8 @@ parse_ncp_svc_fields(const u_char *pd, proto_tree *ncp_tree, int offset,
                                break;  
 
                         default:
-                       /*      nothing */
+                               ; /* nothing */
+                               break;
                }
                field_offset += field_length;
                rec++;
@@ -846,3 +847,15 @@ ncp_completion_code(guint8 ccode, enum nfamily family)
                        return "I don't know how to parse this completion code. Please send this packet trace to Gilbert Ramirez <gram@xiexie.org> for analysis";
        }
 }
+
+void
+proto_register_ncp(void)
+{
+/*        static hf_register_info hf[] = {
+                { &variable,
+                { "Name",           "ncp.abbreviation", TYPE, VALS_POINTER }},
+        };*/
+
+        proto_ncp = proto_register_protocol("NetWare Core Protocol", "ncp");
+ /*       proto_register_field_array(proto_ncp, hf, array_length(hf));*/
+}