ospfd/ospf_vty.c: use keyword cmd style
Use the new keyword command style for:
- default-information originate
- distance ospf
- redistribute
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 5e5a0b0..1489b20 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -5787,11 +5787,10 @@
"OSPF interface commands\n"
"Link state transmit delay\n")
-
-DEFUN (ospf_redistribute_source_metric_type,
- ospf_redistribute_source_metric_type_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD
- " metric <0-16777214> metric-type (1|2) route-map WORD",
+DEFUN (ospf_redistribute_source,
+ ospf_redistribute_source_cmd,
+ "redistribute " QUAGGA_REDIST_STR_OSPFD
+ " {metric <0-16777214>|metric-type (1|2)|route-map WORD}",
REDIST_STR
QUAGGA_REDIST_HELP_STR_OSPFD
"Metric for redistributed routes\n"
@@ -5807,84 +5806,25 @@
int type = -1;
int metric = -1;
+ if (argc < 4)
+ return CMD_WARNING; /* should not happen */
+
/* Get distribute source. */
source = proto_redistnum(AFI_IP, argv[0]);
if (source < 0 || source == ZEBRA_ROUTE_OSPF)
return CMD_WARNING;
/* Get metric value. */
- if (argc >= 2)
+ if (argv[1] != NULL)
if (!str2metric (argv[1], &metric))
return CMD_WARNING;
/* Get metric type. */
- if (argc >= 3)
+ if (argv[2] != NULL)
if (!str2metric_type (argv[2], &type))
return CMD_WARNING;
- if (argc == 4)
- ospf_routemap_set (ospf, source, argv[3]);
- else
- ospf_routemap_unset (ospf, source);
-
- return ospf_redistribute_set (ospf, source, type, metric);
-}
-
-ALIAS (ospf_redistribute_source_metric_type,
- ospf_redistribute_source_metric_type_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD
- " metric <0-16777214> metric-type (1|2)",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "Metric for redistributed routes\n"
- "OSPF default metric\n"
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
-ALIAS (ospf_redistribute_source_metric_type,
- ospf_redistribute_source_metric_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD " metric <0-16777214>",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "Metric for redistributed routes\n"
- "OSPF default metric\n")
-
-DEFUN (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_type_metric_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD
- " metric-type (1|2) metric <0-16777214> route-map WORD",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Metric for redistributed routes\n"
- "OSPF default metric\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int source;
- int type = -1;
- int metric = -1;
-
- /* Get distribute source. */
- source = proto_redistnum(AFI_IP, argv[0]);
- if (source < 0 || source == ZEBRA_ROUTE_OSPF)
- return CMD_WARNING;
-
- /* Get metric value. */
- if (argc >= 2)
- if (!str2metric_type (argv[1], &type))
- return CMD_WARNING;
-
- /* Get metric type. */
- if (argc >= 3)
- if (!str2metric (argv[2], &metric))
- return CMD_WARNING;
-
- if (argc == 4)
+ if (argv[3] != NULL)
ospf_routemap_set (ospf, source, argv[3]);
else
ospf_routemap_unset (ospf, source);
@@ -5892,124 +5832,6 @@
return ospf_redistribute_set (ospf, source, type, metric);
}
-ALIAS (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_type_metric_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD
- " metric-type (1|2) metric <0-16777214>",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Metric for redistributed routes\n"
- "OSPF default metric\n")
-
-ALIAS (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_type_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD " metric-type (1|2)",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
-ALIAS (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD,
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD)
-
-DEFUN (ospf_redistribute_source_metric_routemap,
- ospf_redistribute_source_metric_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD
- " metric <0-16777214> route-map WORD",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "Metric for redistributed routes\n"
- "OSPF default metric\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int source;
- int metric = -1;
-
- /* Get distribute source. */
- source = proto_redistnum(AFI_IP, argv[0]);
- if (source < 0 || source == ZEBRA_ROUTE_OSPF)
- return CMD_WARNING;
-
- /* Get metric value. */
- if (argc >= 2)
- if (!str2metric (argv[1], &metric))
- return CMD_WARNING;
-
- if (argc == 3)
- ospf_routemap_set (ospf, source, argv[2]);
- else
- ospf_routemap_unset (ospf, source);
-
- return ospf_redistribute_set (ospf, source, -1, metric);
-}
-
-DEFUN (ospf_redistribute_source_type_routemap,
- ospf_redistribute_source_type_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD
- " metric-type (1|2) route-map WORD",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int source;
- int type = -1;
-
- /* Get distribute source. */
- source = proto_redistnum(AFI_IP, argv[0]);
- if (source < 0 || source == ZEBRA_ROUTE_OSPF)
- return CMD_WARNING;
-
- /* Get metric value. */
- if (argc >= 2)
- if (!str2metric_type (argv[1], &type))
- return CMD_WARNING;
-
- if (argc == 3)
- ospf_routemap_set (ospf, source, argv[2]);
- else
- ospf_routemap_unset (ospf, source);
-
- return ospf_redistribute_set (ospf, source, type, -1);
-}
-
-DEFUN (ospf_redistribute_source_routemap,
- ospf_redistribute_source_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_OSPFD " route-map WORD",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_OSPFD
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int source;
-
- /* Get distribute source. */
- source = proto_redistnum(AFI_IP, argv[0]);
- if (source < 0 || source == ZEBRA_ROUTE_OSPF)
- return CMD_WARNING;
-
- if (argc == 2)
- ospf_routemap_set (ospf, source, argv[1]);
- else
- ospf_routemap_unset (ospf, source);
-
- return ospf_redistribute_set (ospf, source, -1, -1);
-}
-
DEFUN (no_ospf_redistribute_source,
no_ospf_redistribute_source_cmd,
"no redistribute " QUAGGA_REDIST_STR_OSPFD,
@@ -6067,399 +5889,52 @@
}
/* Default information originate. */
-DEFUN (ospf_default_information_originate_metric_type_routemap,
- ospf_default_information_originate_metric_type_routemap_cmd,
- "default-information originate metric <0-16777214> metric-type (1|2) route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int type = -1;
- int metric = -1;
-
- /* Get metric value. */
- if (argc >= 1)
- if (!str2metric (argv[0], &metric))
- return CMD_WARNING;
-
- /* Get metric type. */
- if (argc >= 2)
- if (!str2metric_type (argv[1], &type))
- return CMD_WARNING;
-
- if (argc == 3)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[2]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ZEBRA,
- type, metric);
-}
-
-ALIAS (ospf_default_information_originate_metric_type_routemap,
- ospf_default_information_originate_metric_type_cmd,
- "default-information originate metric <0-16777214> metric-type (1|2)",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
-ALIAS (ospf_default_information_originate_metric_type_routemap,
- ospf_default_information_originate_metric_cmd,
- "default-information originate metric <0-16777214>",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "OSPF default metric\n"
- "OSPF metric\n")
-
-ALIAS (ospf_default_information_originate_metric_type_routemap,
+DEFUN (ospf_default_information_originate,
ospf_default_information_originate_cmd,
- "default-information originate",
- "Control distribution of default information\n"
- "Distribute a default route\n")
-
-/* Default information originate. */
-DEFUN (ospf_default_information_originate_metric_routemap,
- ospf_default_information_originate_metric_routemap_cmd,
- "default-information originate metric <0-16777214> route-map WORD",
+ "default-information originate "
+ "{always|metric <0-16777214>|metric-type (1|2)|route-map WORD}",
"Control distribution of default information\n"
"Distribute a default route\n"
+ "Always advertise default route\n"
"OSPF default metric\n"
"OSPF metric\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int metric = -1;
-
- /* Get metric value. */
- if (argc >= 1)
- if (!str2metric (argv[0], &metric))
- return CMD_WARNING;
-
- if (argc == 2)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[1]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ZEBRA,
- -1, metric);
-}
-
-/* Default information originate. */
-DEFUN (ospf_default_information_originate_routemap,
- ospf_default_information_originate_routemap_cmd,
- "default-information originate route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
-
- if (argc == 1)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[0]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ZEBRA, -1, -1);
-}
-
-DEFUN (ospf_default_information_originate_type_metric_routemap,
- ospf_default_information_originate_type_metric_routemap_cmd,
- "default-information originate metric-type (1|2) metric <0-16777214> route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
"OSPF metric type for default routes\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n"
- "OSPF default metric\n"
- "OSPF metric\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
struct ospf *ospf = vty->index;
+ int default_originate = DEFAULT_ORIGINATE_ZEBRA;
int type = -1;
int metric = -1;
- /* Get metric type. */
- if (argc >= 1)
- if (!str2metric_type (argv[0], &type))
- return CMD_WARNING;
+ if (argc < 4)
+ return CMD_WARNING; /* this should not happen */
+
+ /* Check whether "always" was specified */
+ if (argv[0] != NULL)
+ default_originate = DEFAULT_ORIGINATE_ALWAYS;
/* Get metric value. */
- if (argc >= 2)
+ if (argv[1] != NULL)
if (!str2metric (argv[1], &metric))
return CMD_WARNING;
- if (argc == 3)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[2]);
+ /* Get metric type. */
+ if (argv[2] != NULL)
+ if (!str2metric_type (argv[2], &type))
+ return CMD_WARNING;
+
+ if (argv[3] != NULL)
+ ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[3]);
else
ospf_routemap_unset (ospf, DEFAULT_ROUTE);
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ZEBRA,
+ return ospf_redistribute_default_set (ospf, default_originate,
type, metric);
}
-ALIAS (ospf_default_information_originate_type_metric_routemap,
- ospf_default_information_originate_type_metric_cmd,
- "default-information originate metric-type (1|2) metric <0-16777214>",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "OSPF default metric\n"
- "OSPF metric\n")
-
-ALIAS (ospf_default_information_originate_type_metric_routemap,
- ospf_default_information_originate_type_cmd,
- "default-information originate metric-type (1|2)",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
-DEFUN (ospf_default_information_originate_type_routemap,
- ospf_default_information_originate_type_routemap_cmd,
- "default-information originate metric-type (1|2) route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int type = -1;
-
- /* Get metric type. */
- if (argc >= 1)
- if (!str2metric_type (argv[0], &type))
- return CMD_WARNING;
-
- if (argc == 2)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[1]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ZEBRA,
- type, -1);
-}
-
-DEFUN (ospf_default_information_originate_always_metric_type_routemap,
- ospf_default_information_originate_always_metric_type_routemap_cmd,
- "default-information originate always metric <0-16777214> metric-type (1|2) route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int type = -1;
- int metric = -1;
-
- /* Get metric value. */
- if (argc >= 1)
- if (!str2metric (argv[0], &metric))
- return CMD_WARNING;
-
- /* Get metric type. */
- if (argc >= 2)
- if (!str2metric_type (argv[1], &type))
- return CMD_WARNING;
-
- if (argc == 3)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[2]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ALWAYS,
- type, metric);
-}
-
-ALIAS (ospf_default_information_originate_always_metric_type_routemap,
- ospf_default_information_originate_always_metric_type_cmd,
- "default-information originate always metric <0-16777214> metric-type (1|2)",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
-ALIAS (ospf_default_information_originate_always_metric_type_routemap,
- ospf_default_information_originate_always_metric_cmd,
- "default-information originate always metric <0-16777214>",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "OSPF metric type for default routes\n")
-
-ALIAS (ospf_default_information_originate_always_metric_type_routemap,
- ospf_default_information_originate_always_cmd,
- "default-information originate always",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n")
-
-DEFUN (ospf_default_information_originate_always_metric_routemap,
- ospf_default_information_originate_always_metric_routemap_cmd,
- "default-information originate always metric <0-16777214> route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int metric = -1;
-
- /* Get metric value. */
- if (argc >= 1)
- if (!str2metric (argv[0], &metric))
- return CMD_WARNING;
-
- if (argc == 2)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[1]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ALWAYS,
- -1, metric);
-}
-
-DEFUN (ospf_default_information_originate_always_routemap,
- ospf_default_information_originate_always_routemap_cmd,
- "default-information originate always route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
-
- if (argc == 1)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[0]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ALWAYS, -1, -1);
-}
-
-DEFUN (ospf_default_information_originate_always_type_metric_routemap,
- ospf_default_information_originate_always_type_metric_routemap_cmd,
- "default-information originate always metric-type (1|2) metric <0-16777214> route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "OSPF default metric\n"
- "OSPF metric\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int type = -1;
- int metric = -1;
-
- /* Get metric type. */
- if (argc >= 1)
- if (!str2metric_type (argv[0], &type))
- return CMD_WARNING;
-
- /* Get metric value. */
- if (argc >= 2)
- if (!str2metric (argv[1], &metric))
- return CMD_WARNING;
-
- if (argc == 3)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[2]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ALWAYS,
- type, metric);
-}
-
-ALIAS (ospf_default_information_originate_always_type_metric_routemap,
- ospf_default_information_originate_always_type_metric_cmd,
- "default-information originate always metric-type (1|2) metric <0-16777214>",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "OSPF default metric\n"
- "OSPF metric\n")
-
-ALIAS (ospf_default_information_originate_always_type_metric_routemap,
- ospf_default_information_originate_always_type_cmd,
- "default-information originate always metric-type (1|2)",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
-DEFUN (ospf_default_information_originate_always_type_routemap,
- ospf_default_information_originate_always_type_routemap_cmd,
- "default-information originate always metric-type (1|2) route-map WORD",
- "Control distribution of default information\n"
- "Distribute a default route\n"
- "Always advertise default route\n"
- "OSPF metric type for default routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
-{
- struct ospf *ospf = vty->index;
- int type = -1;
-
- /* Get metric type. */
- if (argc >= 1)
- if (!str2metric_type (argv[0], &type))
- return CMD_WARNING;
-
- if (argc == 2)
- ospf_routemap_set (ospf, DEFAULT_ROUTE, argv[1]);
- else
- ospf_routemap_unset (ospf, DEFAULT_ROUTE);
-
- return ospf_redistribute_default_set (ospf, DEFAULT_ORIGINATE_ALWAYS,
- type, -1);
-}
-
DEFUN (no_ospf_default_information_originate,
no_ospf_default_information_originate_cmd,
"no default-information originate",
@@ -6552,14 +6027,33 @@
DEFUN (no_ospf_distance_ospf,
no_ospf_distance_ospf_cmd,
- "no distance ospf",
+ "no distance ospf {intra-area|inter-area|external}",
NO_STR
"Define an administrative distance\n"
"OSPF Administrative distance\n"
- "OSPF Distance\n")
+ "OSPF Distance\n"
+ "Intra-area routes\n"
+ "Inter-area routes\n"
+ "External routes\n")
{
struct ospf *ospf = vty->index;
+ if (argc < 3)
+ return CMD_WARNING;
+
+ if (argv[0] != NULL)
+ ospf->distance_intra = 0;
+
+ if (argv[1] != NULL)
+ ospf->distance_inter = 0;
+
+ if (argv[2] != NULL)
+ ospf->distance_external = 0;
+
+ if (argv[0] || argv[1] || argv[2])
+ return CMD_SUCCESS;
+
+ /* If no arguments are given, clear all distance information */
ospf->distance_intra = 0;
ospf->distance_inter = 0;
ospf->distance_external = 0;
@@ -6567,60 +6061,10 @@
return CMD_SUCCESS;
}
-DEFUN (ospf_distance_ospf_intra,
- ospf_distance_ospf_intra_cmd,
- "distance ospf intra-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_intra = atoi (argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_intra_inter,
- ospf_distance_ospf_intra_inter_cmd,
- "distance ospf intra-area <1-255> inter-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_intra = atoi (argv[0]);
- ospf->distance_inter = atoi (argv[1]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_intra_external,
- ospf_distance_ospf_intra_external_cmd,
- "distance ospf intra-area <1-255> external <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n"
- "External routes\n"
- "Distance for external routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_intra = atoi (argv[0]);
- ospf->distance_external = atoi (argv[1]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_intra_inter_external,
- ospf_distance_ospf_intra_inter_external_cmd,
- "distance ospf intra-area <1-255> inter-area <1-255> external <1-255>",
+DEFUN (ospf_distance_ospf,
+ ospf_distance_ospf_cmd,
+ "distance ospf "
+ "{intra-area <1-255>|inter-area <1-255>|external <1-255>}",
"Define an administrative distance\n"
"OSPF Administrative distance\n"
"Intra-area routes\n"
@@ -6632,216 +6076,24 @@
{
struct ospf *ospf = vty->index;
- ospf->distance_intra = atoi (argv[0]);
- ospf->distance_inter = atoi (argv[1]);
- ospf->distance_external = atoi (argv[2]);
+ if (argc < 3) /* should not happen */
+ return CMD_WARNING;
- return CMD_SUCCESS;
-}
+ if (!argv[0] && !argv[1] && !argv[2])
+ {
+ vty_out(vty, "%% Command incomplete. (Arguments required)%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
-DEFUN (ospf_distance_ospf_intra_external_inter,
- ospf_distance_ospf_intra_external_inter_cmd,
- "distance ospf intra-area <1-255> external <1-255> inter-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n"
- "External routes\n"
- "Distance for external routes\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n")
-{
- struct ospf *ospf = vty->index;
+ if (argv[0] != NULL)
+ ospf->distance_intra = atoi(argv[0]);
- ospf->distance_intra = atoi (argv[0]);
- ospf->distance_external = atoi (argv[1]);
- ospf->distance_inter = atoi (argv[2]);
+ if (argv[1] != NULL)
+ ospf->distance_inter = atoi(argv[1]);
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_inter,
- ospf_distance_ospf_inter_cmd,
- "distance ospf inter-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_inter = atoi (argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_inter_intra,
- ospf_distance_ospf_inter_intra_cmd,
- "distance ospf inter-area <1-255> intra-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_inter = atoi (argv[0]);
- ospf->distance_intra = atoi (argv[1]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_inter_external,
- ospf_distance_ospf_inter_external_cmd,
- "distance ospf inter-area <1-255> external <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n"
- "External routes\n"
- "Distance for external routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_inter = atoi (argv[0]);
- ospf->distance_external = atoi (argv[1]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_inter_intra_external,
- ospf_distance_ospf_inter_intra_external_cmd,
- "distance ospf inter-area <1-255> intra-area <1-255> external <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n"
- "External routes\n"
- "Distance for external routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_inter = atoi (argv[0]);
- ospf->distance_intra = atoi (argv[1]);
- ospf->distance_external = atoi (argv[2]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_inter_external_intra,
- ospf_distance_ospf_inter_external_intra_cmd,
- "distance ospf inter-area <1-255> external <1-255> intra-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n"
- "External routes\n"
- "Distance for external routes\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_inter = atoi (argv[0]);
- ospf->distance_external = atoi (argv[1]);
- ospf->distance_intra = atoi (argv[2]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_external,
- ospf_distance_ospf_external_cmd,
- "distance ospf external <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "External routes\n"
- "Distance for external routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_external = atoi (argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_external_intra,
- ospf_distance_ospf_external_intra_cmd,
- "distance ospf external <1-255> intra-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "External routes\n"
- "Distance for external routes\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_external = atoi (argv[0]);
- ospf->distance_intra = atoi (argv[1]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_external_inter,
- ospf_distance_ospf_external_inter_cmd,
- "distance ospf external <1-255> inter-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "External routes\n"
- "Distance for external routes\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_external = atoi (argv[0]);
- ospf->distance_inter = atoi (argv[1]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_external_intra_inter,
- ospf_distance_ospf_external_intra_inter_cmd,
- "distance ospf external <1-255> intra-area <1-255> inter-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "External routes\n"
- "Distance for external routes\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_external = atoi (argv[0]);
- ospf->distance_intra = atoi (argv[1]);
- ospf->distance_inter = atoi (argv[2]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (ospf_distance_ospf_external_inter_intra,
- ospf_distance_ospf_external_inter_intra_cmd,
- "distance ospf external <1-255> inter-area <1-255> intra-area <1-255>",
- "Define an administrative distance\n"
- "OSPF Administrative distance\n"
- "External routes\n"
- "Distance for external routes\n"
- "Inter-area routes\n"
- "Distance for inter-area routes\n"
- "Intra-area routes\n"
- "Distance for intra-area routes\n")
-{
- struct ospf *ospf = vty->index;
-
- ospf->distance_external = atoi (argv[0]);
- ospf->distance_inter = atoi (argv[1]);
- ospf->distance_intra = atoi (argv[2]);
+ if (argv[2] != NULL)
+ ospf->distance_external = atoi(argv[2]);
return CMD_SUCCESS;
}
@@ -8268,63 +7520,13 @@
static void
ospf_vty_zebra_init (void)
{
- install_element (OSPF_NODE, &ospf_redistribute_source_type_metric_cmd);
- install_element (OSPF_NODE, &ospf_redistribute_source_metric_type_cmd);
- install_element (OSPF_NODE, &ospf_redistribute_source_type_cmd);
- install_element (OSPF_NODE, &ospf_redistribute_source_metric_cmd);
install_element (OSPF_NODE, &ospf_redistribute_source_cmd);
- install_element (OSPF_NODE,
- &ospf_redistribute_source_metric_type_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_redistribute_source_type_metric_routemap_cmd);
- install_element (OSPF_NODE, &ospf_redistribute_source_metric_routemap_cmd);
- install_element (OSPF_NODE, &ospf_redistribute_source_type_routemap_cmd);
- install_element (OSPF_NODE, &ospf_redistribute_source_routemap_cmd);
-
install_element (OSPF_NODE, &no_ospf_redistribute_source_cmd);
install_element (OSPF_NODE, &ospf_distribute_list_out_cmd);
install_element (OSPF_NODE, &no_ospf_distribute_list_out_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_metric_type_cmd);
- install_element (OSPF_NODE, &ospf_default_information_originate_metric_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_type_metric_cmd);
- install_element (OSPF_NODE, &ospf_default_information_originate_type_cmd);
install_element (OSPF_NODE, &ospf_default_information_originate_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_metric_type_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_metric_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_type_metric_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_type_cmd);
-
- install_element (OSPF_NODE,
- &ospf_default_information_originate_metric_type_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_metric_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_type_metric_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_type_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_metric_type_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_metric_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_type_metric_routemap_cmd);
- install_element (OSPF_NODE,
- &ospf_default_information_originate_always_type_routemap_cmd);
-
install_element (OSPF_NODE, &no_ospf_default_information_originate_cmd);
install_element (OSPF_NODE, &ospf_default_metric_cmd);
@@ -8334,21 +7536,7 @@
install_element (OSPF_NODE, &ospf_distance_cmd);
install_element (OSPF_NODE, &no_ospf_distance_cmd);
install_element (OSPF_NODE, &no_ospf_distance_ospf_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_intra_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_intra_inter_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_intra_external_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_intra_inter_external_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_intra_external_inter_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_inter_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_inter_intra_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_inter_external_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_inter_intra_external_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_inter_external_intra_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_external_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_external_intra_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_external_inter_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_external_intra_inter_cmd);
- install_element (OSPF_NODE, &ospf_distance_ospf_external_inter_intra_cmd);
+ install_element (OSPF_NODE, &ospf_distance_ospf_cmd);
#if 0
install_element (OSPF_NODE, &ospf_distance_source_cmd);
install_element (OSPF_NODE, &no_ospf_distance_source_cmd);
diff --git a/tests/testcommands.in b/tests/testcommands.in
index 70c5705..7fe6279 100644
--- a/tests/testcommands.in
+++ b/tests/testcommands.in
@@ -199,3 +199,18 @@
sow ipv6 ospf6 databIase as-external adv-router 1.2.3.4
Whow bgp view VARIAeBLE ipv4 unicast community local-AS no-advrtise no-advertise local-AS
Wneighbor 1.2.3.4 dot-capabiliy-negotiate
+#
+#
+# Some teststrings explicitly used for keyword commands
+#
+#
+redistribute bgp
+redistribute bgp m 10
+redistribute bgp metric 10 metric-type 1
+redistribute bgp metric 10 metric 10
+redistribute bgp route-map RMAP_REDIST_BGP
+default-information originate metric-type 1 metric 10
+default-information originate always metric-type 1 metric 10
+default-information originate route-map RMAP_DEFAULT
+default-information originate route-map RMAP_DEFAULT metric 10
+default-information originate always metric-type 2 metric 23
diff --git a/tests/testcommands.refout b/tests/testcommands.refout
index 1422aef..11483b8 100644
--- a/tests/testcommands.refout
+++ b/tests/testcommands.refout
@@ -299,6 +299,18 @@
'maximum-prefix'
describe 'no neighbor VARIABLE maximum-prefix'@22: rv==0
'maximum-prefix' 'Maximum number of prefix accept from this peer'
+execute relaxed 'redistribute isis route-map VARIABLE metric 0 metric-type 2'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'isis', '0', '2', 'VARIABLE'
+execute strict 'redistribute isis route-map VARIABLE metric 0 metric-type 2'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'isis', '0', '2', 'VARIABLE'
+complete 'redistribute isis route-map VARIABLE metric 0 metric-type 2'@23: rv==7
+ '2'
+describe 'redistribute isis route-map VARIABLE metric 0 metric-type 2'@23: rv==0
+ '2' 'Set OSPF External Type 2 metrics'
+execute relaxed 'redistribute rip metric 0 route-map VARIABLE metric-type 1'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'rip', '0', '1', 'VARIABLE'
+execute strict 'redistribute rip metric 0 route-map VARIABLE metric-type 1'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'rip', '0', '1', 'VARIABLE'
+complete 'redistribute rip metric 0 route-map VARIABLE metric-type 1'@23: rv==7
+ '1'
+describe 'redistribute rip metric 0 route-map VARIABLE metric-type 1'@23: rv==0
+ '1' 'Set OSPF External Type 1 metrics'
execute relaxed 'show bgp community VARIABLE local-AS no-export VARIABLE exact-match'@1: rv==0, 'show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match': 'VARIABLE', 'local-AS', 'no-export', 'VARIABLE'
execute strict 'show bgp community VARIABLE local-AS no-export VARIABLE exact-match'@1: rv==0, 'show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match': 'VARIABLE', 'local-AS', 'no-export', 'VARIABLE'
complete 'show bgp community VARIABLE local-AS no-export VARIABLE exact-match'@1: rv==7
@@ -898,3 +910,98 @@
complete 'show ipv6 bgp community wARIBLE VARIABLE 8ARIABLE'@4: rv==2
describe 'show ipv6 bgp community wARIBLE VARIABLE 8ARIABLE'@4: rv==0
'AA:NN' 'community number'
+execute relaxed 'redistribute bgp'@14: rv==0, 'redistribute (kernel|connected|static|ospf|isis|bgp|babel)': 'bgp'
+execute strict 'redistribute bgp'@14: rv==0, 'redistribute (kernel|connected|static|ospf|isis|bgp|babel)': 'bgp'
+complete 'redistribute bgp'@14: rv==7
+ 'bgp'
+describe 'redistribute bgp'@14: rv==0
+ 'bgp' 'Border Gateway Protocol (BGP)'
+execute relaxed 'redistribute bgp'@15: rv==0, 'redistribute (kernel|connected|static|ospf6|isis|bgp|babel)': 'bgp'
+execute strict 'redistribute bgp'@15: rv==0, 'redistribute (kernel|connected|static|ospf6|isis|bgp|babel)': 'bgp'
+complete 'redistribute bgp'@15: rv==7
+ 'bgp'
+describe 'redistribute bgp'@15: rv==0
+ 'bgp' 'Border Gateway Protocol (BGP)'
+execute relaxed 'redistribute bgp'@16: rv==0, 'redistribute (kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp)': 'bgp'
+execute strict 'redistribute bgp'@16: rv==0, 'redistribute (kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp)': 'bgp'
+complete 'redistribute bgp'@16: rv==7
+ 'bgp'
+describe 'redistribute bgp'@16: rv==0
+ 'bgp' 'Border Gateway Protocol (BGP)'
+execute relaxed 'redistribute bgp'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'bgp', '(null)', '(null)', '(null)'
+execute strict 'redistribute bgp'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'bgp', '(null)', '(null)', '(null)'
+complete 'redistribute bgp'@23: rv==7
+ 'bgp'
+describe 'redistribute bgp'@23: rv==0
+ 'bgp' 'Border Gateway Protocol (BGP)'
+execute relaxed 'redistribute bgp'@24: rv==0, 'redistribute (kernel|connected|static|ripng|isis|bgp|babel)': 'bgp'
+execute strict 'redistribute bgp'@24: rv==0, 'redistribute (kernel|connected|static|ripng|isis|bgp|babel)': 'bgp'
+complete 'redistribute bgp'@24: rv==7
+ 'bgp'
+describe 'redistribute bgp'@24: rv==0
+ 'bgp' 'Border Gateway Protocol (BGP)'
+execute relaxed 'redistribute bgp m 10'@14: rv==0, 'redistribute (kernel|connected|static|ospf|isis|bgp|babel) metric <0-16>': 'bgp', '10'
+execute strict 'redistribute bgp m 10'@14: rv==2
+complete 'redistribute bgp m 10'@14: rv==2
+describe 'redistribute bgp m 10'@14: rv==0
+ '<0-16>' 'Metric value'
+execute relaxed 'redistribute bgp m 10'@15: rv==0, 'redistribute (kernel|connected|static|ospf6|isis|bgp|babel) metric <0-16>': 'bgp', '10'
+execute strict 'redistribute bgp m 10'@15: rv==2
+complete 'redistribute bgp m 10'@15: rv==2
+describe 'redistribute bgp m 10'@15: rv==0
+ '<0-16>' 'Metric value'
+execute relaxed 'redistribute bgp m 10'@23: rv==3
+execute strict 'redistribute bgp m 10'@23: rv==2
+complete 'redistribute bgp m 10'@23: rv==3
+describe 'redistribute bgp m 10'@23: rv==3
+execute relaxed 'redistribute bgp metric 10 metric-type 1'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'bgp', '10', '1', '(null)'
+execute strict 'redistribute bgp metric 10 metric-type 1'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'bgp', '10', '1', '(null)'
+complete 'redistribute bgp metric 10 metric-type 1'@23: rv==7
+ '1'
+describe 'redistribute bgp metric 10 metric-type 1'@23: rv==0
+ '1' 'Set OSPF External Type 1 metrics'
+execute relaxed 'redistribute bgp route-map RMAP_REDIST_BGP'@14: rv==0, 'redistribute (kernel|connected|static|ospf|isis|bgp|babel) route-map WORD': 'bgp', 'RMAP_REDIST_BGP'
+execute strict 'redistribute bgp route-map RMAP_REDIST_BGP'@14: rv==0, 'redistribute (kernel|connected|static|ospf|isis|bgp|babel) route-map WORD': 'bgp', 'RMAP_REDIST_BGP'
+complete 'redistribute bgp route-map RMAP_REDIST_BGP'@14: rv==2
+describe 'redistribute bgp route-map RMAP_REDIST_BGP'@14: rv==0
+ 'WORD' 'Pointer to route-map entries'
+execute relaxed 'redistribute bgp route-map RMAP_REDIST_BGP'@15: rv==0, 'redistribute (kernel|connected|static|ospf6|isis|bgp|babel) route-map WORD': 'bgp', 'RMAP_REDIST_BGP'
+execute strict 'redistribute bgp route-map RMAP_REDIST_BGP'@15: rv==0, 'redistribute (kernel|connected|static|ospf6|isis|bgp|babel) route-map WORD': 'bgp', 'RMAP_REDIST_BGP'
+complete 'redistribute bgp route-map RMAP_REDIST_BGP'@15: rv==2
+describe 'redistribute bgp route-map RMAP_REDIST_BGP'@15: rv==0
+ 'WORD' 'Pointer to route-map entries'
+execute relaxed 'redistribute bgp route-map RMAP_REDIST_BGP'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'bgp', '(null)', '(null)', 'RMAP_REDIST_BGP'
+execute strict 'redistribute bgp route-map RMAP_REDIST_BGP'@23: rv==0, 'redistribute (kernel|connected|static|rip|isis|bgp|babel) {metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'bgp', '(null)', '(null)', 'RMAP_REDIST_BGP'
+complete 'redistribute bgp route-map RMAP_REDIST_BGP'@23: rv==2
+describe 'redistribute bgp route-map RMAP_REDIST_BGP'@23: rv==0
+ 'WORD' 'Pointer to route-map entries'
+execute relaxed 'redistribute bgp route-map RMAP_REDIST_BGP'@24: rv==0, 'redistribute (kernel|connected|static|ripng|isis|bgp|babel) route-map WORD': 'bgp', 'RMAP_REDIST_BGP'
+execute strict 'redistribute bgp route-map RMAP_REDIST_BGP'@24: rv==0, 'redistribute (kernel|connected|static|ripng|isis|bgp|babel) route-map WORD': 'bgp', 'RMAP_REDIST_BGP'
+complete 'redistribute bgp route-map RMAP_REDIST_BGP'@24: rv==2
+describe 'redistribute bgp route-map RMAP_REDIST_BGP'@24: rv==0
+ 'WORD' 'Route map name'
+execute relaxed 'default-information originate metric-type 1 metric 10'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': '(null)', '10', '1', '(null)'
+execute strict 'default-information originate metric-type 1 metric 10'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': '(null)', '10', '1', '(null)'
+complete 'default-information originate metric-type 1 metric 10'@23: rv==2
+describe 'default-information originate metric-type 1 metric 10'@23: rv==0
+ '<0-16777214>' 'OSPF metric'
+execute relaxed 'default-information originate always metric-type 1 metric 10'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'always', '10', '1', '(null)'
+execute strict 'default-information originate always metric-type 1 metric 10'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'always', '10', '1', '(null)'
+complete 'default-information originate always metric-type 1 metric 10'@23: rv==2
+describe 'default-information originate always metric-type 1 metric 10'@23: rv==0
+ '<0-16777214>' 'OSPF metric'
+execute relaxed 'default-information originate route-map RMAP_DEFAULT'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': '(null)', '(null)', '(null)', 'RMAP_DEFAULT'
+execute strict 'default-information originate route-map RMAP_DEFAULT'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': '(null)', '(null)', '(null)', 'RMAP_DEFAULT'
+complete 'default-information originate route-map RMAP_DEFAULT'@23: rv==2
+describe 'default-information originate route-map RMAP_DEFAULT'@23: rv==0
+ 'WORD' 'Pointer to route-map entries'
+execute relaxed 'default-information originate route-map RMAP_DEFAULT metric 10'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': '(null)', '10', '(null)', 'RMAP_DEFAULT'
+execute strict 'default-information originate route-map RMAP_DEFAULT metric 10'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': '(null)', '10', '(null)', 'RMAP_DEFAULT'
+complete 'default-information originate route-map RMAP_DEFAULT metric 10'@23: rv==2
+describe 'default-information originate route-map RMAP_DEFAULT metric 10'@23: rv==0
+ '<0-16777214>' 'OSPF metric'
+execute relaxed 'default-information originate always metric-type 2 metric 23'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'always', '23', '2', '(null)'
+execute strict 'default-information originate always metric-type 2 metric 23'@23: rv==0, 'default-information originate {always|metric <0-16777214>|metric-type (1|2)|route-map WORD}': 'always', '23', '2', '(null)'
+complete 'default-information originate always metric-type 2 metric 23'@23: rv==2
+describe 'default-information originate always metric-type 2 metric 23'@23: rv==0
+ '<0-16777214>' 'OSPF metric'