2 * Copyright (C) 2002 Kunihiro Ishiguro
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
33 #include "zebra/zserv.h"
34 #include "zebra/zebra_rnh.h"
36 static int do_show_ip_route(struct vty *vty, safi_t safi, vrf_id_t vrf_id);
37 static void vty_show_ip_route_detail (struct vty *vty, struct route_node *rn,
39 static void vty_show_ip_route (struct vty *vty, struct route_node *rn,
42 /* General function for static route. */
44 zebra_static_ipv4_safi (struct vty *vty, safi_t safi, int add_cmd,
45 const char *dest_str, const char *mask_str,
46 const char *gate_str, const char *flag_str,
47 const char *tag_str, const char *distance_str,
48 const char *vrf_id_str)
58 vrf_id_t vrf_id = VRF_DEFAULT;
60 ret = str2prefix (dest_str, &p);
63 vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
67 /* Cisco like mask notation. */
70 ret = inet_aton (mask_str, &mask);
73 vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
76 p.prefixlen = ip_masklen (mask);
79 /* Apply mask for given prefix. */
82 /* Administrative distance. */
84 distance = atoi (distance_str);
86 distance = ZEBRA_STATIC_DISTANCE_DEFAULT;
94 VTY_GET_INTEGER ("VRF ID", vrf_id, vrf_id_str);
100 /* Null0 static route. */
101 if ((gate_str != NULL) && (strncasecmp (gate_str, "Null0", strlen (gate_str)) == 0))
105 vty_out (vty, "%% can not have flag %s with Null0%s", flag_str, VTY_NEWLINE);
109 static_add_ipv4_safi (safi, &p, NULL, NULL, ZEBRA_FLAG_BLACKHOLE, tag, distance, vrf_id);
111 static_delete_ipv4_safi (safi, &p, NULL, NULL, tag, distance, vrf_id);
117 switch(flag_str[0]) {
120 SET_FLAG (flag, ZEBRA_FLAG_REJECT);
124 SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE);
127 vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE);
132 if (gate_str == NULL)
135 static_add_ipv4_safi (safi, &p, NULL, NULL, flag, tag, distance, vrf_id);
137 static_delete_ipv4_safi (safi, &p, NULL, NULL, tag, distance, vrf_id);
142 /* When gateway is A.B.C.D format, gate is treated as nexthop
143 address other case gate is treated as interface name. */
144 ret = inet_aton (gate_str, &gate);
151 static_add_ipv4_safi (safi, &p, ifname ? NULL : &gate, ifname, flag, tag, distance, vrf_id);
153 static_delete_ipv4_safi (safi, &p, ifname ? NULL : &gate, ifname, tag, distance, vrf_id);
158 /* Static unicast routes for multicast RPF lookup. */
159 DEFUN (ip_mroute_dist,
161 "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255>",
163 "Configure static unicast route into MRIB for multicast RPF lookup\n"
164 "IP destination prefix (e.g. 10.0.0.0/8)\n"
166 "Nexthop interface name\n"
169 VTY_WARN_EXPERIMENTAL();
170 return zebra_static_ipv4_safi(vty, SAFI_MULTICAST, 1, argv[0], NULL, argv[1],
171 NULL, NULL, argc > 2 ? argv[2] : NULL, NULL);
174 ALIAS (ip_mroute_dist,
176 "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE)",
178 "Configure static unicast route into MRIB for multicast RPF lookup\n"
179 "IP destination prefix (e.g. 10.0.0.0/8)\n"
181 "Nexthop interface name\n")
183 DEFUN (ip_mroute_dist_vrf,
184 ip_mroute_dist_vrf_cmd,
185 "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255> " VRF_CMD_STR,
187 "Configure static unicast route into MRIB for multicast RPF lookup\n"
188 "IP destination prefix (e.g. 10.0.0.0/8)\n"
190 "Nexthop interface name\n"
194 VTY_WARN_EXPERIMENTAL();
195 return zebra_static_ipv4_safi(vty, SAFI_MULTICAST, 1, argv[0], NULL, argv[1],
196 NULL, NULL, argc > 3 ? argv[2] : NULL,
197 argc > 3 ? argv[3] : argv[2]);
200 ALIAS (ip_mroute_dist_vrf,
202 "ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) "VRF_CMD_STR,
204 "Configure static unicast route into MRIB for multicast RPF lookup\n"
205 "IP destination prefix (e.g. 10.0.0.0/8)\n"
207 "Nexthop interface name\n"
210 DEFUN (no_ip_mroute_dist,
211 no_ip_mroute_dist_cmd,
212 "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255>",
214 "Configure static unicast route into MRIB for multicast RPF lookup\n"
215 "IP destination prefix (e.g. 10.0.0.0/8)\n"
217 "Nexthop interface name\n"
220 VTY_WARN_EXPERIMENTAL();
221 return zebra_static_ipv4_safi(vty, SAFI_MULTICAST, 0, argv[0], NULL, argv[1],
222 NULL, NULL, argc > 2 ? argv[2] : NULL, NULL);
225 ALIAS (no_ip_mroute_dist,
227 "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE)",
230 "Configure static unicast route into MRIB for multicast RPF lookup\n"
231 "IP destination prefix (e.g. 10.0.0.0/8)\n"
233 "Nexthop interface name\n")
235 DEFUN (no_ip_mroute_dist_vrf,
236 no_ip_mroute_dist_vrf_cmd,
237 "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) <1-255> " VRF_CMD_STR,
239 "Configure static unicast route into MRIB for multicast RPF lookup\n"
240 "IP destination prefix (e.g. 10.0.0.0/8)\n"
242 "Nexthop interface name\n"
246 VTY_WARN_EXPERIMENTAL();
247 return zebra_static_ipv4_safi(vty, SAFI_MULTICAST, 0, argv[0], NULL, argv[1],
248 NULL, NULL, argc > 3 ? argv[2] : NULL,
249 argc > 3 ? argv[3] : argv[2]);
252 ALIAS (no_ip_mroute_dist_vrf,
253 no_ip_mroute_vrf_cmd,
254 "no ip mroute A.B.C.D/M (A.B.C.D|INTERFACE) " VRF_CMD_STR,
257 "Configure static unicast route into MRIB for multicast RPF lookup\n"
258 "IP destination prefix (e.g. 10.0.0.0/8)\n"
260 "Nexthop interface name\n"
263 DEFUN (ip_multicast_mode,
264 ip_multicast_mode_cmd,
265 "ip multicast rpf-lookup-mode (urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix)",
267 "Multicast options\n"
268 "RPF lookup behavior\n"
269 "Lookup in unicast RIB only\n"
270 "Lookup in multicast RIB only\n"
271 "Try multicast RIB first, fall back to unicast RIB\n"
272 "Lookup both, use entry with lower distance\n"
273 "Lookup both, use entry with longer prefix\n")
275 VTY_WARN_EXPERIMENTAL();
277 if (!strncmp (argv[0], "u", 1))
278 multicast_mode_ipv4_set (MCAST_URIB_ONLY);
279 else if (!strncmp (argv[0], "mrib-o", 6))
280 multicast_mode_ipv4_set (MCAST_MRIB_ONLY);
281 else if (!strncmp (argv[0], "mrib-t", 6))
282 multicast_mode_ipv4_set (MCAST_MIX_MRIB_FIRST);
283 else if (!strncmp (argv[0], "low", 3))
284 multicast_mode_ipv4_set (MCAST_MIX_DISTANCE);
285 else if (!strncmp (argv[0], "lon", 3))
286 multicast_mode_ipv4_set (MCAST_MIX_PFXLEN);
289 vty_out (vty, "Invalid mode specified%s", VTY_NEWLINE);
296 DEFUN (no_ip_multicast_mode,
297 no_ip_multicast_mode_cmd,
298 "no ip multicast rpf-lookup-mode (urib-only|mrib-only|mrib-then-urib|lower-distance|longer-prefix)",
301 "Multicast options\n"
302 "RPF lookup behavior\n"
303 "Lookup in unicast RIB only\n"
304 "Lookup in multicast RIB only\n"
305 "Try multicast RIB first, fall back to unicast RIB\n"
306 "Lookup both, use entry with lower distance\n"
307 "Lookup both, use entry with longer prefix\n")
309 multicast_mode_ipv4_set (MCAST_NO_CONFIG);
313 ALIAS (no_ip_multicast_mode,
314 no_ip_multicast_mode_noarg_cmd,
315 "no ip multicast rpf-lookup-mode",
318 "Multicast options\n"
319 "RPF lookup behavior\n")
326 "Display RPF information for multicast source\n")
328 vrf_id_t vrf_id = VRF_DEFAULT;
331 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
333 VTY_WARN_EXPERIMENTAL();
334 return do_show_ip_route(vty, SAFI_MULTICAST, vrf_id);
339 "show ip rpf " VRF_CMD_STR,
342 "Display RPF information for multicast source\n"
345 DEFUN (show_ip_rpf_addr,
346 show_ip_rpf_addr_cmd,
347 "show ip rpf A.B.C.D",
350 "Display RPF information for multicast source\n"
351 "IP multicast source address (e.g. 10.0.0.0)\n")
354 struct route_node *rn;
356 vrf_id_t vrf_id = VRF_DEFAULT;
360 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
362 VTY_WARN_EXPERIMENTAL();
364 ret = inet_aton (argv[0], &addr);
367 vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
371 rib = rib_match_ipv4_multicast (addr, &rn, vrf_id);
374 vty_show_ip_route_detail (vty, rn, 1);
376 vty_out (vty, "%% No match for RPF lookup%s", VTY_NEWLINE);
381 ALIAS (show_ip_rpf_addr,
382 show_ip_rpf_addr_vrf_cmd,
383 "show ip rpf A.B.C.D " VRF_CMD_STR,
386 "Display RPF information for multicast source\n"
387 "IP multicast source address (e.g. 10.0.0.0)\n"
390 DEFUN (show_ip_rpf_vrf_all,
391 show_ip_rpf_vrf_all_cmd,
392 "show ip rpf " VRF_ALL_CMD_STR,
395 "Display RPF information for multicast source\n"
396 VRF_ALL_CMD_HELP_STR)
398 struct zebra_vrf *zvrf;
399 struct route_table *table;
400 struct route_node *rn;
405 VTY_WARN_EXPERIMENTAL();
407 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
409 if ((zvrf = vrf_iter2info (iter)) == NULL ||
410 (table = zvrf->table[AFI_IP][SAFI_MULTICAST]) == NULL)
413 /* Show all IPv4 routes. */
414 for (rn = route_top (table); rn; rn = route_next (rn))
415 RNODE_FOREACH_RIB (rn, rib)
419 vty_out (vty, SHOW_ROUTE_V4_HEADER);
422 vty_show_ip_route (vty, rn, rib);
429 DEFUN (show_ip_rpf_addr_vrf_all,
430 show_ip_rpf_addr_vrf_all_cmd,
431 "show ip rpf A.B.C.D " VRF_ALL_CMD_STR,
434 "Display RPF information for multicast source\n"
435 "IP multicast source address (e.g. 10.0.0.0)\n"
436 VRF_ALL_CMD_HELP_STR)
439 struct route_node *rn;
443 VTY_WARN_EXPERIMENTAL();
445 ret = inet_aton (argv[0], &addr);
448 vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
452 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
454 if (rib_match_ipv4_multicast (addr, &rn, vrf_iter2id (iter)))
455 vty_show_ip_route_detail (vty, rn, 1);
461 /* Static route configuration. */
464 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
466 "Establish static routes\n"
467 "IP destination prefix (e.g. 10.0.0.0/8)\n"
468 "IP gateway address\n"
469 "IP gateway interface name\n"
472 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
473 NULL, NULL, NULL, NULL);
478 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
480 "Establish static routes\n"
481 "IP destination prefix (e.g. 10.0.0.0/8)\n"
482 "IP gateway address\n"
483 "IP gateway interface name\n"
485 "Set tag for this route\n"
488 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
489 argv[1], NULL, argv[2], NULL, NULL);
492 DEFUN (ip_route_tag_vrf,
493 ip_route_tag_vrf_cmd,
494 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295>" VRF_CMD_STR,
496 "Establish static routes\n"
497 "IP destination prefix (e.g. 10.0.0.0/8)\n"
498 "IP gateway address\n"
499 "IP gateway interface name\n"
501 "Set tag for this route\n"
505 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
506 argv[1], NULL, argv[2], NULL, argv[3]);
509 DEFUN (ip_route_flags,
511 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
513 "Establish static routes\n"
514 "IP destination prefix (e.g. 10.0.0.0/8)\n"
515 "IP gateway address\n"
516 "IP gateway interface name\n"
517 "Emit an ICMP unreachable when matched\n"
518 "Silently discard pkts when matched\n")
520 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
521 argv[2], NULL, NULL, NULL);
524 DEFUN (ip_route_flags_tag,
525 ip_route_flags_tag_cmd,
526 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
528 "Establish static routes\n"
529 "IP destination prefix (e.g. 10.0.0.0/8)\n"
530 "IP gateway address\n"
531 "IP gateway interface name\n"
532 "Emit an ICMP unreachable when matched\n"
533 "Silently discard pkts when matched\n"
534 "Set tag for this route\n"
538 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
539 argv[2], argv[3], NULL, NULL);
542 DEFUN (ip_route_flags_tag_vrf,
543 ip_route_flags_tag_vrf_cmd,
544 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
546 "Establish static routes\n"
547 "IP destination prefix (e.g. 10.0.0.0/8)\n"
548 "IP gateway address\n"
549 "IP gateway interface name\n"
550 "Emit an ICMP unreachable when matched\n"
551 "Silently discard pkts when matched\n"
552 "Set tag for this route\n"
556 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
557 argv[2], argv[3], NULL, argv[4]);
560 DEFUN (ip_route_flags2,
562 "ip route A.B.C.D/M (reject|blackhole)",
564 "Establish static routes\n"
565 "IP destination prefix (e.g. 10.0.0.0/8)\n"
566 "Emit an ICMP unreachable when matched\n"
567 "Silently discard pkts when matched\n")
569 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
570 NULL, argv[1], NULL, NULL, NULL);
573 DEFUN (ip_route_flags2_tag,
574 ip_route_flags2_tag_cmd,
575 "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295>",
577 "Establish static routes\n"
578 "IP destination prefix (e.g. 10.0.0.0/8)\n"
579 "Emit an ICMP unreachable when matched\n"
580 "Silently discard pkts when matched\n"
581 "Set tag for this route\n"
584 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, NULL,
585 argv[1], argv[2], NULL, NULL);
588 DEFUN (ip_route_flags2_tag_vrf,
589 ip_route_flags2_tag_vrf_cmd,
590 "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295>",
592 "Establish static routes\n"
593 "IP destination prefix (e.g. 10.0.0.0/8)\n"
594 "Emit an ICMP unreachable when matched\n"
595 "Silently discard pkts when matched\n"
596 "Set tag for this route\n"
600 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, NULL,
601 argv[1], argv[2], NULL, argv[3]);
604 /* Mask as A.B.C.D format. */
605 DEFUN (ip_route_mask,
607 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
609 "Establish static routes\n"
610 "IP destination prefix\n"
611 "IP destination prefix mask\n"
612 "IP gateway address\n"
613 "IP gateway interface name\n"
616 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
617 argv[2], NULL, NULL, NULL, NULL);
620 DEFUN (ip_route_mask_tag,
621 ip_route_mask_tag_cmd,
622 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
624 "Establish static routes\n"
625 "IP destination prefix\n"
626 "IP destination prefix mask\n"
627 "IP gateway address\n"
628 "IP gateway interface name\n"
630 "Set tag for this route\n"
634 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], argv[2],
635 NULL, argv[3], NULL, NULL);
638 DEFUN (ip_route_mask_tag_vrf,
639 ip_route_mask_tag_vrf_cmd,
640 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295>" VRF_CMD_STR,
642 "Establish static routes\n"
643 "IP destination prefix\n"
644 "IP destination prefix mask\n"
645 "IP gateway address\n"
646 "IP gateway interface name\n"
648 "Set tag for this route\n"
652 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], argv[2],
653 NULL, argv[3], NULL, argv[4]);
656 DEFUN (ip_route_mask_flags,
657 ip_route_mask_flags_cmd,
658 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
660 "Establish static routes\n"
661 "IP destination prefix\n"
662 "IP destination prefix mask\n"
663 "IP gateway address\n"
664 "IP gateway interface name\n"
665 "Emit an ICMP unreachable when matched\n"
666 "Silently discard pkts when matched\n")
668 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
669 argv[2], argv[3], NULL, NULL, NULL);
672 DEFUN (ip_route_mask_flags_tag,
673 ip_route_mask_flags_tag_cmd,
674 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
676 "Establish static routes\n"
677 "IP destination prefix\n"
678 "IP destination prefix mask\n"
679 "IP gateway address\n"
680 "IP gateway interface name\n"
681 "Emit an ICMP unreachable when matched\n"
682 "Silently discard pkts when matched\n"
683 "Set tag for this route\n"
686 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
687 argv[2], argv[3], argv[4], NULL, NULL);
690 DEFUN (ip_route_mask_flags_tag_vrf,
691 ip_route_mask_flags_tag_vrf_cmd,
692 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
694 "Establish static routes\n"
695 "IP destination prefix\n"
696 "IP destination prefix mask\n"
697 "IP gateway address\n"
698 "IP gateway interface name\n"
699 "Emit an ICMP unreachable when matched\n"
700 "Silently discard pkts when matched\n"
701 "Set tag for this route\n"
705 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
706 argv[2], argv[3], argv[4], NULL, argv[5]);
709 DEFUN (ip_route_mask_flags2,
710 ip_route_mask_flags2_cmd,
711 "ip route A.B.C.D A.B.C.D (reject|blackhole)",
713 "Establish static routes\n"
714 "IP destination prefix\n"
715 "IP destination prefix mask\n"
716 "Emit an ICMP unreachable when matched\n"
717 "Silently discard pkts when matched\n")
719 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
720 NULL, argv[2], NULL, NULL, NULL);
723 DEFUN (ip_route_mask_flags2_tag,
724 ip_route_mask_flags2_tag_cmd,
725 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295>",
727 "Establish static routes\n"
728 "IP destination prefix\n"
729 "IP destination prefix mask\n"
730 "Emit an ICMP unreachable when matched\n"
731 "Silently discard pkts when matched\n"
732 "Set tag for this route\n"
735 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], NULL,
736 argv[2], argv[3], NULL, NULL);
739 DEFUN (ip_route_mask_flags2_tag_vrf,
740 ip_route_mask_flags2_tag_vrf_cmd,
741 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
743 "Establish static routes\n"
744 "IP destination prefix\n"
745 "IP destination prefix mask\n"
746 "Emit an ICMP unreachable when matched\n"
747 "Silently discard pkts when matched\n"
748 "Set tag for this route\n"
752 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], NULL,
753 argv[2], argv[3], NULL, argv[4]);
756 /* Distance option value. */
757 DEFUN (ip_route_distance,
758 ip_route_distance_cmd,
759 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
761 "Establish static routes\n"
762 "IP destination prefix (e.g. 10.0.0.0/8)\n"
763 "IP gateway address\n"
764 "IP gateway interface name\n"
766 "Distance value for this route\n")
768 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
769 argv[1], NULL, NULL, argv[2], NULL);
772 DEFUN (ip_route_tag_distance,
773 ip_route_tag_distance_cmd,
774 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
776 "Establish static routes\n"
777 "IP destination prefix (e.g. 10.0.0.0/8)\n"
778 "IP gateway address\n"
779 "IP gateway interface name\n"
781 "Set tag for this route\n"
783 "Distance value for this route\n")
785 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
786 argv[1], NULL, argv[2], argv[3], NULL);
789 DEFUN (ip_route_tag_distance_vrf,
790 ip_route_tag_distance_vrf_cmd,
791 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>" VRF_CMD_STR,
793 "Establish static routes\n"
794 "IP destination prefix (e.g. 10.0.0.0/8)\n"
795 "IP gateway address\n"
796 "IP gateway interface name\n"
798 "Set tag for this route\n"
800 "Distance value for this route\n"
803 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
804 argv[1], NULL, argv[2], argv[3], argv[4]);
807 DEFUN (ip_route_flags_distance,
808 ip_route_flags_distance_cmd,
809 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
811 "Establish static routes\n"
812 "IP destination prefix (e.g. 10.0.0.0/8)\n"
813 "IP gateway address\n"
814 "IP gateway interface name\n"
815 "Emit an ICMP unreachable when matched\n"
816 "Silently discard pkts when matched\n"
817 "Distance value for this route\n")
819 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
820 argv[2], NULL, argv[3], NULL);
823 DEFUN (ip_route_flags_tag_distance,
824 ip_route_flags_tag_distance_cmd,
825 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
827 "Establish static routes\n"
828 "IP destination prefix (e.g. 10.0.0.0/8)\n"
829 "IP gateway address\n"
830 "IP gateway interface name\n"
831 "Emit an ICMP unreachable when matched\n"
832 "Silently discard pkts when matched\n"
833 "Set tag for this route\n"
835 "Distance value for this route\n")
837 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
838 argv[2], argv[3], argv[4], NULL);
841 DEFUN (ip_route_flags_tag_distance_vrf,
842 ip_route_flags_tag_distance_vrf_cmd,
843 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
845 "Establish static routes\n"
846 "IP destination prefix (e.g. 10.0.0.0/8)\n"
847 "IP gateway address\n"
848 "IP gateway interface name\n"
849 "Emit an ICMP unreachable when matched\n"
850 "Silently discard pkts when matched\n"
851 "Set tag for this route\n"
853 "Distance value for this route\n"
856 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL, argv[1],
857 argv[2], argv[3], argv[4], argv[5]);
860 DEFUN (ip_route_flags_distance2,
861 ip_route_flags_distance2_cmd,
862 "ip route A.B.C.D/M (reject|blackhole) <1-255>",
864 "Establish static routes\n"
865 "IP destination prefix (e.g. 10.0.0.0/8)\n"
866 "Emit an ICMP unreachable when matched\n"
867 "Silently discard pkts when matched\n"
868 "Distance value for this route\n")
870 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
871 NULL, argv[1], NULL, argv[2], NULL);
874 DEFUN (ip_route_flags_tag_distance2,
875 ip_route_flags_tag_distance2_cmd,
876 "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255>",
878 "Establish static routes\n"
879 "IP destination prefix (e.g. 10.0.0.0/8)\n"
880 "Emit an ICMP unreachable when matched\n"
881 "Silently discard pkts when matched\n"
882 "Set tag for this route\n"
884 "Distance value for this route\n")
886 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
887 NULL, argv[1], argv[2], argv[3], NULL);
890 DEFUN (ip_route_flags_tag_distance2_vrf,
891 ip_route_flags_tag_distance2_vrf_cmd,
892 "ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
894 "Establish static routes\n"
895 "IP destination prefix (e.g. 10.0.0.0/8)\n"
896 "Emit an ICMP unreachable when matched\n"
897 "Silently discard pkts when matched\n"
898 "Set tag for this route\n"
900 "Distance value for this route\n"
903 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
904 NULL, argv[1], argv[2], argv[3], argv[4]);
907 DEFUN (ip_route_mask_distance,
908 ip_route_mask_distance_cmd,
909 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
911 "Establish static routes\n"
912 "IP destination prefix\n"
913 "IP destination prefix mask\n"
914 "IP gateway address\n"
915 "IP gateway interface name\n"
917 "Distance value for this route\n")
919 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], argv[2],
920 NULL, NULL, argv[3], NULL);
923 DEFUN (ip_route_mask_tag_distance,
924 ip_route_mask_tag_distance_cmd,
925 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
927 "Establish static routes\n"
928 "IP destination prefix\n"
929 "IP destination prefix mask\n"
930 "IP gateway address\n"
931 "IP gateway interface name\n"
933 "Set tag for this route\n"
935 "Distance value for this route\n")
937 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
938 argv[2], NULL, argv[3], argv[4], NULL);
941 DEFUN (ip_route_mask_tag_distance_vrf,
942 ip_route_mask_tag_distance_vrf_cmd,
943 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>" VRF_CMD_STR,
945 "Establish static routes\n"
946 "IP destination prefix\n"
947 "IP destination prefix mask\n"
948 "IP gateway address\n"
949 "IP gateway interface name\n"
951 "Set tag for this route\n"
953 "Distance value for this route\n"
956 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
957 argv[2], NULL, argv[3], argv[4], argv[5]);
961 DEFUN (ip_route_mask_flags_tag_distance,
962 ip_route_mask_flags_tag_distance_cmd,
963 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
965 "Establish static routes\n"
966 "IP destination prefix\n"
967 "IP destination prefix mask\n"
968 "IP gateway address\n"
969 "IP gateway interface name\n"
970 "Set tag for this route\n"
972 "Distance value for this route\n"
973 "Emit an ICMP unreachable when matched\n"
974 "Silently discard pkts when matched\n")
976 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], argv[2],
977 argv[3], argv[4], argv[5], NULL);
980 DEFUN (ip_route_mask_flags_tag_distance_vrf,
981 ip_route_mask_flags_tag_distance_vrf_cmd,
982 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
984 "Establish static routes\n"
985 "IP destination prefix\n"
986 "IP destination prefix mask\n"
987 "IP gateway address\n"
988 "IP gateway interface name\n"
989 "Set tag for this route\n"
991 "Distance value for this route\n"
992 "Emit an ICMP unreachable when matched\n"
993 "Silently discard pkts when matched\n"
996 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], argv[2],
997 argv[3], argv[4], argv[5], argv[6]);
1000 DEFUN (ip_route_mask_flags_distance,
1001 ip_route_mask_flags_distance_cmd,
1002 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
1004 "Establish static routes\n"
1005 "IP destination prefix\n"
1006 "IP destination prefix mask\n"
1007 "IP gateway address\n"
1008 "IP gateway interface name\n"
1009 "Emit an ICMP unreachable when matched\n"
1010 "Silently discard pkts when matched\n"
1011 "Distance value for this route\n")
1013 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], argv[2],
1014 argv[3], NULL, argv[4], NULL);
1017 DEFUN (ip_route_mask_flags_distance2,
1018 ip_route_mask_flags_distance2_cmd,
1019 "ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255>",
1021 "Establish static routes\n"
1022 "IP destination prefix\n"
1023 "IP destination prefix mask\n"
1024 "Emit an ICMP unreachable when matched\n"
1025 "Silently discard pkts when matched\n"
1026 "Distance value for this route\n")
1028 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1029 NULL, argv[2], NULL, argv[3], NULL);
1032 DEFUN (ip_route_mask_flags_tag_distance2,
1033 ip_route_mask_flags_tag_distance2_cmd,
1034 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255>",
1036 "Establish static routes\n"
1037 "IP destination prefix\n"
1038 "IP destination prefix mask\n"
1039 "Set tag for this route\n"
1041 "Distance value for this route\n"
1042 "Emit an ICMP unreachable when matched\n"
1043 "Silently discard pkts when matched\n")
1045 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], NULL,
1046 argv[2], argv[3], argv[4], NULL);
1049 DEFUN (ip_route_mask_flags_tag_distance2_vrf,
1050 ip_route_mask_flags_tag_distance2_vrf_cmd,
1051 "ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
1053 "Establish static routes\n"
1054 "IP destination prefix\n"
1055 "IP destination prefix mask\n"
1056 "Set tag for this route\n"
1058 "Distance value for this route\n"
1059 "Emit an ICMP unreachable when matched\n"
1060 "Silently discard pkts when matched\n"
1063 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1], NULL,
1064 argv[2], argv[3], argv[4], argv[5]);
1069 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0)",
1072 "Establish static routes\n"
1073 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1074 "IP gateway address\n"
1075 "IP gateway interface name\n"
1078 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL,
1079 argv[1], NULL, NULL, NULL, NULL);
1082 DEFUN (no_ip_route_tag,
1083 no_ip_route_tag_cmd,
1084 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
1087 "Establish static routes\n"
1088 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1089 "IP gateway address\n"
1090 "IP gateway interface name\n"
1092 "Tag of this route\n"
1095 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1096 NULL, argv[2], NULL, NULL);
1099 DEFUN (no_ip_route_tag_vrf,
1100 no_ip_route_tag_vrf_cmd,
1101 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295>" VRF_CMD_STR,
1104 "Establish static routes\n"
1105 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1106 "IP gateway address\n"
1107 "IP gateway interface name\n"
1109 "Tag of this route\n"
1113 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1114 NULL, argv[2], NULL, argv[3]);
1118 no_ip_route_flags_cmd,
1119 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
1122 "Establish static routes\n"
1123 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1124 "IP gateway address\n"
1125 "IP gateway interface name\n"
1126 "Emit an ICMP unreachable when matched\n"
1127 "Silently discard pkts when matched\n")
1129 ALIAS (no_ip_route_tag,
1130 no_ip_route_flags_tag_cmd,
1131 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
1134 "Establish static routes\n"
1135 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1136 "IP gateway address\n"
1137 "IP gateway interface name\n"
1138 "Emit an ICMP unreachable when matched\n"
1139 "Silently discard pkts when matched\n"
1140 "Tag of this route\n"
1143 DEFUN (no_ip_route_flags2,
1144 no_ip_route_flags2_cmd,
1145 "no ip route A.B.C.D/M (reject|blackhole)",
1148 "Establish static routes\n"
1149 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1150 "Emit an ICMP unreachable when matched\n"
1151 "Silently discard pkts when matched\n")
1153 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL,
1154 NULL, NULL, NULL, NULL, NULL);
1157 DEFUN (no_ip_route_flags2_tag,
1158 no_ip_route_flags2_tag_cmd,
1159 "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295>",
1162 "Establish static routes\n"
1163 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1164 "Emit an ICMP unreachable when matched\n"
1165 "Silently discard pkts when matched\n"
1166 "Tag of this route\n"
1169 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, NULL,
1170 NULL, argv[1], NULL, NULL);
1173 DEFUN (no_ip_route_flags2_tag_vrf,
1174 no_ip_route_flags2_tag_vrf_cmd,
1175 "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
1178 "Establish static routes\n"
1179 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1180 "Emit an ICMP unreachable when matched\n"
1181 "Silently discard pkts when matched\n"
1182 "Tag of this route\n"
1186 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, NULL,
1187 NULL, argv[1], NULL, argv[2]);
1190 DEFUN (no_ip_route_mask,
1191 no_ip_route_mask_cmd,
1192 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0)",
1195 "Establish static routes\n"
1196 "IP destination prefix\n"
1197 "IP destination prefix mask\n"
1198 "IP gateway address\n"
1199 "IP gateway interface name\n"
1202 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1203 argv[2], NULL, NULL, NULL, NULL);
1206 DEFUN (no_ip_route_mask_tag,
1207 no_ip_route_mask_tag_cmd,
1208 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295>",
1211 "Establish static routes\n"
1212 "IP destination prefix\n"
1213 "IP destination prefix mask\n"
1214 "IP gateway address\n"
1215 "IP gateway interface name\n"
1217 "Tag of this route\n"
1220 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], argv[2],
1221 NULL, argv[3], NULL, NULL);
1224 ALIAS (no_ip_route_mask,
1225 no_ip_route_mask_flags_cmd,
1226 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
1229 "Establish static routes\n"
1230 "IP destination prefix\n"
1231 "IP destination prefix mask\n"
1232 "IP gateway address\n"
1233 "IP gateway interface name\n"
1234 "Emit an ICMP unreachable when matched\n"
1235 "Silently discard pkts when matched\n")
1237 ALIAS (no_ip_route_mask_tag,
1238 no_ip_route_mask_flags_tag_cmd,
1239 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295>",
1242 "Establish static routes\n"
1243 "IP destination prefix\n"
1244 "IP destination prefix mask\n"
1245 "IP gateway address\n"
1246 "IP gateway interface name\n"
1247 "Emit an ICMP unreachable when matched\n"
1248 "Silently discard pkts when matched\n"
1249 "Tag of this route\n"
1252 DEFUN (no_ip_route_mask_flags2,
1253 no_ip_route_mask_flags2_cmd,
1254 "no ip route A.B.C.D A.B.C.D (reject|blackhole)",
1257 "Establish static routes\n"
1258 "IP destination prefix\n"
1259 "IP destination prefix mask\n"
1260 "Emit an ICMP unreachable when matched\n"
1261 "Silently discard pkts when matched\n")
1263 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1264 NULL, NULL, NULL, NULL, NULL);
1267 DEFUN (no_ip_route_mask_flags2_tag,
1268 no_ip_route_mask_flags2_tag_cmd,
1269 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295>",
1272 "Establish static routes\n"
1273 "IP destination prefix\n"
1274 "IP destination prefix mask\n"
1275 "Emit an ICMP unreachable when matched\n"
1276 "Silently discard pkts when matched\n"
1277 "Tag of this route\n"
1280 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1281 NULL, NULL, argv[2], NULL, NULL);
1284 DEFUN (no_ip_route_mask_flags2_tag_vrf,
1285 no_ip_route_mask_flags2_tag_vrf_cmd,
1286 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
1289 "Establish static routes\n"
1290 "IP destination prefix\n"
1291 "IP destination prefix mask\n"
1292 "Emit an ICMP unreachable when matched\n"
1293 "Silently discard pkts when matched\n"
1294 "Tag of this route\n"
1298 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1299 NULL, NULL, argv[2], NULL, argv[3]);
1302 DEFUN (no_ip_route_distance,
1303 no_ip_route_distance_cmd,
1304 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255>",
1307 "Establish static routes\n"
1308 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1309 "IP gateway address\n"
1310 "IP gateway interface name\n"
1312 "Distance value for this route\n")
1314 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL,
1315 argv[1], NULL, NULL, argv[2], NULL);
1318 DEFUN (no_ip_route_tag_distance,
1319 no_ip_route_tag_distance_cmd,
1320 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
1323 "Establish static routes\n"
1324 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1325 "IP gateway address\n"
1326 "IP gateway interface name\n"
1328 "Tag of this route\n"
1330 "Distance value for this route\n")
1332 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1333 NULL, argv[2], argv[3], NULL);
1336 DEFUN (no_ip_route_tag_distance_vrf,
1337 no_ip_route_tag_distance_vrf_cmd,
1338 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>" VRF_CMD_STR,
1341 "Establish static routes\n"
1342 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1343 "IP gateway address\n"
1344 "IP gateway interface name\n"
1346 "Tag of this route\n"
1348 "Distance value for this route\n"
1351 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1352 NULL, argv[2], argv[3], argv[4]);
1355 DEFUN (no_ip_route_flags_distance,
1356 no_ip_route_flags_distance_cmd,
1357 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
1360 "Establish static routes\n"
1361 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1362 "IP gateway address\n"
1363 "IP gateway interface name\n"
1364 "Emit an ICMP unreachable when matched\n"
1365 "Silently discard pkts when matched\n"
1366 "Distance value for this route\n")
1368 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL,
1369 argv[1], argv[2], NULL, argv[3], NULL);
1372 DEFUN (no_ip_route_flags_tag_distance,
1373 no_ip_route_flags_tag_distance_cmd,
1374 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
1377 "Establish static routes\n"
1378 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1379 "IP gateway address\n"
1380 "IP gateway interface name\n"
1381 "Emit an ICMP unreachable when matched\n"
1382 "Silently discard pkts when matched\n"
1383 "Tag of this route\n"
1385 "Distance value for this route\n")
1387 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1388 argv[2], argv[3], argv[4], NULL);
1391 DEFUN (no_ip_route_flags_tag_distance_vrf,
1392 no_ip_route_flags_tag_distance_vrf_cmd,
1393 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
1396 "Establish static routes\n"
1397 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1398 "IP gateway address\n"
1399 "IP gateway interface name\n"
1400 "Emit an ICMP unreachable when matched\n"
1401 "Silently discard pkts when matched\n"
1402 "Tag of this route\n"
1404 "Distance value for this route\n"
1407 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1408 argv[2], argv[3], argv[4], argv[5]);
1411 DEFUN (no_ip_route_flags_distance2,
1412 no_ip_route_flags_distance2_cmd,
1413 "no ip route A.B.C.D/M (reject|blackhole) <1-255>",
1416 "Establish static routes\n"
1417 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1418 "Emit an ICMP unreachable when matched\n"
1419 "Silently discard pkts when matched\n"
1420 "Distance value for this route\n")
1422 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, NULL,
1423 argv[1], NULL, argv[2], NULL);
1426 DEFUN (no_ip_route_flags_tag_distance2,
1427 no_ip_route_flags_tag_distance2_cmd,
1428 "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255>",
1431 "Establish static routes\n"
1432 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1433 "Emit an ICMP unreachable when matched\n"
1434 "Silently discard pkts when matched\n"
1435 "Tag of this route\n"
1437 "Distance value for this route\n")
1439 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, NULL,
1440 argv[1], argv[2] , argv[3], NULL);
1443 DEFUN (no_ip_route_flags_tag_distance2_vrf,
1444 no_ip_route_flags_tag_distance2_vrf_cmd,
1445 "no ip route A.B.C.D/M (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
1448 "Establish static routes\n"
1449 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1450 "Emit an ICMP unreachable when matched\n"
1451 "Silently discard pkts when matched\n"
1452 "Tag of this route\n"
1454 "Distance value for this route\n"
1457 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, NULL,
1458 argv[1], argv[2] , argv[3], argv[4]);
1461 DEFUN (no_ip_route_mask_distance,
1462 no_ip_route_mask_distance_cmd,
1463 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
1466 "Establish static routes\n"
1467 "IP destination prefix\n"
1468 "IP destination prefix mask\n"
1469 "IP gateway address\n"
1470 "IP gateway interface name\n"
1472 "Distance value for this route\n")
1474 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1475 argv[2], NULL, NULL, argv[3], NULL);
1478 DEFUN (no_ip_route_mask_tag_distance,
1479 no_ip_route_mask_tag_distance_cmd,
1480 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>",
1483 "Establish static routes\n"
1484 "IP destination prefix\n"
1485 "IP destination prefix mask\n"
1486 "IP gateway address\n"
1487 "IP gateway interface name\n"
1489 "Tag of this route\n"
1491 "Distance value for this route\n")
1493 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1494 argv[2], NULL, argv[3], argv[4], NULL);
1497 DEFUN (no_ip_route_mask_tag_distance_vrf,
1498 no_ip_route_mask_tag_distance_vrf_cmd,
1499 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-4294967295> <1-255>" VRF_CMD_STR,
1502 "Establish static routes\n"
1503 "IP destination prefix\n"
1504 "IP destination prefix mask\n"
1505 "IP gateway address\n"
1506 "IP gateway interface name\n"
1508 "Tag of this route\n"
1510 "Distance value for this route\n"
1513 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1514 argv[2], NULL, argv[3], argv[4], argv[5]);
1517 DEFUN (no_ip_route_mask_flags_distance,
1518 no_ip_route_mask_flags_distance_cmd,
1519 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255>",
1522 "Establish static routes\n"
1523 "IP destination prefix\n"
1524 "IP destination prefix mask\n"
1525 "IP gateway address\n"
1526 "IP gateway interface name\n"
1527 "Emit an ICMP unreachable when matched\n"
1528 "Silently discard pkts when matched\n"
1529 "Distance value for this route\n")
1531 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1532 argv[2], argv[3], NULL, argv[4], NULL);
1535 DEFUN (no_ip_route_mask_flags_tag_distance,
1536 no_ip_route_mask_flags_tag_distance_cmd,
1537 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
1540 "Establish static routes\n"
1541 "IP destination prefix\n"
1542 "IP destination prefix mask\n"
1543 "IP gateway address\n"
1544 "IP gateway interface name\n"
1545 "Emit an ICMP unreachable when matched\n"
1546 "Silently discard pkts when matched\n"
1547 "Tag of this route\n"
1549 "Distance value for this route\n")
1551 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], argv[2], argv[3],
1552 argv[4], argv[5], NULL);
1555 DEFUN (no_ip_route_mask_flags_tag_distance_vrf,
1556 no_ip_route_mask_flags_tag_distance_vrf_cmd,
1557 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
1560 "Establish static routes\n"
1561 "IP destination prefix\n"
1562 "IP destination prefix mask\n"
1563 "IP gateway address\n"
1564 "IP gateway interface name\n"
1565 "Emit an ICMP unreachable when matched\n"
1566 "Silently discard pkts when matched\n"
1567 "Tag of this route\n"
1569 "Distance value for this route\n"
1572 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], argv[2], argv[3],
1573 argv[4], argv[5], argv[6]);
1576 DEFUN (no_ip_route_mask_flags_distance2,
1577 no_ip_route_mask_flags_distance2_cmd,
1578 "no ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255>",
1581 "Establish static routes\n"
1582 "IP destination prefix\n"
1583 "IP destination prefix mask\n"
1584 "Emit an ICMP unreachable when matched\n"
1585 "Silently discard pkts when matched\n"
1586 "Distance value for this route\n")
1588 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1589 NULL, argv[2], NULL, argv[3], NULL);
1592 DEFUN (ip_route_vrf,
1594 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR,
1596 "Establish static routes\n"
1597 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1598 "IP gateway address\n"
1599 "IP gateway interface name\n"
1603 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
1604 argv[1], NULL, NULL, NULL, argv[2]);
1607 DEFUN (ip_route_flags_vrf,
1608 ip_route_flags_vrf_cmd,
1609 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
1611 "Establish static routes\n"
1612 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1613 "IP gateway address\n"
1614 "IP gateway interface name\n"
1615 "Emit an ICMP unreachable when matched\n"
1616 "Silently discard pkts when matched\n"
1619 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
1620 argv[1], argv[2], NULL, NULL, argv[3]);
1623 DEFUN (ip_route_flags2_vrf,
1624 ip_route_flags2_vrf_cmd,
1625 "ip route A.B.C.D/M (reject|blackhole) " VRF_CMD_STR,
1627 "Establish static routes\n"
1628 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1629 "Emit an ICMP unreachable when matched\n"
1630 "Silently discard pkts when matched\n"
1633 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
1634 NULL, argv[1], NULL, NULL, argv[2]);
1637 /* Mask as A.B.C.D format. */
1638 DEFUN (ip_route_mask_vrf,
1639 ip_route_mask_vrf_cmd,
1640 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR,
1642 "Establish static routes\n"
1643 "IP destination prefix\n"
1644 "IP destination prefix mask\n"
1645 "IP gateway address\n"
1646 "IP gateway interface name\n"
1650 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1651 argv[2], NULL, NULL, NULL, argv[3]);
1654 DEFUN (ip_route_mask_flags_vrf,
1655 ip_route_mask_flags_vrf_cmd,
1656 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
1658 "Establish static routes\n"
1659 "IP destination prefix\n"
1660 "IP destination prefix mask\n"
1661 "IP gateway address\n"
1662 "IP gateway interface name\n"
1663 "Emit an ICMP unreachable when matched\n"
1664 "Silently discard pkts when matched\n"
1667 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1668 argv[2], argv[3], NULL, NULL, argv[4]);
1671 DEFUN (ip_route_mask_flags2_vrf,
1672 ip_route_mask_flags2_vrf_cmd,
1673 "ip route A.B.C.D A.B.C.D (reject|blackhole) " VRF_CMD_STR,
1675 "Establish static routes\n"
1676 "IP destination prefix\n"
1677 "IP destination prefix mask\n"
1678 "Emit an ICMP unreachable when matched\n"
1679 "Silently discard pkts when matched\n"
1682 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1683 NULL, argv[2], NULL, NULL, argv[3]);
1686 /* Distance option value. */
1687 DEFUN (ip_route_distance_vrf,
1688 ip_route_distance_vrf_cmd,
1689 "ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR,
1691 "Establish static routes\n"
1692 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1693 "IP gateway address\n"
1694 "IP gateway interface name\n"
1696 "Distance value for this route\n"
1699 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
1700 argv[1], NULL, NULL, argv[2], argv[3]);
1703 DEFUN (ip_route_flags_distance_vrf,
1704 ip_route_flags_distance_vrf_cmd,
1705 "ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR,
1707 "Establish static routes\n"
1708 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1709 "IP gateway address\n"
1710 "IP gateway interface name\n"
1711 "Emit an ICMP unreachable when matched\n"
1712 "Silently discard pkts when matched\n"
1713 "Distance value for this route\n"
1716 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
1717 argv[1], argv[2], NULL, argv[3], argv[4]);
1720 DEFUN (ip_route_flags_distance2_vrf,
1721 ip_route_flags_distance2_vrf_cmd,
1722 "ip route A.B.C.D/M (reject|blackhole) <1-255> " VRF_CMD_STR,
1724 "Establish static routes\n"
1725 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1726 "Emit an ICMP unreachable when matched\n"
1727 "Silently discard pkts when matched\n"
1728 "Distance value for this route\n"
1731 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], NULL,
1732 NULL, argv[1], NULL, argv[2], argv[3]);
1735 DEFUN (ip_route_mask_distance_vrf,
1736 ip_route_mask_distance_vrf_cmd,
1737 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR,
1739 "Establish static routes\n"
1740 "IP destination prefix\n"
1741 "IP destination prefix mask\n"
1742 "IP gateway address\n"
1743 "IP gateway interface name\n"
1745 "Distance value for this route\n"
1748 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1749 argv[2], NULL, NULL, argv[3], argv[4]);
1752 DEFUN (ip_route_mask_flags_distance_vrf,
1753 ip_route_mask_flags_distance_vrf_cmd,
1754 "ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR,
1756 "Establish static routes\n"
1757 "IP destination prefix\n"
1758 "IP destination prefix mask\n"
1759 "IP gateway address\n"
1760 "IP gateway interface name\n"
1761 "Emit an ICMP unreachable when matched\n"
1762 "Silently discard pkts when matched\n"
1763 "Distance value for this route\n"
1766 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1767 argv[2], argv[3], NULL, argv[4], argv[5]);
1770 DEFUN (ip_route_mask_flags_distance2_vrf,
1771 ip_route_mask_flags_distance2_vrf_cmd,
1772 "ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255> " VRF_CMD_STR,
1774 "Establish static routes\n"
1775 "IP destination prefix\n"
1776 "IP destination prefix mask\n"
1777 "Emit an ICMP unreachable when matched\n"
1778 "Silently discard pkts when matched\n"
1779 "Distance value for this route\n"
1782 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 1, argv[0], argv[1],
1783 NULL, argv[2], NULL, argv[3], argv[4]);
1786 DEFUN (no_ip_route_vrf,
1787 no_ip_route_vrf_cmd,
1788 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR,
1791 "Establish static routes\n"
1792 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1793 "IP gateway address\n"
1794 "IP gateway interface name\n"
1798 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0],
1799 NULL, argv[1], NULL, NULL, NULL,
1800 (argc > 3) ? argv[3] : argv[2]);
1803 ALIAS (no_ip_route_vrf,
1804 no_ip_route_flags_vrf_cmd,
1805 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
1808 "Establish static routes\n"
1809 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1810 "IP gateway address\n"
1811 "IP gateway interface name\n"
1812 "Emit an ICMP unreachable when matched\n"
1813 "Silently discard pkts when matched\n"
1816 DEFUN (no_ip_route_flags2_vrf,
1817 no_ip_route_flags2_vrf_cmd,
1818 "no ip route A.B.C.D/M (reject|blackhole) " VRF_CMD_STR,
1821 "Establish static routes\n"
1822 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1823 "Emit an ICMP unreachable when matched\n"
1824 "Silently discard pkts when matched\n"
1827 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0],
1828 NULL, NULL, NULL, NULL, NULL, argv[2]);
1831 DEFUN (no_ip_route_mask_vrf,
1832 no_ip_route_mask_vrf_cmd,
1833 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) " VRF_CMD_STR,
1836 "Establish static routes\n"
1837 "IP destination prefix\n"
1838 "IP destination prefix mask\n"
1839 "IP gateway address\n"
1840 "IP gateway interface name\n"
1844 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1845 argv[2], NULL, NULL, NULL,
1846 (argc > 4) ? argv[4] : argv[3]);
1849 ALIAS (no_ip_route_mask_vrf,
1850 no_ip_route_mask_flags_vrf_cmd,
1851 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
1854 "Establish static routes\n"
1855 "IP destination prefix\n"
1856 "IP destination prefix mask\n"
1857 "IP gateway address\n"
1858 "IP gateway interface name\n"
1859 "Emit an ICMP unreachable when matched\n"
1860 "Silently discard pkts when matched\n"
1863 DEFUN (no_ip_route_mask_flags2_vrf,
1864 no_ip_route_mask_flags2_vrf_cmd,
1865 "no ip route A.B.C.D A.B.C.D (reject|blackhole) " VRF_CMD_STR,
1868 "Establish static routes\n"
1869 "IP destination prefix\n"
1870 "IP destination prefix mask\n"
1871 "Emit an ICMP unreachable when matched\n"
1872 "Silently discard pkts when matched\n"
1875 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1876 NULL, NULL, NULL, NULL, argv[2]);
1879 DEFUN (no_ip_route_distance_vrf,
1880 no_ip_route_distance_vrf_cmd,
1881 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR,
1884 "Establish static routes\n"
1885 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1886 "IP gateway address\n"
1887 "IP gateway interface name\n"
1889 "Distance value for this route\n"
1892 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL,
1893 argv[1], NULL, NULL, argv[2], argv[3]);
1896 DEFUN (no_ip_route_flags_distance_vrf,
1897 no_ip_route_flags_distance_vrf_cmd,
1898 "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR,
1901 "Establish static routes\n"
1902 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1903 "IP gateway address\n"
1904 "IP gateway interface name\n"
1905 "Emit an ICMP unreachable when matched\n"
1906 "Silently discard pkts when matched\n"
1907 "Distance value for this route\n"
1910 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, argv[1],
1911 argv[2], NULL, argv[3], argv[4]);
1914 DEFUN (no_ip_route_flags_distance2_vrf,
1915 no_ip_route_flags_distance2_vrf_cmd,
1916 "no ip route A.B.C.D/M (reject|blackhole) <1-255> " VRF_CMD_STR,
1919 "Establish static routes\n"
1920 "IP destination prefix (e.g. 10.0.0.0/8)\n"
1921 "Emit an ICMP unreachable when matched\n"
1922 "Silently discard pkts when matched\n"
1923 "Distance value for this route\n"
1926 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], NULL, NULL,
1927 argv[1], NULL, argv[2], argv[3]);
1930 DEFUN (no_ip_route_mask_distance_vrf,
1931 no_ip_route_mask_distance_vrf_cmd,
1932 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255> " VRF_CMD_STR,
1935 "Establish static routes\n"
1936 "IP destination prefix\n"
1937 "IP destination prefix mask\n"
1938 "IP gateway address\n"
1939 "IP gateway interface name\n"
1941 "Distance value for this route\n"
1944 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1],
1945 argv[2], NULL, NULL, argv[3], argv[4]);
1948 DEFUN (no_ip_route_mask_flags_distance_vrf,
1949 no_ip_route_mask_flags_distance_vrf_cmd,
1950 "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR,
1953 "Establish static routes\n"
1954 "IP destination prefix\n"
1955 "IP destination prefix mask\n"
1956 "IP gateway address\n"
1957 "IP gateway interface name\n"
1958 "Emit an ICMP unreachable when matched\n"
1959 "Silently discard pkts when matched\n"
1960 "Distance value for this route\n"
1963 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], argv[2],
1964 argv[3], NULL, argv[4], argv[5]);
1967 DEFUN (no_ip_route_mask_flags_distance2_vrf,
1968 no_ip_route_mask_flags_distance2_vrf_cmd,
1969 "no ip route A.B.C.D A.B.C.D (reject|blackhole) <1-255> " VRF_CMD_STR,
1972 "Establish static routes\n"
1973 "IP destination prefix\n"
1974 "IP destination prefix mask\n"
1975 "Emit an ICMP unreachable when matched\n"
1976 "Silently discard pkts when matched\n"
1977 "Distance value for this route\n"
1980 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], NULL,
1981 argv[2], NULL, argv[3], argv[4]);
1984 DEFUN (no_ip_route_mask_flags_tag_distance2,
1985 no_ip_route_mask_flags_tag_distance2_cmd,
1986 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255>",
1989 "Establish static routes\n"
1990 "IP destination prefix\n"
1991 "IP destination prefix mask\n"
1992 "Emit an ICMP unreachable when matched\n"
1993 "Silently discard pkts when matched\n"
1994 "Tag of this route\n"
1996 "Distance value for this route\n")
1998 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], NULL,
1999 argv[2], argv[3], argv[4], NULL);
2002 DEFUN (no_ip_route_mask_flags_tag_distance2_vrf,
2003 no_ip_route_mask_flags_tag_distance2_vrf_cmd,
2004 "no ip route A.B.C.D A.B.C.D (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
2007 "Establish static routes\n"
2008 "IP destination prefix\n"
2009 "IP destination prefix mask\n"
2010 "Emit an ICMP unreachable when matched\n"
2011 "Silently discard pkts when matched\n"
2012 "Tag of this route\n"
2014 "Distance value for this route\n"
2017 return zebra_static_ipv4_safi (vty, SAFI_UNICAST, 0, argv[0], argv[1], NULL,
2018 argv[2], argv[3], argv[4], argv[5]);
2021 char *proto_rm[AFI_MAX][ZEBRA_ROUTE_MAX+1]; /* "any" == ZEBRA_ROUTE_MAX */
2025 "ip protocol PROTO route-map ROUTE-MAP",
2027 "Apply route map to PROTO\n"
2033 if (strcasecmp(argv[0], "any") == 0)
2034 i = ZEBRA_ROUTE_MAX;
2036 i = proto_name2num(argv[0]);
2039 vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
2043 if (proto_rm[AFI_IP][i])
2044 XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
2045 proto_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
2049 DEFUN (no_ip_protocol,
2051 "no ip protocol PROTO",
2053 "Remove route map from PROTO\n"
2058 if (strcasecmp(argv[0], "any") == 0)
2059 i = ZEBRA_ROUTE_MAX;
2061 i = proto_name2num(argv[0]);
2064 vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
2068 if (proto_rm[AFI_IP][i])
2069 XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
2070 proto_rm[AFI_IP][i] = NULL;
2074 /* New RIB. Detailed information for IPv4 route. */
2076 vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
2079 struct nexthop *nexthop, *tnexthop;
2081 char buf[PREFIX_STRLEN];
2083 RNODE_FOREACH_RIB (rn, rib)
2085 const char *mcast_info = "";
2088 rib_table_info_t *info = rn->table->info;
2089 mcast_info = (info->safi == SAFI_MULTICAST)
2090 ? " using Multicast RIB"
2091 : " using Unicast RIB";
2093 vty_out (vty, "Routing entry for %s%s%s",
2094 prefix2str (&rn->p, buf, sizeof(buf)), mcast_info,
2096 vty_out (vty, " Known via \"%s\"", zebra_route_string (rib->type));
2097 vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
2099 vty_out (vty, ", mtu %u", rib->mtu);
2100 vty_out (vty, ", tag %d", rib->tag);
2101 vty_out (vty, ", vrf %u", rib->vrf_id);
2102 if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
2103 vty_out (vty, ", best");
2104 if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_FIB_OVERRIDE))
2105 vty_out (vty, ", fib-override");
2106 if (CHECK_FLAG (rib->status, RIB_ENTRY_SELECTED_FIB))
2107 vty_out (vty, ", fib");
2109 vty_out (vty, ", refcnt %ld", rib->refcnt);
2110 if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
2111 vty_out (vty, ", blackhole");
2112 if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
2113 vty_out (vty, ", reject");
2114 vty_out (vty, "%s", VTY_NEWLINE);
2116 #define ONE_DAY_SECOND 60*60*24
2117 #define ONE_WEEK_SECOND 60*60*24*7
2118 if (rib->type == ZEBRA_ROUTE_RIP
2119 || rib->type == ZEBRA_ROUTE_RIPNG
2120 || rib->type == ZEBRA_ROUTE_OSPF
2121 || rib->type == ZEBRA_ROUTE_OSPF6
2122 || rib->type == ZEBRA_ROUTE_BABEL
2123 || rib->type == ZEBRA_ROUTE_ISIS
2124 || rib->type == ZEBRA_ROUTE_NHRP
2125 || rib->type == ZEBRA_ROUTE_BGP)
2130 uptime = time (NULL);
2131 uptime -= rib->uptime;
2132 tm = gmtime (&uptime);
2134 vty_out (vty, " Last update ");
2136 if (uptime < ONE_DAY_SECOND)
2137 vty_out (vty, "%02d:%02d:%02d",
2138 tm->tm_hour, tm->tm_min, tm->tm_sec);
2139 else if (uptime < ONE_WEEK_SECOND)
2140 vty_out (vty, "%dd%02dh%02dm",
2141 tm->tm_yday, tm->tm_hour, tm->tm_min);
2143 vty_out (vty, "%02dw%dd%02dh",
2145 tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
2146 vty_out (vty, " ago%s", VTY_NEWLINE);
2149 for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
2151 vty_out (vty, " %c%c%s",
2152 CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE) ? '>' : ' ',
2153 CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) ? '*' : ' ',
2154 recursing ? " " : "");
2156 switch (nexthop->type)
2158 case NEXTHOP_TYPE_IPV4:
2159 case NEXTHOP_TYPE_IPV4_IFINDEX:
2160 vty_out (vty, " %s", inet_ntoa (nexthop->gate.ipv4));
2161 if (nexthop->ifindex)
2162 vty_out (vty, ", via %s",
2163 ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
2165 case NEXTHOP_TYPE_IPV6:
2166 case NEXTHOP_TYPE_IPV6_IFINDEX:
2167 case NEXTHOP_TYPE_IPV6_IFNAME:
2168 vty_out (vty, " %s",
2169 inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, sizeof(buf)));
2170 if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
2171 vty_out (vty, ", %s", nexthop->ifname);
2172 else if (nexthop->ifindex)
2173 vty_out (vty, ", via %s",
2174 ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
2176 case NEXTHOP_TYPE_IFINDEX:
2177 vty_out (vty, " directly connected, %s",
2178 ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
2180 case NEXTHOP_TYPE_IFNAME:
2181 vty_out (vty, " directly connected, %s", nexthop->ifname);
2183 case NEXTHOP_TYPE_BLACKHOLE:
2184 vty_out (vty, " directly connected, Null0");
2189 if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
2190 vty_out (vty, " inactive");
2192 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ONLINK))
2193 vty_out (vty, " onlink");
2195 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
2196 vty_out (vty, " (recursive)");
2198 switch (nexthop->type)
2200 case NEXTHOP_TYPE_IPV4:
2201 case NEXTHOP_TYPE_IPV4_IFINDEX:
2202 case NEXTHOP_TYPE_IPV4_IFNAME:
2203 if (nexthop->src.ipv4.s_addr)
2205 if (inet_ntop(AF_INET, &nexthop->src.ipv4, buf, sizeof buf))
2206 vty_out (vty, ", src %s", buf);
2210 case NEXTHOP_TYPE_IPV6:
2211 case NEXTHOP_TYPE_IPV6_IFINDEX:
2212 case NEXTHOP_TYPE_IPV6_IFNAME:
2213 if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any))
2215 if (inet_ntop(AF_INET6, &nexthop->src.ipv6, buf, sizeof buf))
2216 vty_out (vty, ", src %s", buf);
2219 #endif /* HAVE_IPV6 */
2223 vty_out (vty, "%s", VTY_NEWLINE);
2225 vty_out (vty, "%s", VTY_NEWLINE);
2230 vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
2232 struct nexthop *nexthop, *tnexthop;
2237 /* Nexthop information. */
2238 for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
2240 if (nexthop == rib->nexthop)
2242 /* Prefix information. */
2243 len = vty_out (vty, "%c%c%c %s",
2244 zebra_route_char (rib->type),
2245 CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED)
2247 CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
2249 prefix2str (&rn->p, buf, sizeof buf));
2251 /* Distance and metric display. */
2252 if (rib->type != ZEBRA_ROUTE_CONNECT
2253 && rib->type != ZEBRA_ROUTE_KERNEL)
2254 len += vty_out (vty, " [%d/%d]", rib->distance,
2257 if (rib->vrf_id != VRF_DEFAULT)
2258 len += vty_out (vty, " [vrf %u]", rib->vrf_id);
2261 vty_out (vty, " %c%*c",
2262 CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
2264 len - 3 + (2 * recursing), ' ');
2266 switch (nexthop->type)
2268 case NEXTHOP_TYPE_IPV4:
2269 case NEXTHOP_TYPE_IPV4_IFINDEX:
2270 vty_out (vty, " via %s", inet_ntoa (nexthop->gate.ipv4));
2271 if (nexthop->ifindex)
2272 vty_out (vty, ", %s",
2273 ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
2275 case NEXTHOP_TYPE_IPV6:
2276 case NEXTHOP_TYPE_IPV6_IFINDEX:
2277 case NEXTHOP_TYPE_IPV6_IFNAME:
2278 vty_out (vty, " via %s",
2279 inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
2280 if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
2281 vty_out (vty, ", %s", nexthop->ifname);
2282 else if (nexthop->ifindex)
2283 vty_out (vty, ", %s",
2284 ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
2286 case NEXTHOP_TYPE_IFINDEX:
2287 vty_out (vty, " is directly connected, %s",
2288 ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
2290 case NEXTHOP_TYPE_IFNAME:
2291 vty_out (vty, " is directly connected, %s", nexthop->ifname);
2293 case NEXTHOP_TYPE_BLACKHOLE:
2294 vty_out (vty, " is directly connected, Null0");
2299 if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
2300 vty_out (vty, " inactive");
2302 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ONLINK))
2303 vty_out (vty, " onlink");
2305 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
2306 vty_out (vty, " (recursive)");
2308 switch (nexthop->type)
2310 case NEXTHOP_TYPE_IPV4:
2311 case NEXTHOP_TYPE_IPV4_IFINDEX:
2312 case NEXTHOP_TYPE_IPV4_IFNAME:
2313 if (nexthop->src.ipv4.s_addr)
2315 if (inet_ntop(AF_INET, &nexthop->src.ipv4, buf, sizeof buf))
2316 vty_out (vty, ", src %s", buf);
2320 case NEXTHOP_TYPE_IPV6:
2321 case NEXTHOP_TYPE_IPV6_IFINDEX:
2322 case NEXTHOP_TYPE_IPV6_IFNAME:
2323 if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any))
2325 if (inet_ntop(AF_INET6, &nexthop->src.ipv6, buf, sizeof buf))
2326 vty_out (vty, ", src %s", buf);
2329 #endif /* HAVE_IPV6 */
2334 if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
2335 vty_out (vty, ", bh");
2336 if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
2337 vty_out (vty, ", rej");
2339 if (rib->type == ZEBRA_ROUTE_RIP
2340 || rib->type == ZEBRA_ROUTE_RIPNG
2341 || rib->type == ZEBRA_ROUTE_OSPF
2342 || rib->type == ZEBRA_ROUTE_OSPF6
2343 || rib->type == ZEBRA_ROUTE_BABEL
2344 || rib->type == ZEBRA_ROUTE_ISIS
2345 || rib->type == ZEBRA_ROUTE_NHRP
2346 || rib->type == ZEBRA_ROUTE_BGP)
2351 uptime = time (NULL);
2352 uptime -= rib->uptime;
2353 tm = gmtime (&uptime);
2355 #define ONE_DAY_SECOND 60*60*24
2356 #define ONE_WEEK_SECOND 60*60*24*7
2358 if (uptime < ONE_DAY_SECOND)
2359 vty_out (vty, ", %02d:%02d:%02d",
2360 tm->tm_hour, tm->tm_min, tm->tm_sec);
2361 else if (uptime < ONE_WEEK_SECOND)
2362 vty_out (vty, ", %dd%02dh%02dm",
2363 tm->tm_yday, tm->tm_hour, tm->tm_min);
2365 vty_out (vty, ", %02dw%dd%02dh",
2367 tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour);
2369 vty_out (vty, "%s", VTY_NEWLINE);
2373 DEFUN (show_ip_route,
2378 "IP routing table\n")
2380 vrf_id_t vrf_id = VRF_DEFAULT;
2383 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
2385 return do_show_ip_route(vty, SAFI_UNICAST, vrf_id);
2388 static int do_show_ip_route(struct vty *vty, safi_t safi, vrf_id_t vrf_id)
2390 struct route_table *table;
2391 struct route_node *rn;
2395 table = zebra_vrf_table (AFI_IP, safi, vrf_id);
2399 /* Show all IPv4 routes. */
2400 for (rn = route_top (table); rn; rn = route_next (rn))
2401 RNODE_FOREACH_RIB (rn, rib)
2405 vty_out (vty, SHOW_ROUTE_V4_HEADER);
2408 vty_show_ip_route (vty, rn, rib);
2413 ALIAS (show_ip_route,
2414 show_ip_route_vrf_cmd,
2415 "show ip route " VRF_CMD_STR,
2418 "IP routing table\n"
2426 "IP nexthop tracking table\n")
2428 zebra_print_rnh_table(0, AF_INET, vty);
2432 DEFUN (show_ipv6_nht,
2437 "IPv6 nexthop tracking table\n")
2439 zebra_print_rnh_table(0, AF_INET6, vty);
2443 DEFUN (show_ip_route_tag,
2444 show_ip_route_tag_cmd,
2445 "show ip route tag <1-4294967295>",
2448 "IP routing table\n"
2449 "Show only routes with tag\n"
2452 struct route_table *table;
2453 struct route_node *rn;
2456 route_tag_t tag = 0;
2457 vrf_id_t vrf_id = VRF_DEFAULT;
2460 tag = atoi(argv[0]);
2463 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
2465 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2469 /* Show all IPv4 routes with matching tag value. */
2470 for (rn = route_top (table); rn; rn = route_next (rn))
2471 RNODE_FOREACH_RIB (rn, rib)
2473 if (rib->tag != tag)
2478 vty_out (vty, SHOW_ROUTE_V4_HEADER);
2481 vty_show_ip_route (vty, rn, rib);
2486 ALIAS (show_ip_route_tag,
2487 show_ip_route_tag_vrf_cmd,
2488 "show ip route tag <1-4294967295>" VRF_CMD_STR,
2491 "IP routing table\n"
2492 "Show only routes with tag\n"
2496 DEFUN (show_ip_route_prefix_longer,
2497 show_ip_route_prefix_longer_cmd,
2498 "show ip route A.B.C.D/M longer-prefixes",
2501 "IP routing table\n"
2502 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
2503 "Show route matching the specified Network/Mask pair only\n")
2505 struct route_table *table;
2506 struct route_node *rn;
2511 vrf_id_t vrf_id = VRF_DEFAULT;
2513 ret = str2prefix (argv[0], &p);
2516 vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
2521 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
2523 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2527 /* Show matched type IPv4 routes. */
2528 for (rn = route_top (table); rn; rn = route_next (rn))
2529 RNODE_FOREACH_RIB (rn, rib)
2530 if (prefix_match (&p, &rn->p))
2534 vty_out (vty, SHOW_ROUTE_V4_HEADER);
2537 vty_show_ip_route (vty, rn, rib);
2542 ALIAS (show_ip_route_prefix_longer,
2543 show_ip_route_prefix_longer_vrf_cmd,
2544 "show ip route A.B.C.D/M longer-prefixes " VRF_CMD_STR,
2547 "IP routing table\n"
2548 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
2549 "Show route matching the specified Network/Mask pair only\n"
2552 DEFUN (show_ip_route_supernets,
2553 show_ip_route_supernets_cmd,
2554 "show ip route supernets-only",
2557 "IP routing table\n"
2558 "Show supernet entries only\n")
2560 struct route_table *table;
2561 struct route_node *rn;
2565 vrf_id_t vrf_id = VRF_DEFAULT;
2568 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
2570 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2574 /* Show matched type IPv4 routes. */
2575 for (rn = route_top (table); rn; rn = route_next (rn))
2576 RNODE_FOREACH_RIB (rn, rib)
2578 addr = ntohl (rn->p.u.prefix4.s_addr);
2580 if ((IN_CLASSC (addr) && rn->p.prefixlen < 24)
2581 || (IN_CLASSB (addr) && rn->p.prefixlen < 16)
2582 || (IN_CLASSA (addr) && rn->p.prefixlen < 8))
2586 vty_out (vty, SHOW_ROUTE_V4_HEADER);
2589 vty_show_ip_route (vty, rn, rib);
2595 ALIAS (show_ip_route_supernets,
2596 show_ip_route_supernets_vrf_cmd,
2597 "show ip route supernets-only " VRF_CMD_STR,
2600 "IP routing table\n"
2601 "Show supernet entries only\n"
2604 DEFUN (show_ip_route_protocol,
2605 show_ip_route_protocol_cmd,
2606 "show ip route " QUAGGA_IP_REDIST_STR_ZEBRA,
2609 "IP routing table\n"
2610 QUAGGA_IP_REDIST_HELP_STR_ZEBRA)
2613 struct route_table *table;
2614 struct route_node *rn;
2617 vrf_id_t vrf_id = VRF_DEFAULT;
2619 type = proto_redistnum (AFI_IP, argv[0]);
2622 vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
2627 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
2629 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2633 /* Show matched type IPv4 routes. */
2634 for (rn = route_top (table); rn; rn = route_next (rn))
2635 RNODE_FOREACH_RIB (rn, rib)
2636 if (rib->type == type)
2640 vty_out (vty, SHOW_ROUTE_V4_HEADER);
2643 vty_show_ip_route (vty, rn, rib);
2648 ALIAS (show_ip_route_protocol,
2649 show_ip_route_protocol_vrf_cmd,
2650 "show ip route " QUAGGA_IP_REDIST_STR_ZEBRA " " VRF_CMD_STR,
2653 "IP routing table\n"
2654 QUAGGA_IP_REDIST_HELP_STR_ZEBRA
2657 DEFUN (show_ip_route_addr,
2658 show_ip_route_addr_cmd,
2659 "show ip route A.B.C.D",
2662 "IP routing table\n"
2663 "Network in the IP routing table to display\n")
2666 struct prefix_ipv4 p;
2667 struct route_table *table;
2668 struct route_node *rn;
2669 vrf_id_t vrf_id = VRF_DEFAULT;
2671 ret = str2prefix_ipv4 (argv[0], &p);
2674 vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE);
2679 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
2681 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2685 rn = route_node_match (table, (struct prefix *) &p);
2688 vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
2692 vty_show_ip_route_detail (vty, rn, 0);
2694 route_unlock_node (rn);
2699 ALIAS (show_ip_route_addr,
2700 show_ip_route_addr_vrf_cmd,
2701 "show ip route A.B.C.D " VRF_CMD_STR,
2704 "IP routing table\n"
2705 "Network in the IP routing table to display\n"
2708 DEFUN (show_ip_route_prefix,
2709 show_ip_route_prefix_cmd,
2710 "show ip route A.B.C.D/M",
2713 "IP routing table\n"
2714 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
2717 struct prefix_ipv4 p;
2718 struct route_table *table;
2719 struct route_node *rn;
2720 vrf_id_t vrf_id = VRF_DEFAULT;
2722 ret = str2prefix_ipv4 (argv[0], &p);
2725 vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE);
2730 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
2732 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2736 rn = route_node_match (table, (struct prefix *) &p);
2737 if (! rn || rn->p.prefixlen != p.prefixlen)
2739 vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
2741 route_unlock_node (rn);
2745 vty_show_ip_route_detail (vty, rn, 0);
2747 route_unlock_node (rn);
2752 ALIAS (show_ip_route_prefix,
2753 show_ip_route_prefix_vrf_cmd,
2754 "show ip route A.B.C.D/M " VRF_CMD_STR,
2757 "IP routing table\n"
2758 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
2762 vty_show_ip_route_summary (struct vty *vty, struct route_table *table)
2764 struct route_node *rn;
2766 struct nexthop *nexthop;
2767 #define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
2768 #define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
2769 u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
2770 u_int32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
2773 memset (&rib_cnt, 0, sizeof(rib_cnt));
2774 memset (&fib_cnt, 0, sizeof(fib_cnt));
2775 for (rn = route_top (table); rn; rn = route_next (rn))
2776 RNODE_FOREACH_RIB (rn, rib)
2777 for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
2779 rib_cnt[ZEBRA_ROUTE_TOTAL]++;
2780 rib_cnt[rib->type]++;
2781 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
2782 || nexthop_has_fib_child(nexthop))
2784 fib_cnt[ZEBRA_ROUTE_TOTAL]++;
2785 fib_cnt[rib->type]++;
2787 if (rib->type == ZEBRA_ROUTE_BGP &&
2788 CHECK_FLAG (rib->flags, ZEBRA_FLAG_IBGP))
2790 rib_cnt[ZEBRA_ROUTE_IBGP]++;
2791 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
2792 || nexthop_has_fib_child(nexthop))
2793 fib_cnt[ZEBRA_ROUTE_IBGP]++;
2797 vty_out (vty, "%-20s %-20s %s (vrf %u)%s",
2798 "Route Source", "Routes", "FIB",
2799 ((rib_table_info_t *)table->info)->zvrf->vrf_id,
2802 for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
2806 if (i == ZEBRA_ROUTE_BGP)
2808 vty_out (vty, "%-20s %-20d %-20d %s", "ebgp",
2809 rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP],
2810 fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP],
2812 vty_out (vty, "%-20s %-20d %-20d %s", "ibgp",
2813 rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_IBGP],
2817 vty_out (vty, "%-20s %-20d %-20d %s", zebra_route_string(i),
2818 rib_cnt[i], fib_cnt[i], VTY_NEWLINE);
2822 vty_out (vty, "------%s", VTY_NEWLINE);
2823 vty_out (vty, "%-20s %-20d %-20d %s", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL],
2824 fib_cnt[ZEBRA_ROUTE_TOTAL], VTY_NEWLINE);
2825 vty_out (vty, "%s", VTY_NEWLINE);
2829 * Implementation of the ip route summary prefix command.
2831 * This command prints the primary prefixes that have been installed by various
2832 * protocols on the box.
2836 vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table)
2838 struct route_node *rn;
2840 struct nexthop *nexthop;
2841 #define ZEBRA_ROUTE_IBGP ZEBRA_ROUTE_MAX
2842 #define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
2843 u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
2844 u_int32_t fib_cnt[ZEBRA_ROUTE_TOTAL + 1];
2848 memset (&rib_cnt, 0, sizeof(rib_cnt));
2849 memset (&fib_cnt, 0, sizeof(fib_cnt));
2850 for (rn = route_top (table); rn; rn = route_next (rn))
2851 RNODE_FOREACH_RIB (rn, rib)
2855 * In case of ECMP, count only once.
2858 for (nexthop = rib->nexthop; (!cnt && nexthop); nexthop = nexthop->next)
2861 rib_cnt[ZEBRA_ROUTE_TOTAL]++;
2862 rib_cnt[rib->type]++;
2863 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
2865 fib_cnt[ZEBRA_ROUTE_TOTAL]++;
2866 fib_cnt[rib->type]++;
2868 if (rib->type == ZEBRA_ROUTE_BGP &&
2869 CHECK_FLAG (rib->flags, ZEBRA_FLAG_IBGP))
2871 rib_cnt[ZEBRA_ROUTE_IBGP]++;
2872 if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
2873 fib_cnt[ZEBRA_ROUTE_IBGP]++;
2878 vty_out (vty, "%-20s %-20s %s (vrf %u)%s",
2879 "Route Source", "Prefix Routes", "FIB",
2880 ((rib_table_info_t *)table->info)->zvrf->vrf_id,
2883 for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
2887 if (i == ZEBRA_ROUTE_BGP)
2889 vty_out (vty, "%-20s %-20d %-20d %s", "ebgp",
2890 rib_cnt[ZEBRA_ROUTE_BGP] - rib_cnt[ZEBRA_ROUTE_IBGP],
2891 fib_cnt[ZEBRA_ROUTE_BGP] - fib_cnt[ZEBRA_ROUTE_IBGP],
2893 vty_out (vty, "%-20s %-20d %-20d %s", "ibgp",
2894 rib_cnt[ZEBRA_ROUTE_IBGP], fib_cnt[ZEBRA_ROUTE_IBGP],
2898 vty_out (vty, "%-20s %-20d %-20d %s", zebra_route_string(i),
2899 rib_cnt[i], fib_cnt[i], VTY_NEWLINE);
2903 vty_out (vty, "------%s", VTY_NEWLINE);
2904 vty_out (vty, "%-20s %-20d %-20d %s", "Totals", rib_cnt[ZEBRA_ROUTE_TOTAL],
2905 fib_cnt[ZEBRA_ROUTE_TOTAL], VTY_NEWLINE);
2906 vty_out (vty, "%s", VTY_NEWLINE);
2909 /* Show route summary. */
2910 DEFUN (show_ip_route_summary,
2911 show_ip_route_summary_cmd,
2912 "show ip route summary",
2915 "IP routing table\n"
2916 "Summary of all routes\n")
2918 struct route_table *table;
2919 vrf_id_t vrf_id = VRF_DEFAULT;
2922 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
2924 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2928 vty_show_ip_route_summary (vty, table);
2933 ALIAS (show_ip_route_summary,
2934 show_ip_route_summary_vrf_cmd,
2935 "show ip route summary " VRF_CMD_STR,
2938 "IP routing table\n"
2939 "Summary of all routes\n"
2942 /* Show route summary prefix. */
2943 DEFUN (show_ip_route_summary_prefix,
2944 show_ip_route_summary_prefix_cmd,
2945 "show ip route summary prefix",
2948 "IP routing table\n"
2949 "Summary of all routes\n"
2952 struct route_table *table;
2953 vrf_id_t vrf_id = VRF_DEFAULT;
2956 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
2958 table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
2962 vty_show_ip_route_summary_prefix (vty, table);
2967 ALIAS (show_ip_route_summary_prefix,
2968 show_ip_route_summary_prefix_vrf_cmd,
2969 "show ip route summary prefix " VRF_CMD_STR,
2972 "IP routing table\n"
2973 "Summary of all routes\n"
2977 DEFUN (show_ip_route_vrf_all,
2978 show_ip_route_vrf_all_cmd,
2979 "show ip route " VRF_ALL_CMD_STR,
2982 "IP routing table\n"
2983 VRF_ALL_CMD_HELP_STR)
2985 struct route_table *table;
2986 struct route_node *rn;
2988 struct zebra_vrf *zvrf;
2992 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
2994 if ((zvrf = vrf_iter2info (iter)) == NULL ||
2995 (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
2998 /* Show all IPv4 routes. */
2999 for (rn = route_top (table); rn; rn = route_next (rn))
3000 RNODE_FOREACH_RIB (rn, rib)
3004 vty_out (vty, SHOW_ROUTE_V4_HEADER);
3007 vty_show_ip_route (vty, rn, rib);
3014 DEFUN (show_ip_route_prefix_longer_vrf_all,
3015 show_ip_route_prefix_longer_vrf_all_cmd,
3016 "show ip route A.B.C.D/M longer-prefixes " VRF_ALL_CMD_STR,
3019 "IP routing table\n"
3020 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
3021 "Show route matching the specified Network/Mask pair only\n"
3022 VRF_ALL_CMD_HELP_STR)
3024 struct route_table *table;
3025 struct route_node *rn;
3028 struct zebra_vrf *zvrf;
3033 ret = str2prefix (argv[0], &p);
3036 vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
3040 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3042 if ((zvrf = vrf_iter2info (iter)) == NULL ||
3043 (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
3046 /* Show matched type IPv4 routes. */
3047 for (rn = route_top (table); rn; rn = route_next (rn))
3048 RNODE_FOREACH_RIB (rn, rib)
3049 if (prefix_match (&p, &rn->p))
3053 vty_out (vty, SHOW_ROUTE_V4_HEADER);
3056 vty_show_ip_route (vty, rn, rib);
3063 DEFUN (show_ip_route_supernets_vrf_all,
3064 show_ip_route_supernets_vrf_all_cmd,
3065 "show ip route supernets-only " VRF_ALL_CMD_STR,
3068 "IP routing table\n"
3069 "Show supernet entries only\n"
3070 VRF_ALL_CMD_HELP_STR)
3072 struct route_table *table;
3073 struct route_node *rn;
3075 struct zebra_vrf *zvrf;
3080 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3082 if ((zvrf = vrf_iter2info (iter)) == NULL ||
3083 (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
3086 /* Show matched type IPv4 routes. */
3087 for (rn = route_top (table); rn; rn = route_next (rn))
3088 RNODE_FOREACH_RIB (rn, rib)
3090 addr = ntohl (rn->p.u.prefix4.s_addr);
3092 if ((IN_CLASSC (addr) && rn->p.prefixlen < 24)
3093 || (IN_CLASSB (addr) && rn->p.prefixlen < 16)
3094 || (IN_CLASSA (addr) && rn->p.prefixlen < 8))
3098 vty_out (vty, SHOW_ROUTE_V4_HEADER);
3101 vty_show_ip_route (vty, rn, rib);
3109 DEFUN (show_ip_route_protocol_vrf_all,
3110 show_ip_route_protocol_vrf_all_cmd,
3111 "show ip route " QUAGGA_IP_REDIST_STR_ZEBRA " " VRF_ALL_CMD_STR,
3114 "IP routing table\n"
3115 QUAGGA_IP_REDIST_HELP_STR_ZEBRA
3116 VRF_ALL_CMD_HELP_STR)
3119 struct route_table *table;
3120 struct route_node *rn;
3122 struct zebra_vrf *zvrf;
3126 type = proto_redistnum (AFI_IP, argv[0]);
3129 vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
3133 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3135 if ((zvrf = vrf_iter2info (iter)) == NULL ||
3136 (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
3139 /* Show matched type IPv4 routes. */
3140 for (rn = route_top (table); rn; rn = route_next (rn))
3141 RNODE_FOREACH_RIB (rn, rib)
3142 if (rib->type == type)
3146 vty_out (vty, SHOW_ROUTE_V4_HEADER);
3149 vty_show_ip_route (vty, rn, rib);
3156 DEFUN (show_ip_route_addr_vrf_all,
3157 show_ip_route_addr_vrf_all_cmd,
3158 "show ip route A.B.C.D " VRF_ALL_CMD_STR,
3161 "IP routing table\n"
3162 "Network in the IP routing table to display\n"
3163 VRF_ALL_CMD_HELP_STR)
3166 struct prefix_ipv4 p;
3167 struct route_table *table;
3168 struct route_node *rn;
3169 struct zebra_vrf *zvrf;
3172 ret = str2prefix_ipv4 (argv[0], &p);
3175 vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE);
3179 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3181 if ((zvrf = vrf_iter2info (iter)) == NULL ||
3182 (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
3185 rn = route_node_match (table, (struct prefix *) &p);
3189 vty_show_ip_route_detail (vty, rn, 0);
3191 route_unlock_node (rn);
3197 DEFUN (show_ip_route_prefix_vrf_all,
3198 show_ip_route_prefix_vrf_all_cmd,
3199 "show ip route A.B.C.D/M " VRF_ALL_CMD_STR,
3202 "IP routing table\n"
3203 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
3204 VRF_ALL_CMD_HELP_STR)
3207 struct prefix_ipv4 p;
3208 struct route_table *table;
3209 struct route_node *rn;
3210 struct zebra_vrf *zvrf;
3213 ret = str2prefix_ipv4 (argv[0], &p);
3216 vty_out (vty, "%% Malformed IPv4 address%s", VTY_NEWLINE);
3220 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3222 if ((zvrf = vrf_iter2info (iter)) == NULL ||
3223 (table = zvrf->table[AFI_IP][SAFI_UNICAST]) == NULL)
3226 rn = route_node_match (table, (struct prefix *) &p);
3229 if (rn->p.prefixlen != p.prefixlen)
3231 route_unlock_node (rn);
3235 vty_show_ip_route_detail (vty, rn, 0);
3237 route_unlock_node (rn);
3243 DEFUN (show_ip_route_summary_vrf_all,
3244 show_ip_route_summary_vrf_all_cmd,
3245 "show ip route summary " VRF_ALL_CMD_STR,
3248 "IP routing table\n"
3249 "Summary of all routes\n"
3250 VRF_ALL_CMD_HELP_STR)
3252 struct zebra_vrf *zvrf;
3255 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3256 if ((zvrf = vrf_iter2info (iter)) != NULL)
3257 vty_show_ip_route_summary (vty, zvrf->table[AFI_IP][SAFI_UNICAST]);
3262 DEFUN (show_ip_route_summary_prefix_vrf_all,
3263 show_ip_route_summary_prefix_vrf_all_cmd,
3264 "show ip route summary prefix " VRF_ALL_CMD_STR,
3267 "IP routing table\n"
3268 "Summary of all routes\n"
3270 VRF_ALL_CMD_HELP_STR)
3272 struct zebra_vrf *zvrf;
3275 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3276 if ((zvrf = vrf_iter2info (iter)) != NULL)
3277 vty_show_ip_route_summary_prefix (vty, zvrf->table[AFI_IP][SAFI_UNICAST]);
3282 /* Write IPv4 static route configuration. */
3284 static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)
3286 struct route_node *rn;
3287 struct static_route *si;
3288 struct route_table *stable;
3289 struct zebra_vrf *zvrf;
3295 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
3297 if ((zvrf = vrf_iter2info (iter)) == NULL ||
3298 (stable = zvrf->stable[AFI_IP][safi]) == NULL)
3301 for (rn = route_top (stable); rn; rn = route_next (rn))
3302 for (si = rn->info; si; si = si->next)
3304 vty_out (vty, "%s %s/%d", cmd, inet_ntoa (rn->p.u.prefix4),
3309 case STATIC_IPV4_GATEWAY:
3310 vty_out (vty, " %s", inet_ntoa (si->addr.ipv4));
3312 case STATIC_IPV4_IFNAME:
3313 vty_out (vty, " %s", si->ifname);
3315 case STATIC_IPV4_BLACKHOLE:
3316 vty_out (vty, " Null0");
3320 /* flags are incompatible with STATIC_IPV4_BLACKHOLE */
3321 if (si->type != STATIC_IPV4_BLACKHOLE)
3323 if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
3324 vty_out (vty, " %s", "reject");
3326 if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
3327 vty_out (vty, " %s", "blackhole");
3331 vty_out (vty, " tag %d", si->tag);
3333 if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
3334 vty_out (vty, " %d", si->distance);
3336 if (si->vrf_id != VRF_DEFAULT)
3337 vty_out (vty, " vrf %u", si->vrf_id);
3339 vty_out (vty, "%s", VTY_NEWLINE);
3347 DEFUN (show_ip_protocol,
3348 show_ip_protocol_cmd,
3352 "IP protocol filtering status\n")
3356 vty_out(vty, "Protocol : route-map %s", VTY_NEWLINE);
3357 vty_out(vty, "------------------------%s", VTY_NEWLINE);
3358 for (i=0;i<ZEBRA_ROUTE_MAX;i++)
3360 if (proto_rm[AFI_IP][i])
3361 vty_out (vty, "%-10s : %-10s%s", zebra_route_string(i),
3362 proto_rm[AFI_IP][i],
3365 vty_out (vty, "%-10s : none%s", zebra_route_string(i), VTY_NEWLINE);
3367 if (proto_rm[AFI_IP][i])
3368 vty_out (vty, "%-10s : %-10s%s", "any", proto_rm[AFI_IP][i],
3371 vty_out (vty, "%-10s : none%s", "any", VTY_NEWLINE);
3376 /* General fucntion for IPv6 static route. */
3378 static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
3379 const char *gate_str, const char *ifname,
3380 const char *flag_str, const char *tag_str,
3381 const char *distance_str, const char *vrf_id_str)
3386 struct in6_addr *gate = NULL;
3387 struct in6_addr gate_addr;
3389 vrf_id_t vrf_id = VRF_DEFAULT;
3391 route_tag_t tag = 0;
3393 ret = str2prefix (dest_str, &p);
3396 vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
3400 /* Apply mask for given prefix. */
3405 switch(flag_str[0]) {
3408 SET_FLAG (flag, ZEBRA_FLAG_REJECT);
3412 SET_FLAG (flag, ZEBRA_FLAG_BLACKHOLE);
3415 vty_out (vty, "%% Malformed flag %s %s", flag_str, VTY_NEWLINE);
3420 /* Administrative distance. */
3422 distance = atoi (distance_str);
3424 distance = ZEBRA_STATIC_DISTANCE_DEFAULT;
3428 tag = atoi (tag_str);
3432 tag = atoi(tag_str);
3434 /* When gateway is valid IPv6 addrees, then gate is treated as
3435 nexthop address other case gate is treated as interface name. */
3436 ret = inet_pton (AF_INET6, gate_str, &gate_addr);
3440 /* When ifname is specified. It must be come with gateway
3444 vty_out (vty, "%% Malformed address%s", VTY_NEWLINE);
3447 type = STATIC_IPV6_GATEWAY_IFNAME;
3454 type = STATIC_IPV6_GATEWAY;
3459 type = STATIC_IPV6_IFNAME;
3466 VTY_GET_INTEGER ("VRF ID", vrf_id, vrf_id_str);
3469 static_add_ipv6 (&p, type, gate, ifname, flag, tag, distance, vrf_id);
3471 static_delete_ipv6 (&p, type, gate, ifname, tag, distance, vrf_id);
3478 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
3480 "Establish static routes\n"
3481 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3482 "IPv6 gateway address\n"
3483 "IPv6 gateway interface name\n")
3485 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL,
3489 DEFUN (ipv6_route_tag,
3491 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>",
3493 "Establish static routes\n"
3494 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3495 "IPv6 gateway address\n"
3496 "IPv6 gateway interface name\n"
3497 "Set tag for this route\n"
3500 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, argv[2], NULL, NULL);
3503 DEFUN (ipv6_route_tag_vrf,
3504 ipv6_route_tag_vrf_cmd,
3505 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>" VRF_CMD_STR,
3507 "Establish static routes\n"
3508 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3509 "IPv6 gateway address\n"
3510 "IPv6 gateway interface name\n"
3511 "Set tag for this route\n"
3515 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, argv[2], NULL, argv[3]);
3518 DEFUN (ipv6_route_flags,
3519 ipv6_route_flags_cmd,
3520 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
3522 "Establish static routes\n"
3523 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3524 "IPv6 gateway address\n"
3525 "IPv6 gateway interface name\n"
3526 "Emit an ICMP unreachable when matched\n"
3527 "Silently discard pkts when matched\n")
3529 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], NULL,
3533 DEFUN (ipv6_route_flags_tag,
3534 ipv6_route_flags_tag_cmd,
3535 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295>",
3537 "Establish static routes\n"
3538 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3539 "IPv6 gateway address\n"
3540 "IPv6 gateway interface name\n"
3541 "Emit an ICMP unreachable when matched\n"
3542 "Silently discard pkts when matched\n"
3543 "Set tag for this route\n"
3546 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], NULL, NULL);
3549 DEFUN (ipv6_route_flags_tag_vrf,
3550 ipv6_route_flags_tag_vrf_cmd,
3551 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
3553 "Establish static routes\n"
3554 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3555 "IPv6 gateway address\n"
3556 "IPv6 gateway interface name\n"
3557 "Emit an ICMP unreachable when matched\n"
3558 "Silently discard pkts when matched\n"
3559 "Set tag for this route\n"
3563 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], NULL, argv[4]);
3566 DEFUN (ipv6_route_ifname,
3567 ipv6_route_ifname_cmd,
3568 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
3570 "Establish static routes\n"
3571 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3572 "IPv6 gateway address\n"
3573 "IPv6 gateway interface name\n")
3575 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, NULL,
3579 DEFUN (ipv6_route_ifname_tag,
3580 ipv6_route_ifname_tag_cmd,
3581 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295>",
3583 "Establish static routes\n"
3584 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3585 "IPv6 gateway address\n"
3586 "IPv6 gateway interface name\n"
3587 "Set tag for this route\n"
3590 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], NULL, NULL);
3593 DEFUN (ipv6_route_ifname_tag_vrf,
3594 ipv6_route_ifname_tag_vrf_cmd,
3595 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295>" VRF_CMD_STR,
3597 "Establish static routes\n"
3598 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3599 "IPv6 gateway address\n"
3600 "IPv6 gateway interface name\n"
3601 "Set tag for this route\n"
3605 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], NULL, argv[4]);
3608 DEFUN (ipv6_route_ifname_flags,
3609 ipv6_route_ifname_flags_cmd,
3610 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
3612 "Establish static routes\n"
3613 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3614 "IPv6 gateway address\n"
3615 "IPv6 gateway interface name\n"
3616 "Emit an ICMP unreachable when matched\n"
3617 "Silently discard pkts when matched\n")
3619 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL,
3623 DEFUN (ipv6_route_ifname_flags_tag,
3624 ipv6_route_ifname_flags_tag_cmd,
3625 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295>",
3627 "Establish static routes\n"
3628 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3629 "IPv6 gateway address\n"
3630 "IPv6 gateway interface name\n"
3631 "Emit an ICMP unreachable when matched\n"
3632 "Silently discard pkts when matched\n"
3633 "Set tag for this route\n"
3636 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], NULL, NULL);
3639 DEFUN (ipv6_route_ifname_flags_tag_vrf,
3640 ipv6_route_ifname_flags_tag_vrf_cmd,
3641 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295>" VRF_CMD_STR,
3643 "Establish static routes\n"
3644 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3645 "IPv6 gateway address\n"
3646 "IPv6 gateway interface name\n"
3647 "Emit an ICMP unreachable when matched\n"
3648 "Silently discard pkts when matched\n"
3649 "Set tag for this route\n"
3653 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], NULL, argv[5]);
3656 DEFUN (ipv6_route_pref,
3657 ipv6_route_pref_cmd,
3658 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
3660 "Establish static routes\n"
3661 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3662 "IPv6 gateway address\n"
3663 "IPv6 gateway interface name\n"
3664 "Distance value for this prefix\n")
3666 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, argv[2],
3670 DEFUN (ipv6_route_pref_tag,
3671 ipv6_route_pref_tag_cmd,
3672 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>",
3674 "Establish static routes\n"
3675 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3676 "IPv6 gateway address\n"
3677 "IPv6 gateway interface name\n"
3678 "Set tag for this route\n"
3680 "Distance value for this prefix\n")
3682 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, argv[2], argv[3], NULL);
3685 DEFUN (ipv6_route_pref_tag_vrf,
3686 ipv6_route_pref_tag_vrf_cmd,
3687 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>" VRF_CMD_STR,
3689 "Establish static routes\n"
3690 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3691 "IPv6 gateway address\n"
3692 "IPv6 gateway interface name\n"
3693 "Set tag for this route\n"
3695 "Distance value for this prefix\n"
3698 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, argv[2], argv[3], argv[4]);
3701 DEFUN (ipv6_route_flags_pref,
3702 ipv6_route_flags_pref_cmd,
3703 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255>",
3705 "Establish static routes\n"
3706 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3707 "IPv6 gateway address\n"
3708 "IPv6 gateway interface name\n"
3709 "Emit an ICMP unreachable when matched\n"
3710 "Silently discard pkts when matched\n"
3711 "Distance value for this prefix\n")
3713 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, argv[3],
3717 DEFUN (ipv6_route_flags_pref_tag,
3718 ipv6_route_flags_pref_tag_cmd,
3719 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
3721 "Establish static routes\n"
3722 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3723 "IPv6 gateway address\n"
3724 "IPv6 gateway interface name\n"
3725 "Emit an ICMP unreachable when matched\n"
3726 "Silently discard pkts when matched\n"
3727 "Set tag for this route\n"
3729 "Distance value for this prefix\n")
3731 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], argv[4], NULL);
3734 DEFUN (ipv6_route_flags_pref_tag_vrf,
3735 ipv6_route_flags_pref_tag_vrf_cmd,
3736 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
3738 "Establish static routes\n"
3739 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3740 "IPv6 gateway address\n"
3741 "IPv6 gateway interface name\n"
3742 "Emit an ICMP unreachable when matched\n"
3743 "Silently discard pkts when matched\n"
3744 "Set tag for this route\n"
3746 "Distance value for this prefix\n"
3749 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], argv[3], argv[4], argv[5]);
3752 DEFUN (ipv6_route_ifname_pref,
3753 ipv6_route_ifname_pref_cmd,
3754 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
3756 "Establish static routes\n"
3757 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3758 "IPv6 gateway address\n"
3759 "IPv6 gateway interface name\n"
3760 "Distance value for this prefix\n")
3762 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, argv[3],
3766 DEFUN (ipv6_route_ifname_pref_tag,
3767 ipv6_route_ifname_pref_tag_cmd,
3768 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255>",
3770 "Establish static routes\n"
3771 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3772 "IPv6 gateway address\n"
3773 "IPv6 gateway interface name\n"
3774 "Set tag for this route\n"
3776 "Distance value for this prefix\n")
3778 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], argv[4], NULL);
3781 DEFUN (ipv6_route_ifname_pref_tag_vrf,
3782 ipv6_route_ifname_pref_tag_vrf_cmd,
3783 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255>" VRF_CMD_STR,
3785 "Establish static routes\n"
3786 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3787 "IPv6 gateway address\n"
3788 "IPv6 gateway interface name\n"
3789 "Set tag for this route\n"
3791 "Distance value for this prefix\n"
3794 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, argv[3], argv[4], argv[5]);
3797 DEFUN (ipv6_route_ifname_flags_pref,
3798 ipv6_route_ifname_flags_pref_cmd,
3799 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255>",
3801 "Establish static routes\n"
3802 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3803 "IPv6 gateway address\n"
3804 "IPv6 gateway interface name\n"
3805 "Emit an ICMP unreachable when matched\n"
3806 "Silently discard pkts when matched\n"
3807 "Distance value for this prefix\n")
3809 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, argv[4],
3813 DEFUN (ipv6_route_ifname_flags_pref_tag,
3814 ipv6_route_ifname_flags_pref_tag_cmd,
3815 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255>",
3817 "Establish static routes\n"
3818 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3819 "IPv6 gateway address\n"
3820 "IPv6 gateway interface name\n"
3821 "Emit an ICMP unreachable when matched\n"
3822 "Silently discard pkts when matched\n"
3823 "Set tag for this route\n"
3825 "Distance value for this prefix\n")
3827 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], NULL);
3830 DEFUN (ipv6_route_ifname_flags_pref_tag_vrf,
3831 ipv6_route_ifname_flags_pref_tag_vrf_cmd,
3832 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
3834 "Establish static routes\n"
3835 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3836 "IPv6 gateway address\n"
3837 "IPv6 gateway interface name\n"
3838 "Emit an ICMP unreachable when matched\n"
3839 "Silently discard pkts when matched\n"
3840 "Set tag for this route\n"
3842 "Distance value for this prefix\n"
3845 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
3848 DEFUN (no_ipv6_route,
3850 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE)",
3853 "Establish static routes\n"
3854 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3855 "IPv6 gateway address\n"
3856 "IPv6 gateway interface name\n")
3858 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL,
3862 DEFUN (no_ipv6_route_tag,
3863 no_ipv6_route_tag_cmd,
3864 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>",
3867 "Establish static routes\n"
3868 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3869 "IPv6 gateway address\n"
3870 "IPv6 gateway interface name\n"
3871 "Set tag for this route\n"
3874 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL, NULL);
3877 DEFUN (no_ipv6_route_tag_vrf,
3878 no_ipv6_route_tag_vrf_cmd,
3879 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295>" VRF_CMD_STR,
3882 "Establish static routes\n"
3883 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3884 "IPv6 gateway address\n"
3885 "IPv6 gateway interface name\n"
3886 "Set tag for this route\n"
3890 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL, argv[3]);
3893 ALIAS (no_ipv6_route,
3894 no_ipv6_route_flags_cmd,
3895 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
3898 "Establish static routes\n"
3899 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3900 "IPv6 gateway address\n"
3901 "IPv6 gateway interface name\n"
3902 "Emit an ICMP unreachable when matched\n"
3903 "Silently discard pkts when matched\n")
3905 ALIAS (no_ipv6_route_tag,
3906 no_ipv6_route_flags_tag_cmd,
3907 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295>",
3910 "Establish static routes\n"
3911 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3912 "IPv6 gateway address\n"
3913 "IPv6 gateway interface name\n"
3914 "Emit an ICMP unreachable when matched\n"
3915 "Silently discard pkts when matched\n"
3916 "Set tag for this route\n"
3919 DEFUN (no_ipv6_route_ifname,
3920 no_ipv6_route_ifname_cmd,
3921 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
3924 "Establish static routes\n"
3925 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3926 "IPv6 gateway address\n"
3927 "IPv6 gateway interface name\n")
3929 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, NULL,
3933 DEFUN (no_ipv6_route_ifname_tag,
3934 no_ipv6_route_ifname_tag_cmd,
3935 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295>",
3938 "Establish static routes\n"
3939 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3940 "IPv6 gateway address\n"
3941 "IPv6 gateway interface name\n"
3942 "Set tag for this route\n"
3945 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL, NULL);
3948 DEFUN (no_ipv6_route_ifname_tag_vrf,
3949 no_ipv6_route_ifname_tag_vrf_cmd,
3950 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295>" VRF_CMD_STR,
3953 "Establish static routes\n"
3954 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3955 "IPv6 gateway address\n"
3956 "IPv6 gateway interface name\n"
3957 "Set tag for this route\n"
3961 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL, argv[4]);
3964 ALIAS (no_ipv6_route_ifname,
3965 no_ipv6_route_ifname_flags_cmd,
3966 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
3969 "Establish static routes\n"
3970 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3971 "IPv6 gateway address\n"
3972 "IPv6 gateway interface name\n"
3973 "Emit an ICMP unreachable when matched\n"
3974 "Silently discard pkts when matched\n")
3976 ALIAS (no_ipv6_route_ifname_tag,
3977 no_ipv6_route_ifname_flags_tag_cmd,
3978 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295>",
3981 "Establish static routes\n"
3982 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3983 "IPv6 gateway address\n"
3984 "IPv6 gateway interface name\n"
3985 "Emit an ICMP unreachable when matched\n"
3986 "Silently discard pkts when matched\n"
3987 "Set tag for this route\n"
3990 DEFUN (no_ipv6_route_pref,
3991 no_ipv6_route_pref_cmd,
3992 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255>",
3995 "Establish static routes\n"
3996 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
3997 "IPv6 gateway address\n"
3998 "IPv6 gateway interface name\n"
3999 "Distance value for this prefix\n")
4001 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, argv[2],
4005 DEFUN (no_ipv6_route_pref_tag,
4006 no_ipv6_route_pref_tag_cmd,
4007 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>",
4010 "Establish static routes\n"
4011 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4012 "IPv6 gateway address\n"
4013 "IPv6 gateway interface name\n"
4014 "Set tag for this route\n"
4016 "Distance value for this prefix\n")
4018 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], argv[3], NULL);
4021 DEFUN (no_ipv6_route_pref_tag_vrf,
4022 no_ipv6_route_pref_tag_vrf_cmd,
4023 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) tag <1-4294967295> <1-255>" VRF_CMD_STR,
4026 "Establish static routes\n"
4027 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4028 "IPv6 gateway address\n"
4029 "IPv6 gateway interface name\n"
4030 "Set tag for this route\n"
4032 "Distance value for this prefix\n"
4035 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], argv[3], argv[4]);
4038 DEFUN (no_ipv6_route_flags_pref,
4039 no_ipv6_route_flags_pref_cmd,
4040 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255>",
4043 "Establish static routes\n"
4044 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4045 "IPv6 gateway address\n"
4046 "IPv6 gateway interface name\n"
4047 "Emit an ICMP unreachable when matched\n"
4048 "Silently discard pkts when matched\n"
4049 "Distance value for this prefix\n")
4051 /* We do not care about argv[2] */
4052 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, argv[3],
4056 DEFUN (no_ipv6_route_flags_pref_tag,
4057 no_ipv6_route_flags_pref_tag_cmd,
4058 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>",
4061 "Establish static routes\n"
4062 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4063 "IPv6 gateway address\n"
4064 "IPv6 gateway interface name\n"
4065 "Emit an ICMP unreachable when matched\n"
4066 "Silently discard pkts when matched\n"
4067 "Set tag for this route\n"
4069 "Distance value for this prefix\n")
4071 /* We do not care about argv[2] */
4072 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], argv[4], NULL);
4075 DEFUN (no_ipv6_route_flags_pref_tag_vrf,
4076 no_ipv6_route_flags_pref_tag_vrf_cmd,
4077 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
4080 "Establish static routes\n"
4081 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4082 "IPv6 gateway address\n"
4083 "IPv6 gateway interface name\n"
4084 "Emit an ICMP unreachable when matched\n"
4085 "Silently discard pkts when matched\n"
4086 "Set tag for this route\n"
4088 "Distance value for this prefix\n"
4091 /* We do not care about argv[2] */
4092 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], argv[4], argv[5]);
4095 DEFUN (no_ipv6_route_ifname_pref,
4096 no_ipv6_route_ifname_pref_cmd,
4097 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255>",
4100 "Establish static routes\n"
4101 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4102 "IPv6 gateway address\n"
4103 "IPv6 gateway interface name\n"
4104 "Distance value for this prefix\n")
4106 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, argv[3],
4110 DEFUN (no_ipv6_route_ifname_pref_tag,
4111 no_ipv6_route_ifname_pref_tag_cmd,
4112 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255>",
4115 "Establish static routes\n"
4116 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4117 "IPv6 gateway address\n"
4118 "IPv6 gateway interface name\n"
4119 "Set tag for this route\n"
4121 "Distance value for this prefix\n")
4123 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], argv[4], NULL);
4126 DEFUN (no_ipv6_route_ifname_pref_tag_vrf,
4127 no_ipv6_route_ifname_pref_tag_vrf_cmd,
4128 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag <1-4294967295> <1-255>" VRF_CMD_STR,
4131 "Establish static routes\n"
4132 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4133 "IPv6 gateway address\n"
4134 "IPv6 gateway interface name\n"
4135 "Set tag for this route\n"
4137 "Distance value for this prefix\n"
4140 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], argv[4], argv[5]);
4143 DEFUN (no_ipv6_route_ifname_flags_pref,
4144 no_ipv6_route_ifname_flags_pref_cmd,
4145 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255>",
4148 "Establish static routes\n"
4149 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4150 "IPv6 gateway address\n"
4151 "IPv6 gateway interface name\n"
4152 "Emit an ICMP unreachable when matched\n"
4153 "Silently discard pkts when matched\n"
4154 "Distance value for this prefix\n")
4156 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, argv[4],
4160 DEFUN (no_ipv6_route_ifname_flags_pref_tag,
4161 no_ipv6_route_ifname_flags_pref_tag_cmd,
4162 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255>",
4165 "Establish static routes\n"
4166 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4167 "IPv6 gateway address\n"
4168 "IPv6 gateway interface name\n"
4169 "Emit an ICMP unreachable when matched\n"
4170 "Silently discard pkts when matched\n"
4171 "Set tag for this route\n"
4173 "Distance value for this prefix\n")
4175 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], NULL);
4178 DEFUN (no_ipv6_route_ifname_flags_pref_tag_vrf,
4179 no_ipv6_route_ifname_flags_pref_tag_vrf_cmd,
4180 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-4294967295> <1-255>" VRF_CMD_STR,
4183 "Establish static routes\n"
4184 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4185 "IPv6 gateway address\n"
4186 "IPv6 gateway interface name\n"
4187 "Emit an ICMP unreachable when matched\n"
4188 "Silently discard pkts when matched\n"
4189 "Set tag for this route\n"
4191 "Distance value for this prefix\n"
4194 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
4197 DEFUN (ipv6_route_vrf,
4199 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) " VRF_CMD_STR,
4201 "Establish static routes\n"
4202 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4203 "IPv6 gateway address\n"
4204 "IPv6 gateway interface name\n"
4207 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, NULL,
4211 DEFUN (ipv6_route_flags_vrf,
4212 ipv6_route_flags_vrf_cmd,
4213 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
4215 "Establish static routes\n"
4216 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4217 "IPv6 gateway address\n"
4218 "IPv6 gateway interface name\n"
4219 "Emit an ICMP unreachable when matched\n"
4220 "Silently discard pkts when matched\n"
4223 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, NULL,
4227 DEFUN (ipv6_route_ifname_vrf,
4228 ipv6_route_ifname_vrf_cmd,
4229 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE " VRF_CMD_STR,
4231 "Establish static routes\n"
4232 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4233 "IPv6 gateway address\n"
4234 "IPv6 gateway interface name\n"
4237 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, NULL,
4241 DEFUN (ipv6_route_ifname_flags_vrf,
4242 ipv6_route_ifname_flags_vrf_cmd,
4243 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) " VRF_CMD_STR,
4245 "Establish static routes\n"
4246 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4247 "IPv6 gateway address\n"
4248 "IPv6 gateway interface name\n"
4249 "Emit an ICMP unreachable when matched\n"
4250 "Silently discard pkts when matched\n"
4253 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, NULL,
4257 DEFUN (ipv6_route_pref_vrf,
4258 ipv6_route_pref_vrf_cmd,
4259 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255> " VRF_CMD_STR,
4261 "Establish static routes\n"
4262 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4263 "IPv6 gateway address\n"
4264 "IPv6 gateway interface name\n"
4265 "Distance value for this prefix\n"
4268 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, NULL, NULL, argv[2],
4272 DEFUN (ipv6_route_flags_pref_vrf,
4273 ipv6_route_flags_pref_vrf_cmd,
4274 "ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR,
4276 "Establish static routes\n"
4277 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4278 "IPv6 gateway address\n"
4279 "IPv6 gateway interface name\n"
4280 "Emit an ICMP unreachable when matched\n"
4281 "Silently discard pkts when matched\n"
4282 "Distance value for this prefix\n"
4285 return static_ipv6_func (vty, 1, argv[0], argv[1], NULL, argv[2], NULL, argv[3],
4289 DEFUN (ipv6_route_ifname_pref_vrf,
4290 ipv6_route_ifname_pref_vrf_cmd,
4291 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255> " VRF_CMD_STR,
4293 "Establish static routes\n"
4294 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4295 "IPv6 gateway address\n"
4296 "IPv6 gateway interface name\n"
4297 "Distance value for this prefix\n"
4300 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], NULL, NULL, argv[3],
4304 DEFUN (ipv6_route_ifname_flags_pref_vrf,
4305 ipv6_route_ifname_flags_pref_vrf_cmd,
4306 "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255> " VRF_CMD_STR,
4308 "Establish static routes\n"
4309 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4310 "IPv6 gateway address\n"
4311 "IPv6 gateway interface name\n"
4312 "Emit an ICMP unreachable when matched\n"
4313 "Silently discard pkts when matched\n"
4314 "Distance value for this prefix\n"
4317 return static_ipv6_func (vty, 1, argv[0], argv[1], argv[2], argv[3], NULL, argv[4],
4321 DEFUN (no_ipv6_route_vrf,
4322 no_ipv6_route_vrf_cmd,
4323 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) " VRF_CMD_STR,
4326 "Establish static routes\n"
4327 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4328 "IPv6 gateway address\n"
4329 "IPv6 gateway interface name\n"
4332 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL,
4333 (argc > 3) ? argv[3] : argv[2]);
4336 ALIAS (no_ipv6_route_vrf,
4337 no_ipv6_route_flags_vrf_cmd,
4338 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
4341 "Establish static routes\n"
4342 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4343 "IPv6 gateway address\n"
4344 "IPv6 gateway interface name\n"
4345 "Emit an ICMP unreachable when matched\n"
4346 "Silently discard pkts when matched\n"
4349 DEFUN (no_ipv6_route_ifname_vrf,
4350 no_ipv6_route_ifname_vrf_cmd,
4351 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE " VRF_CMD_STR,
4354 "Establish static routes\n"
4355 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4356 "IPv6 gateway address\n"
4357 "IPv6 gateway interface name\n"
4360 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, NULL,
4361 (argc > 4) ? argv[4] : argv[3]);
4364 ALIAS (no_ipv6_route_ifname_vrf,
4365 no_ipv6_route_ifname_flags_vrf_cmd,
4366 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) " VRF_CMD_STR,
4369 "Establish static routes\n"
4370 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4371 "IPv6 gateway address\n"
4372 "IPv6 gateway interface name\n"
4373 "Emit an ICMP unreachable when matched\n"
4374 "Silently discard pkts when matched\n"
4377 DEFUN (no_ipv6_route_pref_vrf,
4378 no_ipv6_route_pref_vrf_cmd,
4379 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) <1-255> " VRF_CMD_STR,
4382 "Establish static routes\n"
4383 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4384 "IPv6 gateway address\n"
4385 "IPv6 gateway interface name\n"
4386 "Distance value for this prefix\n"
4389 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, NULL, argv[2],
4393 DEFUN (no_ipv6_route_flags_pref_vrf,
4394 no_ipv6_route_flags_pref_vrf_cmd,
4395 "no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) <1-255> " VRF_CMD_STR,
4398 "Establish static routes\n"
4399 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4400 "IPv6 gateway address\n"
4401 "IPv6 gateway interface name\n"
4402 "Emit an ICMP unreachable when matched\n"
4403 "Silently discard pkts when matched\n"
4404 "Distance value for this prefix\n"
4407 /* We do not care about argv[2] */
4408 return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, argv[3],
4412 DEFUN (no_ipv6_route_ifname_pref_vrf,
4413 no_ipv6_route_ifname_pref_vrf_cmd,
4414 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <1-255> " VRF_CMD_STR,
4417 "Establish static routes\n"
4418 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4419 "IPv6 gateway address\n"
4420 "IPv6 gateway interface name\n"
4421 "Distance value for this prefix\n"
4424 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, argv[3],
4428 DEFUN (no_ipv6_route_ifname_flags_pref_vrf,
4429 no_ipv6_route_ifname_flags_pref_vrf_cmd,
4430 "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) <1-255> " VRF_CMD_STR,
4433 "Establish static routes\n"
4434 "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
4435 "IPv6 gateway address\n"
4436 "IPv6 gateway interface name\n"
4437 "Emit an ICMP unreachable when matched\n"
4438 "Silently discard pkts when matched\n"
4439 "Distance value for this prefix\n"
4442 return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, argv[4],
4446 DEFUN (show_ipv6_route,
4447 show_ipv6_route_cmd,
4451 "IPv6 routing table\n")
4453 struct route_table *table;
4454 struct route_node *rn;
4457 vrf_id_t vrf_id = VRF_DEFAULT;
4460 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
4462 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4466 /* Show all IPv6 route. */
4467 for (rn = route_top (table); rn; rn = route_next (rn))
4468 RNODE_FOREACH_RIB (rn, rib)
4472 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4475 vty_show_ip_route (vty, rn, rib);
4480 ALIAS (show_ipv6_route,
4481 show_ipv6_route_vrf_cmd,
4482 "show ipv6 route " VRF_CMD_STR,
4485 "IPv6 routing table\n"
4488 DEFUN (show_ipv6_route_tag,
4489 show_ipv6_route_tag_cmd,
4490 "show ipv6 route tag <1-4294967295>",
4493 "IPv6 routing table\n"
4494 "Show only routes with tag\n"
4497 struct route_table *table;
4498 struct route_node *rn;
4501 route_tag_t tag = 0;
4502 vrf_id_t vrf_id = VRF_DEFAULT;
4505 tag = atoi(argv[0]);
4508 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
4510 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4514 /* Show all IPv6 routes with matching tag value. */
4515 for (rn = route_top (table); rn; rn = route_next (rn))
4516 RNODE_FOREACH_RIB (rn, rib)
4518 if (rib->tag != tag)
4523 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4526 vty_show_ip_route (vty, rn, rib);
4531 ALIAS (show_ipv6_route_tag,
4532 show_ipv6_route_tag_vrf_cmd,
4533 "show ipv6 route tag <1-4294967295>" VRF_CMD_STR,
4536 "IPv6 routing table\n"
4537 "Show only routes with tag\n"
4541 DEFUN (show_ipv6_route_prefix_longer,
4542 show_ipv6_route_prefix_longer_cmd,
4543 "show ipv6 route X:X::X:X/M longer-prefixes",
4546 "IPv6 routing table\n"
4548 "Show route matching the specified Network/Mask pair only\n")
4550 struct route_table *table;
4551 struct route_node *rn;
4556 vrf_id_t vrf_id = VRF_DEFAULT;
4558 ret = str2prefix (argv[0], &p);
4561 vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
4566 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
4568 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4572 /* Show matched type IPv6 routes. */
4573 for (rn = route_top (table); rn; rn = route_next (rn))
4574 RNODE_FOREACH_RIB (rn, rib)
4575 if (prefix_match (&p, &rn->p))
4579 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4582 vty_show_ip_route (vty, rn, rib);
4587 ALIAS (show_ipv6_route_prefix_longer,
4588 show_ipv6_route_prefix_longer_vrf_cmd,
4589 "show ipv6 route X:X::X:X/M longer-prefixes " VRF_CMD_STR,
4592 "IPv6 routing table\n"
4594 "Show route matching the specified Network/Mask pair only\n"
4597 DEFUN (show_ipv6_route_protocol,
4598 show_ipv6_route_protocol_cmd,
4599 "show ipv6 route " QUAGGA_IP6_REDIST_STR_ZEBRA,
4602 "IP routing table\n"
4603 QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
4606 struct route_table *table;
4607 struct route_node *rn;
4610 vrf_id_t vrf_id = VRF_DEFAULT;
4612 type = proto_redistnum (AFI_IP6, argv[0]);
4615 vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
4620 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
4622 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4626 /* Show matched type IPv6 routes. */
4627 for (rn = route_top (table); rn; rn = route_next (rn))
4628 RNODE_FOREACH_RIB (rn, rib)
4629 if (rib->type == type)
4633 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4636 vty_show_ip_route (vty, rn, rib);
4641 ALIAS (show_ipv6_route_protocol,
4642 show_ipv6_route_protocol_vrf_cmd,
4643 "show ipv6 route " QUAGGA_IP6_REDIST_STR_ZEBRA " " VRF_CMD_STR,
4646 "IP routing table\n"
4647 QUAGGA_IP6_REDIST_HELP_STR_ZEBRA
4650 DEFUN (show_ipv6_route_addr,
4651 show_ipv6_route_addr_cmd,
4652 "show ipv6 route X:X::X:X",
4655 "IPv6 routing table\n"
4659 struct prefix_ipv6 p;
4660 struct route_table *table;
4661 struct route_node *rn;
4662 vrf_id_t vrf_id = VRF_DEFAULT;
4664 ret = str2prefix_ipv6 (argv[0], &p);
4667 vty_out (vty, "Malformed IPv6 address%s", VTY_NEWLINE);
4672 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
4674 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4678 rn = route_node_match (table, (struct prefix *) &p);
4681 vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
4685 vty_show_ip_route_detail (vty, rn, 0);
4687 route_unlock_node (rn);
4692 ALIAS (show_ipv6_route_addr,
4693 show_ipv6_route_addr_vrf_cmd,
4694 "show ipv6 route X:X::X:X " VRF_CMD_STR,
4697 "IPv6 routing table\n"
4701 DEFUN (show_ipv6_route_prefix,
4702 show_ipv6_route_prefix_cmd,
4703 "show ipv6 route X:X::X:X/M",
4706 "IPv6 routing table\n"
4710 struct prefix_ipv6 p;
4711 struct route_table *table;
4712 struct route_node *rn;
4713 vrf_id_t vrf_id = VRF_DEFAULT;
4715 ret = str2prefix_ipv6 (argv[0], &p);
4718 vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
4723 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
4725 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4729 rn = route_node_match (table, (struct prefix *) &p);
4730 if (! rn || rn->p.prefixlen != p.prefixlen)
4732 vty_out (vty, "%% Network not in table%s", VTY_NEWLINE);
4734 route_unlock_node (rn);
4738 vty_show_ip_route_detail (vty, rn, 0);
4740 route_unlock_node (rn);
4745 ALIAS (show_ipv6_route_prefix,
4746 show_ipv6_route_prefix_vrf_cmd,
4747 "show ipv6 route X:X::X:X/M " VRF_CMD_STR,
4750 "IPv6 routing table\n"
4754 /* Show route summary. */
4755 DEFUN (show_ipv6_route_summary,
4756 show_ipv6_route_summary_cmd,
4757 "show ipv6 route summary",
4760 "IPv6 routing table\n"
4761 "Summary of all IPv6 routes\n")
4763 struct route_table *table;
4764 vrf_id_t vrf_id = VRF_DEFAULT;
4767 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
4769 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4773 vty_show_ip_route_summary (vty, table);
4778 ALIAS (show_ipv6_route_summary,
4779 show_ipv6_route_summary_vrf_cmd,
4780 "show ipv6 route summary " VRF_CMD_STR,
4783 "IPv6 routing table\n"
4784 "Summary of all IPv6 routes\n"
4787 /* Show ipv6 route summary prefix. */
4788 DEFUN (show_ipv6_route_summary_prefix,
4789 show_ipv6_route_summary_prefix_cmd,
4790 "show ipv6 route summary prefix",
4793 "IPv6 routing table\n"
4794 "Summary of all IPv6 routes\n"
4797 struct route_table *table;
4798 vrf_id_t vrf_id = VRF_DEFAULT;
4801 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
4803 table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
4807 vty_show_ip_route_summary_prefix (vty, table);
4812 ALIAS (show_ipv6_route_summary_prefix,
4813 show_ipv6_route_summary_prefix_vrf_cmd,
4814 "show ipv6 route summary prefix " VRF_CMD_STR,
4817 "IPv6 routing table\n"
4818 "Summary of all IPv6 routes\n"
4823 * Show IPv6 mroute command.Used to dump
4824 * the Multicast routing table.
4827 DEFUN (show_ipv6_mroute,
4828 show_ipv6_mroute_cmd,
4832 "IPv6 Multicast routing table\n")
4834 struct route_table *table;
4835 struct route_node *rn;
4838 vrf_id_t vrf_id = VRF_DEFAULT;
4841 VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
4843 table = zebra_vrf_table (AFI_IP6, SAFI_MULTICAST, vrf_id);
4847 /* Show all IPv6 route. */
4848 for (rn = route_top (table); rn; rn = route_next (rn))
4849 RNODE_FOREACH_RIB (rn, rib)
4853 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4856 vty_show_ip_route (vty, rn, rib);
4861 ALIAS (show_ipv6_mroute,
4862 show_ipv6_mroute_vrf_cmd,
4863 "show ipv6 mroute " VRF_CMD_STR,
4866 "IPv6 Multicast routing table\n"
4869 DEFUN (show_ipv6_route_vrf_all,
4870 show_ipv6_route_vrf_all_cmd,
4871 "show ipv6 route " VRF_ALL_CMD_STR,
4874 "IPv6 routing table\n"
4875 VRF_ALL_CMD_HELP_STR)
4877 struct route_table *table;
4878 struct route_node *rn;
4880 struct zebra_vrf *zvrf;
4884 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
4886 if ((zvrf = vrf_iter2info (iter)) == NULL ||
4887 (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
4890 /* Show all IPv6 route. */
4891 for (rn = route_top (table); rn; rn = route_next (rn))
4892 RNODE_FOREACH_RIB (rn, rib)
4896 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4899 vty_show_ip_route (vty, rn, rib);
4906 DEFUN (show_ipv6_route_prefix_longer_vrf_all,
4907 show_ipv6_route_prefix_longer_vrf_all_cmd,
4908 "show ipv6 route X:X::X:X/M longer-prefixes " VRF_ALL_CMD_STR,
4911 "IPv6 routing table\n"
4913 "Show route matching the specified Network/Mask pair only\n"
4914 VRF_ALL_CMD_HELP_STR)
4916 struct route_table *table;
4917 struct route_node *rn;
4920 struct zebra_vrf *zvrf;
4925 ret = str2prefix (argv[0], &p);
4928 vty_out (vty, "%% Malformed Prefix%s", VTY_NEWLINE);
4932 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
4934 if ((zvrf = vrf_iter2info (iter)) == NULL ||
4935 (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
4938 /* Show matched type IPv6 routes. */
4939 for (rn = route_top (table); rn; rn = route_next (rn))
4940 RNODE_FOREACH_RIB (rn, rib)
4941 if (prefix_match (&p, &rn->p))
4945 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4948 vty_show_ip_route (vty, rn, rib);
4955 DEFUN (show_ipv6_route_protocol_vrf_all,
4956 show_ipv6_route_protocol_vrf_all_cmd,
4957 "show ipv6 route " QUAGGA_IP6_REDIST_STR_ZEBRA " " VRF_ALL_CMD_STR,
4960 "IP routing table\n"
4961 QUAGGA_IP6_REDIST_HELP_STR_ZEBRA
4962 VRF_ALL_CMD_HELP_STR)
4965 struct route_table *table;
4966 struct route_node *rn;
4968 struct zebra_vrf *zvrf;
4972 type = proto_redistnum (AFI_IP6, argv[0]);
4975 vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
4979 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
4981 if ((zvrf = vrf_iter2info (iter)) == NULL ||
4982 (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
4985 /* Show matched type IPv6 routes. */
4986 for (rn = route_top (table); rn; rn = route_next (rn))
4987 RNODE_FOREACH_RIB (rn, rib)
4988 if (rib->type == type)
4992 vty_out (vty, SHOW_ROUTE_V6_HEADER);
4995 vty_show_ip_route (vty, rn, rib);
5002 DEFUN (show_ipv6_route_addr_vrf_all,
5003 show_ipv6_route_addr_vrf_all_cmd,
5004 "show ipv6 route X:X::X:X " VRF_ALL_CMD_STR,
5007 "IPv6 routing table\n"
5009 VRF_ALL_CMD_HELP_STR)
5012 struct prefix_ipv6 p;
5013 struct route_table *table;
5014 struct route_node *rn;
5015 struct zebra_vrf *zvrf;
5018 ret = str2prefix_ipv6 (argv[0], &p);
5021 vty_out (vty, "Malformed IPv6 address%s", VTY_NEWLINE);
5025 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
5027 if ((zvrf = vrf_iter2info (iter)) == NULL ||
5028 (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
5031 rn = route_node_match (table, (struct prefix *) &p);
5035 vty_show_ip_route_detail (vty, rn, 0);
5037 route_unlock_node (rn);
5043 DEFUN (show_ipv6_route_prefix_vrf_all,
5044 show_ipv6_route_prefix_vrf_all_cmd,
5045 "show ipv6 route X:X::X:X/M " VRF_ALL_CMD_STR,
5048 "IPv6 routing table\n"
5050 VRF_ALL_CMD_HELP_STR)
5053 struct prefix_ipv6 p;
5054 struct route_table *table;
5055 struct route_node *rn;
5056 struct zebra_vrf *zvrf;
5059 ret = str2prefix_ipv6 (argv[0], &p);
5062 vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
5066 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
5068 if ((zvrf = vrf_iter2info (iter)) == NULL ||
5069 (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
5072 rn = route_node_match (table, (struct prefix *) &p);
5075 if (rn->p.prefixlen != p.prefixlen)
5077 route_unlock_node (rn);
5081 vty_show_ip_route_detail (vty, rn, 0);
5083 route_unlock_node (rn);
5089 /* Show route summary. */
5090 DEFUN (show_ipv6_route_summary_vrf_all,
5091 show_ipv6_route_summary_vrf_all_cmd,
5092 "show ipv6 route summary " VRF_ALL_CMD_STR,
5095 "IPv6 routing table\n"
5096 "Summary of all IPv6 routes\n"
5097 VRF_ALL_CMD_HELP_STR)
5099 struct zebra_vrf *zvrf;
5102 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
5103 if ((zvrf = vrf_iter2info (iter)) != NULL)
5104 vty_show_ip_route_summary (vty, zvrf->table[AFI_IP6][SAFI_UNICAST]);
5109 DEFUN (show_ipv6_mroute_vrf_all,
5110 show_ipv6_mroute_vrf_all_cmd,
5111 "show ipv6 mroute " VRF_ALL_CMD_STR,
5114 "IPv6 Multicast routing table\n"
5115 VRF_ALL_CMD_HELP_STR)
5117 struct route_table *table;
5118 struct route_node *rn;
5120 struct zebra_vrf *zvrf;
5124 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
5126 if ((zvrf = vrf_iter2info (iter)) == NULL ||
5127 (table = zvrf->table[AFI_IP6][SAFI_UNICAST]) == NULL)
5130 /* Show all IPv6 route. */
5131 for (rn = route_top (table); rn; rn = route_next (rn))
5132 RNODE_FOREACH_RIB (rn, rib)
5136 vty_out (vty, SHOW_ROUTE_V6_HEADER);
5139 vty_show_ip_route (vty, rn, rib);
5145 DEFUN (show_ipv6_route_summary_prefix_vrf_all,
5146 show_ipv6_route_summary_prefix_vrf_all_cmd,
5147 "show ipv6 route summary prefix " VRF_ALL_CMD_STR,
5150 "IPv6 routing table\n"
5151 "Summary of all IPv6 routes\n"
5153 VRF_ALL_CMD_HELP_STR)
5155 struct zebra_vrf *zvrf;
5158 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
5159 if ((zvrf = vrf_iter2info (iter)) != NULL)
5160 vty_show_ip_route_summary_prefix (vty, zvrf->table[AFI_IP6][SAFI_UNICAST]);
5165 /* Write IPv6 static route configuration. */
5167 static_config_ipv6 (struct vty *vty)
5169 struct route_node *rn;
5170 struct static_route *si;
5173 struct route_table *stable;
5174 struct zebra_vrf *zvrf;
5179 for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
5181 if ((zvrf = vrf_iter2info (iter)) == NULL ||
5182 (stable = zvrf->stable[AFI_IP6][SAFI_UNICAST]) == NULL)
5185 for (rn = route_top (stable); rn; rn = route_next (rn))
5186 for (si = rn->info; si; si = si->next)
5188 vty_out (vty, "ipv6 route %s", prefix2str (&rn->p, buf, sizeof buf));
5192 case STATIC_IPV6_GATEWAY:
5193 vty_out (vty, " %s",
5194 inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ));
5196 case STATIC_IPV6_IFNAME:
5197 vty_out (vty, " %s", si->ifname);
5199 case STATIC_IPV6_GATEWAY_IFNAME:
5200 vty_out (vty, " %s %s",
5201 inet_ntop (AF_INET6, &si->addr.ipv6, buf, BUFSIZ),
5206 if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
5207 vty_out (vty, " %s", "reject");
5209 if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
5210 vty_out (vty, " %s", "blackhole");
5213 vty_out (vty, " tag %d", si->tag);
5215 if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
5216 vty_out (vty, " %d", si->distance);
5218 if (si->vrf_id != VRF_DEFAULT)
5219 vty_out (vty, " vrf %u", si->vrf_id);
5221 vty_out (vty, "%s", VTY_NEWLINE);
5229 /* Static ip route configuration write function. */
5231 zebra_ip_config (struct vty *vty)
5235 write += static_config_ipv4 (vty, SAFI_UNICAST, "ip route");
5236 write += static_config_ipv4 (vty, SAFI_MULTICAST, "ip mroute");
5238 write += static_config_ipv6 (vty);
5239 #endif /* HAVE_IPV6 */
5244 static int config_write_vty(struct vty *vty)
5247 enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get ();
5249 if (ipv4_multicast_mode != MCAST_NO_CONFIG)
5250 vty_out (vty, "ip multicast rpf-lookup-mode %s%s",
5251 ipv4_multicast_mode == MCAST_URIB_ONLY ? "urib-only" :
5252 ipv4_multicast_mode == MCAST_MRIB_ONLY ? "mrib-only" :
5253 ipv4_multicast_mode == MCAST_MIX_MRIB_FIRST ? "mrib-then-urib" :
5254 ipv4_multicast_mode == MCAST_MIX_DISTANCE ? "lower-distance" :
5258 for (i=0;i<ZEBRA_ROUTE_MAX;i++)
5260 if (proto_rm[AFI_IP][i])
5261 vty_out (vty, "ip protocol %s route-map %s%s", zebra_route_string(i),
5262 proto_rm[AFI_IP][i], VTY_NEWLINE);
5264 if (proto_rm[AFI_IP][ZEBRA_ROUTE_MAX])
5265 vty_out (vty, "ip protocol %s route-map %s%s", "any",
5266 proto_rm[AFI_IP][ZEBRA_ROUTE_MAX], VTY_NEWLINE);
5271 /* table node for protocol filtering */
5272 static struct cmd_node protocol_node = { PROTOCOL_NODE, "", 1 };
5274 /* IP node for static routes. */
5275 static struct cmd_node ip_node = { IP_NODE, "", 1 };
5279 zebra_vty_init (void)
5281 install_node (&ip_node, zebra_ip_config);
5282 install_node (&protocol_node, config_write_vty);
5284 install_element (CONFIG_NODE, &ip_mroute_cmd);
5285 install_element (CONFIG_NODE, &ip_mroute_dist_cmd);
5286 install_element (CONFIG_NODE, &no_ip_mroute_cmd);
5287 install_element (CONFIG_NODE, &no_ip_mroute_dist_cmd);
5288 install_element (CONFIG_NODE, &ip_multicast_mode_cmd);
5289 install_element (CONFIG_NODE, &no_ip_multicast_mode_cmd);
5290 install_element (CONFIG_NODE, &no_ip_multicast_mode_noarg_cmd);
5291 install_element (CONFIG_NODE, &ip_protocol_cmd);
5292 install_element (CONFIG_NODE, &no_ip_protocol_cmd);
5293 install_element (VIEW_NODE, &show_ip_protocol_cmd);
5294 install_element (CONFIG_NODE, &ip_route_cmd);
5295 install_element (CONFIG_NODE, &ip_route_tag_cmd);
5296 install_element (CONFIG_NODE, &ip_route_flags_cmd);
5297 install_element (CONFIG_NODE, &ip_route_flags_tag_cmd);
5298 install_element (CONFIG_NODE, &ip_route_flags_tag_vrf_cmd);
5299 install_element (CONFIG_NODE, &ip_route_flags2_cmd);
5300 install_element (CONFIG_NODE, &ip_route_flags2_tag_cmd);
5301 install_element (CONFIG_NODE, &ip_route_flags2_tag_vrf_cmd);
5302 install_element (CONFIG_NODE, &ip_route_mask_cmd);
5303 install_element (CONFIG_NODE, &ip_route_mask_tag_cmd);
5304 install_element (CONFIG_NODE, &ip_route_mask_tag_vrf_cmd);
5305 install_element (CONFIG_NODE, &ip_route_mask_flags_cmd);
5306 install_element (CONFIG_NODE, &ip_route_mask_flags_tag_cmd);
5307 install_element (CONFIG_NODE, &ip_route_mask_flags_tag_vrf_cmd);
5308 install_element (CONFIG_NODE, &ip_route_mask_flags2_cmd);
5309 install_element (CONFIG_NODE, &ip_route_mask_flags2_tag_cmd);
5310 install_element (CONFIG_NODE, &ip_route_mask_flags2_tag_vrf_cmd);
5311 install_element (CONFIG_NODE, &no_ip_route_cmd);
5312 install_element (CONFIG_NODE, &no_ip_route_tag_cmd);
5313 install_element (CONFIG_NODE, &no_ip_route_flags_cmd);
5314 install_element (CONFIG_NODE, &no_ip_route_flags_tag_cmd);
5315 install_element (CONFIG_NODE, &no_ip_route_flags2_cmd);
5316 install_element (CONFIG_NODE, &no_ip_route_flags2_tag_cmd);
5317 install_element (CONFIG_NODE, &no_ip_route_flags2_tag_vrf_cmd);
5318 install_element (CONFIG_NODE, &no_ip_route_mask_cmd);
5319 install_element (CONFIG_NODE, &no_ip_route_mask_tag_cmd);
5320 install_element (CONFIG_NODE, &no_ip_route_mask_flags_cmd);
5321 install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_cmd);
5322 install_element (CONFIG_NODE, &no_ip_route_mask_flags2_cmd);
5323 install_element (CONFIG_NODE, &no_ip_route_mask_flags2_tag_cmd);
5324 install_element (CONFIG_NODE, &no_ip_route_mask_flags2_tag_vrf_cmd);
5325 install_element (CONFIG_NODE, &ip_route_distance_cmd);
5326 install_element (CONFIG_NODE, &ip_route_tag_distance_cmd);
5327 install_element (CONFIG_NODE, &ip_route_flags_distance_cmd);
5328 install_element (CONFIG_NODE, &ip_route_flags_tag_distance_cmd);
5329 install_element (CONFIG_NODE, &ip_route_flags_tag_distance_vrf_cmd);
5330 install_element (CONFIG_NODE, &ip_route_flags_distance2_cmd);
5331 install_element (CONFIG_NODE, &ip_route_flags_tag_distance2_cmd);
5332 install_element (CONFIG_NODE, &ip_route_flags_tag_distance2_vrf_cmd);
5333 install_element (CONFIG_NODE, &ip_route_mask_distance_cmd);
5334 install_element (CONFIG_NODE, &ip_route_mask_tag_distance_cmd);
5335 install_element (CONFIG_NODE, &ip_route_mask_tag_distance_vrf_cmd);
5336 install_element (CONFIG_NODE, &ip_route_mask_flags_distance_cmd);
5337 install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance_cmd);
5338 install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance_vrf_cmd);
5339 install_element (CONFIG_NODE, &ip_route_mask_flags_distance2_cmd);
5340 install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance2_cmd);
5341 install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance2_vrf_cmd);
5342 install_element (CONFIG_NODE, &no_ip_route_distance_cmd);
5343 install_element (CONFIG_NODE, &no_ip_route_tag_distance_cmd);
5344 install_element (CONFIG_NODE, &no_ip_route_flags_distance_cmd);
5345 install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance_cmd);
5346 install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance_vrf_cmd);
5347 install_element (CONFIG_NODE, &no_ip_route_flags_distance2_cmd);
5348 install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance2_cmd);
5349 install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance2_vrf_cmd);
5350 install_element (CONFIG_NODE, &no_ip_route_mask_distance_cmd);
5351 install_element (CONFIG_NODE, &no_ip_route_mask_tag_distance_cmd);
5352 install_element (CONFIG_NODE, &no_ip_route_mask_tag_distance_vrf_cmd);
5353 install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance_cmd);
5354 install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance_cmd);
5355 install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance_vrf_cmd);
5356 install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance2_cmd);
5357 install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance2_cmd);
5358 install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance2_vrf_cmd);
5360 install_element (VIEW_NODE, &show_ip_route_cmd);
5361 install_element (VIEW_NODE, &show_ip_route_tag_cmd);
5362 install_element (VIEW_NODE, &show_ip_route_tag_vrf_cmd);
5363 install_element (VIEW_NODE, &show_ip_nht_cmd);
5364 install_element (VIEW_NODE, &show_ipv6_nht_cmd);
5365 install_element (VIEW_NODE, &show_ip_route_addr_cmd);
5366 install_element (VIEW_NODE, &show_ip_route_prefix_cmd);
5367 install_element (VIEW_NODE, &show_ip_route_prefix_longer_cmd);
5368 install_element (VIEW_NODE, &show_ip_route_protocol_cmd);
5369 install_element (VIEW_NODE, &show_ip_route_supernets_cmd);
5370 install_element (VIEW_NODE, &show_ip_route_summary_cmd);
5371 install_element (VIEW_NODE, &show_ip_route_summary_prefix_cmd);
5373 install_element (VIEW_NODE, &show_ip_rpf_cmd);
5374 install_element (VIEW_NODE, &show_ip_rpf_addr_cmd);
5376 /* Commands for VRF */
5378 install_element (CONFIG_NODE, &ip_mroute_vrf_cmd);
5379 install_element (CONFIG_NODE, &ip_mroute_dist_vrf_cmd);
5380 install_element (CONFIG_NODE, &no_ip_mroute_vrf_cmd);
5381 install_element (CONFIG_NODE, &no_ip_mroute_dist_vrf_cmd);
5383 install_element (CONFIG_NODE, &ip_route_vrf_cmd);
5384 install_element (CONFIG_NODE, &ip_route_flags_vrf_cmd);
5385 install_element (CONFIG_NODE, &ip_route_flags2_vrf_cmd);
5386 install_element (CONFIG_NODE, &ip_route_mask_vrf_cmd);
5387 install_element (CONFIG_NODE, &ip_route_mask_flags_vrf_cmd);
5388 install_element (CONFIG_NODE, &ip_route_mask_flags2_vrf_cmd);
5389 install_element (CONFIG_NODE, &no_ip_route_vrf_cmd);
5390 install_element (CONFIG_NODE, &no_ip_route_flags_vrf_cmd);
5391 install_element (CONFIG_NODE, &no_ip_route_flags2_vrf_cmd);
5392 install_element (CONFIG_NODE, &no_ip_route_mask_vrf_cmd);
5393 install_element (CONFIG_NODE, &no_ip_route_mask_flags_vrf_cmd);
5394 install_element (CONFIG_NODE, &no_ip_route_mask_flags2_vrf_cmd);
5395 install_element (CONFIG_NODE, &ip_route_distance_vrf_cmd);
5396 install_element (CONFIG_NODE, &ip_route_flags_distance_vrf_cmd);
5397 install_element (CONFIG_NODE, &ip_route_flags_distance2_vrf_cmd);
5398 install_element (CONFIG_NODE, &ip_route_mask_distance_vrf_cmd);
5399 install_element (CONFIG_NODE, &ip_route_mask_flags_distance_vrf_cmd);
5400 install_element (CONFIG_NODE, &ip_route_mask_flags_distance2_vrf_cmd);
5401 install_element (CONFIG_NODE, &no_ip_route_distance_vrf_cmd);
5402 install_element (CONFIG_NODE, &no_ip_route_flags_distance_vrf_cmd);
5403 install_element (CONFIG_NODE, &no_ip_route_flags_distance2_vrf_cmd);
5404 install_element (CONFIG_NODE, &no_ip_route_mask_distance_vrf_cmd);
5405 install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance_vrf_cmd);
5406 install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance2_vrf_cmd);
5408 install_element (VIEW_NODE, &show_ip_route_vrf_cmd);
5409 install_element (VIEW_NODE, &show_ip_route_addr_vrf_cmd);
5410 install_element (VIEW_NODE, &show_ip_route_prefix_vrf_cmd);
5411 install_element (VIEW_NODE, &show_ip_route_prefix_longer_vrf_cmd);
5412 install_element (VIEW_NODE, &show_ip_route_protocol_vrf_cmd);
5413 install_element (VIEW_NODE, &show_ip_route_supernets_vrf_cmd);
5414 install_element (VIEW_NODE, &show_ip_route_summary_vrf_cmd);
5415 install_element (VIEW_NODE, &show_ip_route_summary_prefix_vrf_cmd);
5417 install_element (VIEW_NODE, &show_ip_route_vrf_all_cmd);
5418 install_element (VIEW_NODE, &show_ip_route_addr_vrf_all_cmd);
5419 install_element (VIEW_NODE, &show_ip_route_prefix_vrf_all_cmd);
5420 install_element (VIEW_NODE, &show_ip_route_prefix_longer_vrf_all_cmd);
5421 install_element (VIEW_NODE, &show_ip_route_protocol_vrf_all_cmd);
5422 install_element (VIEW_NODE, &show_ip_route_supernets_vrf_all_cmd);
5423 install_element (VIEW_NODE, &show_ip_route_summary_vrf_all_cmd);
5424 install_element (VIEW_NODE, &show_ip_route_summary_prefix_vrf_all_cmd);
5426 install_element (VIEW_NODE, &show_ip_rpf_vrf_cmd);
5427 install_element (VIEW_NODE, &show_ip_rpf_vrf_all_cmd);
5428 install_element (VIEW_NODE, &show_ip_rpf_addr_vrf_cmd);
5429 install_element (VIEW_NODE, &show_ip_rpf_addr_vrf_all_cmd);
5431 install_element (CONFIG_NODE, &ipv6_route_cmd);
5432 install_element (CONFIG_NODE, &ipv6_route_flags_cmd);
5433 install_element (CONFIG_NODE, &ipv6_route_ifname_cmd);
5434 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_cmd);
5435 install_element (CONFIG_NODE, &no_ipv6_route_cmd);
5436 install_element (CONFIG_NODE, &no_ipv6_route_flags_cmd);
5437 install_element (CONFIG_NODE, &no_ipv6_route_ifname_cmd);
5438 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_cmd);
5439 install_element (CONFIG_NODE, &ipv6_route_pref_cmd);
5440 install_element (CONFIG_NODE, &ipv6_route_flags_pref_cmd);
5441 install_element (CONFIG_NODE, &ipv6_route_ifname_pref_cmd);
5442 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_cmd);
5443 install_element (CONFIG_NODE, &no_ipv6_route_pref_cmd);
5444 install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_cmd);
5445 install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_cmd);
5446 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_cmd);
5447 install_element (CONFIG_NODE, &ipv6_route_tag_cmd);
5448 install_element (CONFIG_NODE, &ipv6_route_tag_vrf_cmd);
5449 install_element (CONFIG_NODE, &ipv6_route_flags_tag_cmd);
5450 install_element (CONFIG_NODE, &ipv6_route_flags_tag_vrf_cmd);
5451 install_element (CONFIG_NODE, &ipv6_route_ifname_tag_cmd);
5452 install_element (CONFIG_NODE, &ipv6_route_ifname_tag_vrf_cmd);
5453 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_tag_cmd);
5454 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_tag_vrf_cmd);
5455 install_element (CONFIG_NODE, &ipv6_route_pref_tag_cmd);
5456 install_element (CONFIG_NODE, &ipv6_route_pref_tag_vrf_cmd);
5457 install_element (CONFIG_NODE, &ipv6_route_flags_pref_tag_cmd);
5458 install_element (CONFIG_NODE, &ipv6_route_flags_pref_tag_vrf_cmd);
5459 install_element (CONFIG_NODE, &ipv6_route_ifname_pref_tag_cmd);
5460 install_element (CONFIG_NODE, &ipv6_route_ifname_pref_tag_vrf_cmd);
5461 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_tag_cmd);
5462 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_tag_vrf_cmd);
5463 install_element (CONFIG_NODE, &no_ipv6_route_tag_cmd);
5464 install_element (CONFIG_NODE, &no_ipv6_route_tag_vrf_cmd);
5465 install_element (CONFIG_NODE, &no_ipv6_route_flags_tag_cmd);
5466 install_element (CONFIG_NODE, &no_ipv6_route_ifname_tag_cmd);
5467 install_element (CONFIG_NODE, &no_ipv6_route_ifname_tag_vrf_cmd);
5468 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_tag_cmd);
5469 install_element (CONFIG_NODE, &no_ipv6_route_pref_tag_cmd);
5470 install_element (CONFIG_NODE, &no_ipv6_route_pref_tag_vrf_cmd);
5471 install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_tag_cmd);
5472 install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_tag_vrf_cmd);
5473 install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_tag_cmd);
5474 install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_tag_vrf_cmd);
5475 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_tag_cmd);
5476 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_tag_vrf_cmd);
5477 install_element (VIEW_NODE, &show_ipv6_route_cmd);
5478 install_element (VIEW_NODE, &show_ipv6_route_tag_cmd);
5479 install_element (VIEW_NODE, &show_ipv6_route_tag_vrf_cmd);
5480 install_element (VIEW_NODE, &show_ipv6_route_summary_cmd);
5481 install_element (VIEW_NODE, &show_ipv6_route_summary_prefix_cmd);
5482 install_element (VIEW_NODE, &show_ipv6_route_protocol_cmd);
5483 install_element (VIEW_NODE, &show_ipv6_route_addr_cmd);
5484 install_element (VIEW_NODE, &show_ipv6_route_prefix_cmd);
5485 install_element (VIEW_NODE, &show_ipv6_route_prefix_longer_cmd);
5487 install_element (VIEW_NODE, &show_ipv6_mroute_cmd);
5489 /* Commands for VRF */
5491 install_element (CONFIG_NODE, &ipv6_route_vrf_cmd);
5492 install_element (CONFIG_NODE, &ipv6_route_flags_vrf_cmd);
5493 install_element (CONFIG_NODE, &ipv6_route_ifname_vrf_cmd);
5494 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_vrf_cmd);
5495 install_element (CONFIG_NODE, &no_ipv6_route_vrf_cmd);
5496 install_element (CONFIG_NODE, &no_ipv6_route_flags_vrf_cmd);
5497 install_element (CONFIG_NODE, &no_ipv6_route_ifname_vrf_cmd);
5498 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_vrf_cmd);
5499 install_element (CONFIG_NODE, &ipv6_route_pref_vrf_cmd);
5500 install_element (CONFIG_NODE, &ipv6_route_flags_pref_vrf_cmd);
5501 install_element (CONFIG_NODE, &ipv6_route_ifname_pref_vrf_cmd);
5502 install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_vrf_cmd);
5503 install_element (CONFIG_NODE, &no_ipv6_route_pref_vrf_cmd);
5504 install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_vrf_cmd);
5505 install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_vrf_cmd);
5506 install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_vrf_cmd);
5508 install_element (VIEW_NODE, &show_ipv6_route_vrf_cmd);
5509 install_element (VIEW_NODE, &show_ipv6_route_summary_vrf_cmd);
5510 install_element (VIEW_NODE, &show_ipv6_route_summary_prefix_vrf_cmd);
5511 install_element (VIEW_NODE, &show_ipv6_route_protocol_vrf_cmd);
5512 install_element (VIEW_NODE, &show_ipv6_route_addr_vrf_cmd);
5513 install_element (VIEW_NODE, &show_ipv6_route_prefix_vrf_cmd);
5514 install_element (VIEW_NODE, &show_ipv6_route_prefix_longer_vrf_cmd);
5516 install_element (VIEW_NODE, &show_ipv6_route_vrf_all_cmd);
5517 install_element (VIEW_NODE, &show_ipv6_route_summary_vrf_all_cmd);
5518 install_element (VIEW_NODE, &show_ipv6_route_summary_prefix_vrf_all_cmd);
5519 install_element (VIEW_NODE, &show_ipv6_route_protocol_vrf_all_cmd);
5520 install_element (VIEW_NODE, &show_ipv6_route_addr_vrf_all_cmd);
5521 install_element (VIEW_NODE, &show_ipv6_route_prefix_vrf_all_cmd);
5522 install_element (VIEW_NODE, &show_ipv6_route_prefix_longer_vrf_all_cmd);
5524 install_element (VIEW_NODE, &show_ipv6_mroute_vrf_cmd);
5526 install_element (VIEW_NODE, &show_ipv6_mroute_vrf_all_cmd);
5527 install_element (ENABLE_NODE, &show_ipv6_mroute_vrf_all_cmd);