Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-15 Thread Dmitry V. Levin
On Sun, May 15, 2016 at 10:24:22AM +, Fabien Siron wrote: [...] > > > + } req = { > > > + .nlh = { > > > + .nlmsg_len = sizeof(req), > > > + .nlmsg_type = SOCK_DIAG_BY_FAMILY, > > > + .nlmsg_flags = NLM_F_DUMP | NLM_F_R

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-15 Thread Dmitry V. Levin
On Sun, May 15, 2016 at 03:45:12PM +0900, Masatake YAMATO wrote: > On Sun, 15 May 2016 02:27:36 +0300, "Dmitry V. Levin" > wrote: > >> + if (netlink_proto) { > >> + if (asprintf(&details, "%s:[%s]", proto_name, > >> + netlink_proto) < 0) > > > > I've tried this wit

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-15 Thread Fabien Siron
Quoting Masatake YAMATO (2016-05-15 06:45:12) > On Sun, 15 May 2016 02:27:36 +0300, "Dmitry V. Levin" > wrote: > >> +if (netlink_proto) { > >> +if (asprintf(&details, "%s:[%s]", proto_name, > >> +netlink_proto) < 0) > > > > I've tried this with "ip l" comm

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-15 Thread Fabien Siron
Quoting Dmitry V. Levin (2016-05-14 23:27:36) > On Fri, May 13, 2016 at 12:02:37PM +, Fabien Siron wrote: > > #include > > #include > > #include > > +#include > > This header first appeared in linux v3.10-rc1, but strace can be built > with older kernel headers. > > In similar cases of

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-14 Thread Masatake YAMATO
On Sun, 15 May 2016 02:27:36 +0300, "Dmitry V. Levin" wrote: >> +if (netlink_proto) { >> +if (asprintf(&details, "%s:[%s]", proto_name, >> +netlink_proto) < 0) > > I've tried this with "ip l" command, and it printed > , which looks redundant. > > Wouldn't i

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-14 Thread Dmitry V. Levin
On Fri, May 13, 2016 at 12:02:37PM +, Fabien Siron wrote: > * socketutils.c: (print_sockeaddr_by_inode): Call netlink_print. > (netlink_send_query, netlink_parse_response, netlink_print): New functions. > --- > socketutils.c | 67 > ++- >

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-13 Thread Masatake YAMATO
> +static int > +netlink_parse_response(const char *proto_name, const void *data, > + const int data_len, const unsigned long inode) > +{ > + const struct netlink_diag_msg *const diag_msg = data; > + const char *netlink_proto; > + char *details; > + > + if (data_len

Re: [PATCH] Add netlink domain sockets support to socketutils

2016-05-13 Thread Gabriel Laskar
On Fri, 13 May 2016 12:02:37 + Fabien Siron wrote: > * socketutils.c: (print_sockeaddr_by_inode): Call netlink_print. > (netlink_send_query, netlink_parse_response, netlink_print): New > functions. > --- Looks good to me. Acked-by: Gabriel Laskar > socketutils.c | 67 > ++

[PATCH] Add netlink domain sockets support to socketutils

2016-05-13 Thread Fabien Siron
Hi everyone, This patch adds netlink decoding for the -yy option. It will be used later to get some netlink protocols. Note: This patch doesn't success if the socket is not binded, strace prints the inode instead. Cheers, -- Fabien Siron

[PATCH] Add netlink domain sockets support to socketutils

2016-05-13 Thread Fabien Siron
* socketutils.c: (print_sockeaddr_by_inode): Call netlink_print. (netlink_send_query, netlink_parse_response, netlink_print): New functions. --- socketutils.c | 67 ++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/socketutils