Commit Graph

15 Commits

Author SHA1 Message Date
João Valverde 39df3ae3c0 Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
Guy Harris 11b500ce1c Remove redundant assertion.
I guess we used to just have a g_assert() here to check that there was a
subdissector table to which to add the capture dissector, but we now
have a test for a null subdissector table pointer that attempts to
produce a more detailed and more useful error (and to fail only if we've
set the "crash on some otherwise-ignored errors" environment variable).

Remove the assertion, as we've already ensured that, at that point, the
subdissector table pointer is not null.

This should squelch a constArgument warning from cppcheck.
2021-01-19 23:40:31 -08:00
Anders Broman 98cda1bf46 Load environment vars to globals for efficency.
These environment variables are read very frequently, read them once to
globals for performance improvment.

Change-Id: I4f05a5edca85b370674cc5f85fce40bd1af695cb
Reviewed-on: https://code.wireshark.org/review/34449
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-04 12:31:53 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Guy Harris 452e78bb83 Fix the type of the packet buffer argument to a capture dissector.
It's a blob of bytes, so the right type is guint8 *, not guchar *.
(Yes, in practice, they're both typedefs for "unsigned char" - sadly,
C's data types didn't make a distinction between "byte-sized integral
value" and "character" - but given that we have different names, let's
use them to make it clearer what's being done.)

Change-Id: Idb10a208877c84df0432043d69d4aff5a2b2f803
Reviewed-on: https://code.wireshark.org/review/29943
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-30 21:25:22 +00:00
Gerald Combs 9ec5b2b0fe Qt: Implement the capture info dialog.
Add back the capture info dialog. Draw sparklines for each protocol.
Update the User's Guide.

Bug: 12004
Change-Id: I45be8a0df4752255831a8b139ee84bb34d675ba9
Reviewed-on: https://code.wireshark.org/review/27565
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-16 04:26:36 +00:00
Dario Lombardo 7650151311 more SPDX convertions.
Change-Id: I6b8404c28b31a81767a3b64ffe9ba96156c4c217
Reviewed-on: https://code.wireshark.org/review/25757
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-13 13:57:30 +00:00
João Valverde d47551982b Implement registration of capture dissectors by name
Mirror it after protocol dissector API.

Change-Id: I7985bcfa9e07654c7cf005efec94efc205d7a304
Reviewed-on: https://code.wireshark.org/review/18496
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-28 17:39:04 +00:00
Guy Harris 3ed06ec32b The C standard requires <stdlib.h> for getenv() and abort().
You might be able to get away with not including it on some or all
UN*Xes, but you can't do so on Windows with MSVC.

Change-Id: Id2de70745e2a6e8dedc005a55030f3d3fcb54a69
Reviewed-on: https://code.wireshark.org/review/16064
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-21 23:34:45 +00:00
Joerg Mayer 1b1296a045 More helpful failure when registration fails.
Change-Id: I3c574c504cc9166d04b5b725a6a393767a58a280
Reviewed-on: https://code.wireshark.org/review/16063
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-06-21 22:29:54 +00:00
Michael Mann f2b8504740 Don't limit capture packet counts to a fixed set of protocols.
Kept backwards compatibility with GTK+ capture info dialog by keeping the protocols tracked hardcoded, but Qt should have more freedom.

Change-Id: I497be71ec761d53f312e14858daa7152d01b8c72
Reviewed-on: https://code.wireshark.org/review/12724
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>
2015-12-22 05:23:06 +00:00
Michael Mann f342fdcdb8 Create capture dissector "info" structure (capture_packet_info_t)
While it currently only contains packet_counts, it will hopefully stabilize the capture function signature if more fields are added.

Change-Id: I003552c58043c7c2d67aec458187b12b233057e2
Reviewed-on: https://code.wireshark.org/review/12690
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-17 04:01:56 +00:00
Michael Mann 0960ac4dfd Create capture dissector tables.
They are modeled after dissection dissector tables, but for the moment, don't have/need the flexibility.  They are intended to be much simpler/faster than full dissection.
The two most used/needed are "wtap_encap" and "ethertype", so they were the basis of starting to use and test capture dissector table API.  Others may be added in the future.

The "capture dissector" function signature needed a bit of tweeking to handling "claiming" of a packet.
The current application of this is capture functions returning TRUE if they affected a "type" of packet count.  Returning FALSE ends up considering the packet an "other" type.

Change-Id: I81d06a6ccb2c03665f087258a46b9d78d513d6cd
Reviewed-on: https://code.wireshark.org/review/12607
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-14 12:17:49 +00:00
Pascal Quantin 260704695d Fix crash at startup
Change-Id: I6d21fb06ace6186991f4e481bfc7452364e6c4f7
Reviewed-on: https://code.wireshark.org/review/12602
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-12-13 20:48:16 +00:00
Michael Mann 56aa05227f Create a way to register "capture" dissectors.
Capture dissectors could be architected like dissection dissectors, with tables and subtables and possibly using tvbs to pass there data instead of raw byte arrays.  This is a first step towards that by refactoring capture_info_packet() to work off of a "capture dissector table"

Registering the capture dissection functions instead of calling them directly also clears up a bunch of dissector header files who sole purpose was providing the capture dissection function definition.

Change-Id: I10e9b79e061f32d2572f009823601d4f048d37aa
Reviewed-on: https://code.wireshark.org/review/12581
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-13 14:34:13 +00:00