mirror_iproute2/lib
Petr Machata c13216f7a6 lib: Generalize parse_mapping()
The function parse_mapping() assumes the key is a number, with a single
configurable exception, which is using "all" to mean "all possible keys".
If a caller wishes to use symbolic names instead of numbers, they cannot
reuse this function.

To facilitate reuse in these situations, convert parse_mapping() into a
helper, parse_mapping_gen(), which instead of an allow-all boolean takes a
generic key-parsing callback. Rewrite parse_mapping() in terms of this
newly-added helper and add a pair of key parsers, one for just numbers,
another for numbers and the keyword "all". Publish the latter as well.

Signed-off-by: Petr Machata <me@pmachata.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
2021-01-18 04:09:29 +00:00
..
bpf_glue.c lib: make ipvrf able to use libbpf and fix function name conflicts 2020-11-24 22:14:04 -07:00
bpf_legacy.c lib: add libbpf support 2020-11-24 22:14:05 -07:00
bpf_libbpf.c lib: add libbpf support 2020-11-24 22:14:05 -07:00
cg_map.c lib: ignore invalid mounts in cg_init_map 2020-10-11 23:02:35 -07:00
color.c lib/color: make local functions static 2018-11-19 11:42:44 -08:00
coverity_model.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
exec.c netns: switch netns in the child when executing commands 2019-06-20 14:30:41 -07:00
fs.c lib: fix checking of returned file handle size for cgroup 2020-07-06 11:05:54 -07:00
inet_proto.c ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
json_print.c lib: print_color_rate(): Fix formatting small rates in IEC mode 2020-12-09 02:30:41 +00:00
json_writer.c json: fix backslash escape typo in jsonw_puts 2019-07-19 10:48:38 -07:00
libgenl.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
libnetlink.c libnetlink: define __aligned conditionally 2020-10-28 10:24:02 -07:00
ll_addr.c lib/ll_addr: whitespace and indent cleanup 2018-11-19 11:42:44 -08:00
ll_map.c ip: allow to use alternative names as handle 2019-10-28 07:35:29 -07:00
ll_proto.c m_mpls: add mac_push action 2020-10-20 08:57:08 -06:00
ll_types.c ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
Makefile Only compile mnl_utils when HAVE_MNL is defined 2020-12-04 16:19:05 +00:00
mnl_utils.c lib: Extract from devlink/mnlg a helper, mnlu_socket_recv_run() 2020-11-13 19:43:15 -07:00
mpls_ntop.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
mpls_pton.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
names.c tc: drop unused name_to_id function 2018-11-19 11:42:44 -08:00
namespace.c netns: make netns_{save,restore} static 2019-06-20 14:30:41 -07:00
rt_names.c lib: rt_names: Add rtnl_dsfield_get_name() 2021-01-18 04:09:29 +00:00
utils.c lib: Generalize parse_mapping() 2021-01-18 04:09:29 +00:00