]> granicus.if.org Git - strace/log
strace
7 years agoupdate_copyright_years.sh: workaround for old git versions
Eugene Syromyatnikov [Fri, 25 Aug 2017 22:28:45 +0000 (00:28 +0200)]
update_copyright_years.sh: workaround for old git versions

Old git versions (like the one shipped in Debian 8) do not support setting
date format with --date, working this around by processing git log output
with date +%Y.

* main/update_copyright_years.sh (process_file) <first_commit_year,
last_commit_year>: Change format to format:%aD, remove --date, supply
output as a -d option argument to date +%Y.

7 years agosyscall: use spaces in tile personality names, de-duplicate definition
Eugene Syromyatnikov [Sat, 26 Aug 2017 23:36:30 +0000 (01:36 +0200)]
syscall: use spaces in tile personality names, de-duplicate definition

As Chris Metcalf, the author of v4.7-40-g0b99a8a, told in private, there
is no strong reason for having tile's personality name different from
personality names on other architectures, so let's use spaces instead of
dashes here. And, while we are here, remove duplication of personality
name definitions for various architectures.

* syscall.c (update_personality) [defined TILE]: Change dashes to spaces
in personality names.

7 years agotests: check decoding of rtmsg netlink attributes
JingPiao Chen [Tue, 22 Aug 2017 15:24:55 +0000 (23:24 +0800)]
tests: check decoding of rtmsg netlink attributes

* tests/nlattr_rtmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
(LWTUNNEL_ENCAP_NONE, RTA_ENCAP_TYPE): New macros.
(main): Check decoding of RTA_DST, RTA_OIF, RTA_METRICS, RTA_MULTIPATH,
RTA_CACHEINFO, RTA_MFC_STATS, RTA_VIA, and RTA_ENCAP_TYPE.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
7 years agortnl_route: decode rtmsg netlink attributes
JingPiao Chen [Tue, 22 Aug 2017 15:24:45 +0000 (23:24 +0800)]
rtnl_route: decode rtmsg netlink attributes

* configure.ac (AC_CHECK_TYPES): Check for
rta_mfc_stats and rtvia structures in <linux/rtnetlink.h>.
* nlattr.c (decode_nla_ifindex): New function.
* nlattr.h (decode_nla_ifindex): New prototype.
* rtnl_route.c (decode_route_addr, decode_rta_metrics,
decode_rta_multipath, decode_rta_cacheinfo,
decode_rta_mfc_stats, decode_rtvia,
decode_rta_encap_type): New functions.
(rta_metrics_nla_decoders, rtmsg_nla_decoders): New arrays.
(decode_rtmsg): Use rtmsg_nla_decoders.
* xlat/lwtunnel_encap_types.in: New file.
* xlat/route_nexthop_flags.in: Likewise.
* xlat/rtnl_rta_metrics_attrs.in: Likewise.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
7 years agos390: wire up s390_guarded_storage syscall
Dmitry V. Levin [Fri, 25 Aug 2017 15:57:14 +0000 (15:57 +0000)]
s390: wire up s390_guarded_storage syscall

* linux/s390/syscallent.h [378]: Add s390_guarded_storage entry.
* linux/s390x/syscallent.h: Likewise.

7 years agomicroblaze: wire up statx syscall
Dmitry V. Levin [Fri, 25 Aug 2017 15:57:14 +0000 (15:57 +0000)]
microblaze: wire up statx syscall

* linux/microblaze/syscallent.h [398]: Add statx entry.

7 years agoalloc_number_set_array: add ATTRIBUTE_MALLOC
Dmitry V. Levin [Thu, 24 Aug 2017 18:13:29 +0000 (18:13 +0000)]
alloc_number_set_array: add ATTRIBUTE_MALLOC

* number_set.h: Include "gcc_compat.h".
(alloc_number_set_array): Add ATTRIBUTE_MALLOC.

7 years agoAdd macros for testing QUAL_* flags
Nikolay Marchuk [Thu, 24 Aug 2017 11:19:40 +0000 (18:19 +0700)]
Add macros for testing QUAL_* flags

* defs.h (traced, raw, inject): Add macros for testing QUAL_TRACE,
QUAL_RAW, and QUAL_INJECT flags.
* syscall.c (syscall_entering_trace, syscall_exiting_trace): Use them.

7 years agoRemove QUAL_SIGNAL, QUAL_READ and QUAL_WRITE
Dmitry V. Levin [Thu, 24 Aug 2017 18:24:16 +0000 (18:24 +0000)]
Remove QUAL_SIGNAL, QUAL_READ and QUAL_WRITE

Remove these flags that are unused since commit v4.15~26.
They might be introduced later with a different meaning.

* defs.h (QUAL_SIGNAL, QUAL_READ, QUAL_WRITE): Remove.

7 years agoxstrdup, xtrndup: allow NULL argument
Eugene Syromiatnikov [Thu, 24 Aug 2017 17:36:08 +0000 (17:36 +0000)]
xstrdup, xtrndup: allow NULL argument

Accept NULL argument in xstrdup and xtrndup functions to allow use
of "xstrdup(str)" instead of "str ? xstrdup(str) : NULL".

