aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-i2c.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-12-19 10:11:40 -0500
committerAnders Broman <a.broman58@gmail.com>2015-12-22 05:23:06 +0000
commitf2b8504740f3fd145a5504682c3788947e151606 (patch)
treecf82793b5becca1f2cd0d2064d3c361e8fe46b7e /epan/dissectors/packet-i2c.c
parentebb7e000c6b4f2c954923ae26a57a36b665232c1 (diff)
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>
Diffstat (limited to 'epan/dissectors/packet-i2c.c')
-rw-r--r--epan/dissectors/packet-i2c.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/packet-i2c.c b/epan/dissectors/packet-i2c.c
index 78a1525298..5b5cc4a5d5 100644
--- a/epan/dissectors/packet-i2c.c
+++ b/epan/dissectors/packet-i2c.c
@@ -34,6 +34,9 @@ void proto_register_i2c(void);
void proto_reg_handoff_i2c(void);
static int proto_i2c = -1;
+static int proto_i2c_event = -1;
+static int proto_i2c_data = -1;
+
static int hf_i2c_bus = -1;
static int hf_i2c_event = -1;
@@ -88,9 +91,9 @@ static gboolean
capture_i2c(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
if (pseudo_header->i2c.is_event) {
- cpinfo->counts->i2c_event++;
+ capture_dissector_increment_count(cpinfo, proto_i2c_event);
} else {
- cpinfo->counts->i2c_data++;
+ capture_dissector_increment_count(cpinfo, proto_i2c_data);
}
return TRUE;
@@ -245,6 +248,10 @@ proto_register_i2c(void)
static decode_as_t i2c_da = {"i2c", "I2C Message", "i2c.message", 1, 0, &i2c_da_values, NULL, NULL,
decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
+ /* Placeholders for capture statistics */
+ proto_i2c_event = proto_register_protocol("I2C Events", "I2C Events", "i2c_event");
+ proto_i2c_data = proto_register_protocol("I2C Data", "I2C Data", "i2c_data");
+
proto_i2c = proto_register_protocol("Inter-Integrated Circuit", "I2C", "i2c");
proto_register_field_array(proto_i2c, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));