return do_show_ip_route (vty, argv[idx_json]->arg, SAFI_UNICAST, uj);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip nht " VRF_CMD_STR,
- * SHOW_STR
- * IP_STR
- * "IP nexthop tracking table\n"
- * VRF_CMD_HELP_STR
- *
- */
DEFUN (show_ip_nht,
show_ip_nht_cmd,
- "show ip nht",
+ "show ip nht [vrf NAME]",
SHOW_STR
IP_STR
- "IP nexthop tracking table\n")
+ "IP nexthop tracking table\n"
+ VRF_CMD_HELP_STR)
{
+ int idx_vrf = 4;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (argc == 5)
+ VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
zebra_print_rnh_table(vrf_id, AF_INET, vty, RNH_NEXTHOP_TYPE);
return CMD_SUCCESS;
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 nht " VRF_CMD_STR,
- * SHOW_STR
- * IPV6_STR
- * "IPv6 nexthop tracking table\n"
- * VRF_CMD_HELP_STR
- *
- */
DEFUN (show_ipv6_nht,
show_ipv6_nht_cmd,
- "show ipv6 nht",
+ "show ipv6 nht [vrf NAME]",
SHOW_STR
IPV6_STR
- "IPv6 nexthop tracking table\n")
+ "IPv6 nexthop tracking table\n"
+ VRF_CMD_HELP_STR)
{
+ int idx_vrf = 4;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (argc == 5)
+ VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
zebra_print_rnh_table(vrf_id, AF_INET6, vty, RNH_NEXTHOP_TYPE);
return CMD_SUCCESS;
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " tag <1-65535>",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "Show only routes with tag\n"
- * "Tag value\n"
- *
- */
DEFUN (show_ip_route_tag,
show_ip_route_tag_cmd,
- "show ip route tag (1-65535)",
+ "show ip route [vrf NAME] tag (1-65535)",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"Show only routes with tag\n"
"Tag value\n")
{
- int idx_number = 4;
struct route_table *table;
struct route_node *rn;
struct rib *rib;
int first = 1;
u_short tag = 0;
vrf_id_t vrf_id = VRF_DEFAULT;
-
- if (argc > 1)
- {
- tag = atoi(argv[1]);
- VRF_GET_ID (vrf_id, argv[idx_number]->arg);
- }
- else
- tag = atoi(argv[idx_number]->arg);
+
+ if (strcmp(argv[3]->text, "vrf"))
+ {
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ tag = atoi(argv[6]->arg);
+ }
+ else
+ {
+ tag = atoi(argv[4]->arg);
+ }
table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
if (! table)
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " A.B.C.D/M longer-prefixes",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
- * "Show route matching the specified Network/Mask pair only\n"
- *
- */
DEFUN (show_ip_route_prefix_longer,
show_ip_route_prefix_longer_cmd,
- "show ip route A.B.C.D/M longer-prefixes",
+ "show ip route [vrf NAME] A.B.C.D/M longer-prefixes",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Show route matching the specified Network/Mask pair only\n")
{
- int idx_ipv4_prefixlen = 3;
struct route_table *table;
struct route_node *rn;
struct rib *rib;
int first = 1;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- ret = str2prefix (argv[1], &p);
- VRF_GET_ID (vrf_id, argv[idx_ipv4_prefixlen]->arg);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ ret = str2prefix (argv[5]->arg, &p);
}
else
- ret = str2prefix (argv[idx_ipv4_prefixlen]->arg, &p);
+ {
+ ret = str2prefix (argv[3]->arg, &p);
+ }
if (! ret)
{
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " supernets-only",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "Show supernet entries only\n"
- *
- */
DEFUN (show_ip_route_supernets,
show_ip_route_supernets_cmd,
- "show ip route supernets-only",
+ "show ip route [vrf NAME] supernets-only",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"Show supernet entries only\n")
{
struct route_table *table;
int first = 1;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 0)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (strcmp(argv[3]->text, "vrf"))
+ VRF_GET_ID (vrf_id, argv[4]->arg);
table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
if (! table)
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " " QUAGGA_IP_REDIST_STR_ZEBRA,
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * QUAGGA_IP_REDIST_HELP_STR_ZEBRA
- *
- */
DEFUN (show_ip_route_protocol,
show_ip_route_protocol_cmd,
- "show ip route " QUAGGA_IP_REDIST_STR_ZEBRA,
+ "show ip route [vrf NAME] " QUAGGA_IP_REDIST_STR_ZEBRA,
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
QUAGGA_IP_REDIST_HELP_STR_ZEBRA)
{
int type;
int first = 1;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- type = proto_redistnum (AFI_IP, argv[1]);
+ type = proto_redistnum (AFI_IP, argv[5]->arg);
VRF_GET_ID (vrf_id, argv[4]->arg);
- }
+ }
else
- type = proto_redistnum (AFI_IP, argv[4]->arg);
+ {
+ type = proto_redistnum (AFI_IP, argv[3]->arg);
+ }
if (type < 0)
{
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " A.B.C.D",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "Network in the IP routing table to display\n"
- *
- */
DEFUN (show_ip_route_addr,
show_ip_route_addr_cmd,
- "show ip route A.B.C.D",
+ "show ip route [vrf NAME] A.B.C.D",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"Network in the IP routing table to display\n")
{
- int idx_ipv4 = 3;
int ret;
struct prefix_ipv4 p;
struct route_table *table;
struct route_node *rn;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- VRF_GET_ID (vrf_id, argv[idx_ipv4]->arg);
- ret = str2prefix_ipv4 (argv[1], &p);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ ret = str2prefix_ipv4 (argv[5]->arg, &p);
}
else
- ret = str2prefix_ipv4 (argv[idx_ipv4]->arg, &p);
+ {
+ ret = str2prefix_ipv4 (argv[3]->arg, &p);
+ }
if (ret <= 0)
{
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " A.B.C.D/M",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
- *
- */
DEFUN (show_ip_route_prefix,
show_ip_route_prefix_cmd,
- "show ip route A.B.C.D/M",
+ "show ip route [vrf NAME] A.B.C.D/M",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
{
- int idx_ipv4_prefixlen = 3;
int ret;
struct prefix_ipv4 p;
struct route_table *table;
struct route_node *rn;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- VRF_GET_ID (vrf_id, argv[idx_ipv4_prefixlen]->arg);
- ret = str2prefix_ipv4 (argv[1], &p);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ ret = str2prefix_ipv4 (argv[5]->arg, &p);
}
else
- ret = str2prefix_ipv4 (argv[idx_ipv4_prefixlen]->arg, &p);
+ {
+ ret = str2prefix_ipv4 (argv[3]->arg, &p);
+ }
if (ret <= 0)
{
}
/* Show route summary. */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " summary",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "Summary of all routes\n"
- *
- */
DEFUN (show_ip_route_summary,
show_ip_route_summary_cmd,
- "show ip route summary",
+ "show ip route [vrf NAME] summary",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"Summary of all routes\n")
{
struct route_table *table;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 0)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (strcmp(argv[3]->text, "vrf"))
+ VRF_GET_ID (vrf_id, argv[4]->arg);
table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
if (! table)
/* Show route summary prefix. */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ip route " VRF_CMD_STR " summary prefix",
- * SHOW_STR
- * IP_STR
- * "IP routing table\n"
- * VRF_CMD_HELP_STR
- * "Summary of all routes\n"
- * "Prefix routes\n"
- *
- */
DEFUN (show_ip_route_summary_prefix,
show_ip_route_summary_prefix_cmd,
- "show ip route summary prefix",
+ "show ip route [vrf NAME] summary prefix",
SHOW_STR
IP_STR
"IP routing table\n"
+ VRF_CMD_HELP_STR
"Summary of all routes\n"
"Prefix routes\n")
{
struct route_table *table;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 0)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (strcmp(argv[3]->text, "vrf"))
+ VRF_GET_ID (vrf_id, argv[4]->arg);
table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
if (! table)
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route " VRF_CMD_STR " tag <1-65535>",
- * SHOW_STR
- * IP_STR
- * "IPv6 routing table\n"
- * VRF_CMD_HELP_STR
- * "Show only routes with tag\n"
- * "Tag value\n"
- *
- */
DEFUN (show_ipv6_route_tag,
show_ipv6_route_tag_cmd,
- "show ipv6 route tag (1-65535)",
+ "show ipv6 route [vrf NAME] tag (1-65535)",
SHOW_STR
IP_STR
"IPv6 routing table\n"
+ VRF_CMD_HELP_STR
"Show only routes with tag\n"
"Tag value\n")
{
- int idx_number = 4;
struct route_table *table;
struct route_node *rn;
struct rib *rib;
u_short tag = 0;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- VRF_GET_ID (vrf_id, argv[idx_number]->arg);
- tag = atoi(argv[1]);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ tag = atoi(argv[6]->arg);
}
else
- tag = atoi(argv[idx_number]->arg);
+ {
+ tag = atoi(argv[4]->arg);
+ }
table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
if (! table)
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route " VRF_CMD_STR " X:X::X:X/M longer-prefixes",
- * SHOW_STR
- * IP_STR
- * "IPv6 routing table\n"
- * VRF_CMD_HELP_STR
- * "IPv6 prefix\n"
- * "Show route matching the specified Network/Mask pair only\n"
- *
- */
DEFUN (show_ipv6_route_prefix_longer,
show_ipv6_route_prefix_longer_cmd,
- "show ipv6 route X:X::X:X/M longer-prefixes",
+ "show ipv6 route [vrf NAME] X:X::X:X/M longer-prefixes",
SHOW_STR
IP_STR
"IPv6 routing table\n"
+ VRF_CMD_HELP_STR
"IPv6 prefix\n"
"Show route matching the specified Network/Mask pair only\n")
{
- int idx_ipv6_prefixlen = 3;
struct route_table *table;
struct route_node *rn;
struct rib *rib;
int first = 1;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- VRF_GET_ID (vrf_id, argv[idx_ipv6_prefixlen]->arg);
- ret = str2prefix (argv[1], &p);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ ret = str2prefix (argv[5]->arg, &p);
}
else
- ret = str2prefix (argv[idx_ipv6_prefixlen]->arg, &p);
+ {
+ ret = str2prefix (argv[3]->arg, &p);
+ }
if (! ret)
{
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route " VRF_CMD_STR " X:X::X:X",
- * SHOW_STR
- * IP_STR
- * "IPv6 routing table\n"
- * VRF_CMD_HELP_STR
- * "IPv6 Address\n"
- *
- */
DEFUN (show_ipv6_route_addr,
show_ipv6_route_addr_cmd,
- "show ipv6 route X:X::X:X",
+ "show ipv6 route [vrf NAME] X:X::X:X",
SHOW_STR
IP_STR
"IPv6 routing table\n"
+ VRF_CMD_HELP_STR
"IPv6 Address\n")
{
- int idx_ipv6 = 3;
int ret;
struct prefix_ipv6 p;
struct route_table *table;
struct route_node *rn;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1 )
+ if (strcmp(argv[3]->text, "vrf"))
{
- VRF_GET_ID (vrf_id, argv[idx_ipv6]->arg);
- ret = str2prefix_ipv6 (argv[1], &p);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ ret = str2prefix_ipv6 (argv[5]->arg, &p);
}
else
- ret = str2prefix_ipv6 (argv[idx_ipv6]->arg, &p);
+ {
+ ret = str2prefix_ipv6 (argv[3]->arg, &p);
+ }
if (ret <= 0)
{
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route " VRF_CMD_STR " X:X::X:X/M ",
- * SHOW_STR
- * IP_STR
- * "IPv6 routing table\n"
- * VRF_CMD_HELP_STR
- * "IPv6 prefix\n"
- *
- */
DEFUN (show_ipv6_route_prefix,
show_ipv6_route_prefix_cmd,
- "show ipv6 route X:X::X:X/M",
+ "show ipv6 route [vrf NAME] X:X::X:X/M",
SHOW_STR
IP_STR
"IPv6 routing table\n"
+ VRF_CMD_HELP_STR
"IPv6 prefix\n")
{
- int idx_ipv6_prefixlen = 3;
int ret;
struct prefix_ipv6 p;
struct route_table *table;
struct route_node *rn;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 1)
+ if (strcmp(argv[3]->text, "vrf"))
{
- VRF_GET_ID (vrf_id, argv[idx_ipv6_prefixlen]->arg);
- ret = str2prefix_ipv6 (argv[1], &p);
+ VRF_GET_ID (vrf_id, argv[4]->arg);
+ ret = str2prefix_ipv6 (argv[5]->arg, &p);
}
else
- ret = str2prefix_ipv6 (argv[idx_ipv6_prefixlen]->arg, &p);
+ ret = str2prefix_ipv6 (argv[3]->arg, &p);
if (ret <= 0)
{
/* Show route summary. */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route " VRF_CMD_STR " summary",
- * SHOW_STR
- * IP_STR
- * "IPv6 routing table\n"
- * VRF_CMD_HELP_STR
- * "Summary of all IPv6 routes\n"
- *
- */
DEFUN (show_ipv6_route_summary,
show_ipv6_route_summary_cmd,
- "show ipv6 route summary",
+ "show ipv6 route [vrf NAME] summary",
SHOW_STR
IP_STR
"IPv6 routing table\n"
+ VRF_CMD_HELP_STR
"Summary of all IPv6 routes\n")
{
struct route_table *table;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 0)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (strcmp(argv[3]->text, "vrf"))
+ VRF_GET_ID (vrf_id, argv[4]->arg);
table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
if (! table)
/* Show ipv6 route summary prefix. */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route " VRF_CMD_STR " summary prefix",
- * SHOW_STR
- * IP_STR
- * "IPv6 routing table\n"
- * VRF_CMD_HELP_STR
- * "Summary of all IPv6 routes\n"
- * "Prefix routes\n"
- *
- */
DEFUN (show_ipv6_route_summary_prefix,
show_ipv6_route_summary_prefix_cmd,
- "show ipv6 route summary prefix",
+ "show ipv6 route [vrf NAME] summary prefix",
SHOW_STR
IP_STR
"IPv6 routing table\n"
+ VRF_CMD_HELP_STR
"Summary of all IPv6 routes\n"
"Prefix routes\n")
{
struct route_table *table;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 0)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (strcmp(argv[3]->text, "vrf"))
+ VRF_GET_ID (vrf_id, argv[4]->arg);
table = zebra_vrf_table (AFI_IP6, SAFI_UNICAST, vrf_id);
if (! table)
* Show IPv6 mroute command.Used to dump
* the Multicast routing table.
*/
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 mroute " VRF_CMD_STR,
- * SHOW_STR
- * IP_STR
- * "IPv6 Multicast routing table\n"
- * VRF_CMD_HELP_STR
- *
- */
DEFUN (show_ipv6_mroute,
show_ipv6_mroute_cmd,
- "show ipv6 mroute",
+ "show ipv6 mroute [vrf NAME]",
SHOW_STR
IP_STR
- "IPv6 Multicast routing table\n")
+ "IPv6 Multicast routing table\n"
+ VRF_CMD_HELP_STR)
{
struct route_table *table;
struct route_node *rn;
int first = 1;
vrf_id_t vrf_id = VRF_DEFAULT;
- if (argc > 0)
- VRF_GET_ID (vrf_id, argv[0]);
+ if (strcmp(argv[3]->text, "vrf"))
+ VRF_GET_ID (vrf_id, argv[4]->arg);
table = zebra_vrf_table (AFI_IP6, SAFI_MULTICAST, vrf_id);
if (! table)