* xmalloc.c (xstrdup, xstrndup): Handle NULL argument.
* xmalloc.h: Add comment regarding this deviation from the behaviour
of the POSIX counterparts of these functions.

7 years agotests: really skip mips o32 scno tampering tests on mips n64
Dmitry V. Levin [Wed, 23 Aug 2017 18:38:26 +0000 (18:38 +0000)]
tests: really skip mips o32 scno tampering tests on mips n64

* tests/is_linux_mips_n64.c: New file.
* tests/Makefile.am (check_PROGRAMS): Add it.
* tests/scno_tampering.sh <$STRACE_ARCH == mips>:
In case of mips o32 abi, skip the test if is_linux_mips_n64 says
that the kernel is mips n64, even if "uname -m" claims it's mips.

7 years agoHide struct number_set implementation details from users
Dmitry V. Levin [Tue, 22 Aug 2017 21:23:49 +0000 (21:23 +0000)]
Hide struct number_set implementation details from users

* number_set.h (number_slot_t, struct number_set): Move to number_set.c.
(struct number_set): Add forward declaration.
(read_set, write_set, signal_set): Change prototypes from objects
to pointers.
* filter_qualify.c (read_set, write_set, signal_set): Change definitions
from objects to pointers.
(abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change
definitions from arrays to pointers.
(qualify_read): Initialize read_set before first use.
(qualify_write): Initialize write_set before first use.
(qualify_signals): Initialize signal_set before first use.
(qualify_trace): Initialize trace_set before first use.
(qualify_abbrev): Initialize abbrev_set before first use.
(qualify_verbose): Initialize verbose_set before first use.
(qualify_raw): Initialize raw_set before first use.
(qualify_inject_common): Initialize inject_set before first use.
* strace.c (print_signalled, print_stopped): Update signal_set usage.
* syscall.c (dumpio): Update usage of read_set and write_set.

7 years agoExtend number_set interface
Dmitry V. Levin [Tue, 22 Aug 2017 21:23:49 +0000 (21:23 +0000)]
Extend number_set interface

* number_set.h (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New function prototypes.
* number_set.c (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New functions.
* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
qualify_syscall_class, qualify_syscall_name): Use
add_number_to_set_array.
(qualify_syscall_tokens, qualify_tokens): Use
clear_number_set_array and invert_number_set_array.
* filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, and free_number_set_array.
(qual_flags): Use is_number_in_set_array.

7 years agoMove number_set interface to separate files
Dmitry V. Levin [Tue, 22 Aug 2017 21:23:49 +0000 (21:23 +0000)]
Move number_set interface to separate files

* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.

7 years agoMove SUPPORTED_PERSONALITIES to a separate file
Edgar Kaziakhmedov [Tue, 22 Aug 2017 12:35:03 +0000 (15:35 +0300)]
Move SUPPORTED_PERSONALITIES to a separate file

Since the defs.h contains unrelated declarations which are
redundant (and sometimes conflicting) for other binaries included
in the strace package, move SUPPORTED_PERSONALITIES defintions
to a separate file.

* defs.h: Include "supported_personalities.h".
(SUPPORTED_PERSONALITIES): Move ...
* supported_personalities.h: ... to the new file.
* Makefile.am (strace_SOURCES): Add it.

Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
7 years agoMove string_to_uint* functions to a separate file
Edgar Kaziakhmedov [Tue, 22 Aug 2017 12:35:02 +0000 (15:35 +0300)]
Move string_to_uint* functions to a separate file

Make string_to_uint* functions available to other binaries
included in the strace package.

* string_to_uint.h: New file.
* defs.h: Include it.
(string_to_uint_ex, string_to_uint_upto, string_to_uint): Move
to string_to_uint.h.
* util.c (string_to_uint_ex, string_to_uint): Move ...
* string_to_uint.c: ... to the new file.
* Makefile.am (strace_SOURCES): Add string_to_uint.h and string_to_uint.c.

Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
7 years agotests: check decoding of ifaddrmsg netlink attributes
JingPiao Chen [Tue, 22 Aug 2017 06:45:49 +0000 (14:45 +0800)]
tests: check decoding of ifaddrmsg netlink attributes

* tests/nlattr_ifaddrmsg.c: Include <arpa/inet.h>.
(IFA_FLAGS, SET_IFA_FAMILY): New macros.
(init_ifaddrmsg): Set ifaddrmsg.ifa_family field from ifa_family.
(print_ifaddrmsg): Print ifaddrmsg.ifa_family field using ifa_family_str.
(main): Check decoding of IFA_ADDRESS, IFA_CACHEINFO, and IFA_FLAGS.

7 years agortnl_addr: decode ifaddrmsg netlink attributes
JingPiao Chen [Tue, 22 Aug 2017 06:45:48 +0000 (14:45 +0800)]
rtnl_addr: decode ifaddrmsg netlink attributes

* rtnl_addr.c (decode_ifa_address,
decode_ifa_cacheinfo, decode_ifa_flags): New functions.
(ifaddrmsg_nla_decoders): New array.
(decode_ifaddrmsg): Use it.

7 years agoExport decode_inet_addr
Dmitry V. Levin [Tue, 22 Aug 2017 11:35:20 +0000 (11:35 +0000)]
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.

7 years agonetlink_inet_diag: prepare decode_inet_addr for export
Dmitry V. Levin [Mon, 21 Aug 2017 11:30:47 +0000 (11:30 +0000)]
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.

7 years agoprint_inet_addr: add support of invocations without field name
Dmitry V. Levin [Sun, 20 Aug 2017 11:10:03 +0000 (11:10 +0000)]
print_inet_addr: add support of invocations without field name

Prepare print_inet_addr for use in structureless contexts where
no structure field name is available.

* sockaddr.c (print_inet_addr): Handle var_name == NULL.

7 years agoprint_inet_addr: print address of unsupported family in hex
Dmitry V. Levin [Sat, 19 Aug 2017 11:04:00 +0000 (11:04 +0000)]
print_inet_addr: print address of unsupported family in hex

* sockaddr.c (print_inet_addr): Specify QUOTE_FORCE_HEX
to print_quoted_string.

7 years agomips o32: do not bail out in get_syscall_args if umoven fails
Dmitry V. Levin [Fri, 18 Aug 2017 14:30:08 +0000 (14:30 +0000)]
mips o32: do not bail out in get_syscall_args if umoven fails

If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
both PTRACE_PEEKDATA and process_vm_readv become unavailable when the
process dumpable flag is cleared.  As the first 4 syscall arguments are
still available via registers, do not treat this as get_syscall_args
error.

This condition is triggered and therefore tested by prctl-dumpable test.

* linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSO32]:
Do not bail out if umoven fails.

7 years agoconfigure: cleanup struct statfs/statfs64 member checks
Dmitry V. Levin [Thu, 17 Aug 2017 12:43:18 +0000 (12:43 +0000)]
configure: cleanup struct statfs/statfs64 member checks

* configure.ac <AC_CHECK_TYPES([struct statfs])>: Merge several
AC_CHECK_MEMBERS checks of struct statfs members into a single check.
<AC_CHECK_TYPES([struct statfs64])>: Likewise, for checks
of struct statfs64 members.

7 years agotests: fix a few harmless -Woverflow compilation warnings
Dmitry V. Levin [Wed, 16 Aug 2017 17:50:25 +0000 (17:50 +0000)]
tests: fix a few harmless -Woverflow compilation warnings

Fix the following compilation warnings on platforms where
sizeof(struct timeval.tv_usec) < sizeof(long):

xettimeofday.c: In function ‘main’:
xettimeofday.c:76:16: warning: overflow in implicit constant conversion [-Woverflow]
  tv->tv_usec = (long) 0xbadc0dedfacefeedLL;
xetitimer.c: In function ‘main’:
xetitimer.c:170:28: warning: overflow in implicit constant conversion [-Woverflow]
  p_new->it_value.tv_usec = (long) 0xbadc0dedfacefeedLL;
In file included from utimes.c:38:0:
xutimes.c: In function ‘main’:
xutimes.c:110:18: warning: overflow in implicit constant conversion [-Woverflow]
  tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL;
futimesat.c: In function ‘main’:
futimesat.c:121:18: warning: overflow in implicit constant conversion [-Woverflow]
  tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL;
In file included from _newselect.c:35:0:
xselect.c: In function ‘main’:
xselect.c:94:16: warning: overflow in implicit constant conversion [-Woverflow]
  tv->tv_usec = (long) 0xbadc0dedfacefeedLL;
                ^
* tests/futimesat.c (main): In initialization of struct timeval.tv_usec,
change explicit cast from (long) to (suseconds_t).
* tests/xetitimer.c: Likewise.
* tests/xettimeofday.c: Likewise.
* tests/xselect.c: Likewise.
* tests/xutimes.c: Likewise.

Reported-by: Anatoly Pugachev <matorola@gmail.com>
7 years agotests: fix sigaction.test on sparc
Dmitry V. Levin [Wed, 16 Aug 2017 16:25:03 +0000 (16:25 +0000)]
tests: fix sigaction.test on sparc

On sparc, the first argument of old sigaction syscall has negated
semantics, compared to other architectures.  While sigaction.test
was aware about this arch-specific detail from the beginning, in one
of many sigaction syscall invocations a non-negative signal number
was erroneously passed on sparc.

* tests/sigaction.c (ADDR_INT, SIGNO_INT): New arch-specific macros.
(signo, addr): Use them.

7 years agonlattr: fix printing of unrecognized attribute data
Dmitry V. Levin [Wed, 16 Aug 2017 02:24:29 +0000 (02:24 +0000)]
nlattr: fix printing of unrecognized attribute data

Do not print more than "nlattr.nla_len - NLA_HDRLEN" bytes
of unrecognized attribute data.

* nlattr.c (decode_nlattr_with_data): Specify "nla_len - NLA_HDRLEN"
instead of "len - NLA_HDRLEN" as the size of unrecognized attribute
data.
* tests/nlattr.c (test_nlattr): Check it.

7 years agotests: check decoding of NETLINK_ROUTE rtgenmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 05:00:46 +0000 (13:00 +0800)]
tests: check decoding of NETLINK_ROUTE rtgenmsg attributes

