Commit Graph

7121 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
cbbf708b4d macros: add ROUNDUP macro
* macros.h (ROUNDUP): New macro.
2018-09-02 22:03:43 +00:00
Eugene Syromyatnikov
c3ac40611c futex: recognise FUTEX_BITSET_MATCH_ANY bitmask
* xlat/futexbitset.in: New file.
* futex.c: Include "xlat/futexbitset.h".
(futex) <FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET>: Decode val3 using
futexbitset xlat.
* tests/futex.c: Add checks for 0xffffffff bitset mask printing.

Closes: Linux commit v4.16-rc1~166^2^2~2
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
8a56b8a1b7 ioprio: move constant definitions to xlat
* xlat/ioprio_class.in: Add fallback values.
* xlat/ioprio_who.in: Likewise.
* ioprio.c: Remove IOPRIO_WHO_* and IOPRIO_CLASS_* enums.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
38e0f55602 net: decode AF_PACKET protocols in socket syscall
* net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode.
(SYS_FUNC(socket)) <AF_PACKET>: Decode using ethernet_protocols xlat.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
9a969eb670 print_ifindex: add public get_ifname method
In order to be able to obtain sanitised device name internally.

* defs.h (get_ifname): New declaration.
* print_ifindex.c (get_ifname): Refactor, leaving out addition
of if_nametoindex("") part.
(sprint_ifname): New function, adds if_nametoindex("")
to get_ifname's output.
(print_ifindex): Use sprint_ifname instead of get_ifname.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
ef859a2702 socketutils: introduce get_family_by_proto
Add a helper function that returns address family based on the internal
notion of the socket protocol using protocols table.

* defs.h (get_family_by_proto): New declaration.
* socketutils.c (get_family_by_proto): New function.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
54fc755c56 socketutils: add more IP/IPv6 transport protocols
* defs.h (sock_proto): Add SOCK_PROTO_UDPLITE, SOCK_PROTO_DCCP,
SOCK_PROTO_SCTP, SOCK_PROTO_L2TP_IP, SOCK_PROTO_PING, SOCK_PROTO_RAW,
SOCK_PROTO_UDPLITEv6, SOCK_PROTO_DCCPv6, SOCK_PROTO_L2TP_IPv6,
SOCK_PROTO_SCTPv6, SOCK_PROTO_PINGv6, and SOCK_PROTO_RAWv6.
* socketutils.c: Include "xlat/inet_protocols.h" in XLAT_MACROS_ONLY
mode.
(protocols): Add protocol descriptions for them.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
7c08fe37a1 socketutils: store more information in protocols table
This also allows getting rid of all these *_v[46]_get calls.

