]> git.ipfire.org Git - thirdparty/iproute2.git/commit
utils: Reimplement ll_idx_n2a() and introduce ll_idx_a2n()
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 15 Feb 2018 21:23:18 +0000 (23:23 +0200)
committerDavid Ahern <dsahern@gmail.com>
Fri, 16 Feb 2018 16:14:13 +0000 (08:14 -0800)
commitfe269b6e7c5de9870ffa5c3889a51dbb26e4e6ff
treef734f328a3f03b81e8fef3bceec4c95aea70bf5f
parentd92cc2d087b0efde6152acf5e52ec4bf469d9805
utils: Reimplement ll_idx_n2a() and introduce ll_idx_a2n()

Now all users of ll_idx_n2a() replaced with ll_index_to_name() we can
move it's functionality to ll_index_to_name() and implement index to
name conversion using snprintf() and "if%u".

Use %u specifier in "if%..." template consistently: network device
indexes are always greather than zero.

Also introduce ll_idx_n2a() conterpart: ll_idx_a2n() that is used
to translate name of the "if%u" form to index using sscanf().

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
include/ll_map.h
lib/ll_map.c