aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-netlink-route.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-12-11 14:05:11 +0000
committerJoão Valverde <j@v6e.pt>2021-12-11 16:32:28 +0000
commit3230ed2dac645ddc7d917323c27813300ff98df3 (patch)
tree6ebbab2877662f2127bcdc0c8cb1cc1c39f30fc7 /epan/dissectors/packet-netlink-route.c
parent53cded5062330a0f1ee3c381e26ff2ec5dc9cf1a (diff)
Netlink: Change dissector API to use HF index
Instead of passing a pointer to a header_field_info structure, pass an integer index to the registry. This allows each dissector to be converted to a more conventional structure.
Diffstat (limited to 'epan/dissectors/packet-netlink-route.c')
-rw-r--r--epan/dissectors/packet-netlink-route.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-netlink-route.c b/epan/dissectors/packet-netlink-route.c
index 944975ffdb..1849e1db6f 100644
--- a/epan/dissectors/packet-netlink-route.c
+++ b/epan/dissectors/packet-netlink-route.c
@@ -397,7 +397,7 @@ _fill_label_value_string_bitmask(char *label, guint32 value, const value_string
}
static int
-dissect_netlink_route_attributes(tvbuff_t *tvb, header_field_info *hfi_type, struct netlink_route_info *info, struct packet_netlink_data *nl_data, proto_tree *tree, int offset, netlink_attributes_cb_t cb)
+dissect_netlink_route_attributes(tvbuff_t *tvb, int hf_type, struct netlink_route_info *info, struct packet_netlink_data *nl_data, proto_tree *tree, int offset, netlink_attributes_cb_t cb)
{
/* XXX, it's *almost* the same:
* - rtnetlink is using struct rtattr with shorts
@@ -405,7 +405,7 @@ dissect_netlink_route_attributes(tvbuff_t *tvb, header_field_info *hfi_type, str
*/
/* XXX, nice */
- return dissect_netlink_attributes_to_end(tvb, hfi_type, ett_netlink_route_attr, info, nl_data, tree, offset, cb);
+ return dissect_netlink_attributes_to_end(tvb, hf_type, ett_netlink_route_attr, info, nl_data, tree, offset, cb);
}
/* Interface */
@@ -1457,7 +1457,7 @@ dissect_netlink_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
nlmsg_tree = proto_item_add_subtree(pi, ett_netlink_route);
/* Netlink message header (nlmsghdr) */
- offset = dissect_netlink_header(tvb, nlmsg_tree, offset, nl_data->encoding, &hfi_netlink_route_nltype, NULL);
+ offset = dissect_netlink_header(tvb, nlmsg_tree, offset, nl_data->encoding, hfi_netlink_route_nltype.id, NULL);
info.pinfo = pinfo;
@@ -1475,7 +1475,7 @@ dissect_netlink_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
info.legacy = (nl_data->type == WS_RTM_GETLINK) && (tvb_reported_length_remaining(tvb, offset) < 16);
offset = dissect_netlink_route_ifinfomsg(tvb, &info, nl_data, nlmsg_tree, offset);
/* Optional attributes */
- offset = dissect_netlink_route_attributes(tvb, &hfi_netlink_route_ifla_attr_type, &info, nl_data, nlmsg_tree, offset, dissect_netlink_route_ifla_attrs);
+ offset = dissect_netlink_route_attributes(tvb, hfi_netlink_route_ifla_attr_type.id, &info, nl_data, nlmsg_tree, offset, dissect_netlink_route_ifla_attrs);
break;
case WS_RTM_NEWADDR:
@@ -1497,7 +1497,7 @@ dissect_netlink_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* Not present in legacy-tool messages;
* again, see the comment above.
*/
- offset = dissect_netlink_route_attributes(tvb, &hfi_netlink_route_ifa_attr_type, &info, nl_data, nlmsg_tree, offset, dissect_netlink_route_ifa_attrs);
+ offset = dissect_netlink_route_attributes(tvb, hfi_netlink_route_ifa_attr_type.id, &info, nl_data, nlmsg_tree, offset, dissect_netlink_route_ifa_attrs);
}
break;
@@ -1521,7 +1521,7 @@ dissect_netlink_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* Not present in legacy-tool messages;
* again, see the comment above.
*/
- offset = dissect_netlink_route_attributes(tvb, &hfi_netlink_route_rta_attr_type, &info, nl_data, nlmsg_tree, offset, dissect_netlink_route_route_attrs);
+ offset = dissect_netlink_route_attributes(tvb, hfi_netlink_route_rta_attr_type.id, &info, nl_data, nlmsg_tree, offset, dissect_netlink_route_route_attrs);
}
break;