* tests/nlattr_rtgenmsg.c: New file.
* tests/gen_tests.in (nlattr_rtgenmsg): New entry.
* tests/pure_executables.list: Add nlattr_rtgenmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE rtgenmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:22 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE rtgenmsg attributes

* rtnl_nsid.c: Include "nlattr.h" and "xlat/rtnl_nsid_attrs.h".
(decode_rtgenmsg): Call decode_nlattr.
* xlat/rtnl_nsid_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE br_port_msg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:55:04 +0000 (12:55 +0800)]
tests: check decoding of NETLINK_ROUTE br_port_msg attributes

* tests/nlattr_br_port_msg.c: New file.
* tests/gen_tests.in (nlattr_br_port_msg): New entry.
* tests/pure_executables.list: Add nlattr_br_port_msg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE br_port_msg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:21 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE br_port_msg attributes

* rtnl_mdb.c: Include "netlink.h", "nlattr.h".
and "xlat/rtnl_mdb_attrs.h".
(decode_br_port_msg): Call decode_nlattr.
* xlat/rtnl_mdb_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE netconfmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:55:03 +0000 (12:55 +0800)]
tests: check decoding of NETLINK_ROUTE netconfmsg attributes

* tests/nlattr_netconfmsg.c: New file.
* tests/gen_tests.in (nlattr_netconfmsg): New entry.
* tests/pure_executables.list: Add nlattr_netconfmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:20 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes

