summaryrefslogtreecommitdiff
path: root/plugins/transum
AgeCommit message (Collapse)AuthorFilesLines
2017-04-17Get rid of unnecesary #includes.Guy Harris1-3/+0
Change-Id: I379a2a1007be1b844873d9c5e8ea53bd689f0f4d Reviewed-on: https://code.wireshark.org/review/21158 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17Remove unnecessary tap.Guy Harris1-38/+0
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-17Rename some routines and structure members.Guy Harris1-1/+1
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-16Get rid of some generated files with "make distclean".Guy Harris1-2/+4
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-13Use proto_get_finfo_ptr_array() rather than proto_find_finfo().Guy Harris1-12/+4
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-12Fix indentation.Guy Harris1-2/+2
Change-Id: Idc3d9c40a5f8ecd0f192c289538c3303ba2b7ffe Reviewed-on: https://code.wireshark.org/review/21067 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12Prime the epan_dissect_t with postdissector wanted fields if necessary.Guy Harris1-53/+71
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-12Add an API to let a postdissector specify fields whose values it needs.Guy Harris1-3/+21
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-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-1/+1
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-02-18transum: Add protections against NULL trees.Michael Mann1-4/+32
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-01-07Convert range API to always use wmem memory.Michael Mann1-15/+2
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>
2016-12-25Cleanup transum post-dissector.Michael Mann5-665/+514
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-24[TRANSUM] smb2.msg_id is now a FT_UINT64.Michael Mann1-1/+1
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-21decoders(transum): fix redundant redeclaration of 'add_detected_tcp_svc’ ↵Alexis La Goutte1-1/+0
[-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-21transum: fix no previous prototype for ‘proto_register_transum’ ↵Alexis La Goutte1-1/+1
[-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-21transum: fix no previous prototype for '...’ [-Wmissing-prototypes]Alexis La Goutte1-4/+4
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-19transum: add Modelines infoAlexis La Goutte5-0/+65
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-19transum: fix no previous prototype for '...’ [-Wmissing-prototypes]Alexis La Goutte2-16/+20
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-18decoders(transum): fix no previous prototype for ‘decode_*’ ↵Alexis La Goutte1-0/+1
[-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-13Build TRANSUM pluginPascal Quantin6-35/+219
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-09transum: plugin codePaul Offord12-0/+2524
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>