aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ncp2222.py
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2010-11-01 18:38:13 +0000
committerBill Meier <wmeier@newsguy.com>2010-11-01 18:38:13 +0000
commit2f8ab638582a8ecbcabb50362cd559a02be0ffba (patch)
tree43a0cecce979fa59468295f87900179665f792b2 /tools/ncp2222.py
parent5227ad988a17c3400caa02a60944428b750a994d (diff)
Compile (over 100) dfilters only if needed rather than at every Wireshark startup;
Also: Minor whitespace cleanup. svn path=/trunk/; revision=34747
Diffstat (limited to 'tools/ncp2222.py')
-rwxr-xr-xtools/ncp2222.py41
1 files changed, 10 insertions, 31 deletions
diff --git a/tools/ncp2222.py b/tools/ncp2222.py
index a377b98523..5162b05936 100755
--- a/tools/ncp2222.py
+++ b/tools/ncp2222.py
@@ -5756,10 +5756,10 @@ static int ptvc_struct_int_storage;
if global_highest_var > -1:
print "#define NUM_REPEAT_VARS\t%d" % (global_highest_var + 1)
- print "static guint repeat_vars[NUM_REPEAT_VARS];",
+ print "static guint repeat_vars[NUM_REPEAT_VARS];"
else:
print "#define NUM_REPEAT_VARS\t0"
- print "static guint *repeat_vars = NULL;",
+ print "static guint *repeat_vars = NULL;"
print """
#define NO_VAR NUM_REPEAT_VARS
@@ -6271,7 +6271,7 @@ static int hf_iter_search = -1;
static int hf_iter_other = -1;
static int hf_nds_oid = -1;
- """
+"""
# Look at all packet types in the packets collection, and cull information
# from them.
@@ -6296,6 +6296,9 @@ static int hf_nds_oid = -1;
groups_used_hash[group] = len(groups_used_list)
groups_used_list.append(group)
+
+
+
# Determine which variables are used.
vars = pkt.Variables()
ExamineVars(vars, structs_used_hash, variables_used_hash)
@@ -6574,26 +6577,7 @@ static int hf_nds_oid = -1;
print "\t0"
print "};\n"
- # final_registration_ncp2222()
- print """
-static void
-final_registration_ncp2222(void)
-{
- int i;
- """
-
- # Create dfilter_t's for conditional_record's
- print """
- for (i = 0; i < NUM_REQ_CONDS; i++) {
- if (!dfilter_compile((const gchar*)req_conds[i].dfilter_text,
- &req_conds[i].dfilter)) {
- g_message("NCP dissector failed to compile dfilter: %s\\n",
- req_conds[i].dfilter_text);
- g_assert_not_reached();
- }
- }
-}
- """
+ print ""
# proto_register_ncp2222()
print """
@@ -8276,20 +8260,15 @@ proto_register_ncp2222(void)
print "\t};\n"
print """
- proto_register_field_array(proto_ncp, hf, array_length(hf));
- """
+ proto_register_field_array(proto_ncp, hf, array_length(hf));"""
if ett_list:
print """
- proto_register_subtree_array(ett, array_length(ett));
- """
+ proto_register_subtree_array(ett, array_length(ett));"""
print """
register_init_routine(&ncp_init_protocol);
- register_postseq_cleanup_routine(&ncp_postseq_cleanup);
- register_final_registration_routine(final_registration_ncp2222);
- """
-
+ register_postseq_cleanup_routine(&ncp_postseq_cleanup);"""
# End of proto_register_ncp2222()
print "}"