Commit Graph

21 Commits

Author SHA1 Message Date
Guy Harris ea1f62a8e8 Get rid of unnecesary #includes.
Change-Id: I379a2a1007be1b844873d9c5e8ea53bd689f0f4d
Reviewed-on: https://code.wireshark.org/review/21158
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 03:02:30 +00:00
Guy Harris 4db20ec4a4 Remove unnecessary tap.
The tap was just a trick to get fields and protocols registered as being
of interest.  Now that we have mechanisms by which postdissectors can
explicitly register fields and protocols as being of interest, and are
using that, the trick is no longer needed.

Change-Id: I0bccc88a1e4ee4c9fc84b90d968820375594c5c1
Reviewed-on: https://code.wireshark.org/review/21157
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 02:58:22 +00:00
Guy Harris 407a2b07e5 Rename some routines and structure members.
They deal with sets of hfids, which can belong to protocols as well as
fields (I guess you could argue that a protocol is a field, but...).

Change-Id: Ibd103cfa26427ead4ef54be89f1251908004cfae
Reviewed-on: https://code.wireshark.org/review/21154
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17 01:49:01 +00:00
Guy Harris 581db4c2b8 Get rid of some generated files with "make distclean".
register.c, and the plugin.c for various plugins, are generated by tools
that must be available to do a build, and aren't distributed as part of
the source tarball.  That means "make distclean" should remove them.  Do
so.

Change-Id: I9e37abdafb50234cf1ebb5fb828446e45e605d78
Reviewed-on: https://code.wireshark.org/review/21125
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-16 08:24:01 +00:00
Guy Harris 9769e8af99 Use proto_get_finfo_ptr_array() rather than proto_find_finfo().
As the comments say, proto_find_finfo() is slower than
proto_get_finfo_ptr_array(), as it has to scan the entire tree, and,
given that we're priming the tree with the fields we need (which we
*have* to do to *guarantee* that we'll get the fields we want;
requesting that a protocol tree be constructed isn't sufficient, and
asking for a "visible" protocol tree is overkill),
proto_get_finfo_ptr_array() will work.

Change-Id: Ic1e21105a0a89003a3cdd3d7a2e55ac287ddad5e
Reviewed-on: https://code.wireshark.org/review/21068
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-13 00:10:11 +00:00
Guy Harris 37e45ccba8 Fix indentation.
Change-Id: Idc3d9c40a5f8ecd0f192c289538c3303ba2b7ffe
Reviewed-on: https://code.wireshark.org/review/21067
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 23:45:23 +00:00
Guy Harris 847c25c5a7 Prime the epan_dissect_t with postdissector wanted fields if necessary.
This makes sure that postdissectors that indicate that they need certain
fields in the first pass will get them.

While we're at it:

Fix the field-fetching code in TRANSUM not to assume it got any
instances of the field being fetched.

Rename process_packet_first_pass() in sharkd to process_packet(), as
it's the only routine in sharkd that processes packets.

Rename process_packet() in tshark and tfshark to
process_packet_single_pass(), as it's what's used if we're only doing
one-pass analysis.

Clean up comments and whitespace.

Change-Id: I3769af952c66f5ca4b68002ad6213858ab9cab9b
Reviewed-on: https://code.wireshark.org/review/21063
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 23:33:37 +00:00
Guy Harris c079255539 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>
2017-04-12 04:31:19 +00:00
Guy Harris 2c44a7f930 Clean up handling of enabled/disabled protocols/heuristic dissectors.
Add a "report a warning message" routine to the "report_err" code in
libwsutil, and rename files and routines appropriately, as they don't
only handle errors any more.

Have a routine read_enabled_and_disabled_protos() that reads all the
files that enable or disable protocols or heuristic dissectors, enables
and disables them based on the contents of those files, and reports
errors itself (as warnings) using the new "report a warning message"
routine.  Fix that error reporting to report separately on the disabled
protocols, enabled protocols, and heuristic dissectors files.

Have a routine to set up the enabled and disabled protocols and
heuristic dissectors from the command-line arguments, so it's done the
same way in all programs.

If we try to enable or disable an unknown heuristic dissector via a
command-line argument, report an error.

Update a bunch of comments.

Update the name of disabled_protos_cleanup(), as it cleans up
information for disabled *and* enabled protocols and for heuristic
dissectors.

