[PATCH v2 0/6] Decode family field of Netlink GENERIC protocol
Masatake YAMATO
yamato at redhat.com
Sun Jun 11 07:42:26 UTC 2017
Netlink GENERIC protocol allows a process to talk with a subsystem of
Linux kernel specified by its name(family name); the process asks the
id(family id)for the name first, then talks to the subsystem with the
id. The id is defined at run-time, when the subsystem is
registered. Therefore strace cannot make a table mapping from a family
id to its family name in build-time.
These change sets are for decoding family ids.
strace gets the mapping and makes the table at run-time.
Following case is not considered yet.
The target process it self can ask registering a subsystem not
registered yet to Linux kernel. When strace detects such action of the
target process, strace should extend the table for decoding the family id
of the newly registered subsystem.
Changes in V2:
* Fix the most of formatting issues reported by Linux kernel's
checkpatch.pl script.
Suggested by Dmitry V. Levin <ldv at altlinux.org>.
* keep NETLINK_* entries in nlmsg_types sorted.
Suggested by JingPiao Chen <chenjingpiao at gmail.com>.
* Add tests/.gitignore to 6/6 change log.
Suggested by JingPiao Chen <chenjingpiao at gmail.com>.
Masatake YAMATO (6):
socketeutils: extend receive_responses() to handle other type than
SOCK_DIAG_BY_FAMILY communication
socketeutils: allow to pass a user data to the callback function of
receive_responses()
dyxlat: building xlat dynamically
socketutils: build a xlat table dynamically for decoding "family"
field of Netlink GENERIC protocol
netlink: decode "family" field of Netlink GENERIC protocol
tests: add check for decoding family field of netlink GENERIC protocol
Makefile.am | 1 +
defs.h | 10 ++++
dyxlat.c | 119 ++++++++++++++++++++++++++++++++++++++
netlink.c | 8 ++-
socketutils.c | 136 ++++++++++++++++++++++++++++++++++++++------
tests/.gitignore | 1 +
tests/gen_tests.in | 1 +
tests/netlink_generic.c | 80 ++++++++++++++++++++++++++
tests/pure_executables.list | 1 +
9 files changed, 339 insertions(+), 18 deletions(-)
create mode 100644 dyxlat.c
create mode 100644 tests/netlink_generic.c
--
2.9.4
More information about the Strace-devel
mailing list