diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-04-11 19:53:48 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-04-12 04:31:19 +0000 |
commit | c0792555392f234ab96917e784d365b5de053836 (patch) | |
tree | 02c053696f2fbd0a6b05ae239b5460d1c551a64f /plugins/mate/packet-mate.c | |
parent | aa9a0b3bf831395dc1cfbaea7f467faed952dbf9 (diff) |
Add an API to let a postdissector specify fields whose values it needs.
Currently, this is only used to determine whether a protocol tree needs
to be built on the first pass or not - if there are postdissectors that
need fields, it does - but eventually we should be able to use it to
prime the dissection to deliver those fields in cases where we don't
need the *entire* protocol tree (rather than using a hack such as
cooking up a fake tap with a fake filter to do that).
Update MATE and TRANSUM to use it.
Clean up code to check whether we need a protocol tree, and add comments
before that code indicating, in each case, what the criteria are.
The array of postdissectors includes a length, so we don't need to
separately keep track of the number of postdissectors.
Clean up indentation while we're at it.
Change-Id: I71d4025848206d144bc54cc82941089a50e80ab7
Reviewed-on: https://code.wireshark.org/review/21029
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'plugins/mate/packet-mate.c')
-rw-r--r-- | plugins/mate/packet-mate.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c index 047ebae889..65f08209fb 100644 --- a/plugins/mate/packet-mate.c +++ b/plugins/mate/packet-mate.c @@ -53,6 +53,8 @@ static const gchar* current_mate_config_filename = NULL; static proto_item *mate_i = NULL; +static dissector_handle_t mate_handle; + static void pdu_attrs_tree(proto_tree* tree, packet_info *pinfo, tvbuff_t *tvb, mate_pdu* pdu) { @@ -352,6 +354,12 @@ proto_reg_handoff_mate(void) proto_register_subtree_array((gint**)(void*)mc->ett->data, mc->ett->len); register_init_routine(initialize_mate_runtime); + /* + * Set the list of fields we want. + */ + set_postdissector_wanted_fields(mate_handle, + mc->wanted_fields); + tap_error = register_tap_listener("frame", &mate_tap_data, (char*) mc->tap_filter, 0, @@ -393,7 +401,6 @@ proto_register_mate(void) expert_module_t* expert_mate; module_t *mate_module; - dissector_handle_t mate_handle; proto_mate = proto_register_protocol("Meta Analysis Tracing Engine", "MATE", "mate"); proto_register_field_array(proto_mate, hf, array_length(hf)); |