Support the command-line flags to enable and disable protocols and
heuristic dissectors in tfshark.

Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df
Reviewed-on: https://code.wireshark.org/review/20966
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08 20:40:08 +00:00
Michael Mann 5d3d96cac4 transum: Add protections against NULL trees.
proto_find_finfo doesn't have NULL tree protection, so protect it from
transum dissector.

Bug: 13395
Change-Id: I1037c675cf10b959f116b20b12cc7b388c175cd3
Reviewed-on: https://code.wireshark.org/review/20077
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18 03:09:38 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Michael Mann 78d56e5dd7 Cleanup transum post-dissector.
1. Enable/disable preference not needed - just use Enabled Protocol
dialog interface.  Added support for backwards compatibility of preference.
2. Add value_string for calculation values
3. Create an structured array of "hfs of interest" so they can more easily
be extended.
4. Convert a bunch of arrays into hash tables and lists.  For the amount
of wasted space they were taking up, we can live with the very slight
performance degrade.  Also puts less limits on number of things to process.

Change-Id: I7399789d62432b507062ed9cdc20ad974b9dde1b
Reviewed-on: https://code.wireshark.org/review/19406
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-25 08:06:53 +00:00
Michael Mann ad7caed698 [TRANSUM] smb2.msg_id is now a FT_UINT64.
Per bug 12915, SMB2 message ID should be treated as a unsigned 64bit value.
Have transum logic match that as it was assuming SMB2 message ID was a
signed 64bit value

Change-Id: Ide0c12b505d1eef2aeb89d165a3ea59058e6be34
Reviewed-on: https://code.wireshark.org/review/19407
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-24 03:25:09 +00:00
Alexis La Goutte a5f1afe2b7 decoders(transum): fix redundant redeclaration of 'add_detected_tcp_svc’ [-Wredundant-decls]
Change-Id: I70ccf182160086a4c04467eec214857a461a2869
Reviewed-on: https://code.wireshark.org/review/19373
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-21 15:57:46 +00:00
Alexis La Goutte c7a46477d3 transum: fix no previous prototype for ‘proto_register_transum’ [-Wmissing-prototypes]
the last one

Change-Id: I8b279d11b61645a19b0b356d52cf66eed0180700
Reviewed-on: https://code.wireshark.org/review/19372
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-21 15:57:16 +00:00
Alexis La Goutte 56cf6998bb transum: fix no previous prototype for '...’ [-Wmissing-prototypes]
Part 2...

Change-Id: Id219bd2b04de2003b5bfa4a33893d0310856275d
Reviewed-on: https://code.wireshark.org/review/19368
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-21 11:37:42 +00:00
Alexis La Goutte cf0f6ae0ae transum: add Modelines info
Change-Id: I9d9ffdb7d32a940dbe155e82946d59f649cafe09
Reviewed-on: https://code.wireshark.org/review/19345
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-19 13:32:10 +00:00
Alexis La Goutte 562954bbe6 transum: fix no previous prototype for '...’ [-Wmissing-prototypes]
Comment set_pkt_rrpd (not used)

Change-Id: I8d571f3cd45c51b07969132718a43244003c0f59
Reviewed-on: https://code.wireshark.org/review/19344
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-19 13:31:57 +00:00
Alexis La Goutte 8e19794b5e decoders(transum): fix no previous prototype for ‘decode_*’ [-Wmissing-prototypes]
Change-Id: I93b24285443d99799f83c40f61f413c2d106c85f
Reviewed-on: https://code.wireshark.org/review/19338
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-18 21:24:56 +00:00
Pascal Quantin 693dcd276e Build TRANSUM plugin
Add plugin to autofoo and CMake build systems and fix errors found
Add plugin to Windows installer (optional component activated by default)

Change-Id: Id1b777bdee04e53076b3291f6fb68d5abad6985d
Reviewed-on: https://code.wireshark.org/review/19228
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-12-13 08:50:27 +00:00
Paul Offord fb0c288f99 transum: plugin code
A plugin to calculate response, service and spread time values based on
the RTE model.

Bug: 12892
Change-Id: I47d7e5354fc269916851a318fef10b826897eaf8
Reviewed-on: https://code.wireshark.org/review/17750
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-09 04:41:35 +00:00