crosvm/common/sys_util
Grzegorz Jaszczyk d7db39550e sys_util: netlink: add functionality for family name query and mcast group id parsing
In order to listen on a specific netlink generic multicast group for a given
family (e.g. "acpi_mc_group" multicast group registered for "acpi_event" family),
we first need to get its group id registered by the kernel.

To achieve above, this commit implements two functionalities:
1) family name query (family_name_query), which prepares proper netlink
   message, which is next send to netlink generic controller to query
   kernel about a given family name. (e.g. it can be used to query about
   "acpi_event" family)
2) parse the netlink generic answer and get group id registered for a
   given generic netlink multicast group name (get_multicast_group_id)
   (e.g. it can be used to get multicast group id for "acpi_mc_group").

BUG=b:197247746, b:205072342
TEST=Use introduced functionality to query about "acpi_event" generic
netlink family and get group id for "acpi_mc_group" group. Additionally
test the same after hacking the kernel and registering two other multicast
groups for acpi_event, so "acpi_mc_group" got a different group id. In
both cases successfully listen on "acpi_mc_group".

Change-Id: Ia7681fae2200ff5baebbad3742c9dd97ac59cae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3515924
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Tomasz Nowicki <tnowicki@google.com>
2022-03-19 07:27:42 +00:00
..
src sys_util: netlink: add functionality for family name query and mcast group id parsing 2022-03-19 07:27:42 +00:00
Cargo.toml crosvm: migrate to Rust 2021 edition 2022-03-09 01:16:03 +00:00