ip: Add support for MPLS netconf
Add support for MPLS netconf to ip monitor and ip netconf commands. Changes to header files not included as those are typically pulled in my a header sync with the kernel. Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
This commit is contained in:
parent
3f34574d0f
commit
76f7d89d4d
|
|
@ -176,6 +176,7 @@ int do_ipmonitor(int argc, char **argv)
|
|||
groups |= nl_mgrp(RTNLGRP_IPV4_RULE);
|
||||
groups |= nl_mgrp(RTNLGRP_IPV6_RULE);
|
||||
groups |= nl_mgrp(RTNLGRP_NSID);
|
||||
groups |= nl_mgrp(RTNLGRP_MPLS_NETCONF);
|
||||
|
||||
rtnl_close(&rth);
|
||||
|
||||
|
|
@ -271,6 +272,8 @@ int do_ipmonitor(int argc, char **argv)
|
|||
groups |= nl_mgrp(RTNLGRP_IPV4_NETCONF);
|
||||
if (!preferred_family || preferred_family == AF_INET6)
|
||||
groups |= nl_mgrp(RTNLGRP_IPV6_NETCONF);
|
||||
if (!preferred_family || preferred_family == AF_MPLS)
|
||||
groups |= nl_mgrp(RTNLGRP_MPLS_NETCONF);
|
||||
}
|
||||
if (lrule) {
|
||||
if (!preferred_family || preferred_family == AF_INET)
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
|
|||
case AF_INET6:
|
||||
fprintf(fp, "ipv6 ");
|
||||
break;
|
||||
case AF_MPLS:
|
||||
fprintf(fp, "mpls ");
|
||||
break;
|
||||
default:
|
||||
fprintf(fp, "unknown ");
|
||||
break;
|
||||
|
|
@ -131,6 +134,9 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
|
|||
print_onoff(fp, "ignore_routes_with_linkdown",
|
||||
rta_getattr_u32(tb[NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN]));
|
||||
|
||||
if (tb[NETCONFA_INPUT])
|
||||
print_onoff(fp, "input", rta_getattr_u32(tb[NETCONFA_INPUT]));
|
||||
|
||||
fprintf(fp, "\n");
|
||||
fflush(fp);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue