summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2017-04-18 09:00:01 +0200
committerMichael Mann <mmann78@netscape.net>2017-04-18 11:17:18 +0000
commit6c33af3d16c84066ef2cd33b649a9e9232784c56 (patch)
tree62f2d3ee725c26f92518be2ff64fbe3f24671329
parent1b7677e32f75c8e12698a9de505f3f9fb9df9569 (diff)
downloadwireshark-6c33af3d16c84066ef2cd33b649a9e9232784c56.tar.gz
NETLINK: Show raw attribute data
Once the netlink dissector does an attribute dissector callback it knows whether or not the callback function could handle the data. If not then simply add the raw data to be inspected by a human. Change-Id: Ibeb7a54f72f0f856008a50f5340e4ba142e00115 Reviewed-on: https://code.wireshark.org/review/21180 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-netlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-netlink.c b/epan/dissectors/packet-netlink.c
index f2a496134e..a9c4078326 100644
--- a/epan/dissectors/packet-netlink.c
+++ b/epan/dissectors/packet-netlink.c
@@ -166,6 +166,10 @@ static header_field_info hfi_netlink_hdr_pid NETLINK_HFI_INIT =
{ "Port ID", "netlink.hdr_pid", FT_UINT32, BASE_DEC,
NULL, 0x00, "Sender port ID", HFILL };
+static header_field_info hfi_netlink_attr_len NETLINK_HFI_INIT =
+ { "Len", "netlink.attr_len", FT_UINT16, BASE_DEC,
+ NULL, 0x00, NULL, HFILL };
+
static header_field_info hfi_netlink_attr_type NETLINK_HFI_INIT =
{ "Type", "netlink.attr_type", FT_UINT16, BASE_HEX,
NULL, 0x0000, "Netlink Attribute type", HFILL };
@@ -182,8 +186,8 @@ static header_field_info hfi_netlink_attr_index NETLINK_HFI_INIT =
{ "Index", "netlink.attr_index", FT_UINT16, BASE_DEC,
NULL, 0x0000, "Netlink Attribute type (array index)", HFILL };
-static header_field_info hfi_netlink_attr_len NETLINK_HFI_INIT =
- { "Len", "netlink.attr_len", FT_UINT16, BASE_DEC,
+static header_field_info hfi_netlink_attr_data NETLINK_HFI_INIT =
+ { "Data", "netlink.attr_data", FT_BYTES, BASE_NONE,
NULL, 0x00, NULL, HFILL };
/* TODO add a value_string for errno. */
@@ -309,7 +313,7 @@ dissect_netlink_attributes_common(tvbuff_t *tvb, header_field_info *hfi_type, in
}
if (!cb(tvb, data, attr_tree, rta_type, offset, rta_len - 4)) {
- /* not handled */
+ proto_tree_add_item(attr_tree, &hfi_netlink_attr_data, tvb, offset, rta_len - 4, encoding);
}
} else {
/*
@@ -597,6 +601,7 @@ proto_register_netlink(void)
&hfi_netlink_attr_type_nested,
&hfi_netlink_attr_type_net_byteorder,
&hfi_netlink_attr_index,
+ &hfi_netlink_attr_data,
/* Netlink message payloads */
&hfi_netlink_error,