]> granicus.if.org Git - strace/commit
print_ifindex: add public get_ifname method
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 27 Aug 2018 13:16:10 +0000 (15:16 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 2 Sep 2018 17:44:26 +0000 (17:44 +0000)
commit9a969eb6704ef0f12f14ddb53bfe01f9a16e287e
tree10cf180a2a1547afda3fead99d0d05531eb497f0
parentef859a27029fe2977f954d270a701fabaae28024
print_ifindex: add public get_ifname method

In order to be able to obtain sanitised device name internally.

* defs.h (get_ifname): New declaration.
* print_ifindex.c (get_ifname): Refactor, leaving out addition
of if_nametoindex("") part.
(sprint_ifname): New function, adds if_nametoindex("")
to get_ifname's output.
(print_ifindex): Use sprint_ifname instead of get_ifname.
defs.h
print_ifindex.c