Commit Graph

3 Commits

Author SHA1 Message Date
JingPiao Chen
f8ce9d580c netlink: decode AF_PACKET packet_diag_msg attributes
* linux/packet_diag.h (packet_diag_info, packet_diag_mclist,
packet_diag_ring): New structures.
(PDI_*): New macros.
* netlink_sock_diag.c: Include <linux/filter.h>
and "xlat/packet_diag_info_flags.h".
(decode_packet_diag_info, decode_packet_diag_mclist,
decode_packet_diag_ring, decode_packet_diag_filter): New functions.
(packet_diag_msg_nla_decoders): New array.
(decode_packet_diag_msg): Use it.
* print_fields.h (PRINT_FIELD_QUOTED_STRING): New macro.
* xlat/packet_diag_info_flags.in: New file.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
2017-07-09 00:21:02 +00:00
JingPiao Chen
6cc89c0314 netlink: add a basic netlink attribute parser of AF_PACKET diag
* linux/packet_diag.h (PACKET_DIAG_*): New enum.
* netlink_sock_diag.c: Include "xlat/packet_diag_attrs.h".
(decode_packet_diag_msg): Use decode_nlattr.
* xlat/packet_diag_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
2017-06-30 21:38:49 +00:00
JingPiao Chen
e822874c36 netlink: add a basic socket diag parser of AF_PACKET messages
* linux/packet_diag.h: New file.
* Makefile.am (EXTRA_DIST): Add it.
* defs.h (ethernet_protocols): New xlat prototype.
* netlink_sock_diag.c: Include <linux/packet_diag.h>
and "xlat/packet_diag_show.h".
(decode_packet_diag_req, decode_packet_diag_msg): New functions.
(diag_decoders): Add AF_PACKET.
* xlat/packet_diag_show.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
2017-06-15 22:44:04 +00:00