summaryrefslogtreecommitdiffstats
path: root/eigrpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-03 22:25:47 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-02-03 23:45:08 +0100
commit1313365236085bae90a700c23ab1e7a9fb12489a (patch)
treef4cb6450c83c3b08f767bcf7f4b904b8655be4b8 /eigrpd
parenteigrpd: Abstract display of an individual entry (diff)
downloadfrr-1313365236085bae90a700c23ab1e7a9fb12489a.tar.xz
frr-1313365236085bae90a700c23ab1e7a9fb12489a.zip
eigrpd: Allow A.B.C.D and A.B.C.D/M for topology specification
Allow eigrp to display interesting topo information to the end user. Fixes: #3705 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_vty.c70
1 files changed, 55 insertions, 15 deletions
diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c
index a6e03b22b..104f35244 100644
--- a/eigrpd/eigrp_vty.c
+++ b/eigrpd/eigrp_vty.c
@@ -479,9 +479,9 @@ static void eigrp_vty_display_prefix_entry(struct vty *vty,
}
}
-DEFUN (show_ip_eigrp_topology,
- show_ip_eigrp_topology_cmd,
- "show ip eigrp topology [all-links]",
+DEFPY (show_ip_eigrp_topology_all,
+ show_ip_eigrp_topology_all_cmd,
+ "show ip eigrp topology [all-links$all]",
SHOW_STR
IP_STR
"IP-EIGRP show commands\n"
@@ -505,21 +505,62 @@ DEFUN (show_ip_eigrp_topology,
continue;
tn = rn->info;
- eigrp_vty_display_prefix_entry(vty, eigrp, tn, argc == 5);
+ eigrp_vty_display_prefix_entry(vty, eigrp, tn,
+ all ? true : false);
}
return CMD_SUCCESS;
+
}
-ALIAS(show_ip_eigrp_topology, show_ip_eigrp_topology_detail_cmd,
- "show ip eigrp topology <A.B.C.D|A.B.C.D/M|detail|summary>",
- SHOW_STR IP_STR
- "IP-EIGRP show commands\n"
- "IP-EIGRP topology\n"
- "Netwok to display information about\n"
- "IP prefix <network>/<length>, e.g., 192.168.0.0/16\n"
- "Show all links in topology table\n"
- "Show a summary of the topology table\n")
+DEFPY (show_ip_eigrp_topology,
+ show_ip_eigrp_topology_cmd,
+ "show ip eigrp topology <A.B.C.D$address|A.B.C.D/M$prefix>",
+ SHOW_STR
+ IP_STR
+ "IP-EIGRP show commands\n"
+ "IP-EIGRP topology\n"
+ "For a specific address\n"
+ "For a specific prefix\n")
+{
+ struct eigrp *eigrp;
+ struct eigrp_prefix_entry *tn;
+ struct route_node *rn;
+ struct prefix cmp;
+
+ eigrp = eigrp_lookup();
+ if (eigrp == NULL) {
+ vty_out(vty, " EIGRP Routing Process not enabled\n");
+ return CMD_SUCCESS;
+ }
+
+ show_ip_eigrp_topology_header(vty, eigrp);
+
+ if (address_str)
+ prefix_str = address_str;
+
+ if (str2prefix(prefix_str, &cmp) < 0) {
+ vty_out(vty, "%% Malformed address\n");
+ return CMD_WARNING;
+ }
+
+ rn = route_node_match(eigrp->topology_table, &cmp);
+ if (!rn) {
+ vty_out(vty, "%% Network not in table\n");
+ return CMD_WARNING;
+ }
+
+ if (!rn->info) {
+ vty_out(vty, "%% Network not in table\n");
+ route_unlock_node(rn);
+ return CMD_WARNING;
+ }
+
+ tn = rn->info;
+ eigrp_vty_display_prefix_entry(vty, eigrp, tn, argc == 5);
+
+ return CMD_SUCCESS;
+}
DEFUN (show_ip_eigrp_interfaces,
show_ip_eigrp_interfaces_cmd,
@@ -1493,8 +1534,7 @@ void eigrp_vty_show_init(void)
install_element(VIEW_NODE, &show_ip_eigrp_neighbors_cmd);
install_element(VIEW_NODE, &show_ip_eigrp_topology_cmd);
-
- install_element(VIEW_NODE, &show_ip_eigrp_topology_detail_cmd);
+ install_element(VIEW_NODE, &show_ip_eigrp_topology_all_cmd);
}
/* eigrpd's interface node. */