* rtnl_netconf.c: Include "netlink.h", "nlattr.h",
and "xlat/rtnl_netconf_attrs.h".
(decode_netconfmsg): Call decode_nlattr.
* xlat/rtnl_netconf_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE dcbmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:55:02 +0000 (12:55 +0800)]
tests: check decoding of NETLINK_ROUTE dcbmsg attributes

* tests/nlattr_dcbmsg.c: New file.
* tests/gen_tests.in (nlattr_dcbmsg): New entry.
* tests/pure_executables.list: Add nlattr_dcbmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE dcbmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:19 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE dcbmsg attributes

* rtnl_dcb.c: Include "netlink.h", "nlattr.h",
and "xlat/rtnl_dcb_attrs.h".
(decode_dcbmsg): Call decode_nlattr.
* xlat/rtnl_dcb_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE ifaddrlblmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:55:01 +0000 (12:55 +0800)]
tests: check decoding of NETLINK_ROUTE ifaddrlblmsg attributes

* tests/nlattr_ifaddrlblmsg.c: New file.
* tests/gen_tests.in (nlattr_ifaddrlblmsg): New entry.
* tests/pure_executables.list: Add nlattr_ifaddrlblmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE ifaddrlblmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:18 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE ifaddrlblmsg attributes

* rtnl_addrlabel.c: Include "netlink.h", "nlattr.h",
and "xlat/rtnl_addrlabel_attrs.h".
(decode_ifaddrlblmsg): Call decode_nlattr.
* xlat/rtnl_addrlabel_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE tcamsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:55:00 +0000 (12:55 +0800)]
tests: check decoding of NETLINK_ROUTE tcamsg attributes

* tests/nlattr_tcamsg.c: New file.
* tests/gen_tests.in (nlattr_tcamsg): New entry.
* tests/pure_executables.list: Add nlattr_tcamsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE tcamsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:17 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE tcamsg attributes

* rtnl_tc_action.c: Include "nlattr.h" and "xlat/rtnl_tc_action_attrs.h".
(decode_tcamsg): Call decode_nlattr.
* xlat/rtnl_tc_action_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE tcmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:53:14 +0000 (12:53 +0800)]
tests: check decoding of NETLINK_ROUTE tcmsg attributes

* tests/nlattr_tcmsg.c: New file.
* tests/gen_tests.in (nlattr_tcmsg): New entry.
* tests/pure_executables.list: Add nlattr_tcmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE tcmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:16 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE tcmsg attributes

* rtnl_tc.c: Include "nlattr.h" and "xlat/rtnl_tc_attrs.h".
(decode_tcmsg): Call decode_nlattr.
* xlat/rtnl_tc_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE ndtmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:51:28 +0000 (12:51 +0800)]
tests: check decoding of NETLINK_ROUTE ndtmsg attributes

* tests/nlattr_ndtmsg.c: New file.
* tests/gen_tests.in (nlattr_ndtmsg): New entry.
* tests/pure_executables.list: Add nlattr_ndtmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE ndtmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:15 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE ndtmsg attributes

* rtnl_neightbl.c: Include "nlattr.h" and "xlat/rtnl_neightbl_attrs.h".
(decode_ndtmsg): Call decode_nlattr.
* xlat/rtnl_neightbl_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE ndmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:51:27 +0000 (12:51 +0800)]
tests: check decoding of NETLINK_ROUTE ndmsg attributes

* tests/nlattr_ndmsg.c: New file.
* tests/gen_tests.in (nlattr_ndmsg): New entry.
* tests/pure_executables.list: Add nlattr_ndmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE ndmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:14 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE ndmsg attributes

* rtnl_neigh.c: Include "nlattr.h" and "xlat/rtnl_neigh_attrs.h".
(decode_ndmsg): Call decode_nlattr.
* xlat/rtnl_neigh_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE fib_rule_hdr attributes
JingPiao Chen [Tue, 15 Aug 2017 04:51:26 +0000 (12:51 +0800)]
tests: check decoding of NETLINK_ROUTE fib_rule_hdr attributes

