return CMD_SUCCESS;
}
+static void eigrp_interface_helper(struct vty *vty, struct eigrp *eigrp,
+ const char *ifname, const char *detail)
+{
+ struct eigrp_interface *ei;
+ struct listnode *node;
+
+ if (!ifname)
+ show_ip_eigrp_interface_header(vty, eigrp);
+
+ for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, ei)) {
+ if (!ifname || strcmp(ei->ifp->name, ifname) == 0) {
+ show_ip_eigrp_interface_sub(vty, eigrp, ei);
+ if (detail)
+ show_ip_eigrp_interface_detail(vty, eigrp, ei);
+ }
+ }
+}
+
DEFPY (show_ip_eigrp_interfaces,
show_ip_eigrp_interfaces_cmd,
"show ip eigrp [vrf NAME] interfaces [IFNAME] [detail]$detail",
"Interface name to look at\n"
"Detailed information\n")
{
- struct eigrp_interface *ei;
struct eigrp *eigrp;
- struct listnode *node;
- eigrp = eigrp_vty_get_eigrp(vty, vrf);
- if (eigrp == NULL) {
- vty_out(vty, "EIGRP Routing Process not enabled\n");
- return CMD_SUCCESS;
- }
+ if (vrf && strncmp(vrf, "all", sizeof("all")) == 0) {
+ struct vrf *vrf;
- if (!ifname)
- show_ip_eigrp_interface_header(vty, eigrp);
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
+ eigrp = eigrp_lookup(vrf->vrf_id);
+ if (!eigrp)
+ continue;
- for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, ei)) {
- if (!ifname || strcmp(ei->ifp->name, ifname) == 0) {
- show_ip_eigrp_interface_sub(vty, eigrp, ei);
- if (detail)
- show_ip_eigrp_interface_detail(vty, eigrp, ei);
+ vty_out(vty, "VRF %s:\n", vrf->name);
+
+ eigrp_interface_helper(vty, eigrp, ifname, detail);
+ }
+ } else {
+ eigrp = eigrp_vty_get_eigrp(vty, vrf);
+ if (eigrp == NULL) {
+ vty_out(vty, "EIGRP Routing Process not enabled\n");
+ return CMD_SUCCESS;
}
+
+ eigrp_interface_helper(vty, eigrp, ifname, detail);
}
+
return CMD_SUCCESS;
}