diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-07-07 08:15:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-07-07 08:15:41 +0000 |
commit | 85f219be2e41191971218a632022f590003f992c (patch) | |
tree | 83e8e6d8fc2e605d78ee7497db3f4e2587fbd013 /epan/prefs.c | |
parent | ef825ec6d3e07e97a85d52e116338c08c2637432 (diff) |
From Michael Mann:
Add a preference for the packet length statistics.
Fixes bug 3239.
svn path=/trunk/; revision=43597
Diffstat (limited to 'epan/prefs.c')
-rw-r--r-- | epan/prefs.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c index bfbcad9c14..1ac65cdb7d 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -319,7 +319,6 @@ prefs_register_module_or_subtree(module_t *parent, const char *name, * Register that a protocol has preferences. */ module_t *protocols_module = NULL; -module_t *stats_module = NULL; module_t * prefs_register_protocol(int id, void (*apply_cb)(void)) @@ -427,6 +426,37 @@ prefs_register_protocol_obsolete(int id) return module; } +/* + * Register that a statistical tap has preferences. + * + * "name" is a name for the tap to use on the command line with "-o" + * and in preference files. + * + * "title" is a short human-readable name for the tap. + * + * "description" is a longer human-readable description of the tap. + */ +module_t *stats_module = NULL; + +module_t * +prefs_register_stat(const char *name, const char *title, + const char *description, void (*apply_cb)(void)) +{ + /* + * Have we yet created the "Statistics" subtree? + */ + if (stats_module == NULL) { + /* + * No. Register Statistics subtree as well as any preferences + * for non-dissector modules. + */ + prefs_register_modules(); + } + + return prefs_register_module(stats_module, name, title, description, + apply_cb); +} + module_t * prefs_find_module(const char *name) { |