* tests/nlattr_fib_rule_hdr.c: New file.
* tests/gen_tests.in (nlattr_fib_rule_hdr): New entry.
* tests/pure_executables.list: Add nlattr_fib_rule_hdr.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE fib_rule_hdr attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:13 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE fib_rule_hdr attributes

* rtnl_rule.c: Include "nlattr.h" and "xlat/rtnl_rule_attrs.h".
(decode_fib_rule_hdr): Call decode_nlattr.
* xlat/rtnl_rule_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE rtmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:25 +0000 (12:41 +0800)]
tests: check decoding of NETLINK_ROUTE rtmsg attributes

* tests/nlattr_rtmsg.c: New file.
* tests/gen_tests.in (nlattr_rtmsg): New entry.
* tests/pure_executables.list: Add nlattr_rtmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE rtmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:12 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE rtmsg attributes

* rtnl_route.c: Include "nlattr.h" and "xlat/rtnl_route_attrs.h".
(decode_rtmsg): Call decode_nlattr.
* xlat/rtnl_route_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE ifaddrmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:24 +0000 (12:41 +0800)]
tests: check decoding of NETLINK_ROUTE ifaddrmsg attributes

* tests/nlattr_ifaddrmsg.c: New file.
* tests/gen_tests.in (nlattr_ifaddrmsg): New entry.
* tests/pure_executables.list: Add nlattr_ifaddrmsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE ifaddrmsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:11 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE ifaddrmsg attributes

* rtnl_addr.c: Include "nlattr.h" and "xlat/rtnl_addr_attrs.h".
(decode_ifaddrmsg): Call decode_nlattr.
* xlat/rtnl_addr_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of NETLINK_ROUTE ifinfomsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:23 +0000 (12:41 +0800)]
tests: check decoding of NETLINK_ROUTE ifinfomsg attributes

* tests/nlattr_ifinfomsg.c: New file.
* tests/gen_tests.in (nlattr_ifinfomsg): New entry.
* tests/pure_executables.list: Add nlattr_ifinfomsg.
* tests/.gitignore: Likewise.

7 years agonetlink: add basic decoding of NETLINK_ROUTE ifinfomsg attributes
JingPiao Chen [Tue, 15 Aug 2017 04:41:10 +0000 (12:41 +0800)]
netlink: add basic decoding of NETLINK_ROUTE ifinfomsg attributes

* rtnl_link.c: Include "nlattr.h" and "xlat/rtnl_link_attrs.h".
(decode_ifinfomsg): Call decode_nlattr.
* xlat/rtnl_link_attrs.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests/test_nlattr.h: include <stdint.h>
Dmitry V. Levin [Tue, 15 Aug 2017 22:34:46 +0000 (22:34 +0000)]
tests/test_nlattr.h: include <stdint.h>

* tests/test_nlattr.h: Include <stdint.h> for definition of uint16_t
used by init_nlattr.

7 years agotests: use ifindex_lo and IFINDEX_LO_STR
Dmitry V. Levin [Tue, 15 Aug 2017 20:08:39 +0000 (20:08 +0000)]
tests: use ifindex_lo and IFINDEX_LO_STR

* tests/netlink_route.c: Do not check for HAVE_IF_INDEXTONAME.
(if_nametoindex, IFINDEX_LO): Remove.
(test_rtnl_link, test_rtnl_addr, test_rtnl_neigh, test_rtnl_tc,
test_rtnl_addrlabel, test_rtnl_mdb): Use ifindex_lo instead
of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.
* tests/netlink_sock_diag.c: Do not check for HAVE_IF_INDEXTONAME.
(if_nametoindex, IFINDEX_LO): Remove.
(test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2,
test_inet_diag_msg, test_smc_diag_req): Use ifindex_lo instead
of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.
* tests/nlattr_inet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME.
(if_nametoindex, IFINDEX_LO): Remove.
(init_inet_diag_msg): Use ifindex_lo instead of if_nametoindex.
(print_inet_diag_msg): Use IFINDEX_LO_STR instead of hardcoded string.
* tests/nlattr_inet_diag_req_compat.c: Do not check
for HAVE_IF_INDEXTONAME.
(if_nametoindex, IFINDEX_LO): Remove.
(init_inet_diag_req): Use ifindex_lo instead of if_nametoindex.
(print_inet_diag_req): Use IFINDEX_LO_STR instead of hardcoded string.
* tests/nlattr_inet_diag_req_v2.c: Do not check for HAVE_IF_INDEXTONAME.
(if_nametoindex, IFINDEX_LO): Remove.
(init_inet_diag_req_v2, print_inet_diag_req_v2,
test_inet_diag_bc_dev_cond): Use ifindex_lo instead of if_nametoindex,
use IFINDEX_LO_STR instead of hardcoded string.
* tests/nlattr_packet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME.
(if_nametoindex, IFINDEX_LO): Remove.
(main): Use ifindex_lo instead of if_nametoindex.
(print_packet_diag_mclist): Use IFINDEX_LO_STR instead of hardcoded
string.

7 years agotests/net-sockaddr: use ifindex_lo and IFINDEX_LO_STR
Dmitry V. Levin [Mon, 14 Aug 2017 18:53:17 +0000 (18:53 +0000)]
tests/net-sockaddr: use ifindex_lo and IFINDEX_LO_STR

