nl80211: display interface name as a string

The attribute value of the ifname attribute is a 0-terminated string that
contains the interface name. Add an hf variable for this name and
display it as a string.

Change-Id: I0bd4caae49274f3e471a6eefb210db8d56f020f7
Reviewed-on: https://code.wireshark.org/review/30789
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Martin Kaiser 2018-11-25 15:38:26 +01:00 committed by Anders Broman
parent 7f80b7a2ad
commit fc1e2ac66d
1 changed files with 6 additions and 0 deletions

View File

@ -2490,6 +2490,10 @@ static header_field_info hfi_nl80211_attr_value32 NETLINK_NL80211_HFI_INIT =
{ "Attribute Value", "nl80211.attr_value32", FT_UINT32, BASE_HEX_DEC,
NULL, 0x00, NULL, HFILL };
static header_field_info hfi_nl80211_ifname NETLINK_NL80211_HFI_INIT =
{ "Interface Name", "nl80211.ifname", FT_STRINGZ, STR_ASCII,
NULL, 0x00, NULL, HFILL };
static int
dissect_nl80211_generic(tvbuff_t *tvb, void *data, proto_tree *tree, _U_ int nla_type, int offset, int len)
{
@ -2758,6 +2762,7 @@ dissect_nl80211_attrs(tvbuff_t *tvb, void *data, proto_tree *tree, int nla_type,
static const struct attr_lookup values[] = {
{ WS_NL80211_ATTR_CHANNEL_WIDTH, &hfi_nl80211_chan_width, NULL, NULL },
{ WS_NL80211_ATTR_WIPHY_CHANNEL_TYPE, &hfi_nl80211_channel_type, NULL, NULL },
{ WS_NL80211_ATTR_IFNAME, &hfi_nl80211_ifname, NULL, NULL },
{ WS_NL80211_ATTR_IFTYPE, &hfi_nl80211_iftype, NULL, NULL },
{ WS_NL80211_ATTR_STA_PLINK_ACTION, &hfi_plink_actions, NULL, NULL },
{ WS_NL80211_ATTR_MPATH_INFO, &hfi_nl80211_mpath_info, NULL, NULL },
@ -2848,6 +2853,7 @@ proto_register_netlink_nl80211(void)
&hfi_nl80211_attr_value,
&hfi_nl80211_attr_value16,
&hfi_nl80211_attr_value32,
&hfi_nl80211_ifname,
/* Extracted using tools/generate-nl80211-fields.py */
/* Definitions from linux/nl80211.h {{{ */
&hfi_nl80211_commands,