534 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
33ea6a9bb0 xlat: provide fallback values for schedulers
* xlat/schedulers.in: Provide fallback values, add #value_indexed.
(SCHED_ISO): Comment out, not currently used in Linux.
2018-09-06 19:58:27 +02:00
Eugene Syromyatnikov
f4e7b1e740 Revert "netlink_diag: move constant definitions to xlats"
This reverts commit bfbdf336ec301578fe5ab80b3271f8f6ade71466.
2018-09-06 11:24:58 +02:00
Eugene Syromyatnikov
bfbdf336ec netlink_diag: move constant definitions to xlats
In order to avoid duplication.

* linux/netlink_diag.h (NETLINK_DIAG_MEMINFO, NETLINK_DIAG_GROUPS,
NETLINK_DIAG_RX_RING, NETLINK_DIAG_TX_RING, NETLINK_DIAG_FLAGS,
NDIAG_SHOW_MEMINFO, NDIAG_SHOW_GROUPS, NDIAG_SHOW_RING_CFG,
NDIAG_SHOW_FLAGS, NDIAG_FLAG_CB_RUNNING, NDIAG_FLAG_PKTINFO,
NDIAG_FLAG_BROADCAST_ERROR, NDIAG_FLAG_NO_ENOBUFS,
NDIAG_FLAG_LISTEN_ALL_NSID, NDIAG_FLAG_CAP_ACK): Remove.
* xlat/netlink_diag_attrs.in: Add fallback values.
* xlat/netlink_diag_show.in: Likewise.
* xlat/netlink_socket_flags.in: Likewise.
2018-09-05 00:45:35 +02:00
Eugene Syromyatnikov
861f9fd7d8 Add xlat description structure.
Rename struct xlat to struct xlat_data and make struct  xlat an xlat descriptor
that contains various information about xlat. So far, it's type and number
of items.