* tests/net-sockaddr.c (if_nametoindex): Remove declaration.
(check_in6_linklocal, check_ll): Remove HAVE_IF_INDEXTONAME checks,
Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR instead
of hardcoded string.

7 years agotests/msg_control: use ifindex_lo and IFINDEX_LO_STR
Dmitry V. Levin [Sun, 13 Aug 2017 20:28:28 +0000 (20:28 +0000)]
tests/msg_control: use ifindex_lo and IFINDEX_LO_STR

* tests/msg_control.c (test_ip_pktinfo): Use ifindex_lo instead
of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string.

7 years agotests/inet-cmsg: use IFINDEX_LO_STR
Dmitry V. Levin [Sat, 12 Aug 2017 19:27:07 +0000 (19:27 +0000)]
tests/inet-cmsg: use IFINDEX_LO_STR

* tests/inet-cmsg.c (print_pktinfo): Use IFINDEX_LO_STR instead
of hardcoded string.

7 years agotests/ip_mreq: use ifindex_lo and IFINDEX_LO_STR
Dmitry V. Levin [Fri, 11 Aug 2017 18:26:02 +0000 (18:26 +0000)]
tests/ip_mreq: use ifindex_lo and IFINDEX_LO_STR

* tests/ip_mreq.c: Do not check for HAVE_IF_INDEXTONAME.
(main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR
instead of hardcoded string.

7 years agotests/group_req: use ifindex_lo and IFINDEX_LO_STR
Dmitry V. Levin [Thu, 10 Aug 2017 18:47:28 +0000 (18:47 +0000)]
tests/group_req: use ifindex_lo and IFINDEX_LO_STR

* tests/group_req.c: Do not check for HAVE_IF_INDEXTONAME.
(main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR
instead of hardcoded string.

7 years agotests: add ifindex_lo function and IFINDEX_LO_STR macro to libtests
Dmitry V. Levin [Tue, 8 Aug 2017 20:40:57 +0000 (20:40 +0000)]
tests: add ifindex_lo function and IFINDEX_LO_STR macro to libtests

* tests/ifindex.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/tests.h (ifindex_lo): New prototype.
(IFINDEX_LO_STR): New macro.

7 years agoconfigure.ac: remove redundant linux/dcbnl.h header check
JingPiao Chen [Tue, 15 Aug 2017 04:41:09 +0000 (12:41 +0800)]
configure.ac: remove redundant linux/dcbnl.h header check

* configure.ac (AC_CHECK_HEADERS): Remove linux/dcbnl.h.
* rtnl_dcb.c: Replace HAVE_LINUX_DCBNL_H with HAVE_STRUCT_DCBMSG.
* tests/netlink_route.c: Likewise.

7 years agopathtrace: fix typo in comment
Eugene Syromyatnikov [Fri, 21 Jul 2017 18:14:58 +0000 (20:14 +0200)]
pathtrace: fix typo in comment

7 years agopathtrace: limit amount of checked poll fds similarly to select limit
Eugene Syromyatnikov [Fri, 21 Jul 2017 18:15:24 +0000 (20:15 +0200)]
pathtrace: limit amount of checked poll fds similarly to select limit

* pathtrace.c (pathtrace_match_set): Limit the maximum descriptor number
checked for fd match in poll family syscalls to 1024 * 1024.

7 years agopathtrace: fail poll path match on first failed umove
Eugene Syromyatnikov [Thu, 20 Jul 2017 19:14:42 +0000 (21:14 +0200)]
pathtrace: fail poll path match on first failed umove

* pathtrace.c (pathtrace_match_set): When checking descriptors of poll
family syscalls for fd match, break the loop on first failed umove call.

7 years agoUpdate NEWS
JingPiao Chen [Sun, 13 Aug 2017 02:30:36 +0000 (10:30 +0800)]
Update NEWS

7 years agotests: check decoding of rtnetlink nsid messages
JingPiao Chen [Sun, 13 Aug 2017 02:29:03 +0000 (10:29 +0800)]
tests: check decoding of rtnetlink nsid messages

* tests/netlink_route.c (test_rtnl_nsid): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of nsid messages
JingPiao Chen [Sun, 13 Aug 2017 02:29:02 +0000 (10:29 +0800)]
netlink: add a basic rtnetlink parser of nsid messages

* rtnl_nsid.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_rtgenmsg): New prototype.
* netlink_route.c (route_decoders): Add RTM_DELNSID, RTM_GETNSID,
and RTM_NEWNSID.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink mdb messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:31 +0000 (10:27 +0800)]
tests: check decoding of rtnetlink mdb messages

* tests/netlink_route.c: Include <netinet/in.h>
and <linux/if_bridge.h>.
(test_rtnl_mdb): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of mdb messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:30 +0000 (10:27 +0800)]
netlink: add a basic rtnetlink parser of mdb messages

* rtnl_mdb.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_br_port_msg): New prototype.
* configure.ac (AC_CHECK_TYPES): Check for struct br_port_msg
in <linux/if_bridge.h>.
* netlink_route.c (route_decoders): Add RTM_DELMDB, RTM_GETMDB,
and RTM_NEWMDB.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink netconf messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:29 +0000 (10:27 +0800)]
tests: check decoding of rtnetlink netconf messages

* tests/netlink_route.c: Include <linux/netconf.h>.
(test_rtnl_netconf): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of netconf messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:28 +0000 (10:27 +0800)]
netlink: add a basic rtnetlink parser of netconf messages

* rtnl_netconf.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_netconfmsg): New prototype.
* configure.ac (AC_CHECK_TYPES): Check for struct netconfmsg
in <linux/netconf.h>.
* netlink_route.c (route_decoders): Add RTM_GETNETCONF
and RTM_NEWNETCONF.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink dcb messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:27 +0000 (10:27 +0800)]
tests: check decoding of rtnetlink dcb messages

* tests/netlink_route.c: Include <linux/dcbnl.h>.
(test_rtnl_dcb): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of dcb messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:26 +0000 (10:27 +0800)]
netlink: add a basic rtnetlink parser of dcb messages

* rtnl_dcb.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_dcbmsg): New prototype.
* configure.ac (AC_CHECK_HEADERS): Add linux/dcbnl.h.
(AC_CHECK_TYPES): Check for struct dcbmsg in <linux/dcbnl.h>.
* netlink_route.c (route_decoders): Add RTM_GETDCB and RTM_SETDCB.
* xlat/dcb_commands.in: New file.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink addrlabel messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:25 +0000 (10:27 +0800)]
tests: check decoding of rtnetlink addrlabel messages

* tests/netlink_route.c: Include <linux/if_addrlabel.h>.
(test_rtnl_addrlabel): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of addrlabel messages
JingPiao Chen [Sun, 13 Aug 2017 02:27:24 +0000 (10:27 +0800)]
netlink: add a basic rtnetlink parser of addrlabel messages

* rtnl_addrlabel.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_ifaddrlblmsg): New prototype.
* configure.ac (AC_CHECK_TYPES): Check for struct ifaddrlblmsg
in <linux/if_addrlabel.h>.
* netlink_route.c (route_decoders): Add RTM_DELADDRLABEL,
RTM_GETADDRLABEL, and RTM_NEWADDRLABEL.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink tc action messages
JingPiao Chen [Sun, 13 Aug 2017 02:26:38 +0000 (10:26 +0800)]
tests: check decoding of rtnetlink tc action messages

* tests/netlink_route.c (test_rtnl_tca): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of tc action messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:31 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of tc action messages

* rtnl_tc_action.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_tcamsg): New prototype.
* netlink_route.c (route_decoders): Add RTM_DELACTION, RTM_GETACTION,
and RTM_NEWACTION.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink tc messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:30 +0000 (10:22 +0800)]
tests: check decoding of rtnetlink tc messages

* tests/netlink_route.c (test_rtnl_tc): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of tc messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:29 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of tc messages

* rtnl_tc.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_tcmsg): New prototype.
* netlink_route.c (route_decoders): Add RTM_DELQDISC,
RTM_GETQDISC, RTM_NEWQDISC, RTM_DELTCLASS, RTM_GETTCLASS,
RTM_NEWTCLASS, RTM_DELTFILTER, RTM_GETTFILTER, and RTM_NEWTFILTER.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink neightbl messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:28 +0000 (10:22 +0800)]
tests: check decoding of rtnetlink neightbl messages

* tests/netlink_route.c (test_rtnl_neightbl): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of neightbl messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:27 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of neightbl messages

* rtnl_neightbl.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_ndtmsg): New prototype.
* netlink_route.c (route_decoders): Add RTM_GETNEIGHTBL,
RTM_NEWNEIGHTBL, and RTM_SETNEIGHTBL.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink neigh messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:26 +0000 (10:22 +0800)]
tests: check decoding of rtnetlink neigh messages

* tests/netlink_route.c: Include <linux/neighbour.h>.
(test_rtnl_neigh): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of neigh messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:25 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of neigh messages

* rtnl_neigh.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes.
* configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h.
* netlink_route.c (route_decoders): Add RTM_DELNEIGH, RTM_DELNEIGH,
and RTM_NEWNEIGH.
* xlat/nda_types.in: New file.
* xlat/neighbor_cache_entry_flags.in: Likewise.
* xlat/neighbor_cache_entry_states.in: Likewise.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink rule messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:24 +0000 (10:22 +0800)]
tests: check decoding of rtnetlink rule messages

* tests/netlink_route.c: Include <linux/fib_rules.h>.
(test_rtnl_rule): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of rule messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:23 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of rule messages

* defs.h (routing_table_ids): New xlat prototype.
* rtnl_rule.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (ip_type_of_services, routing_table_ids): New xlat prototypes.
* netlink_route.h (decode_fib_rule_hdr): New prototype.
* configure.ac (AC_CHECK_HEADERS): Add linux/fib_rules.h.
* netlink_route.c (route_decoders): Add RTM_DELRULE, RTM_GETRULE,
and RTM_NEWRULE.
* xlat/fib_rule_actions.in: New file.
* xlat/fib_rule_flags.in: Likewise.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink route messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:22 +0000 (10:22 +0800)]
tests: check decoding of rtnetlink route messages

* tests/netlink_route.c: Include <linux/ip.h>.
(test_rtnl_route): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of route messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:21 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of route messages

