iproute2/include
Vadim Kochan b13ba03f54 ip netns: Allow exec on each netns
This change allows to exec some cmd on each
named netns (except default) by specifying '-all' option:

    # ip -all netns exec ip link

Each command executes synchronously.

Exit status is not considered, so there might be a case
that some CMD can fail on some netns but success on the other.

EXAMPLES:

1) Show link info on all netns:

$ ip -all netns exec ip link

netns: test_net
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
    link/ether 1a:19:6f:25:eb:85 brd ff:ff:ff:ff:ff:ff

netns: home0
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
    link/ether ea:1a:59:40:d3:29 brd ff:ff:ff:ff:ff:ff

netns: lan0
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
    link/ether ce:49:d5:46:81:ea brd ff:ff:ff:ff:ff:ff

2) Set UP tap0 device for the all netns:

$ ip -all netns exec ip link set dev tap0 up

netns: test_net

netns: home0

netns: lan0

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2015-02-05 10:28:19 -08:00
..
libiptc iproute2: Support IFF_LOWER_UP and IFF_DORMANT 2007-06-19 16:40:40 -07:00
linux can: update kernel header 2015-02-05 10:17:50 -08:00
netinet ss: report ecnseen 2011-11-23 14:51:54 -08:00
SNAPSHOT.h v3.18.0 2014-12-24 12:20:49 -08:00
dlfcn.h Fix build when shared libraries are disabled 2013-03-13 08:29:59 -07:00
hlist.h ll_map: add name and index hash 2013-03-28 14:57:28 -07:00
ip6tables.h Remove trailing whitespace 2006-12-05 10:10:22 -08:00
iptables.h Fix compilation error of m_ipt.c with -Werror enabled 2013-02-26 17:35:26 -08:00
iptables_common.h fix build warnings 2007-06-20 10:55:18 -07:00
libgenl.h iproute2: GENL: merge GENL_REQUEST and GENL_INITIALIZER 2012-09-17 15:46:45 -07:00
libnetlink.h Add define for nlmsg_types with timestamp 2015-01-13 17:34:47 -08:00
ll_map.h cleanup warnings 2014-08-04 10:30:35 -07:00
namespace.h lib: Exec func on each netns 2015-02-05 10:28:19 -08:00
rt_names.h ss: Identify more netlink protocol names 2014-11-29 11:13:38 -08:00
rtm_map.h (Logical change 1.3) 2004-04-15 20:56:59 +00:00
utils.h ip netns: Allow exec on each netns 2015-02-05 10:28:19 -08:00
xt-internal.h Breakage noticed when debian upgraded to xtables (iptables > 1.4.1) 2009-02-19 09:02:13 -08:00