As a result, xlookup/printxval now have enought information for handling
xlat depending on its type, so no *index/*_search APIs are needed.

* xlat.h (struct xlat_data): Rename from struct xlat.
(struct xlat): New type definition.
* xlat.c (xlat_search, printxval_sized, printxval_searchn_ex, xlat_idx,
printxval_indexn_ex, printxval_dispatch_ex, ): Remove.
(xlookup): Handle xlat_data based on xlat type.
(xlookup_le): New function, replaces xlat_search_eq_or_less and supports
all xlat types.
(sprintflags_ex, printflags_ex): Update.
* xlat/gen.sh (gen_header): Add handling for #sorted, generate new
struct xlat descriptor.
* defs.h (arp_hardware_types_size, ethernet_protocols_size,
inet_protocols_size, evdev_abs_size, xlat_search,
xlat_search_eq_or_less, xlat_idx, printxval_searchn_ex,
printxval_searchn, printxval_search, printxval_search_ex,
printxval_indexn_ex, printxval_indexn, printxval_index,
printxval_index_ex, printxval_dispatch_ex, printxval_dispatch): Remove.
(enum xlat_style_private_flag_bits): Remove PAF_INDEX_XLAT_SORTED_BIT
and PAF_INDEX_XLAT_VALUE_INDEXED_BIT.
(enum xlat_style_private_flag): Remove PAF_INDEX_XLAT_SORTED and
PAF_INDEX_XLAT_VALUE_INDEXED.
(print_array_ex): Remove index_xlat_size argument.
(xlookup_le): New declaration.
(printxval_ex): New macro.
* dyxlat.c (struct dyxlat): Remove used field (use xlat.size instead),
embed struct xlat, add pointer to struct xlat_data.
(MARK_END): Remove.
(dyxlat_alloc, dyxlat_free, dyxlat_get, dyxlat_add_pair): Update in
accordance with the structure changes.
* evdev.c (evdev_abs_size): Remove.
(keycode_ioctl): Use printxval instead of printxval_index.
(decode_bitset): Remove.
(decode_bitset_): Rename to decode_bitset, remove decode_nr_size and xt
arguments, call printxval instead of printxval_dispatch.
(bit_ioctl, evdev_read_ioctl): Do not pass xlat type to decode_bitset.
* print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED,
PRINT_FIELD_XVAL_INDEX): Remove.
* nlattr.h (struct decode_nla_xlat_opts): Remove xlat_size and xt
fields.
* nlattr.c (decode_nla_meminfo): do not pass
PAF_INDEX_XLAT_VALUE_INDEXED flag and netlink_sk_meminfo_indices size
in a print_array_ex call.
(decode_nla_xval): Call printxval_ex instead of printxval_dispatch_ex.
(decode_nla_ether_proto, decode_nla_ip_proto): Do not pass xlat_size and
xt fields in opts.
(decode_nla_flags): Remove XT_INDEXED unsupported warning.
* process.c (struct_user_offsets_data): Rename from
struct_user_offsets, change type to struct xlat_data[], remove XLAT_END.
(struct_user_offsets): New xlat description.
(print_user_offset_addr): Rewrite using xlookup_le.
* util.c (print_array_ex): Remove index_xlat_size argument, simply call
printxval_ex for index printing.
* aio.c (tprint_lio_opcode): Use printxval_ex instead of
printxval_indexn_ex.
* bpf.c: Use printxval instead of printxval_index; use PRINT_FIELD_XVAL
instead of PRINT_FIELD_XVAL_INDEX.
* bpf_filter.c (print_bpf_filter_code): Use printxval instead of
printxval_index.
* ioctl.c (evdev_decode_number): Use printxval instead of
printxval_indexn.
* kvm.c (kvm_ioctl_decode_check_extension): Use printxval instead of
printxval_index.
(kvm_ioctl_run_attach_auxstr): Use xlookup instead of xlat_idx.
* net.c: Use printxval instead of printxval_search/printxval_index, use
printxval_ex instead of printxval_searchn_ex.
* netlink_packet_diag.c (decode_packet_diag_msg): Use PRINT_FIELD_XVAL
instead of PRINT_FIELD_XVAL_SORTED_SIZED.
* netlink_smc_diag.c (decode_smc_diag_shutdown): Remove ARRSZ_PAIR
wrapper.
(decode_smc_diag_fallback): Use printxval_ex instead of
printxval_search_ex.
(decode_smc_diag_msg): Use PRINT_FIELD_XVAL instead of
PRINT_FIELD_XVAL_INDEX.
* print_statfs.c (print_statfs_type): Use printxval instead of
printxval_search.
* rtnl_cachereport.c (decode_nla_ipmra_msg_type,
decode_nla_ip6mra_msg_type): Remove ARRSZ_PAIR wrappers, xt fields.
* rtnl_link.c (decode_ifla_inet6_flags, decode_ifla_inet6_agm):
Likewise.
(decode_nla_tun_type, decode_ifla_xdp_attached): Remove xlat_size,
xt fields.
(decode_ifla_inet_conf, decode_ifla_inet6_conf, decode_ifla_inet6_stats,
decode_ifla_inet6_icmp6_stats): Remove PAF_INDEX_XLAT_VALUE_INDEXED flag
and ARRSZ_PAIR wrapper in print_array_ex calls.
(decode_ifinfomsg): Use PRINT_FIELD_XVAL instead of
PRINT_FIELD_XVAL_SORTED_SIZED.
* rtnl_route.c (decode_nla_rt_proto): Use printxval instead of
printxval_search.
* sock.c (print_ifreq): Use PRINT_FIELD_XVAL instead of
PRINT_FIELD_XVAL_SORTED_SIZED.
* sockaddr.c (print_sockaddr_data_ll, print_sockaddr_data_bt,
print_sockaddr): Use printxval instead of printxval_search and
printxval_index.
* time.c (getitimer, osf_getitimer, setitimer, printclockname): Use
printxval instead of printxval_index.
(do_adjtimex): Use xlookup instead of xlat_idx.
* v4l2.c (print_v4l2_cid): Use xlookup instead of xlat_search.
(print_v4l2_cid): Use xlookup_le instead of xlat_search_eq_or_less.
* tests/btrfs.c: Update xlat handling, use struct xlat_data instead of
struct xlat for XLAT() arrays.
* tests/ioctl_block.c: Likewise.
* tests/ioctl_rtc.c: Likewise.
* tests/printflags.c: Likewise.
* tests/printxval.c: Likewise.
* tests/prlimit64.c: Likewise.
* tests/setrlimit.c: Likewise.
* tests/socketcall.c: Likewise.
* tests/xgetrlimit.c: Likewise.
* tests/xstatfsx.c: Likewise.
* xlat/af_packet_versions.in: Add #value_indexed.
* xlat/arp_hardware_types.in: Add #sorted.
* xlat/ax25_protocols.in: Likewise.
* xlat/bluetooth_l2_cid.in: Likewise.
* xlat/bluetooth_l2_psm.in: Likewise.
* xlat/ethernet_protocols.in: Likewise.
* xlat/evdev_ff_types.in: Likewise.
* xlat/fsmagic.in: Likewise.
* xlat/hw_breakpoint_type.in: Likewise.
* xlat/iffflags.in: Likewise.
* xlat/inet6_if_flags.in: Likewise.
* xlat/inet_protocols.in: Likewise.
* xlat/msgctl_flags.in: Likewise.
* xlat/perf_hw_cache_id.in: Likewise.
* xlat/perf_hw_cache_op_id.in: Likewise.
* xlat/perf_hw_cache_op_result_id.in: Likewise.
* xlat/perf_hw_id.in: Likewise.
* xlat/perf_sw_ids.in: Likewise.
* xlat/perf_type_id.in: Likewise.
* xlat/routing_protocols.in: Likewise.
* xlat/semctl_flags.in: Likewise.
* xlat/shmctl_flags.in: Likewise.
* xlat/smc_decl_codes.in: Likewise.
* xlat/sock_ax25_options.in: Likewise.
* xlat/sock_bluetooth_options.in: Likewise.
* xlat/sock_dccp_options.in: Likewise.
* xlat/sock_tipc_options.in: Likewise.
* xlat/socketlayers.in: Likewise.
* xlat/v4l2_control_classes.in: Likewise.
* xlat/v4l2_pix_fmts.in: Likewise.
* xlat/v4l2_sdr_fmts.in: Likewise.
2018-08-31 23:05:03 +02:00
Eugene Syromyatnikov
dea7b2d055 xlat: provide fallback definitions for open_access_modes constants
* xlat/open_access_modes.in: Add fallback values.
2018-08-31 21:11:42 +02:00
Eugene Syromyatnikov
653abe7a9d xlat: update resources
* xlat/resources.in: declare as #value indexed. Provide fallback values.
(RLIMIT_VMEM): Remove.
2018-08-31 21:11:42 +02:00
Eugene Syromyatnikov
b821526643 futex: recoginise 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-08-31 21:11:42 +02:00
Eugene Syromyatnikov
3960fea7f1 [wip] NFNL_SUBSYS_CTNETLINK subsystem decoding support 2018-08-31 21:11:42 +02:00
Eugene Syromyatnikov
13263abd4f aio: assorted iocb decoder updates
* xlat/aio_iocb_flags.in: New file.
* defs.h (pollflags, rwf_flags): New declarations.
* configure.ac: Check for the presence of aio_rw_flags field of the
struct iocb.
* aio.c: Include "xlat/aio_iocb_flags.h".
(AIO_RW_FLAGS_FIELD): New macro definition, defined based on the
presence of HAVE_STRUCT_IOCB_AIO_RW_FLAGS macro.
(iocb_sub): Add SUB_POLL.
(tprint_lio_opcode): Change IOCB_CMD_POLL subtype to SUB_POLL.
[!IOCB_FLAG_RESFD] (print_common_flags): Remove IOCB_FLAG_RESFD presence
check, as it is now provided via xlat.
(print_common_flags): Print aio_flags using aio_iocb_flags xlat.
(print_iocb_header): Always print aio_data. Print aio_rw_flags if it is
non-zero. Print aio_reqprio based on the presence of IOCB_FLAG_IOPRIO
flag in aio_flags (us print_ioprio if it set and print as a signed
integer otherwise).
(print_iocb): Decode SUB_POLL subtype.
* tests/aio.c: Update expected output.
2018-08-31 19:33:29 +02:00
Eugene Syromyatnikov
ea3b724cf0 netlink_packet_diag: assorted decoding fixes
* xlat/af_packet_versions.in: New file.
* netlink_packet_diag.c: Include "xlat/af_packet_versions.h".
(decode_packet_diag_req): sdiag_protocol shouldn't be decoded as a protocol,
it's currently should be set to 0.
(decode_packet_diag_info): Decode pdi_version field using af_packet_versions
xlat; decode pdi_index field as an interface index.
(packet_diag_msg_nla_decoders) <PACKET_DIAG_UID>: Decode using
decode_nla_uid.
(decode_packet_diag_msg): Decode pdiag_num as an low-level protocol.
* tests/netlink_sock_diag.c: Update expected output.
* tests/nlattr_packet_diag_msg.c: Likewise.
2018-08-31 19:33:29 +02:00
Eugene Syromyatnikov
d961fb6936 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-08-31 19:33:29 +02:00
Eugene Syromyatnikov
e901b0cd05 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-08-31 19:33:29 +02:00
Eugene Syromyatnikov
6d4d8e4241 xlat: provide fallback definitions to pollflags
* xlat/pollflags.in: Add fallback definitions for POLLWRNORM,
POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP.
2018-08-31 19:33:29 +02:00
Eugene Syromyatnikov
d573499dfc xlat: provide fallback values for socktypes
* xlat/socktypes.in: Provide fallback values.
2018-08-31 19:33:29 +02:00
Eugene Syromyatnikov
7f232e50af sock: decode SIOCADDRT and SIOCDELRT commands
Those are a bit tricky, as their arguments depends on socket's address
family. So far, it's implemented for AF_INET, AF_AX25, AF_APPLETALK,
AF_NETROM, AF_X25, AF_INET6, AF_ROSE, and AF_PACKET.

* xlat/inet6_route_metrics.in: New file.
* xlat/inet6_router_pref.in: Likewise.
* xlat/netrom_route_types.in: Likewise.
* xlat/route_flags.in: Likewise.
* defs.h (route_nexthop_flags): New xlat declaration.
(sock_proto): Add SOCK_PROTO_AX25, SOCK_PROTO_DDP, SOCK_PROTO_NETROM,
SOCK_PROTO_PACKET, SOCK_PROTO_ROSE, SOCK_PROTO_X25.
* print_fields.h (PRINT_FIELD_INET6_ADDR): New macro.
* sock.c: Include <linux/ax25.h>, <linux/in_route.h>,
<linux/ipv6_route.h>, <linux/netrom.h>, <linux/rose.h>, <linux/route.h>,
<linux/x25.h>, "xlat/inet6_route_metrics.h", "xlat/inet6_router_pref.h",
"xlat/netrom_route_types.h", "xlat/route_flags.h",
"xlat/route_flags_inet6.h", "xlat/route_nexthop_flags.h",
"xlat/routing_types.h".
(decode_rtentry, print_digipeaters, decode_ax25_routes_struct,
decode_nr_route_struct, decode_x25_route_struct, print_inet6_route_pref,
decode_in6_rtmsg, decode_rose_route_struct): New function.
(sock_ioctl): Handle SIOCADDRT and SIOCDELRT.
* socketutils.c (protocols): Add address family information for
SOCK_PROTO_AX25, SOCK_PROTO_DDP, SOCK_PROTO_NETROM, SOCK_PROTO_PACKET,
SOCK_PROTO_ROSE, and SOCK_PROTO_X25.

Co-Authored-by; Olga Feiermann <charmik@users.sourceforge.net>
Closes: https://github.com/strace/strace/issues/41
2018-08-31 19:33:28 +02:00
Eugene Syromyatnikov
624d03085c xlat: provide fallback values to route_nexthop_flags
* xlat/route_nexthop_flags.in: Add fallback values.
2018-08-31 19:33:28 +02:00
Eugene Syromyatnikov
fc9b2b76e3 net: add support for AX.25 protocols and socket option names decoding
* xlat/ax25_protocols.in: New file.
* xlat/sock_ax25_options.in: Likewise.
* net.c: Include "xlat/ax25_protocols.h", "xlat/sock_ax25_options.h".
* (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using
ax25_protocols xlat.
(print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name
using sock_ax25_options xlat.
2018-08-31 19:33:28 +02:00
Eugene Syromyatnikov
da228c39ad ubi: decode flags field of struct ubi_mkvol_req
Introduced by Linux commit v4.19-rc1~13^2~6.

* configure.ac (AC_CHECK_MEMBERS): Add check for struct
ubi_mkvol_req.flags field.
* ubi.c: Include "xlat/ubi_mkvol_req_flags.h".
(UBI_MKVOL_REQ_FLAGS_FIELD): New macro definition.
(ubi_ioctl): Decode the flags field of struct ubi_mkvol_req.
* xlat/ubi_mkvol_req_flags.in: New file.
2018-08-31 19:33:28 +02:00
Eugene Syromyatnikov
044c1560f2 block: move fallback definitions for ioctl commands to xlat
* xlat/block_ioctl_cmds.in: New file.
* block.c: Include "xlat/block_ioctl_cmds.h".
(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-08-31 19:33:28 +02:00
Eugene Syromyatnikov
02ad183786 netlink_netfilter: decode netfilter netlink attribute names
* xlat/nf_acct_attr_names.in: New file.
* xlat/nf_cthelper_attr_names.in: Likewise.
* xlat/nf_ctnetlink_attr_names.in: Likewise.
* xlat/nf_ctnetlink_exp_attr_names.in: Likewise.
* xlat/nf_ctnetlink_to_attr_names.in: Likewise.
* xlat/nf_ipset_attr_names.in: Likewise.
* xlat/nf_nft_compat_attr_names.in: Likewise.
* xlat/nf_nftables_msg_types.in: Likewise.
* xlat/nf_osf_attr_names.in: Likewise.
* xlat/nf_queue_attr_names.in: Likewise.
* xlat/nf_ulog_attr_names.in: Likewise.
* xlat/nft_chain_attr_names.in: Likewise.
* xlat/nft_flow_attr_names.in: Likewise.
* xlat/nft_gen_attr_names.in: Likewise.
* xlat/nft_obj_attr_names.in: Likewise.
* xlat/nft_rule_attr_names.in: Likewise.
* xlat/nft_set_attr_names.in: Likewise.
* xlat/nft_setelem_attr_names.in: Likewise.
* xlat/nft_table_attr_names.in: Likewise.
* xlat/nft_trace_attr_names.in: Likewise.
* netlink_netfilter.c (struct nfnl_decoder): New type definition.
(nft_subsystem_decoders, nfnl_subsystems): New static constants.
(decode_netlink_netfilter): Select xlat for attribute names based
on message subsystem.
* tests/netlink_netfilter.c: Update expected output.
2018-08-31 19:33:24 +02:00
Eugene Syromyatnikov
9f25e7a911 xlat/gen.sh: generate <name>_size variable for xlats in mpers
Otherwise they are nearly unusable.

* xlat/gen.sh (gen_header): Add ${name}_size declaration and definition
if in_mpers is set.
2018-08-28 13:44:50 +02:00
Eugene Syromyatnikov
f676bc701d netlink_route: implement RTM_{NEW,DEL,GET}CHAIN commands
* xlat/nl_route_types.in (RTM_NEWCHAIN, RTM_DELCHAIN, RTM_GETCHAIN): New
constant, introduced by Linux commit v4.19-rc1~140^2~279^2~9.
* netlink_route.c (route_decoders) <[RTM_NEWCHAIN - RTM_BASE],
[RTM_DELCHAIN - RTM_BASE], [RTM_GETCHAIN - RTM_BASE]>: New decoder,
calls decode_tcmsg.
2018-08-28 13:44:50 +02:00
Eugene Syromyatnikov
e6c00226f4 netlink_route: implement RTM_NEWCACHEREPORT message decoding
* xlat/rtnl_family.in: New file.
* xlat/rtnl_ip6mra_creport_attr.in: Likewise.
* xlat/rtnl_ip6mra_msg_types.in: Likewise.
* xlat/rtnl_ipmra_creport_attr.in: Likewise.
* xlat/rtnl_ipmra_msg_types.in: Likewise.
* rtnl_cachereport.c: Likewise.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.c (route_decoders) <[RTM_NEWCACHEREPORT - RTM_BASE]>:
New decoder, call decode_cachereport.
* netlink_route.h (decode_cachereport): New declaration.
* xlat/nl_route_types.in (RTM_NEWCACHEREPORT): New constant, introduced
by Linux commit v4.13-rc1~157^2~129^2~3.
2018-08-28 13:44:50 +02:00
Eugene Syromyatnikov
d5f960204c netlink_route: implement RTM_NEWSTATS, RTM_GETSTATS message decoding
* xlat/ifstats_attr.in: New file.
* xlat/ifstats_attr_mask.in: Likewise.
* xlat/ifstats_offload_attr.in: Likewise.
* xlat/ifstats_xstats_type_attr.in: Likewise.
* xlat/nl_bridge_vlan_flags.in: Likewise.
* rtnl_stats.c: Likewise.
* Makefile.am (strace_SOURCES): Add it.
* configure.ac: Add struct if_stats_msg type check.
* netlink_route.c (route_decoders) <[RTM_NEWSTATS - RTM_BASE],
[RTM_GETSTATS - RTM_BASE]>: New decoder, call decode_ifstatsmsg.
* netlink_route.h (decode_ifstatsmsg): New declaration.
* nlattr.h (DECL_NLA(ifla_af_spec), DECL_NLA(rtnl_link_stats64)): New
declaration.
* rtnl_link.c (decode_nla_rtnl_link_stats64): Rename from
decode_rtnl_link_stats64.
(decode_nla_ifla_af_spec): Rename from decode_ifla_af_spec.
(ifinfomsg_nla_decoders) <[IFLA_STATS64], [IFLA_AF_SPEC]>: Use new
decoder function names.
2018-08-28 13:44:50 +02: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
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
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
Eugene Syromyatnikov
2d88ec9e39 xlat: fix typo in smc_protocols.in
* xlat/smc_protocols.in: s/^MCPROTO_SMC/SMCPROTO_SMC/.
2018-08-19 10:26:18 +00:00
Zhibin Li
5ee385e2eb evdev: fix decoding of EVIOCGBIT(0, ...)
There is a comment in drivers/input/evdev.c which says:
/* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */

