ip: add support of 'ip link type ip6tnl'
This patch allows to manage ip6 tunnels via the interface ip link.
The syntax for parameters is the same that 'ip -6 tunnel'.
It also allows to display tunnels parameters with 'ip -details link' or
'ip -details monitor link'.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 4b1d469..d87e58f 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -85,6 +85,12 @@
print_rule(who, n, arg);
return 0;
}
+ if (n->nlmsg_type == RTM_NEWNETCONF) {
+ if (prefix_banner)
+ fprintf(fp, "[NETCONF]");
+ print_netconf(who, n, arg);
+ return 0;
+ }
if (n->nlmsg_type == 15) {
char *tstr;
time_t secs = ((__u32*)NLMSG_DATA(n))[0];
@@ -118,6 +124,7 @@
int lroute=0;
int lprefix=0;
int lneigh=0;
+ int lnetconf=0;
rtnl_close(&rth);
ipaddr_reset_filter(1);
@@ -143,6 +150,9 @@
} else if (matches(*argv, "neigh") == 0) {
lneigh = 1;
groups = 0;
+ } else if (matches(*argv, "netconf") == 0) {
+ lnetconf = 1;
+ groups = 0;
} else if (strcmp(*argv, "all") == 0) {
groups = ~RTMGRP_TC;
prefix_banner=1;
@@ -176,6 +186,12 @@
if (lneigh) {
groups |= nl_mgrp(RTNLGRP_NEIGH);
}
+ if (lnetconf) {
+ if (!preferred_family || preferred_family == AF_INET)
+ groups |= nl_mgrp(RTNLGRP_IPV4_NETCONF);
+ if (!preferred_family || preferred_family == AF_INET6)
+ groups |= nl_mgrp(RTNLGRP_IPV6_NETCONF);
+ }
if (file) {
FILE *fp;
fp = fopen(file, "r");