diff options
author | Michael Tuexen <tuexen@wireshark.org> | 2023-02-20 16:47:55 +0100 |
---|---|---|
committer | Michael Tuexen <tuexen@wireshark.org> | 2023-02-20 16:47:55 +0100 |
commit | 2c645005bf40f986bb06bbcca40a18db0c0b539f (patch) | |
tree | 500247b14c3b6d7dd4f79e4aa4151258d1d26088 | |
parent | 9ee9523e527ff5a7d793b5a69e4ecd5576594a82 (diff) |
BBLog: Prepare for event type specifc info column
While there, improve the handling of unknown event types.
-rw-r--r-- | epan/dissectors/packet-bblog.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/epan/dissectors/packet-bblog.c b/epan/dissectors/packet-bblog.c index 5a124a4ec1..74085aa739 100644 --- a/epan/dissectors/packet-bblog.c +++ b/epan/dissectors/packet-bblog.c @@ -186,10 +186,25 @@ dissect_bblog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U { proto_item *bblog_item; proto_tree *bblog_tree; + const gchar *event_name; + guint32 flex1, flex2; guint16 event_flags; + guint8 event_identifier; col_set_str(pinfo->cinfo, COL_PROTOCOL, "BBLog"); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(tvb_get_guint8(tvb, 25), event_identifier_values, "Unknown")); + event_identifier = tvb_get_guint8(tvb, 25); + flex1 = tvb_get_letohl(tvb, 140); + flex2 = tvb_get_letohl(tvb, 144); + switch (event_identifier) { + default: + event_name = try_val_to_str(event_identifier, event_identifier_values); + if (event_name != NULL) { + col_append_fstr(pinfo->cinfo, COL_INFO, "%s", event_name); + } else { + col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown (flex1 0x%08x, flex2 0x%08x0)", flex1, flex2); + } + break; + } bblog_item = proto_tree_add_item(tree, proto_bblog, tvb, 0, -1, ENC_NA); bblog_tree = proto_item_add_subtree(bblog_item, ett_bblog); |