Re: [PATCH v7 1/4] Add a enum for decoding to tprint_iov() and tprint_iov_upto()

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 01:27:03PM +, Fabien Siron wrote: > Introduce a new type iov_decode which will be used instead of the integer > "decode" as a parameter. Applied, thanks. -- ldv pgpIi3JpA4v0W.pgp Description: PGP signature ---

Re: [PATCH v7 4/4] Netlink: handle multi netlink messages

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 01:27:06PM +, Fabien Siron wrote: > Handle the case where there are several messages in the buffer. > This is very useful to some protocols like SOCK_DIAG. > > * netlink.c (nlmsg_fetch, nlmsg_next): New functions. > (decode_netlink_msg): New function. > (decode_netlink)

Re: [PATCH v7 3/4] tests: check decoding of netlink protocol

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 01:27:05PM +, Fabien Siron wrote: > * tests/netlink_parsing.test: New test. > * tests/netlink_parsing.c: New file. > * tests/.gitignore: Add netlink_parsing. > * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add netlink_parsing.test. > diff --git a/tes

Re: [PATCH v7 2/4] Add a general netlink socket parser

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 01:27:04PM +, Fabien Siron wrote: > Introduce a general socket netlink parser which prints > the header and a string for the remaining part of the buffer. It doesn't > handle all the netlink flags and types because the parser needs more > information. It will be done soo

Re: [PATCH v2 1/3] Add decoding for binder ioctls

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 03:41:19PM +0200, Gabriel Laskar wrote: [...] > Since android does not use the configure, but a separate Makefile with > all the values hardcoded, Does it? OMG. > does it makes sense to bother with it? Absolutely not. -- ldv pgp85B1IwC4Wc.pgp Description: PGP signat

Re: [PATCH v2 1/3] Add decoding for binder ioctls

2016-06-22 Thread Gabriel Laskar
On Wed, 22 Jun 2016 13:37:19 +0300 "Dmitry V. Levin" wrote: > On Wed, Jun 22, 2016 at 11:30:29AM +0200, Antoine Damhet wrote: > [...] > > > > + if (_IOC_SIZE(type) > 0) { > > > > + tprints("["); > > > > + printxval(x, type, str); > > > > +

[PATCH v7 2/4] Add a general netlink socket parser

2016-06-22 Thread Fabien Siron
Introduce a general socket netlink parser which prints the header and a string for the remaining part of the buffer. It doesn't handle all the netlink flags and types because the parser needs more information. It will be done soon. * net.c (printsock): Return family. (do_msghdr): Call tprint_iov_u

Netlink parser v7

2016-06-22 Thread Fabien Siron
Hi, Changes since v6: * Change some commit messages. * Improve some checks in netlink.c. * Some minor fixes. Regards, -- Fabien Siron -- Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco,

[PATCH v7 1/4] Add a enum for decoding to tprint_iov() and tprint_iov_upto()

2016-06-22 Thread Fabien Siron
Introduce a new type iov_decode which will be used instead of the integer "decode" as a parameter. * defs.h (iov_decode): New enum. (tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode. * aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in tprint_iov() ca

[PATCH v7 4/4] Netlink: handle multi netlink messages

2016-06-22 Thread Fabien Siron
Handle the case where there are several messages in the buffer. This is very useful to some protocols like SOCK_DIAG. * netlink.c (nlmsg_fetch, nlmsg_next): New functions. (decode_netlink_msg): New function. (decode_netlink): Call decode_netlink_msg(). * tests/netlink_parsing.c (send_query): Adapt

[PATCH v7 3/4] tests: check decoding of netlink protocol

2016-06-22 Thread Fabien Siron
* tests/netlink_parsing.test: New test. * tests/netlink_parsing.c: New file. * tests/.gitignore: Add netlink_parsing. * tests/Makefile.am (check_PROGRAMS): Likewise. --- tests/.gitignore | 1 + tests/Makefile.am | 2 + tests/netlink_parsing.c| 119 +++

Re: [PATCH v6 4/4] Netlink: handle multi netlink messages

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 12:18:38PM +, Fabien Siron wrote: > Quoting Dmitry V. Levin (2016-06-22 11:13:42) > > On Wed, Jun 22, 2016 at 10:19:03AM +, Fabien Siron wrote: > > > Quoting Dmitry V. Levin (2016-06-21 17:43:49) > > > > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote: >

Re: [PATCH v6 4/4] Netlink: handle multi netlink messages

2016-06-22 Thread Fabien Siron
Quoting Dmitry V. Levin (2016-06-22 11:13:42) > On Wed, Jun 22, 2016 at 10:19:03AM +, Fabien Siron wrote: > > Quoting Dmitry V. Levin (2016-06-21 17:43:49) > > > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote: [...] > > > > + if (nlmsghdr.nlmsg_len != (unsigned) -1 && > > > >

Re: [PATCH v6 4/4] Netlink: handle multi netlink messages

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 10:19:03AM +, Fabien Siron wrote: > Quoting Dmitry V. Levin (2016-06-21 17:43:49) > > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote: > > [...] > > > +static unsigned long > > > +nlmsg_next(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long > > >

Re: [PATCH v2 1/3] Add decoding for binder ioctls

2016-06-22 Thread Dmitry V. Levin
On Wed, Jun 22, 2016 at 11:30:29AM +0200, Antoine Damhet wrote: [...] > > > + if (_IOC_SIZE(type) > 0) { > > > + tprints("["); > > > + printxval(x, type, str); > > > + tprints(", "); > > > + if (pos + sizeof(type) + _IOC_SIZE(t

Re: [PATCH v6 4/4] Netlink: handle multi netlink messages

2016-06-22 Thread Fabien Siron
Quoting Dmitry V. Levin (2016-06-21 17:43:49) > On Tue, Jun 21, 2016 at 02:42:46PM +, Fabien Siron wrote: > [...] > > +static unsigned long > > +nlmsg_next(struct nlmsghdr *nlmsghdr, unsigned long addr, unsigned long > > *len) { > > + *len -= NLMSG_ALIGN(nlmsghdr->nlmsg_len); > > + > > +

Re: [PATCH v2 1/3] Add decoding for binder ioctls

2016-06-22 Thread Antoine Damhet
Le Mon, 20 Jun 2016 15:07:52 +0300, "Dmitry V. Levin" a écrit : > On Sat, Jun 18, 2016 at 07:13:54PM +0200, Antoine Damhet wrote: > [...] > > +static int > > +decode_binder_commands_buffer(struct tcb *tcp, uintptr_t buffer, > > size_t pos, > > + size_t size, const struct xlat *x, const