]> granicus.if.org Git - strace/commit
nlattr: add value processing support for xlat/flags nlattr decoders
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 18 May 2018 15:36:00 +0000 (17:36 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jun 2018 15:10:37 +0000 (15:10 +0000)
commit79a02d029ccd6d998479d1cf58c812a7ea05ab73
treedbbc1e7b0b50c2eec07e0fb417b5407620082cf6
parentbdc6ca9e5665bf8543b45a11afcb2fa48fa5d07b
nlattr: add value processing support for xlat/flags nlattr decoders

Needed for upcoming decoder of ethernet proto which is stored in the
host order and has to be converted to the network order before printing
as an xval constant.  This change also adds ability to provide
prefix/suffix in order to enclose the printed value in something that
describes the performed conversion.

* nlattr.h (struct decode_nla_xlat_opts): Add prefix, suffix, and
process_fn fields.
* nlattr.c (decode_nla_xval, decode_nla_flags): Handle process_fn,
prefix, snd uffix parameters.
nlattr.c
nlattr.h