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

2016-06-20 Thread Dmitry V. Levin
On Mon, Jun 20, 2016 at 04:06:45PM +, Fabien Siron wrote: > This commit handles 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. > (de

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

2016-06-20 Thread Dmitry V. Levin
On Mon, Jun 20, 2016 at 04:06:43PM +, Fabien Siron wrote: > This commit introduces 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 wil

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

2016-06-20 Thread Dmitry V. Levin
On Mon, Jun 20, 2016 at 04:06:42PM +, Fabien Siron wrote: > This commit introduces 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. >

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

2016-06-20 Thread Fabien Siron
This commit introduces 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 tp

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

2016-06-20 Thread Fabien Siron
This commit introduces 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

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

2016-06-20 Thread Fabien Siron
This commit handles 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_

Netlink parser v5 bis

2016-06-20 Thread Fabien Siron
Hello again, This second series for version 5 of netlink parser corrects the issue with tab that happens in the previous message, I am sorry. Changes since v4: * Change iov_decoder to iov_decode and IOV_DECODER_* to IOV_DECODE_*. * Squash commit old commit 5 and old commit 6 to current commit 4.

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

2016-06-20 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: Netlink parser v5

2016-06-20 Thread Dmitry V. Levin
Hi, On Mon, Jun 20, 2016 at 02:34:20PM +, Fabien Siron wrote: > Hi, > > Changes since v4: > * Change iov_decoder to iov_decode and IOV_DECODER_* to IOV_DECODE_*. > * Squash commit old commit 5 and old commit 6 to current commit 4. In these series, most of added lines have leading tabs change

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

2016-06-20 Thread Fabien Siron
This commit introduces 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

Netlink parser v5

2016-06-20 Thread Fabien Siron
Hi, Changes since v4: * Change iov_decoder to iov_decode and IOV_DECODER_* to IOV_DECODE_*. * Squash commit old commit 5 and old commit 6 to current commit 4. Regards, -- Fabien Siron -- What NetFlow Analyzer can do for

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

2016-06-20 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 +++

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

2016-06-20 Thread Fabien Siron
This commit handles 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_

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

2016-06-20 Thread Fabien Siron
This commit introduces 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 tp

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

2016-06-20 Thread Dmitry V. Levin
On Mon, Jun 20, 2016 at 03:07:52PM +0300, Dmitry V. Levin wrote: > On Sat, Jun 18, 2016 at 07:13:54PM +0200, Antoine Damhet wrote: [...] > > + if (_IOC_SIZE(type) > 0) { > > + tprints("["); > > + printxval(x, type, str); > > + tprints(

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

2016-06-20 Thread Dmitry V. Levin
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 char *str) > +{ > + if (size < sizeof(uint32_t)) { > + tprints