]> granicus.if.org Git - strace/commit
socketeutils: extend receive_responses further
authorMasatake YAMATO <yamato@redhat.com>
Sun, 11 Jun 2017 07:42:28 +0000 (16:42 +0900)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 12 Jun 2017 16:44:45 +0000 (16:44 +0000)
commit3a33709f40c61cdd0b291a9b24715159eb306b18
treec6727852e860180fd8e1ab1ae0c8acb2f08f7b9d
parent6c33d4628f699f9bb8fb7d3dd5d75e38e9f00aa5
socketeutils: extend receive_responses further

This is the second patch in series of implementing NETLINK_GENERIC
protocol decoder.

This change allows passing of opaque user data to the callback function.

* socketutils.c (receive_responses): Change the type of proto_name
argument from "const char *" to "void *" to allow passing
of arbitrary data to the callback function.
Rename proto_name to opaque_data, make it the last argument.
Pass it to the callback function as the last argument.
(inet_parse_response, unix_parse_response, netlink_parse_response):
Change the type of proto_name argument from "const char *" to "void *",
rename it to opaque_data, make it the last argument.
Introduce a local variable proto_name to convert the type
of opaque_data argument from "void *" to "const char *".
(unix_get, inet_get, netlink_get): Cast the protocol name from
"const char *" to "void *" for passing to the callback function.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
socketutils.c