* socketutils.c (unix_get, inet_get, netlink_gen): Add family, protocol,
and proto_name paramteres, use them where appropriate.
(tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Remove.
(protocols): Add family and proto fields to the structure, call inet_get
for IP/IPv6 protocols.
(get_sockaddr_by_inode_uncached): Update protocols->get calls.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
a302982576 sockaddr: whitespace cleanup, fix typo in comment
* sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess
indentation from the switch statement.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
f561173367 tests: add utimensat test variants with different xlat verbosity levels
* tests/utimensat-Xabbrev.c: New file.
* tests/utimensat-Xraw.c: Likewise.
* tests/utimensat-Xverbose.c: Likewise.
* tests/utimensat.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags.
* tests/pure_executables.list: Add utimensat-Xabbrev, utimensat-Xraw,
and utimensat-Xverbose.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (utimensat-Xabbrev, utimensat-Xraw, utimensat-Xverbose): New
tests.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
9f4b5992fe print_timespec: make print_timespec_t_utime respect xlat style setting
* print_timespec.c (print_timespec_t_utime): Print raw timespec value
in accordance with xlat style setting.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
79878e783c netlink: honor custom xlat style setting during nlmsg flags printing
Commit v4.23~343 introduced xlat style argument to printflags_ex, but
XLAT_STYLE_DEFAULT was introduced only in the next commit v4.23~342,
which led to missing out fixing the sole external user of this
peculiar extended interface.

* netlink.c (decode_nlmsg_flags): Use XLAT_STYLE_DEFAULT instead of
XLAT_STYLE_ABBREV in printflags_ex call.

Fixes: v4.23~342 "Introduce XLAT_STYLE_DEFAULT"
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
298f29a15b netlink_netfilter: use xlat styles for res_id workaround printing
* netlink_netfilter.c (decode_netlink_netfilter): Call print_xlat_ex
in order to respect xlat style setting.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
6177e74134 xlat: provide fallback definitions for epollevents
* xlat/epollevents.in: Provide fallback definitions, add EPOLLNVAL
constant (introduced by Linux commit v4.16-rc1~3^2~3).
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
b05d2667e9 xlat: provide fallback definitions to pollflags
* xlat/pollflags.in: Add fallback definitions for POLLWRNORM,
POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
fdfc68a984 xlat: provide fallback values for socktypes
* xlat/socktypes.in: Provide fallback values.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
3f10639284 xlat: provide fallback values to route_nexthop_flags
* xlat/route_nexthop_flags.in: Add fallback values.
2018-09-02 17:44:26 +00:00
Eugene Syromyatnikov
618d4ed497 block: move fallback definitions for ioctl commands to xlat
* xlat/block_ioctl_cmds.in: New file.
* block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
(BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN,
BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET,
BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove
fallback definitions as those are porvided by block_ioctl_cmds xlat now.
2018-09-01 14:38:12 +00:00
Eugene Syromyatnikov
9b5d56054c Decode BLKGETSIZE64 unconditionally
It is available on all supported kernel versions.

* block.c (block_ioctl): Remove #ifdef HAVE_BLKGETSIZE64.
* configure.ac: Remove BLKGETSIZE64 check.
2018-09-01 14:38:12 +00:00
Eugene Syromyatnikov
f3b38739d5 xlat: add ability to specify a default string to print_xlat_ex
In order to avoid dealing with xlat verbosity styles outside xlat code
as much as possible.

* defs.h (xlat_style_private_flag_bits): Rename from
print_array_flag_bits, add PXF_DEFAULT_STR_BIT.
(xlat_style_private_flags): Rename from print_array_flags, add
FLAG_(PXF_DEFAULT_STR).
* xlat.c (print_xlat_ex): Handle PXF_DEFAULT_STR by interpreting str
as a default value (print both value and str in XLAT_STYLE_ABBREV).
2018-09-01 13:13:09 +00:00
Eugene Syromyatnikov
288b872266 nlattr: provide common AF_INET{,6} address decoders
Rename decode_ifla_inet6_token to decode_nla_in6_addr,
add a sister function decode_nla_in_addr for future use.

* nlattr.c (decode_nla_in_addr, decode_nla_in6_addr): New functions.
* nlattr.h (DECL_NLA(in_addr), DECL_NLA(in6_addr)): New declarations.
* rtnl_link.c (decode_ifla_inet6_token): Remove.
(ifla_inet6_nla_decoders) <[IFLA_INET6_TOKEN]>: Use decode_nla_in6_addr.
2018-09-01 13:02:04 +00:00
Eugene Syromyatnikov
1d7b8edda9 net: decode SOL_XDP socket option names
* xlat/sock_xdp_options.in: New file.
* net.c: Include "xlat/sock_xdp_options.h".
(print_sockopt_fd_level_name) <case SOL_XDP>: Print SOL_XDP socket
option names.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
45afd0c7a3 xlat: add SOL_XDP to socketlayers.in
* xlat/socketlayers.in (SOL_XDP): New constant, introduced by Linux
commit v4.18-rc1~114^2~304^2~4^2~14.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
dac524ad98 xlat: add AF_XDP to addrfams.in
* xlat/addrfams.in (AF_XDP): New constant, introduced by Linux commit
v4.18-rc1~114^2~304^2~4^2~14.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
587d1d5663 netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value
* xlat/sock_shutdown_flags.in: New file.
* netlink_smc_diag.c: Include "xlat/sock_shutdown_flags.h".
(decode_smc_diag_shutdown): New function.
(smc_diag_msg_nla_decoders) <[SMC_DIAG_SHUTDOWN]>: Use
decode_smc_diag_shutdown.
* tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_SHUTDOWN.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
00bfa52a81 tests/ioctl_v4l2: do not calculate page end address each time
* tests/ioctl_v4l2.c (main): Replace page + size with page_end.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
5d18b8cdef print_fields: simplify UINT64_MAX printing
As we have print_xlat_u now.

* print_fields.h (PRINT_FIELD_U64): Use print_xlat_u for UINT64_MAX
printing.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
25a4cafa90 nsfs: simplify auxstr logic
There's no need to check whether non-NULL value is being assigned to
auxstr; syscall_exiting_trace does it itself.

* nsfs.c (nsfs_ioctl) <case NS_GET_NSTYPE>: Simply assign result of
xlookup to auxstr if syserror(tcp) is false.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
6e7da52286 xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in
* xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_REUSEPORT): New constant,
introduced by Linux commit v4.19-rc1~140^2~24^2~2^2~5.
* tests/bpf.c: Update expected output.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
930864b083 xlat: add IPSTATS_MIB_REASM_OVERLAPS to snmp_ip_stats_mib.in
* xlat/snmp_ip_stats.in (IPSTATS_MIB_REASM_OVERLAPS): New constant,
introduced by Linux commit v4.19-rc1~140^2~128^2~2.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
3926f4a07d xlat: update bpf_map_types.in
* xlat/bpf_map_types.in (BPF_MAP_TYPE_CGROUP_STORAGE): New constant,
introduced by Linux commit v4.19-rc1~140^2~108^2~3^2~12.
(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY): New constant, introduced by Linux
commit v4.19-rc1~140^2~24^2~2^2~6.
* tests/bpf.c: Update expected output.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
24535be245 rtnl_link: add IFLA_MIN_MTU and IFLA_MAX_MTU attributes
Introduced by Linux commit v4.19-rc1~140^2~205^2~1.

* rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_MIN_MTU], [IFLA_MAX_MTU]>:
New decoder, calls decode_nla_u32.
* xlat/rtnl_link_attrs.in (IFLA_MIN_MTU, IFLA_MAX_MTU): New constant.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
4fa680e63f xlat: add IPV4_DEVCONF_BC_FORWARDING-1 to inet_devconf_indices.in
* xlat/inet_devconf_indices.in (IPV4_DEVCONF_BC_FORWARDING-1): New
constant, introduced by Linux commit v4.19-rc1~140^2~208^2~1.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
fb7c51690e rtnl_netconf: add NETCONFA_BC_FORWARDING attribute
Introduced by Linux commit v4.19-rc1~140^2~208^2~1.

