summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 10f1f92100..13582008a7 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -47,6 +47,7 @@
#include "zebra/irdp.h"
#include "zebra/zebra_ptm.h"
#include "zebra/rt_netlink.h"
+#include "zebra/if_netlink.h"
#include "zebra/interface.h"
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_errors.h"
@@ -181,6 +182,7 @@ static int if_zebra_delete_hook(struct interface *ifp)
list_delete(&rtadv->AdvDNSSLList);
#endif /* HAVE_RTADV */
+ XFREE(MTYPE_TMP, zebra_if->desc);
THREAD_OFF(zebra_if->speed_update);
XFREE(MTYPE_ZINFO, zebra_if);
@@ -1062,7 +1064,14 @@ void zebra_if_update_all_links(void)
}
}
-
+void zebra_if_set_protodown(struct interface *ifp, bool down)
+{
+#ifdef HAVE_NETLINK
+ netlink_protodown(ifp, down);
+#else
+ zlog_warn("Protodown is not supported on this platform");
+#endif
+}
/* Output prefix string to vty. */
static int prefix_vty_out(struct vty *vty, struct prefix *p)
@@ -1303,6 +1312,9 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
if (ifp->desc)
vty_out(vty, " Description: %s\n", ifp->desc);
+ if (zebra_if->desc)
+ vty_out(vty, " OS Description: %s\n", zebra_if->desc);
+
if (ifp->ifindex == IFINDEX_INTERNAL) {
vty_out(vty, " pseudo interface\n");
return;
@@ -1696,6 +1708,10 @@ static void if_show_description(struct vty *vty, vrf_id_t vrf_id)
vty_out(vty, "Interface Status Protocol Description\n");
FOR_ALL_INTERFACES (vrf, ifp) {
int len;
+ struct zebra_if *zif;
+ bool intf_desc;
+
+ intf_desc = false;
len = vty_out(vty, "%s", ifp->name);
vty_out(vty, "%*s", (16 - len), " ");
@@ -1715,8 +1731,19 @@ static void if_show_description(struct vty *vty, vrf_id_t vrf_id)
vty_out(vty, "down down ");
}
- if (ifp->desc)
+ if (ifp->desc) {
+ intf_desc = true;
vty_out(vty, "%s", ifp->desc);
+ }
+ zif = ifp->info;
+ if (zif && zif->desc) {
+ vty_out(vty, "%s%s",
+ intf_desc
+ ? "\n "
+ : "",
+ zif->desc);
+ }
+
vty_out(vty, "\n");
}
}