aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2008-04-03 22:13:52 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2008-04-03 22:13:52 +0000
commit906d2f3cbb7343d38ae986f87b04efc4760aba78 (patch)
tree51ff06c9ccd87a169b568d3c515fad7613793950 /epan/proto.h
parent5916e54d06fc3bd7d1ec000d7b4165a6792a259c (diff)
http://www.wireshark.org/lists/wireshark-dev/200803/msg00308.html
proto.[hc] define new APIs to allow delayed registration of protocol fields, so that dissectors with "flexible" fields like xml, radius, diameter, snmp do not have to load their files at startup but can do so as late as possible. gtk/dfilter_expr_dlg.c : have the expression dialog registering all prefixes so that all fileds appear in the dialog tshark.c register all prefixes when called with -G epan/radius_dict.l epan/dissectors/packet-radius.c epan/dissectors/packet-radius.h refactor registration to delay dictionary loading as long as possible svn path=/trunk/; revision=24762
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h
index 2be5a3a055..fb1ffa99c8 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -1399,6 +1399,21 @@ proto_item_fill_label(field_info *fi, gchar *label_str);
extern int
proto_register_protocol(const char *name, const char *short_name, const char *filter_name);
+/** This is the type of function can be registered to get called whenever
+ a given field was not found but a its prefix is matched
+ it can be used to procrastinate the hf array registration
+ @param match what's being matched */
+typedef void (*prefix_initializer_t)(const char* match);
+
+/** Register a new prefix for delayed initialization of field arrays
+@param prefix the prefix for the new protocol
+@param initializer function that will initialize the field array for the given prefix */
+extern void
+proto_register_prefix(const char *prefix, prefix_initializer_t initializer);
+
+/** Initialize every remaining uninitialized prefix. */
+extern void proto_initialize_all_prefixes(void);
+
/** Register a header_field array.
@param parent the protocol handle from proto_register_protocol()
@param hf the hf_register_info array