* rtnl_netconf.c (netconfmsg_nla_decoders) <[NETCONFA_BC_FORWARDING]>:
New decoder, calls decode_nla_s32.
* xlat/rtnl_netconf_attrs.in (NETCONFA_BC_FORWARDING): New constant.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
df7dd5aa66 netlink_smc_diag: add SMC_DIAG_FALLBACK attribute support
Introduced by Linux commit v4.19-rc1~140^2~253^2~1.

* linux/smc_diag.h (SMC_DIAG_FALLBACK): New enumeration item.
(struct smc_diag_fallback): New type definition.
* netlink_smc_diag.c: Include "xlat/smc_decl_codes.h".
(decode_smc_diag_fallback): New function.
(smc_diag_msg_nla_decoders) <[SMC_DIAG_FALLBACK]>: New decoder, calls
decode_smc_diag_fallback.
* tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_FALLBACK
attribute decoding.
* xlat/smc_decl_codes.in: New file.
* xlat/smc_diag_attrs.in (SMC_DIAG_FALLBACK): New constant.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
e8d95392ad defs.h: add style argument to printxval_search_ex macro
It is identical to printxval_search otherwise.

* defs.h (printxval_search_ex): Add style argument.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
fe8861f6b4 xlat: update v4l2_pix_fmts.in
* xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT): New constant, introduced by
Linux commit v4.19-rc1~137^2~221.
(V4L2_PIX_FMT_SBGGR14P, V4L2_PIX_FMT_SGBRG14P, V4L2_PIX_FMT_SGRBG14P,
V4L2_PIX_FMT_SRGGB14P): New constants, introduced by Linux commit
v4.19-rc1~137^2~97.
(V4L2_PIX_FMT_Y10P): New constant, introduced by Linux commit
v4.19-rc1~137^2~95.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
f7d175b562 netlink_smc_diag: decode smc_diag_msg.diag_fallback constant names
Introduced by Linux commit v4.19-rc1~140^2~285^2~4.

