mirror_iproute2/lib
Nicolas Dichtel eaefb07804 ipnetns: enable to dump nsid conversion table
This patch enables to dump/get nsid from a netns into another netns.

Example:
$ ./test.sh
+ ip netns add foo
+ ip netns add bar
+ touch /var/run/netns/init_net
+ mount --bind /proc/1/ns/net /var/run/netns/init_net
+ ip netns set init_net 11
+ ip netns set foo 12
+ ip netns set bar 13
+ ip netns
init_net (id: 11)
bar (id: 13)
foo (id: 12)
+ ip -n foo netns set init_net 21
+ ip -n foo netns set foo 22
+ ip -n foo netns set bar 23
+ ip -n foo netns
init_net (id: 21)
bar (id: 23)
foo (id: 22)
+ ip -n bar netns set init_net 31
+ ip -n bar netns set foo 32
+ ip -n bar netns set bar 33
+ ip -n bar netns
init_net (id: 31)
bar (id: 33)
foo (id: 32)
+ ip netns list-id target-nsid 12
nsid 21 current-nsid 11 (iproute2 netns name: init_net)
nsid 22 current-nsid 12 (iproute2 netns name: foo)
nsid 23 current-nsid 13 (iproute2 netns name: bar)
+ ip -n foo netns list-id target-nsid 21
nsid 11 current-nsid 21 (iproute2 netns name: init_net)
nsid 12 current-nsid 22 (iproute2 netns name: foo)
nsid 13 current-nsid 23 (iproute2 netns name: bar)
+ ip -n bar netns list-id target-nsid 33 nsid 32
nsid 32 current-nsid 32 (iproute2 netns name: foo)
+ ip -n bar netns list-id target-nsid 31 nsid 32
nsid 12 current-nsid 32 (iproute2 netns name: foo)
+ ip netns list-id nsid 13
nsid 13 (iproute2 netns name: bar)

CC: Petr Oros <poros@redhat.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Tested-by: Petr Oros <poros@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-10-14 13:04:19 -07:00
..
bpf.c Merge ../iproute2-next 2019-09-24 12:37:33 -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 Include bsd/string.h only in include/utils.h 2018-11-05 08:38:32 -08:00
inet_proto.c ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
json_print.c lib: fix spelling errors 2019-08-12 18:21:10 -07: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 ipnetns: enable to dump nsid conversion table 2019-10-14 13:04:19 -07:00
ll_addr.c lib/ll_addr: whitespace and indent cleanup 2018-11-19 11:42:44 -08:00
ll_map.c lib: suppress error msg when filling the cache 2019-05-28 12:23:52 -07:00
ll_proto.c lib: add mpls_uc and mpls_mc as link layer protocol names 2019-07-10 14:06:28 -07:00
ll_types.c ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
Makefile lib: Correct object file dependencies 2018-02-16 08:14:18 -08: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 ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
utils.c lib: fix spelling errors 2019-08-12 18:21:10 -07:00