Commit Graph

8 Commits

Author SHA1 Message Date
daaf8ab7fe Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-02-13 22:00:00 +00:00
Eugene Syromyatnikov
0327446ae5 Use char * for pointer arithmetics
* netlink_inet_diag.c (decode_inet_diag_req_compat,
decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char *
instead of void *.
* netlink_netlink_diag.c (decode_netlink_diag_req,
decode_netlink_diag_msg): Likewise.
* netlink_packet_diag.c (decode_packet_diag_req,
decode_packet_diag_msg): Likewise.
* netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg):
Likewise.
* rtnl_addr.c (decode_ifaddrmsg): Likewise.
* rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise.
* rtnl_dcb.c (decode_dcbmsg): Likewise.
* rtnl_link.c (decode_ifinfomsg): Likewise.
* rtnl_mdb.c (decode_br_port_msg): Likewise.
* rtnl_neigh.c (decode_ndmsg): Likewise.
* rtnl_route.c (decode_rtmsg): Likewise.
* rtnl_rule.c (decode_fib_rule_hdr): Likewise.
* rtnl_tc.c (decode_tcmsg): Likewise.
2018-01-23 23:17:02 +00:00
Eugene Syromyatnikov
2b97629df1 netlink_inet_diag.c: remove unnecessary return
decode_inet_diag_req, as well as the functions it calls, returns void.

* netlink_inet_diag.c (decode_inet_diag_req): Do not return anything.
2018-01-23 23:17:02 +00:00
2baaf7302e netlink: implement decoding of INET_DIAG_CLASS_ID attribute
This is a new netlink attribute introduced by linux kernel commit
v4.14-rc1~130^2~207.

* linux/inet_diag.h (INET_DIAG_CLASS_ID): New enum.
* netlink_inet_diag.c (inet_diag_msg_nla_decoders): Add
INET_DIAG_CLASS_ID.
* xlat/inet_diag_attrs.in: Add INET_DIAG_CLASS_ID.
* xlat/inet_diag_extended_flags.in: Add 1<<(INET_DIAG_CLASS_ID-1).
* tests/nlattr_inet_diag_msg.c (main): Check INET_DIAG_CLASS_ID
decoding.
2017-09-17 12:04:11 +00:00
89cab1f000 Export decode_inet_addr
* defs.h (decode_inet_addr): New prototype.
* netlink_inet_diag.c (decode_inet_addr): Remove static keyword, move ...
* sockaddr.c: ... here.
2017-08-22 11:39:03 +00:00
7c6f8ad313 netlink_inet_diag: prepare decode_inet_addr for export
* netlink_inet_diag.c (decode_inet_addr): Change return type to bool,
parametrize field name using new var_name argument.
(decode_inet_diag_hostcond): Specify "addr" field name
to decode_inet_addr.
2017-08-22 11:39:03 +00:00
JingPiao Chen
d6a94e0bcd netlink_sock_diag: replace NLA_ALIGN with NLMSG_ALIGN
In several netlink_sock_diag parsers NLA_ALIGN was used instead of
NLMSG_ALIGN to align the length of netlink messages.  Fortunately,
both macros round the given length to the closest multiple of 4,
so technically there is no difference, but the use of wrong macro
is misleading.

* netlink_inet_diag.c (decode_inet_diag_req_compat,
decode_inet_diag_req_v2, decode_inet_diag_msg): Replace
NLA_ALIGN with NLMSG_ALIGN.
* netlink_netlink_diag.c (decode_netlink_diag_msg): Likewise.
* netlink_packet_diag.c (decode_packet_diag_msg): Likewise.
* netlink_smc_diag.c (decode_smc_diag_msg): Likewise.
2017-07-22 15:31:09 +00:00
bf24770d91 Move family-specific NETLINK_SOCK_DIAG parsers to separate files
Split netlink_sock_diag.c that grew too big.

* defs.h (tcp_states, tcp_state_flags): New xlat prototypes.
* netlink_sock_diag.h: New file.
* netlink_inet_diag.c: Likewise.
* netlink_netlink_diag.c: Likewise.
* netlink_packet_diag.c: Likewise.
* netlink_smc_diag.c: Likewise.
* netlink_unix_diag.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* netlink_sock_diag.c: Move family-specific parsers and associated
header includes to separate files.
* nlattr.h (DECL_NLA(meminfo)): New prototype.
* nlattr.c: Include <linux/sock_diag.h>.
(print_meminfo, decode_nla_meminfo): New functions from
netlink_sock_diag.c.
2017-07-19 10:07:34 +00:00