* defs.h (routing_scopes): New xlat prototype.
* rtnl_route.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* netlink_route.h (decode_rtmsg): New prototype.
* netlink_route.c (route_decoders): Add RTM_DELROUTE, RTM_GETROUTE,
and RTM_NEWROUTE.
* xlat/ip_type_of_services.in: New file.
* xlat/routing_flags.in: Likewise.
* xlat/routing_protocols.in: Likewise.
* xlat/routing_table_ids.in: Likewise.
* xlat/routing_types.in: Likewise.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agotests: check decoding of rtnetlink addr messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:20 +0000 (10:22 +0800)]
tests: check decoding of rtnetlink addr messages

* tests/netlink_route.c: Include <linux/if_addr.h>.
(test_rtnl_addr): New function.
(main): Use it.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agonetlink: add a basic rtnetlink parser of addr messages
JingPiao Chen [Sun, 13 Aug 2017 02:22:19 +0000 (10:22 +0800)]
netlink: add a basic rtnetlink parser of addr messages

* rtnl_addr.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h.
* netlink_route.h (decode_ifaddrmsg): New prototype.
* netlink_route.c (route_decoders): Add RTM_DELADDR,
RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST, and RTM_NEWADDR.
* xlat/ifaddrflags.in: New file.
* xlat/routing_scopes.in: Likewise.

Co-authored-by: Fabien Siron <fabien.siron@epita.fr>
7 years agoMake description of discrepancies between libc and kernel APIs more relevant
Eugene Syromyatnikov [Sun, 13 Aug 2017 17:33:58 +0000 (19:33 +0200)]
Make description of discrepancies between libc and kernel APIs more relevant

Looks like this part was untouched since the days strace supported OSes
other than Linux. Well, it's time to make it more contemporary.

* strace.1.in (.SH NOTES): Use faccessat(2) and setrlimit(2)/prlimit(2)
instead of time(2) and stat(2)/xstat(2) as examples of libc/kernel API
discrepancies.

7 years agotests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE
JingPiao Chen [Thu, 10 Aug 2017 01:03:23 +0000 (09:03 +0800)]
tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE

* tests/netlink_route.c (test_nlmsg_done): New function.
(main): Use it.

7 years agoAdd TF flag to inotify_add_watch syscall entries
Nikolay Marchuk [Fri, 11 Aug 2017 05:43:58 +0000 (12:43 +0700)]
Add TF flag to inotify_add_watch syscall entries

The second argument of the inotify_add_watch syscall is a file name,
but inotify_add_watch has no TF flag set.

* linux/32/syscallent.h (inotify_add_watch): Add TF flag.
* linux/64/syscallent.h: Likewise.
* linux/alpha/syscallent.h: Likewise.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/crisv10/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.

7 years agopathtrace: fix matching of execveat syscall
Nikolay Marchuk [Fri, 11 Aug 2017 05:43:57 +0000 (12:43 +0700)]
pathtrace: fix matching of execveat syscall

* pathtrace.c (pathtrace_match_set): Add testing of SEN_execveat.

7 years agostrace.1: add indentation to examples
Eugene Syromyatnikov [Thu, 10 Aug 2017 19:32:15 +0000 (21:32 +0200)]
strace.1: add indentation to examples

* strace.1 (.de CW): Add .in +4n.
(.de CE): Add .in.

7 years agoGenerate date for the man page
Eugene Syromyatnikov [Thu, 10 Aug 2017 18:40:29 +0000 (20:40 +0200)]
Generate date for the man page

* Makefile.am (dist-hook): Add .strace.1.in.date generation.
* strace.spec.in (%setup): Likewise.
* configure.ac (manpage_date): New m4 define.
(MANPAGE_DATE): New define/subst.
* strace.1 (.TH): Add manpage date and strace's version.

7 years agoAdd script for generating date of the last commit for specific file
Eugene Syromyatnikov [Thu, 10 Aug 2017 18:39:29 +0000 (20:39 +0200)]
Add script for generating date of the last commit for specific file

* file-date-gen: New auxiliary script.

7 years agoMake strace.1 generated
Eugene Syromyatnikov [Thu, 10 Aug 2017 18:38:10 +0000 (20:38 +0200)]
Make strace.1 generated

* .gitignore (/strace.1): New entry.
* configure.ac (AC_CONFIG_FILES): Add strace.1.
* strace.1.in: Rename from strace.1.

7 years agostrace.1: format synopsis using .SY/.OP macros
Eugene Syromyatnikov [Thu, 10 Aug 2017 17:58:15 +0000 (19:58 +0200)]
strace.1: format synopsis using .SY/.OP macros

Also, add .OM and .OR macros and use { ... | ... } syntax for indicating
possible options regarding mandatory arguments.

* strace.1 (.OM, .OR): New macro definitions, based on .OP
(.SH SYNOPSYS): Format using .SY/.OP/.OM/.OR. Put -p/command inside
{ ... | ... } block.

7 years agostrace.1: remove date from .TH, as it is no longer relevant
Eugene Syromyatnikov [Thu, 10 Aug 2017 17:58:01 +0000 (19:58 +0200)]
strace.1: remove date from .TH, as it is no longer relevant

* strace.1 (.TH): Remove date.