On 02.04.2020 02:14, Christos Zoulas wrote:
> In article <[email protected]>,
> Kamil Rytarowski <[email protected]> wrote:
>> I propose to add two new tools:
>>
>> - ioctlname
>> - ioctldecode
>
> I would call it ioctlprint and have:
>
> ioctlprint [-f <format>] <name>|<expr>|<value> arg....
>
> for the input arg can be:
> name = TIOCFOO
> expr = _IO?('x', y, z)
> value = 0xfoobee
>
> The format can be contain %e %n %v which expand to what you
> think and defaults to:
>
> "%n %e %v\n"
>
> christos
>
I've implemented:
ioctlprint [-f format] [-e emul] arg...
$ ./ioctlprint 2148554498 2148554498
WSKBDIO_COMPLEXBELL _IOW('W',0x2,0x10) 0x80105702
WSKBDIO_COMPLEXBELL _IOW('W',0x2,0x10) 0x80105702
$ ./ioctlprint -f "%o %d %d %i %x %e %n\n" 2148554498
020004053402 2148554498 2148554498 2148554498 0x80105702
_IOW('W',0x2,0x10) WSKBDIO_COMPLEXBELL
%n - name
%e - expression
%x - print HEX number
%o - print OCT number
%d %i - print DEC number
http://netbsd.org/~kamil/patch-00245-kdump-ioctlname.3.txt