aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2016-03-30 15:56:21 -0400
committerMichael Mann <mmann78@netscape.net>2016-03-31 03:14:39 +0000
commitfda0bafeb842f77059bce6aa3aa5cabd04f8457d (patch)
tree77e52c2e4136d7373d0d2af6333bd7cdc45f969c /epan/proto.h
parentd81fe3907b00e00fb05a88eb0812ac874922e835 (diff)
Ensure our fields are registered before starting dissection--even when !tree.
(The check to ensure the delayed field registration had been done was still wrapped inside an if(tree) but a bunch of proto_add_*()'s had been pulled out from under if(tree)'s thus causing some hf's to be used before registered.) Also simplify the code to ensure the fields are registered since we're doing it potentially many times per frame: do an integer comparison rather than looking up an hf by name. Add a note to the docs for proto_register_prefix() to make it clear that the initializer routine may not be called before the dissector is asked to dissect something. Change-Id: I5dc1154638a290c3a94149184d56570c3abb836a Reviewed-on: https://code.wireshark.org/review/14711 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h
index 54c72a10e8..7d6ce083c2 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -2080,6 +2080,9 @@ proto_deregister_protocol(const char *short_name);
typedef void (*prefix_initializer_t)(const char* match);
/** Register a new prefix for delayed initialization of field arrays
+ Note that the initializer function MAY NOT be called before the dissector
+ is first called. That is, dissectors using this function must be prepared
+ to call the initializer before beginning dissection.
@param prefix the prefix for the new protocol
@param initializer function that will initialize the field array for the given prefix */
WS_DLL_PUBLIC void