summaryrefslogtreecommitdiff
path: root/tests/nlattr_ifla_linkinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* xlat: update IFLA_BRPORT_* constantsDmitry V. Levin2023-04-281-1/+3
| | | | | | | | | | | * src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_MCAST_N_GROUPS, IFLA_BRPORT_MCAST_MAX_GROUPS): New constants introduced by Linux kernel commit v6.3-rc1~162^2~139^2~8. * src/rtnl_link.c (ifla_brport_nla_decoders): Add IFLA_BRPORT_MCAST_N_GROUPS and IFLA_BRPORT_MCAST_MAX_GROUPS. * tests/nlattr_ifla_brport.c (main): Update expected output. * tests/nlattr_ifla_linkinfo.c (main): Likewise. * NEWS: Mention this.
* Update copyright headersDmitry V. Levin2023-02-261-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* xlat: update IFLA_* constantsDmitry V. Levin2023-01-201-1/+2
| | | | | | | | | | | | * src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_MAB): New constant introduced by Linux kernel commit v6.2-rc1~99^2~297^2~1. * src/xlat/rtnl_link_attrs.in (IFLA_DEVLINK_PORT): New constant introduced by Linux kernel commit v6.2-rc1~99^2~296^2. * src/rtnl_link.c (ifla_brport_nla_decoders): Add IFLA_BRPORT_MAB. (ifinfomsg_nla_decoders): Add IFLA_DEVLINK_PORT. * tests/nlattr_ifla_brport.c (main): Update expected output. * tests/nlattr_ifla_linkinfo.c: Likewise. * NEWS: Mention this.
* tests: move clock_t_str from nlattr_ifla_linkinfo.c into a separate fileEugene Syromyatnikov2022-08-111-24/+0
| | | | | | | | | * tests/nlattr_ifla_linkinfo.c (clock_t_str): Move it... * tests/clock_t_str.c: ...to a new file. * tests/Makefile.am (libtests_a_SOURCES): Add it. (LDADD): Add ${m_LIBS} after libtests.a. (nlattr_ifla_linkinfo_LDADD): Remove. * tests/tests.h (clock_t_str): New declaration.
* Update copyright headersDmitry V. Levin2022-06-181-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* xlat: update BR_* constantsDmitry V. Levin2022-04-291-7/+9
| | | | | | | | | * src/xlat/rtnl_ifla_br_boolopts.in (BR_BOOLOPT_MST_ENABLE): New constant introduced by Linux kernel commit v5.18-rc1~136^2~50^2~14. * src/xlat/rtnl_ifla_br_boolopt_flags.in (1<<BR_BOOLOPT_MST_ENABLE): Likewise. * tests/nlattr_ifla_linkinfo.c (main): Update expected output. * NEWS: Mention this.
* xlat: update IFLA_* constantsDmitry V. Levin2022-04-281-1/+2
| | | | | | | | | | | | | * src/xlat/rtnl_ifla_af_spec_bridge_attrs.in (IFLA_BRIDGE_MST): New constant introduced by Linux kernel commit v5.18-rc1~136^2~50^2~12. * src/xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_LOCKED): New constant introduced by Linux kernel commit v5.18-rc1~136^2~267^2~4. * src/rtnl_link.c (ifla_brport_nla_decoders): Add IFLA_BRPORT_LOCKED. (ifla_af_spec_bridge_nla_decoders): Add IFLA_BRIDGE_MST. * tests/nlattr_ifla_af_spec.c (main): Update expected output. * tests/nlattr_ifla_brport.c: Likewise. * tests/nlattr_ifla_linkinfo.c: Likewise. * NEWS: Mention this.
* rtnl_link: print IFLA_BRPORT_GROUP_FWD_MASK as hexEugene Syromyatnikov2021-11-111-1/+15
| | | | | | | | | | | Similarly to IFLA_BR_GROUP_FWD_MASK. * src/rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_GROUP_FWD_MASK]>: Change decoder to decode_nla_x16. * tests/test_nlattr.h (check_x16_nlattr): New function, defined via DEF_NLATTR_INTEGER_CHECK_. * tests/nlattr_ifla_brport.c: Update expected output. * tests/nlattr_ifla_linkinfo.c: Likewise.
* rtnl_link: implement initial IFLA_INFO_SLAVE_DATA decodingEugene Syromyatnikov2021-11-111-50/+300
| | | | | | | | | | | | | | | | | | | | | * src/nlattr.h (struct ifla_linkinfo_ctx): Add slave_kind field, increase the size of the kind field to 64. * src/rtnl_link.c (decode_nla_linkinfo_slave_kind, decode_nla_linkinfo_slave_data_bridge, decode_nla_linkinfo_slave_data): New functions. (ifla_linkinfo_nla_decoders) <[IFLA_INFO_SLAVE_KIND]>: Use decode_nla_linkinfo_slave_kind as a decoder. (ifla_linkinfo_nla_decoders) <[IFLA_INFO_SLAVE_DATA]>: Decode using decode_nla_linkinfo_slave_data. * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS, TEST_LINKINFO_, TEST_LINKINFO, TEST_NESTED_LINKINFO): Add kindtype_ argument, use it instead of IFLA_INFO_KIND, update callers. (main) <unsupported_slave_data_types, supported_tunnel_types>: New static constants. (main): Use supported_tunnel_types instead of unsupported_xstats_types and unsupported_data_types pair; add checks for the IFLA_INFO_SLAVE_KIND and IFLA_INFO_SLAVE_DATA attributes decoding. * NEWS: Mention it.
* rtnl_link: decode IFLA_BR_MCAST_QUERIER_STATEEugene Syromyatnikov2021-11-111-1/+100
| | | | | | | | | | | | | | | * src/xlat/rtnl_ifla_br_mcast_querier_attrs.in: New file. * src/xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_MCAST_QUERIER_STATE): New constant, introduced by Linux commit v5.15-rc1~157^2~209^2~2. * src/rtnl_link.c: Include "xlat/rtnl_ifla_br_mcast_querier_attrs.h". (ifla_br_mcast_querier_decoders): New decoder table. (decode_ifla_br_mcast_qstate): New function. (ifla_info_data_bridge_nla_decoders) <[IFLA_BR_MCAST_QUERIER_STATE]>: Decode using decode_ifla_br_mcast_qstate. * tests/nlattr_ifla_linkinfo.c: Include "xmalloc.h". (main): Update expected output, add IFLA_BR_MCAST_QUERIER_STATE attribute decoding checks. * NEWS: Mention it.
* rtnl_link: decode IFLA_BR_MULTI_BOOLOPTEugene Syromyatnikov2021-11-111-0/+36
| | | | | | | | | | | | | * src/xlat/rtnl_ifla_br_boolopt_flags.in: New file. * src/xlat/rtnl_ifla_br_boolopts.in: Likewise. * src/rtnl_link.c: Include <linux/if_bridge.h>, "xlat/rtnl_ifla_br_boolopts.h", and "xlat/rtnl_ifla_br_boolopt_flags.h". (decode_ifla_br_boolopt): New function. (ifla_info_data_bridge_nla_decoders) <[IFLA_BR_MULTI_BOOLOPT]>: Decode using decode_ifla_br_boolopt. * tests/nlattr_ifla_linkinfo.c: Include <linux/if_bridge.h>, add checks for IFLA_BR_MULTI_BOOLOPT attribute decoding. * NEWS: Mention it.
* rtnl_link, rtnl_mdb: switch relevant attribute decoding to decode_nla_clock_tEugene Syromyatnikov2021-11-111-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is quite a few attributes that use clock_t time units for reporting time intervals (for whatever reason), so it makes sense to improve decoding for them, considering the fact that clock_t decoding has been already implemented (in v5.14-30-g3270b1358 "util: implement clock_t type decoding"). * configure.ac: Add a check for a library required for mathematical functions. * src/rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_MESSAGE_AGE_TIMER], [IFLA_BRPORT_FORWARD_DELAY_TIMER], [IFLA_BRPORT_HOLD_TIMER]>: Decode using decode_nla_clock_t. (ifla_info_data_bridge_nla_decoders) <[IFLA_BR_FORWARD_DELAY], [IFLA_BR_HELLO_TIME], [IFLA_BR_MAX_AGE], [IFLA_BR_AGEING_TIME], [IFLA_BR_HELLO_TIMER], [IFLA_BR_TCN_TIMER], [IFLA_BR_TOPOLOGY_CHANGE_TIMER], [IFLA_BR_GC_TIMER], [IFLA_BR_MCAST_LAST_MEMBER_INTVL], [IFLA_BR_MCAST_MEMBERSHIP_INTVL], [IFLA_BR_MCAST_QUERIER_INTVL], [IFLA_BR_MCAST_QUERY_INTVL], [IFLA_BR_MCAST_QUERY_RESPONSE_INTVL], [IFLA_BR_MCAST_STARTUP_QUERY_INTVL]>: Likewise. * src/rtnl_mdb.c (mdba_mdb_eattr_nla_decoders) <[MDBA_MDB_EATTR_TIMER]>: Likewise. (mdba_router_pattr_nla_decoders) <[MDBA_ROUTER_PATTR_TIMER], [MDBA_ROUTER_PATTR_INET_TIMER], [MDBA_ROUTER_PATTR_INET6_TIMER]>: Likewise. * tests/Makefile.am (nlattr_ifla_linkinfo_LDADD, nlattr_mdba_router_port_LDADD): Add m_libs. * tests/nlattr_ifla_brport.c: Update expected output. * tests/nlattr_ifla_linkinfo.c: Likewise. * tests/nlattr_mdba_router_port.c: Likewise. * tests/nlattr_nhmsg.c: Likewise. * NEWS: Mention it.
* tests/nlattr_ifla_linkinfo.c: constify unsupported_*_typesEugene Syromyatnikov2021-11-081-6/+6
| | | | | | | | | There is no need them to be non-constant. * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS) <arrstrs, arrstrs_pos, arrstr>: Add const qualifier. (main) <unsupported_tunnel_types, unsupported_xstats_types, unsupported_data_types>: Likewise.
* tests/nlattr_ifla_linkinfo.c: update the list of unsupported tunnel typesEugene Syromyatnikov2021-11-081-1/+3
| | | | | | | | * tests/nlattr_ifla_linkinfo.c (unsupported_tunnel_types): Add "bareudp" (introduced by Linux commit v5.7-rc1~146^2~339^2~1), "wireguard" (introduced by Linux commit v5.6-rc1~151^2~283), "wwan" (introduced by Linux commit v5.14-rc1~119^2~191^2~1), and "xfrm" (introduced by Linux commit v4.19-rc1~140^2~230^2~10).
* Use loop initial declarationsDmitry V. Levin2021-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This make the code easier to read. * src/bpf.c (decode_attr_extra_data): Use "for" loop initial declarations. * src/count.c (call_summary): Likewise. * src/dm.c (dm_decode_dm_target_spec, dm_decode_dm_name_list, dm_decode_dm_target_versions): Likewise. * src/dyxlat.c (dyxlat_free, dyxlat_add_pair): Likewise. * src/filter_qualify.c (parse_poke_token): Likewise. * src/filter_seccomp.c (check_seccomp_order_tracer): Likewise. * src/ipc.c (SYS_FUNC(ipc)): Likewise. * src/kexec.c (print_seg): Likewise. * src/kvm.c (kvm_vcpu_info_free): Likewise. * src/linux/alpha/get_syscall_args.c (arch_get_syscall_args): Likewise. * src/linux/arc/get_syscall_args.c (arch_get_syscall_args): Likewise. * src/linux/bfin/get_syscall_args.c (arch_get_syscall_args): Likewise. * src/linux/ia64/get_syscall_args.c (arch_get_syscall_args): Likewise. * src/linux/metag/get_syscall_args.c (arch_get_syscall_args): Likewise. * src/linux/microblaze/get_syscall_args.c (arch_get_syscall_args): Likewise. * src/mmap_notify.c (mmap_notify_report): Likewise. * src/mmsghdr.c (dumpiov_in_mmsghdr): Likewise. * src/nlattr.c (decode_nlattr): Likewise. * src/number_set.c (clear_number_set_array, invert_number_set_array): Likewise. * src/pathtrace.c (pathmatch, pathtrace_match_set): Likewise. * src/poll.c (decode_poll_exiting): Likewise. * src/signal.c (sprintsigmask_n): Likewise. * src/sockaddr.c (print_sockaddr_data_ll): Likewise. * src/socketutils.c (unix_parse_response, get_proto_by_name, get_sockaddr_by_inode_uncached, genl_parse_families_response): Likewise. * src/strace.c (expand_tcbtab, alloctcb, droptcb, startup_attach, redirect_standard_fds, cleanup): Likewise. * src/syscall.c (decode_socket_subcall, decode_ipc_subcall): Likewise. * src/term.c (decode_termio): Likewise. * src/util.c (dumpiov_upto): Likewise. * src/v4l2.c (print_pixelformat): Likewise. * tests/add_key.c (main): Likewise. * tests/attach-f-p.c (main): Likewise. * tests/btrfs.c (max_flags_plus_one, btrfs_print_qgroup_inherit, btrfs_test_subvol_ioctls, btrfs_print_tree_search_buf, btrfs_test_space_info_ioctl, btrfs_test_ino_path_ioctls, btrfs_test_get_dev_stats_ioctl, btrfs_test_read_ioctls): Likewise. * tests/count-f.c (thread, process, main): Likewise. * tests/fanotify_init.c (main): Likewise. * tests/fanotify_mark.c (main): Likewise. * tests/file_handle.c (main): Likewise. * tests/fill_memory.c (fill_memory_ex, fill_memory16_ex, fill_memory32_ex): Likewise. * tests/filter-unavailable.c (process, main): Likewise. * tests/futex.c (invalid_op, main): Likewise. * tests/get_mempolicy.c (print_nodes): Likewise. * tests/group_req.c (main): Likewise. * tests/hexdump_strdup.c (hexdump_memdup): Likewise. * tests/hexquote_strndup.c (hexquote_strndup): Likewise. * tests/inet-cmsg.c (print_opts, main): Likewise. * tests/init_delete_module.h (print_str): Likewise. * tests/ioctl_block.c (main): Likewise. * tests/ioctl_dm.c (main): Likewise. * tests/ioctl_evdev.c (main): Likewise. * tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise. * tests/ip_mreq.c (main): Likewise. * tests/ipc.c (main): Likewise. * tests/kcmp.c (main): Likewise. * tests/kexec_file_load.c (main): Likewise. * tests/kexec_load.c (main): Likewise. * tests/keyctl.c (do_keyctl, main): Likewise. * tests/ksysent.c (main): Likewise. * tests/list_sigaction_signum.c (main): Likewise. * tests/mincore.c (print_mincore): Likewise. * tests/mmsg_name.c (test_mmsg_name): Likewise. * tests/move_pages.c (print_page_array, print_node_array, print_status_array): Likewise. * tests/mq_sendrecv.c (printstr, dumpstr): Likewise. * tests/msg_control.c (print_fds, test_scm_rights3, test_sol_socket, print_ip_opts, test_ip_opts): Likewise. * tests/netlink_protocol.c (send_query): Likewise. * tests/nlattr.c (test_nlattr): Likewise. * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS): Likewise. * tests/nlattr_rtmsg.c (print_quoted_hex_ellipsis): Likewise. * tests/perf_event_open.c (main): Likewise. * tests/perf_event_open_nonverbose.c (main): Likewise. * tests/pkey_alloc.c (main): Likewise. * tests/pkey_free.c (main): Likewise. * tests/pkey_mprotect.c (main): Likewise. * tests/poll.c (print_pollfd_array_entering, print_pollfd_array_exiting): Likewise. * tests/prctl-arg2-intptr.c (main): Likewise. * tests/prctl-name.c (main): Likewise. * tests/pread64-pwrite64.c (dump_str, print_hex, test_dump, main): Likewise. * tests/preadv.c (print_iov, print_iovec): Likewise. * tests/print_quoted_string.c (print_quoted_memory_ex, print_quoted_hex): Likewise. * tests/process_vm_readv_writev.c (print_iov): Likewise. * tests/pwritev.c (print_iovec, main): Likewise. * tests/qual_fault.c (main): Likewise. * tests/qual_signal.c (main): Likewise. * tests/read-write.c (dump_str_ex, print_hex, test_dump, main): Likewise. * tests/readahead.c (main): Likewise. * tests/redirect-fds.c (main): Likewise. * tests/request_key.c (main): Likewise. * tests/rt_sigsuspend.c (iterate): Likewise. * tests/s390_pci_mmio_read_write.c (main): Likewise. * tests/s390_runtime_instr.c (main): Likewise. * tests/seccomp-filter-v.c (main): Likewise. * tests/seccomp_get_action_avail.c (main): Likewise. * tests/set_mempolicy.c (print_nodes): Likewise. * tests/setfsugid.c (main): Likewise. * tests/setns.c (main): Likewise. * tests/setresugid.c (main): Likewise. * tests/setreugid.c (main): Likewise. * tests/setugid.c (main): Likewise. * tests/socketcall.c (main): Likewise. * tests/sockopt-sol_netlink.c (main): Likewise. * tests/test_nlattr.h (print_sockfd): Likewise. * tests/test_printpath.c (test_printpath_at, test_printpath): Likewise. * tests/test_printstrn.c (test_printstrn_at, test_efault, test_printstrn): Likewise. * tests/unix-pair-send-recv.c (transpose): Likewise. * tests/unix-pair-sendto-recvfrom.c (transpose): Likewise. * tests/unshare.c (main): Likewise. * tests/xchownx.c (main): Likewise.
* tests: use BE_LE macro in more placesEugene Syromyatnikov2021-10-091-41/+11
| | | | | | | | | | | It makes reading the code where only little pieces are switched on WORDS_BIGENDIAN a little bit easier. * tests/io_uring_register.c (BE_LE): Move it... * tests/tests.h (BE_LE): ...here. * tests/bpf.c (bpf_attr_check): Use BE_LE instead of #ifdef WORDS_BIGENDIAN. * tests/clone3.c: Likewise. * tests/nlattr_ifla_linkinfo.c: Likewise.
* netlink, nlattr: print structures followed by payloads as arraysDmitry V. Levin2021-05-031-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When struct nlmsgerr is followed by payload, print this sequence of data as an array rather than a compound structure with a few nameless fields. Likewise, when struct nlattr is followed by payload, print this sequence of data as an array rather than a compound structure with nameless fields. * src/netlink.c (decode_nlmsgerr): Print the sequence of data as an array when len > payload. * src/nlattr.c (decode_nlattr_with_data): Use tprint_array_begin and tprint_array_end instead of tprint_struct_begin and tprint_struct_end when nla_len > NLA_HDRLEN. * NEWS: Mention this change. * tests/nlattr.c (test_nlattr): Update expected output. * tests/nlattr_ifinfomsg.c (print_prop_list_msg): Likewise. * tests/nlattr_ifla.h (print_ifinfomsg): Likewise. * tests/nlattr_ifla_af_spec.c (print_##family_##_msg): Likewise. * tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS, TEST_LINKINFO_, TEST_NESTED_LINKINFO): Likewise. * tests/nlattr_mdba_mdb_entry.c (print_br_port_msg, main): Likewise. * tests/nlattr_mdba_router_port.c (print_br_port_msg, main): Likewise. * tests/nlattr_nlmsgerr.c (print_nlmsgerr, main): Likewise. * tests/nlattr_tc_stats.c (print_tcmsg): Likewise. * tests/nlattr_tca_stab.c (print_tcmsg): Likewise. * tests/test_nlattr.h (print_nlattr, print_sockfd): Likewise.
* Update copyright headersDmitry V. Levin2021-02-161-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* rtnl_link: switch to use bundled <linux/if_link.h>Dmitry V. Levin2021-02-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/types/rtnl_link.h: Remove. * bundled/linux/include/uapi/linux/if_link.h: New file, copied from headers_install'ed Linux kernel v5.11-rc6. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/if_link.h. (AC_CHECK_TYPES): Remove struct ifla_cacheinfo. * src/rtnl_link.c: Include <linux/if_link.h> instead of "types/rtnl_link.h". (decode_rtnl_link_stats): Replace struct_rtnl_link_stats with struct rtnl_link_stats. (decode_rtnl_link_stats64): Replace struct_rtnl_link_stats64 with struct rtnl_link_stats64. (decode_ifla_bridge_id): Use struct ifla_bridge_id. (decode_ifla_port_vsi): Replace struct_ifla_port_vsi with struct ifla_port_vsi. * src/xlat/in6_addr_gen_mode.in: Add #unconditional, remove fallback definitions. * src/xlat/rtnl_ifla_af_spec_inet6_attrs.in: Likewise. * src/xlat/rtnl_ifla_af_spec_inet_attrs.in: Likewise. * src/xlat/rtnl_ifla_brport_attrs.in: Likewise. * src/xlat/rtnl_ifla_events.in: Likewise. * src/xlat/rtnl_ifla_info_attrs.in: Likewise. * src/xlat/rtnl_ifla_info_data_bridge_attrs.in: Likewise. * src/xlat/rtnl_ifla_info_data_tun_attrs.in: Likewise. * src/xlat/rtnl_ifla_port_attrs.in: Likewise. * src/xlat/rtnl_ifla_vf_port_attrs.in: Likewise. * src/xlat/rtnl_ifla_xdp_attached_mode.in: Add #unconditional, remove fallback definitions, #enum and #include. * src/xlat/rtnl_ifla_xdp_attrs.in: Likewise. * src/xlat/rtnl_link_attrs.in: Likewise. * tests/nlattr_ifinfomsg.c: Include <linux/if_link.h> unconditionally, assume all <linux/if_link.h> types are properly defined, remove fallback definitions for constants defined in <linux/if_link.h>. * tests/nlattr_ifla_af_spec.c: Likewise. * tests/nlattr_ifla_brport.c: Likewise. * tests/nlattr_ifla_linkinfo.c: Likewise. * tests/nlattr_ifla_port.c: Likewise. * tests/nlattr_ifla_xdp.c: Likewise.
* tests: fix use of WORDS_BIGENDIANDmitry V. Levin2021-01-131-6/+6
| | | | | | | | | | | | | | | WORDS_BIGENDIAN is a preprocessor macro which is defined to 1 for big-endian systems, and undefined otherwise. * tests/tests.h: Replace "if WORDS_BIGENDIAN" with "ifdef WORDS_BIGENDIAN". * tests/bpf.c: Likewise. * tests/clone3.c: Likewise. * tests/io_uring_register.c: Likewise. * tests/ioctl_v4l2-success.c: Likewise. * tests/ioctl_v4l2.c: Likewise. * tests/nlattr_ifla_linkinfo.c: Likewise. * tests/rt_sigpending.c: Likewise.
* Update copyright headersDmitry V. Levin2020-04-031-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* nlattr: implement generic hardware address nlattr decoderEugene Syromyatnikov2020-03-201-1/+15
| | | | | | | | | | | | | | * nlattr.c (decode_nla_hwaddr): New function. * nlattr.h (DECL_NLA(hwaddr)): New declaration. (NLA_HWADDR_FAMILY_OFFSET): New macro. (decode_nla_hwaddr_family, decode_nla_hwaddr_nofamily): New functions. * rtnl_link.c (ifla_info_data_bridge_nla_decoders) <IFLA_BR_GROUP_ADDR>: Use nlattr_hwaddr_nofamily. * rtnl_neigh.c (decode_neigh_lladdr): Remove. (ndmsg_nla_decoders) <NDA_LLADDR>: Change decoder from decode_neigh_lladdr to decode_nla_hwaddr_nofamily. * tests/nlattr_ifla_linkinfo.c: Update expected output. * tests/nlattr_ndmsg.c: Likewise.
* Update copyright headersDmitry V. Levin2019-03-181-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* xlat: update IFLA_* constantsDmitry V. Levin2019-01-051-1/+1
| | | | | | | * xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_MULTI_BOOLOPT): New constant introduced by Linux kernel commit v5.0-rc1~129^2~207^2~2. * NEWS: Mention this. * tests/nlattr_ifla_linkinfo.c (main): Update.
* Fix preprocessor indentationDmitry V. Levin2018-12-301-2/+2
| | | | | | | | | Indent the C preprocessor directives to reflect their nesting using the following script: $ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do cppi < "$f" > "$f".cppi; mv "$f".cppi "$f" done
* xlat: add IFLA_BR_VLAN_STATS_PER_PORT to rtnl_ifla_info_data_bridge_attrsEugene Syromyatnikov2018-12-261-1/+2
| | | | | | | | | | | | * xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_VLAN_STATS_PER_PORT): New constant, introduced by Linux commit v4.20-rc1~14^2~90. * rtnl_link.c (ifla_info_data_bridge_nla_decoders): Add IFLA_BR_VLAN_STATS_PER_PORT. * NEWS: Mention this. * tests/nlattr_ifla_linkinfo.c (main): Check it. Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* tests: change the license to GPL-2.0-or-laterDmitry V. Levin2018-12-101-21/+1
| | | | | strace test suite is now provided under the terms of the GNU General Public License version 2 or later, see tests/COPYING for more details.
* tests: check decoding of IFLA_LINKINFO netlink attributeEugene Syromyatnikov2018-06-111-0/+711
* tests/nlattr_ifla_linkinfo.c: New file. * tests/pure_executables.list: Add nlattr_ifla_linkinfo. * tests/.gitignore: Likewise. * tests/gen_tests.in (nlattr_ifla_linkinfo): New test. Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>