* xlat/smc_diag_mode.in: New file.
* netlink_smc_diag.c: Include "xlat/smc_diag_mode.h".
(decode_smc_diag_msg): Print diag_fallback field using smc_diag_mode
xlat.
* tests/netlink_sock_diag.c (test_smc_diag_msg): Update expected output.
* tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
701fd04d8a rtnl_link: add IFLA_BRPORT_BACKUP_PORT attribute
Introduced by Linux commit v4.19-rc1~140^2~288^2.

* xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_PORT): New
constant.
* rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_BACKUP_PORT]>:
New decoder.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
cde23ff80c xlat: update nt_descriptor_types.in
* xlat/nt_descriptor_types.in (NT_VMCOREDD): New named constant,
introduced by Linux commit v4.18-rc1~114^2~252^2~2.
(NT_MIPS_DSP): New named constant, introduced by Linux commit
v4.19-rc1~42^2~63.
(NT_MIPS_FP_MODE): New named constant, introduced by Linux commit
v4.19-rc1~42^2~62.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
6b141f643a xlat: add AUDIT_INTEGRITY_POLICY_RULE to nl_audit_types.in
* xlat/nl_audit_types.in (AUDIT_INTEGRITY_POLICY_RULE): New constant,
introduced by Linux commit v4.19-rc1~124^2~5.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
d029a5efd1 rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value
* xlat/rtnl_ifla_xdp_attached_mode.in: New file.
* rtnl_link.c: Include "xlat/rtnl_ifla_xdp_attached_mode.h".
(decode_ifla_xdp_attached): New function.
(ifla_xdp_nla_decoders) <[IFLA_XDP_ATTACHED]>: Use
decode_ifla_xdp_attached instead of decode_nla_u8.
* tests/nlattr_ifla_xdp.c: Add checks for IFLA_XDP_ATTACHED decoding.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
eded21f5c0 rtnl_link: add new IFLA_XDP_* attributes
Introduced by Linux commit v4.19-rc1~140^2~364^2~6^2~6.

* xlat/rtnl_ifla_xdp_attrs.in (IFLA_XDP_DRV_PROG_ID,
IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): New constants.
* rtnl_link.c (ifla_xdp_nla_decoders): Add decoders for
IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, and IFLA_XDP_HW_PROG_ID.
* tests/nlattr_ifla_xdp.c: Add checks for new attributes.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
9624d9f09d xlat: update v4l2_control_ids.in
* xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_VP8_PROFILE): Renamed
from V4L2_CID_MPEG_VIDEO_VPX_PROFILE (the latter is now a synonym),
by Linux commit v4.19-rc1~137^2~270.
(V4L2_CID_MPEG_VIDEO_VP9_PROFILE): New constant, introduced by Linux
commit v4.19-rc1~137^2~269.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
db5235d0e9 xlat: add SO_TXTIME to sock_options.in
* xlat/sock_options.in (SO_TXTIME): New constant, introduced by Linux
commit v4.19-rc1~140^2~465^2~12.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
cf174ac87a netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding
The message has been added by Linux commit v4.19-rc1~140^2~507^2~1.

* linux/smc_diag.h: Include "gcc_compat.h".
(enum): Add SMC_DIAG_DMBINFO.
(struct smcd_diag_dmbinfo): New type definition.
* xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant.
* netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function.
(smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls
decode_smc_diag_dmbinfo.
* tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
f9578731fc xlat: add SCTP_REUSE_PORT to sock_sctp_options.in
* xlat/sock_sctp_options.in (SCTP_REUSE_PORT): New constant, introduced
by Linux commit v4.19-rc1~140^2~518.
2018-08-27 23:41:41 +00:00
Eugene Syromyatnikov
9aa1efde58 xlat: add IN_MASK_CREATE to inotify_flags.in
* xlat/inotify_flags.in (IN_MASK_CREATE): New constant, introduced by
Linux commit v4.19-rc1~115^2.
* tests/inotify.c (main): Update expected output.
2018-08-27 23:41:41 +00:00
44e21ae30d tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
* tests/nsyscalls.c (test_syscall): Do not assume that unimplemented
syscalls always fail with ENOSYS.
2018-08-22 20:38:27 +00:00
ccee090b78 tests: workaround systemd-nspawn habit of disabling mlockall syscall
* tests/mmap.c (main): Do not assume that mlockall syscall always
succeeds.
2018-08-22 20:38:27 +00:00