Lines Matching refs:vty

26 #include "vty.h"
363 /* Printout flag information into vty */
365 if_flag_dump_vty (struct vty *vty, unsigned long flag)
373 vty_out (vty, ","); \
376 vty_out (vty, Y); \
379 vty_out (vty, "<");
396 vty_out (vty, ">");
399 /* Output prefix string to vty. */
401 prefix_vty_out (struct vty *vty, struct prefix *p)
406 vty_out (vty, "%s", str);
410 /* Dump if address information to vty. */
412 connected_dump_vty (struct vty *vty, struct connected *connected)
422 vty_out (vty, " %s ", prefix_family_str (p));
423 prefix_vty_out (vty, p);
424 vty_out (vty, "/%d", p->prefixlen);
433 vty_out (vty, " broadcast ");
434 prefix_vty_out (vty, p);
439 vty_out (vty, " pointopoint ");
440 prefix_vty_out (vty, p);
445 vty_out (vty, " secondary");
448 vty_out (vty, " %s", connected->label);
450 vty_out (vty, "%s", VTY_NEWLINE);
454 /* Dump interface ND information to vty. */
456 nd_dump_vty (struct vty *vty, struct interface *ifp)
466 vty_out (vty, " ND advertised reachable time is %d milliseconds%s",
468 vty_out (vty, " ND advertised retransmit interval is %d milliseconds%s",
470 vty_out (vty, " ND router advertisements are sent every %d seconds%s",
472 vty_out (vty, " ND router advertisements live for %d seconds%s",
475 vty_out (vty, " Hosts use DHCP to obtain routable addresses.%s",
478 vty_out (vty, " Hosts use stateless autoconfig for addresses.%s",
484 /* Interface's information print out to vty interface. */
486 if_dump_vty (struct vty *vty, struct interface *ifp)
494 vty_out (vty, "Interface %s%s", ifp->name,
497 vty_out (vty, " Description: %s%s", ifp->desc,
501 vty_out(vty, " index %d pseudo interface%s", ifp->ifindex, VTY_NEWLINE);
506 vty_out(vty, " index %d inactive interface%s",
512 vty_out (vty, " index %d metric %d mtu %d ",
514 if_flag_dump_vty (vty, ifp->flags);
515 vty_out (vty, "%s", VTY_NEWLINE);
525 vty_out (vty, " HWaddr: ");
527 vty_out (vty, "%s%02x", i == 0 ? "" : ":", *ptr);
528 vty_out (vty, "%s", VTY_NEWLINE);
535 vty_out (vty, " HWaddr: ");
537 vty_out (vty, "%s%02x", i == 0 ? "" : ":", ifp->hw_addr[i]);
538 vty_out (vty, "%s", VTY_NEWLINE);
545 vty_out(vty, " bandwidth %u kbps", ifp->bandwidth);
546 vty_out(vty, "%s", VTY_NEWLINE);
553 connected_dump_vty (vty, connected);
557 nd_dump_vty (vty, ifp);
562 vty_out (vty, " input packets %lu, bytes %lu, dropped %lu,"
567 vty_out (vty, " input errors %lu, length %lu, overrun %lu,"
574 vty_out (vty, " output packets %lu, bytes %lu, dropped %lu%s",
578 vty_out (vty, " output errors %lu, aborted %lu, carrier %lu,"
585 vty_out (vty, " collisions %lu%s", ifp->stats.collisions, VTY_NEWLINE);
591 vty_out (vty, " input packets %qu, bytes %qu, dropped %qu,"
597 vty_out (vty, " input errors %qu%s",
600 vty_out (vty, " output packets %qu, bytes %qu, multicast packets %qu%s",
604 vty_out (vty, " output errors %qu%s",
607 vty_out (vty, " collisions %qu%s",
611 vty_out (vty, " input packets %lu, bytes %lu, dropped %lu,"
617 vty_out (vty, " input errors %lu%s",
620 vty_out (vty, " output packets %lu, bytes %lu, multicast packets %lu%s",
624 vty_out (vty, " output errors %lu%s",
627 vty_out (vty, " collisions %lu%s",
660 ret = interface_cmd.func (self, vty, argc, argv);
662 ifp = vty->index;
687 vty_out (vty, "Inteface %s does not exist%s",
695 vty_out(vty, "Only inactive interfaces can be deleted%s", VTY_NEWLINE);
712 /* Show all or specified interface to vty. */
737 vty_out (vty, "%% Can't find interface %s%s", argv[0],
741 if_dump_vty (vty, ifp);
747 if_dump_vty (vty, getdata (node));
761 ifp = (struct interface *) vty->index;
765 vty_out (vty, "Can't set multicast flag%s", VTY_NEWLINE);
785 ifp = (struct interface *) vty->index;
789 vty_out (vty, "Can't unset multicast flag%s", VTY_NEWLINE);
808 ifp = (struct interface *) vty->index;
812 vty_out (vty, "Can't shutdown interface%s", VTY_NEWLINE);
832 ifp = (struct interface *) vty->index;
836 vty_out (vty, "Can't up interface%s", VTY_NEWLINE);
855 ifp = (struct interface *) vty->index;
861 vty_out (vty, "Bandwidth is invalid%s", VTY_NEWLINE);
882 ifp = (struct interface *) vty->index;
902 ip_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
914 vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
969 vty_out (vty, "%% Can't set interface IP address: %s.%s",
989 ip_address_uninstall (struct vty *vty, struct interface *ifp, char *addr_str,
1000 vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
1008 vty_out (vty, "%% Can't find address%s", VTY_NEWLINE);
1029 vty_out (vty, "%% Can't unset interface IP address: %s.%s",
1054 return ip_address_install (vty, vty->index, argv[0], NULL, NULL, 0);
1065 return ip_address_uninstall (vty, vty->index, argv[0], NULL, NULL, 0);
1077 return ip_address_install (vty, vty->index, argv[0], NULL, NULL, 1);
1089 return ip_address_install (vty, vty->index, argv[0], NULL, argv[1], 1);
1101 return ip_address_uninstall (vty, vty->index, argv[0], NULL, NULL, 1);
1114 return ip_address_uninstall (vty, vty->index, argv[0], NULL, argv[1], 1);
1120 ipv6_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
1131 vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
1177 vty_out (vty, "%% Can't set interface IP address: %s.%s",
1197 ipv6_address_uninstall (struct vty *vty, struct interface *ifp, char *addr_str,
1208 vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
1216 vty_out (vty, "%% Can't find address%s", VTY_NEWLINE);
1237 vty_out (vty, "%% Can't unset interface IP address: %s.%s",
1262 return ipv6_address_install (vty, vty->index, argv[0], NULL, NULL, 0);
1273 return ipv6_address_uninstall (vty, vty->index, argv[0], NULL, NULL, 0);
1297 if_config_write (struct vty *vty)
1313 vty_out (vty, "interface %s%s", ifp->name,
1317 vty_out (vty, " description %s%s", ifp->desc,
1323 vty_out(vty, " bandwidth %u%s", ifp->bandwidth, VTY_NEWLINE);
1331 vty_out (vty, " ip%s address %s/%d",
1337 vty_out (vty, " secondary");
1340 vty_out (vty, " label %s", ifc->label);
1342 vty_out (vty, "%s", VTY_NEWLINE);
1349 vty_out (vty, " shutdown%s", VTY_NEWLINE);
1352 vty_out (vty, " %smulticast%s",
1358 rtadv_config_write (vty, ifp);
1361 vty_out (vty, "!%s", VTY_NEWLINE);