]> git.ipfire.org Git - thirdparty/iproute2.git/commit
netns: allow to dump and monitor nsid
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Wed, 15 Apr 2015 12:23:22 +0000 (14:23 +0200)
committerStephen Hemminger <shemming@brocade.com>
Mon, 20 Apr 2015 17:02:38 +0000 (10:02 -0700)
commitd652ccbf8195e63ff6eedb923fad060b065fd18a
tree6b626838ce1eb8dab516c5015778422b5385cb32
parentb1410e0ab1b4f2f9f0b21392efc213692adf2bd5
netns: allow to dump and monitor nsid

Two commands are added:
 - ip netns list-id
 - ip monitor nsid

A cache is also added to remember the association between the iproute2 netns
name (from /var/run/netns/) and the nsid.
To avoid interfering with the rth socket, a new rtnl socket (rtnsh) is used to
get nsid (we may send rtnl request during listing on rth).

Example:
$ ip netns list-id
nsid 0 (iproute2 netns name: foo)
$ ip monitor nsid
Deleted nsid 0 (iproute2 netns name: foo)
nsid 16 (iproute2 netns name: bar)

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
include/ll_map.h
ip/ip_common.h
ip/ipmonitor.c
ip/ipnetns.c
lib/ll_map.c
man/man8/ip-monitor.8
man/man8/ip-netns.8