That is, EVIOCGBIT(0, ...) should return a bit mask with supported
event types instead of SYN_* event codes.

* defs.h (evdev_ev): New prototype.
* evdev.c: Include "xlat/evdev_ev.h" and remove "xlat/evdev_sync.h".
(bit_ioctl) <case EV_SYN>: Replace EV_SYN with 0, use evdev_ev
with XT_SORTED in decode_bitset invocation instead.
* ioctl.c: Do not include "xlat/evdev_ev.h".
(evdev_decode_number): Print nr == 0x20 as "0" instead of "EV_SYN".
* tests/ioctl_evdev.c (main): Use 0 instead of EV_SYN in EVIOCGBIT
output.
* xlat/evdev_sync.in: Remove.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: v4.10~89 "Add decoding for evdev ioctls"
2018-08-19 10:26:18 +00:00
Pierre Marsais
e38143b00e kvm: decode the argument of KVM_CHECK_EXTENSION
xlat/kvm_cap.in has been generated using the following command line:

grep '#define\s\+KVM_CAP' $linux/include/uapi/linux/kvm.h |
sed -E -e 's/^#define\s+([^ \t]+)\s*([0-9]+).*$/printf "%-40s%s\n" \1 \2/e' \
       -e 's/ {8}/\t/g; s/ +/\t/g'

* xlat/kvm_cap.in: New file.
* kvm.c: Include "xlat/kvm_cap.h".
(kvm_ioctl_decode_check_extension): New function.
(kvm_ioctl): Use it.
* tests/ioctl_kvm_run_common.c (main): Check decoding
of KVM_CHECK_EXTENSION command.

Signed-off-by: Pierre Marsais <pierre.marsais@lse.epita.fr>
2018-08-19 10:26:18 +00:00