aboutsummaryrefslogtreecommitdiffstats
path: root/packet-stat.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-16 11:44:20 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-16 11:44:20 +0000
commite4c62806db219ae013652ae479827fb38a0a9635 (patch)
treebcc3d6ea4d23e60c7841a408e9b1876ed6a93106 /packet-stat.c
parent8f0f1f9ae49aca3671a8c4c3aa81858684a4f05c (diff)
Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by "proto_register_subtree_array()"; this: obviates the need to update "packet.h" whenever you add a new subtree type - you only have to add a call to "proto_register_subtree_array()" to a "register" routine and an array of pointers to "ett_", if they're not already there, and add a pointer to the new "ett_" variable to the array, if they are there; would allow run-time-loaded dissectors to allocate subtree types when they're loaded. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1043 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-stat.c')
-rw-r--r--packet-stat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/packet-stat.c b/packet-stat.c
index 55e8970233..09643118d2 100644
--- a/packet-stat.c
+++ b/packet-stat.c
@@ -1,7 +1,7 @@
/* packet-stat.c
* Routines for stat dissection
*
- * $Id: packet-stat.c,v 1.1 1999/11/11 21:22:00 nneul Exp $
+ * $Id: packet-stat.c,v 1.2 1999/11/16 11:42:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -38,6 +38,8 @@
static int proto_stat = -1;
+static gint ett_stat = -1;
+
/* proc number, "proc name", dissect_request, dissect_reply */
/* NULL as function pointer means: take the generic one. */
@@ -70,13 +72,16 @@ proto_register_stat(void)
NULL, 0, "Path" }},
#endif
};
+ static gint *ett[] = {
+ &ett_stat,
+ };
proto_stat = proto_register_protocol("Status Service", "stat");
proto_register_field_array(proto_stat, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
/* Register the protocol as RPC */
- rpc_init_prog(proto_stat, STAT_PROGRAM, ETT_STAT);
+ rpc_init_prog(proto_stat, STAT_PROGRAM, ett_stat);
/* Register the procedure tables */
rpc_init_proc_table(STAT_PROGRAM, 1, stat_proc);
}
-