Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: clean up the mess that is CLI command nodes #6135

Merged
merged 9 commits into from
Apr 16, 2020

Conversation

eqvinox
Copy link
Contributor

@eqvinox eqvinox commented Apr 2, 2020

I really don't know why this was designed as it is, but it's full of bear traps (like forgetting to update node_names or one of the switch statements) so it shall go die in a blaze.

NB: there are still pitfalls, like forgetting to update the cmd_nodes in vtysh/vtysh.c. They should probably be extracted like DEFUNs. But at least some of the pitfalls are gone.

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/885c6bd436a102c1a262ab54704eb2b5/raw/8c07b2229904408f14f08e403ae9bb476a4d0bf5/cr_6135_1585822195.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index fc1d778a7..e6ed53920 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -15334,10 +15334,10 @@ static struct cmd_node bgp_ipv6_labeled_unicast_node = {
 };
 
 static struct cmd_node bgp_vpnv4_node = {
-	 .name = "bgp vpnv4",
-	 .node = BGP_VPNV4_NODE,
-	 .parent_node = BGP_NODE,
-	 .prompt = "%s(config-router-af)# ",
+	.name = "bgp vpnv4",
+	.node = BGP_VPNV4_NODE,
+	.parent_node = BGP_NODE,
+	.prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_vpnv6_node = {
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/lib/vty.c b/lib/vty.c
index 9cdfd02a8..683c39f89 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2611,16 +2611,17 @@ void vty_config_exit(struct vty *vty)
 	/* unlock and jump up to ENABLE_NODE if -and only if- we're
 	 * somewhere below CONFIG_NODE */
 	while (node && node != CONFIG_NODE) {
-	        cnode = vector_lookup(cmdvec, node);
-	        node = cnode->parent_node;
+		cnode = vector_lookup(cmdvec, node);
+		node = cnode->parent_node;
 	}
 	if (node != CONFIG_NODE) {
-		vty_out(vty, "WARNING: vty_config_exit() from outside CONFIG_NODE!\n");
-	        return;
+		vty_out(vty,
+			"WARNING: vty_config_exit() from outside CONFIG_NODE!\n");
+		return;
 	}
 
 	while (vty->node != ENABLE_NODE)
-	        cmd_exit(vty);
+		cmd_exit(vty);
 
 	/* Check if there's a pending confirmed commit. */
 	if (vty->t_confirmed_commit_timeout) {
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 2, 2020

Outdated results 🛑

Basic BGPD CI results: FAILURE

_ _
Result FAILURE git merge/6135 22d8939 frr.github Build
Date 04/02/2020
Start 06:12:22
Finish 06:12:42
Run-Time 00:20
Total
Pass
Fail
Valgrind-Errors
Valgrind-Loss
Details vncregress-2020-04-02-06:12:22.txt
Log make-2020-04-02-06:12:22.out.bz2
Memory

For details, please contact louberger

@eqvinox eqvinox force-pushed the cli-node-cleanup branch from 22d8939 to 465cdec Compare April 2, 2020 10:15
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/20e004f28683bbf3ffd8215ca0daaacc/raw/da8c738fd777b2d399cb3ea8bb8e2917aeeafc3e/cr_6135_1585822550.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/lib/vty.c b/lib/vty.c
index 9fae9bb2b..683c39f89 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2615,12 +2615,13 @@ void vty_config_exit(struct vty *vty)
 		node = cnode->parent_node;
 	}
 	if (node != CONFIG_NODE) {
-		vty_out(vty, "WARNING: vty_config_exit() from outside CONFIG_NODE!\n");
+		vty_out(vty,
+			"WARNING: vty_config_exit() from outside CONFIG_NODE!\n");
 		return;
 	}
 
 	while (vty->node != ENABLE_NODE)
-	        cmd_exit(vty);
+		cmd_exit(vty);
 
 	/* Check if there's a pending confirmed commit. */
 	if (vty->t_confirmed_commit_timeout) {
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@eqvinox eqvinox force-pushed the cli-node-cleanup branch from 465cdec to 0828118 Compare April 2, 2020 10:18
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/a709ce58b7fd91ada090b880741e4dd2/raw/da8c738fd777b2d399cb3ea8bb8e2917aeeafc3e/cr_6135_1585822722.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/lib/vty.c b/lib/vty.c
index 9fae9bb2b..683c39f89 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2615,12 +2615,13 @@ void vty_config_exit(struct vty *vty)
 		node = cnode->parent_node;
 	}
 	if (node != CONFIG_NODE) {
-		vty_out(vty, "WARNING: vty_config_exit() from outside CONFIG_NODE!\n");
+		vty_out(vty,
+			"WARNING: vty_config_exit() from outside CONFIG_NODE!\n");
 		return;
 	}
 
 	while (vty->node != ENABLE_NODE)
-	        cmd_exit(vty);
+		cmd_exit(vty);
 
 	/* Check if there's a pending confirmed commit. */
 	if (vty->t_confirmed_commit_timeout) {
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@eqvinox eqvinox force-pushed the cli-node-cleanup branch from 0828118 to 4e23051 Compare April 2, 2020 10:20
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/3de749fd5dd350951f9f9a6c11912b4f/raw/597c12b4cbec05466bd780ffcee626a34a434525/cr_6135_1585822823.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@eqvinox
Copy link
Contributor Author

eqvinox commented Apr 2, 2020

remaining style suggestions are chickenheaded ;D

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 2, 2020

Outdated results 🛑

Basic BGPD CI results: FAILURE

_ _
Result FAILURE git merge/6135 0828118 frr.github Build
Date 04/02/2020
Start 06:22:22
Finish 06:22:56
Run-Time 00:34
Total
Pass
Fail
Valgrind-Errors
Valgrind-Loss
Details vncregress-2020-04-02-06:22:22.txt
Log make-2020-04-02-06:22:22.out.bz2
Memory

For details, please contact louberger

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 2, 2020

Outdated results 🛑

Basic BGPD CI results: FAILURE

_ _
Result FAILURE git merge/6135 4e23051 frr.github Build
Date 04/02/2020
Start 06:27:21
Finish 06:27:56
Run-Time 00:35
Total
Pass
Fail
Valgrind-Errors
Valgrind-Loss
Details vncregress-2020-04-02-06:27:21.txt
Log make-2020-04-02-06:27:21.out.bz2
Memory

For details, please contact louberger

@NetDEF-CI

This comment has been minimized.

@eqvinox eqvinox force-pushed the cli-node-cleanup branch from 4e23051 to 77f5b07 Compare April 2, 2020 11:11
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/1fa3e2fc43d39cf8cc2aaf74d8de778f/raw/597c12b4cbec05466bd780ffcee626a34a434525/cr_6135_1585825871.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@eqvinox eqvinox force-pushed the cli-node-cleanup branch from 77f5b07 to 4cc4248 Compare April 2, 2020 11:12
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/78643d92f72cfcbdde983ae566202a5a/raw/597c12b4cbec05466bd780ffcee626a34a434525/cr_6135_1585825930.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 2, 2020

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Failed

OpenBSD 6 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for OpenBSD 6 amd64 build:
(see full PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI011BUILD/ErrorLog/log_pytests.txt)

=================================== FAILURES ===================================
__________________________ TestNbOperData.test_refout __________________________
self = <test_oper_data.TestNbOperData object at 0xe7cec15f710>
    def test_refout(self):
        basedir = os.path.dirname(inspect.getsourcefile(type(self)))
        program = os.path.join(basedir, self.program)
    
        if getattr(self, 'built_refin', False):
            refin = binpath(program) + '.in'
        else:
            refin = program + '.in'
        if getattr(self, 'built_refout', False):
            refout = binpath(program) + '.refout'
        else:
            refout = program + '.refout'
    
        intext = ''
        if os.path.exists(refin):
            with open(refin, 'rb') as f:
                intext = f.read()
        with open(refout, 'rb') as f:
            reftext = f.read()
    
        proc = subprocess.Popen([binpath(program)],
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE)
        outtext,_ = proc.communicate(intext)
        if outtext != reftext:
>           raise TestRefMismatch(self, outtext, reftext)
E           frrtest.TestRefMismatch: Expected output and actual output differ:
E           --- outtext
E           +++ reftext
E           @@ -116,4 +116,3 @@
E              }
E            }
E            test# 
E           -end.
helpers/python/frrtest.py:200: TestRefMismatch
_____________________________ TestLSDB.test_refout _____________________________
self = <test_lsdb.TestLSDB object at 0xe7ce2fba630>
    def test_refout(self):
        basedir = os.path.dirname(inspect.getsourcefile(type(self)))
        program = os.path.join(basedir, self.program)
    
        if getattr(self, 'built_refin', False):
            refin = binpath(program) + '.in'
        else:
            refin = program + '.in'
        if getattr(self, 'built_refout', False):
            refout = binpath(program) + '.refout'
        else:
            refout = program + '.refout'
    
        intext = ''
        if os.path.exists(refin):
            with open(refin, 'rb') as f:
                intext = f.read()
        with open(refout, 'rb') as f:
            reftext = f.read()
    
        proc = subprocess.Popen([binpath(program)],
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE)
        outtext,_ = proc.communicate(intext)
        if outtext != reftext:
>           raise TestRefMismatch(self, outtext, reftext)
E           frrtest.TestRefMismatch: Expected output and actual output differ:
E           --- outtext
E           +++ reftext
E           @@ -189,4 +189,3 @@
E            test# lsa drop 5
E            test# 
E            test# 
E           -end.
helpers/python/frrtest.py:200: TestRefMismatch
---- generated xml file: /home/ci/cibuild.11579/frr-source/tests/tests.xml -----
=============== 2 failed, 422 passed, 2 skipped in 26.17 seconds ===============
gmake: *** [Makefile:11721: tests/tests.xml] Error 1

OpenBSD 6 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI011BUILD/config.status/config.status

Ubuntu 18.04 ppc64le build: Failed (click for details)

DejaGNU Unittests (make check) failed for Ubuntu 18.04 ppc64le build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1804PPC64LEBUILD/ErrorLog/log_pytests.txt
Ubuntu 18.04 ppc64le build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1804PPC64LEBUILD/config.status/config.status

Ubuntu 16.04 i386 build: Failed (click for details)

Package building failed for Ubuntu 16.04 i386 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1604I386/ErrorLog/log_package_build.txt)

dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Ubuntu 16.04 i386 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1604I386/config.status/config.status

Debian 9 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Debian 9 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI021BUILD/ErrorLog/log_pytests.txt
Debian 9 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI021BUILD/config.status/config.status

Ubuntu 16.04 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Ubuntu 16.04 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI014BUILD/ErrorLog/log_pytests.txt
Ubuntu 16.04 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI014BUILD/config.status/config.status

Ubuntu 14.04 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Ubuntu 14.04 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI001BUILD/ErrorLog/log_pytests.txt
Ubuntu 14.04 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI001BUILD/config.status/config.status

Debian 8 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Debian 8 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI008BLD/ErrorLog/log_pytests.txt
Debian 8 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI008BLD/config.status/config.status

Successful on other platforms/tests
  • Fedora 29 amd64 build
  • Debian 10 amd64 build
  • FreeBSD 11 amd64 build
  • NetBSD 6 amd64 build
  • CentOS 7 amd64 build
  • Ubuntu 18.04 amd64 build
  • FreeBSD 12 amd64 build
  • NetBSD 8 amd64 build
  • Ubuntu 12.04 amd64 build

Warnings Generated during build:

Checkout code: Successful with additional warnings
OpenBSD 6 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for OpenBSD 6 amd64 build:
(see full PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI011BUILD/ErrorLog/log_pytests.txt)

=================================== FAILURES ===================================
__________________________ TestNbOperData.test_refout __________________________
self = <test_oper_data.TestNbOperData object at 0xe7cec15f710>
    def test_refout(self):
        basedir = os.path.dirname(inspect.getsourcefile(type(self)))
        program = os.path.join(basedir, self.program)
    
        if getattr(self, 'built_refin', False):
            refin = binpath(program) + '.in'
        else:
            refin = program + '.in'
        if getattr(self, 'built_refout', False):
            refout = binpath(program) + '.refout'
        else:
            refout = program + '.refout'
    
        intext = ''
        if os.path.exists(refin):
            with open(refin, 'rb') as f:
                intext = f.read()
        with open(refout, 'rb') as f:
            reftext = f.read()
    
        proc = subprocess.Popen([binpath(program)],
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE)
        outtext,_ = proc.communicate(intext)
        if outtext != reftext:
>           raise TestRefMismatch(self, outtext, reftext)
E           frrtest.TestRefMismatch: Expected output and actual output differ:
E           --- outtext
E           +++ reftext
E           @@ -116,4 +116,3 @@
E              }
E            }
E            test# 
E           -end.
helpers/python/frrtest.py:200: TestRefMismatch
_____________________________ TestLSDB.test_refout _____________________________
self = <test_lsdb.TestLSDB object at 0xe7ce2fba630>
    def test_refout(self):
        basedir = os.path.dirname(inspect.getsourcefile(type(self)))
        program = os.path.join(basedir, self.program)
    
        if getattr(self, 'built_refin', False):
            refin = binpath(program) + '.in'
        else:
            refin = program + '.in'
        if getattr(self, 'built_refout', False):
            refout = binpath(program) + '.refout'
        else:
            refout = program + '.refout'
    
        intext = ''
        if os.path.exists(refin):
            with open(refin, 'rb') as f:
                intext = f.read()
        with open(refout, 'rb') as f:
            reftext = f.read()
    
        proc = subprocess.Popen([binpath(program)],
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE)
        outtext,_ = proc.communicate(intext)
        if outtext != reftext:
>           raise TestRefMismatch(self, outtext, reftext)
E           frrtest.TestRefMismatch: Expected output and actual output differ:
E           --- outtext
E           +++ reftext
E           @@ -189,4 +189,3 @@
E            test# lsa drop 5
E            test# 
E            test# 
E           -end.
helpers/python/frrtest.py:200: TestRefMismatch
---- generated xml file: /home/ci/cibuild.11579/frr-source/tests/tests.xml -----
=============== 2 failed, 422 passed, 2 skipped in 26.17 seconds ===============
gmake: *** [Makefile:11721: tests/tests.xml] Error 1

OpenBSD 6 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI011BUILD/config.status/config.status

Ubuntu 18.04 ppc64le build: Failed (click for details)

DejaGNU Unittests (make check) failed for Ubuntu 18.04 ppc64le build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1804PPC64LEBUILD/ErrorLog/log_pytests.txt
Ubuntu 18.04 ppc64le build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1804PPC64LEBUILD/config.status/config.status

Ubuntu 16.04 i386 build: Failed (click for details)

Package building failed for Ubuntu 16.04 i386 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1604I386/ErrorLog/log_package_build.txt)

dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Ubuntu 16.04 i386 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/U1604I386/config.status/config.status

Debian 9 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Debian 9 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI021BUILD/ErrorLog/log_pytests.txt
Debian 9 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI021BUILD/config.status/config.status

Ubuntu 16.04 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Ubuntu 16.04 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI014BUILD/ErrorLog/log_pytests.txt
Ubuntu 16.04 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI014BUILD/config.status/config.status

Ubuntu 14.04 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Ubuntu 14.04 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI001BUILD/ErrorLog/log_pytests.txt
Ubuntu 14.04 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI001BUILD/config.status/config.status

Debian 8 amd64 build: Failed (click for details)

DejaGNU Unittests (make check) failed for Debian 8 amd64 build
Pytest output suppressed for verbosity. See failure on other Distro above
see PyTest log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI008BLD/ErrorLog/log_pytests.txt
Debian 8 amd64 build: config.status output from configure script can be found at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/CI008BLD/config.status/config.status

Report for command.h | 2 issues
===============================================
< WARNING: function definition argument 'struct vty *' should also have an identifier name
< #185: FILE: /tmp/f1-27828/command.h:185:
Report for vty.c | 4 issues
===============================================
< WARNING: Block comments use a trailing */ on a separate line
< #2612: FILE: /tmp/f1-27828/vty.c:2612:
< WARNING: Prefer using '"%s...", __func__' to using 'vty_config_exit', this function's name, in a string
< #2619: FILE: /tmp/f1-27828/vty.c:2619:

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11579/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: pkg-js-tools-test-is-missing
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200402-06-g4cc424898-0 (missing) -> 7.4-dev-20200402-06-g4cc424898-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200402-06-g4cc424898-0 (missing) -> 7.4-dev-20200402-06-g4cc424898-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200402-06-g4cc424898-0 (missing) -> 7.4-dev-20200402-06-g4cc424898-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200402-06-g4cc424898-0 (missing) -> 7.4-dev-20200402-06-g4cc424898-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200402-06-g4cc424898-0 (missing) -> 7.4-dev-20200402-06-g4cc424898-0~deb10u1

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 2, 2020

Outdated results 🛑

Basic BGPD CI results: FAILURE

_ _
Result FAILURE git merge/6135 4cc4248 frr.github Build
Date 04/02/2020
Start 07:43:37
Finish 07:44:12
Run-Time 00:35
Total
Pass
Fail
Valgrind-Errors
Valgrind-Loss
Details vncregress-2020-04-02-07:43:37.txt
Log make-2020-04-02-07:43:37.out.bz2
Memory

For details, please contact louberger

@eqvinox
Copy link
Contributor Author

eqvinox commented Apr 2, 2020

looks like I somewhere lost the end. printed at logout on the CLI...

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/bfe639bc7b2041902f40bb843ac198ef/raw/597c12b4cbec05466bd780ffcee626a34a434525/cr_6135_1585829074.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index c3fefcd33..f82c63825 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3548,8 +3546,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI

This comment has been minimized.

@eqvinox eqvinox force-pushed the cli-node-cleanup branch from 6120c5b to bfec662 Compare April 2, 2020 12:42
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/95b40fdd1877a192f831c78972a9ccd8/raw/76f7d1aefc5d0d79bb1395ad41d84c9a4cdf101b/cr_6135_1585831357.diff | git apply

diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 21fb48163..a810f94ac 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -60,11 +60,11 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
-    .name = "interface",
-    .node = INTERFACE_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-if)# ",
-    .config_write = interface_config_write,
+	.name = "interface",
+	.node = INTERFACE_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-if)# ",
+	.config_write = interface_config_write,
 };
 
 
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 906f48564..1cd6c2de8 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,14 +69,13 @@ static time_t expiry_time;
 static time_t source_expiry_time;
 
 /* Babel node structure. */
-static int babel_config_write (struct vty *vty);
-static struct cmd_node cmd_babel_node =
-{
-    .name = "babel",
-    .node   = BABEL_NODE,
-    .parent_node = CONFIG_NODE,
-    .prompt = "%s(config-router)# ",
-    .config_write = babel_config_write,
+static int babel_config_write(struct vty *vty);
+static struct cmd_node cmd_babel_node = {
+	.name = "babel",
+	.node = BABEL_NODE,
+	.parent_node = CONFIG_NODE,
+	.prompt = "%s(config-router)# ",
+	.config_write = babel_config_write,
 };
 
 /* print current babel configuration on vty */
@@ -722,32 +721,32 @@ void
 babeld_quagga_init(void)
 {
 
-    install_node(&cmd_babel_node);
+	install_node(&cmd_babel_node);
 
-    install_element(CONFIG_NODE, &router_babel_cmd);
-    install_element(CONFIG_NODE, &no_router_babel_cmd);
+	install_element(CONFIG_NODE, &router_babel_cmd);
+	install_element(CONFIG_NODE, &no_router_babel_cmd);
 
-    install_default(BABEL_NODE);
-    install_element(BABEL_NODE, &babel_diversity_cmd);
-    install_element(BABEL_NODE, &no_babel_diversity_cmd);
-    install_element(BABEL_NODE, &babel_diversity_factor_cmd);
-    install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
-    install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
+	install_default(BABEL_NODE);
+	install_element(BABEL_NODE, &babel_diversity_cmd);
+	install_element(BABEL_NODE, &no_babel_diversity_cmd);
+	install_element(BABEL_NODE, &babel_diversity_factor_cmd);
+	install_element(BABEL_NODE, &babel_set_resend_delay_cmd);
+	install_element(BABEL_NODE, &babel_set_smoothing_half_life_cmd);
 
-    babel_if_init();
+	babel_if_init();
 
-    /* Access list install. */
-    access_list_init ();
-    access_list_add_hook (babel_distribute_update_all_wrapper);
-    access_list_delete_hook (babel_distribute_update_all_wrapper);
+	/* Access list install. */
+	access_list_init();
+	access_list_add_hook(babel_distribute_update_all_wrapper);
+	access_list_delete_hook(babel_distribute_update_all_wrapper);
 
-    /* Prefix list initialize.*/
-    prefix_list_init ();
-    prefix_list_add_hook (babel_distribute_update_all);
-    prefix_list_delete_hook (babel_distribute_update_all);
+	/* Prefix list initialize.*/
+	prefix_list_init();
+	prefix_list_add_hook(babel_distribute_update_all);
+	prefix_list_delete_hook(babel_distribute_update_all);
 
-    /* Distribute list install. */
-    distribute_list_init(BABEL_NODE);
+	/* Distribute list install. */
+	distribute_list_init(BABEL_NODE);
 }
 
 /* Stubs to adapt Babel's filtering calls to Quagga's infrastructure. */
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index be209e6bc..d5bc43a4b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2669,8 +2669,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 71b991928..582ed7d13 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3614,8 +3612,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI

This comment has been minimized.

@NetDEF-CI

This comment has been minimized.

@NetDEF-CI

This comment has been minimized.

Copy link
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea :)

I like how the code is more modular and better organized this way. I hope the CI errors aren't hard to resolve.

.name = "ldp",
.node = LDP_NODE,
.parent_node = CONFIG_NODE,
.prompt = "%s(config-ldp)# ",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing .config_write = ldp_config_write.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, Thanks :)

@LabN-CI

This comment has been minimized.

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/47d6f7f74e2a9b6f2eda6b8bde87ba3c/raw/26a57edb6e4c3eaf21adaef4d2f01fb9d460c056/cr_6135_1586944723.diff | git apply

diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 89ffa43a7..7601496b1 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3547,8 +3545,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI

This comment has been minimized.

@NetDEF-CI

This comment has been minimized.

@NetDEF-CI

This comment has been minimized.

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/a9eb8375811d6fa6e9981fa2aa7b251c/raw/98a6aa7c7612f98492d8bf39d178dbe338c8d4c9/cr_6135_1586946408.diff | git apply

diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index b5869d7cb..38525b4c5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2668,8 +2668,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/lib/command.h b/lib/command.h
index 5047ec838..1a8a7f51b 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -84,84 +84,84 @@ struct host {
 
 /* List of CLI nodes. Please remember to update the name array in command.c. */
 enum node_type {
-	AUTH_NODE,		 /* Authentication mode of vty interface. */
-	VIEW_NODE,		 /* View node. Default mode of vty interface. */
-	AUTH_ENABLE_NODE,	/* Authentication mode for change enable. */
-	ENABLE_NODE,		 /* Enable node. */
-	CONFIG_NODE,		 /* Config node. Default mode of config file. */
-	DEBUG_NODE,		 /* Debug node. */
-	VRF_DEBUG_NODE,		 /* Vrf Debug node. */
-	NORTHBOUND_DEBUG_NODE,	 /* Northbound Debug node. */
-	DEBUG_VNC_NODE,		 /* Debug VNC node. */
-	RMAP_DEBUG_NODE,         /* Route-map debug node */
-	RESOLVER_DEBUG_NODE,	 /* Resolver debug node */
-	AAA_NODE,		 /* AAA node. */
-	KEYCHAIN_NODE,		 /* Key-chain node. */
-	KEYCHAIN_KEY_NODE,       /* Key-chain key node. */
-	IP_NODE,		 /* Static ip route node. */
-	VRF_NODE,		 /* VRF mode node. */
-	INTERFACE_NODE,		 /* Interface mode node. */
-	NH_GROUP_NODE,		 /* Nexthop-Group mode node. */
-	ZEBRA_NODE,		 /* zebra connection node. */
-	TABLE_NODE,		 /* rtm_table selection node. */
-	RIP_NODE,		 /* RIP protocol mode node. */
-	RIPNG_NODE,		 /* RIPng protocol mode node. */
-	BABEL_NODE,		 /* BABEL protocol mode node. */
-	EIGRP_NODE,		 /* EIGRP protocol mode node. */
-	BGP_NODE,		 /* BGP protocol mode which includes BGP4+ */
-	BGP_VPNV4_NODE,		 /* BGP MPLS-VPN PE exchange. */
-	BGP_VPNV6_NODE,		 /* BGP MPLS-VPN PE exchange. */
-	BGP_IPV4_NODE,		 /* BGP IPv4 unicast address family.  */
-	BGP_IPV4M_NODE,		 /* BGP IPv4 multicast address family.  */
-	BGP_IPV4L_NODE,		 /* BGP IPv4 labeled unicast address family.  */
-	BGP_IPV6_NODE,		 /* BGP IPv6 address family */
-	BGP_IPV6M_NODE,		 /* BGP IPv6 multicast address family. */
-	BGP_IPV6L_NODE,		 /* BGP IPv6 labeled unicast address family. */
-	BGP_VRF_POLICY_NODE,     /* BGP VRF policy */
-	BGP_VNC_DEFAULTS_NODE,   /* BGP VNC nve defaults */
-	BGP_VNC_NVE_GROUP_NODE,  /* BGP VNC nve group */
-	BGP_VNC_L2_GROUP_NODE,   /* BGP VNC L2 group */
-	RFP_DEFAULTS_NODE,       /* RFP defaults node */
-	BGP_EVPN_NODE,		 /* BGP EVPN node. */
-	OSPF_NODE,		 /* OSPF protocol mode */
-	OSPF6_NODE,		 /* OSPF protocol for IPv6 mode */
-	LDP_NODE,		 /* LDP protocol mode */
-	LDP_IPV4_NODE,		 /* LDP IPv4 address family */
-	LDP_IPV6_NODE,		 /* LDP IPv6 address family */
-	LDP_IPV4_IFACE_NODE,     /* LDP IPv4 Interface */
-	LDP_IPV6_IFACE_NODE,     /* LDP IPv6 Interface */
-	LDP_L2VPN_NODE,		 /* LDP L2VPN node */
-	LDP_PSEUDOWIRE_NODE,     /* LDP Pseudowire node */
-	ISIS_NODE,		 /* ISIS protocol mode */
-	ACCESS_NODE,		 /* Access list node. */
-	PREFIX_NODE,		 /* Prefix list node. */
-	ACCESS_IPV6_NODE,	/* Access list node. */
-	ACCESS_MAC_NODE,	 /* MAC access list node*/
-	PREFIX_IPV6_NODE,	/* Prefix list node. */
-	AS_LIST_NODE,		 /* AS list node. */
-	COMMUNITY_LIST_NODE,     /* Community list node. */
-	RMAP_NODE,		 /* Route map node. */
-	PBRMAP_NODE,		 /* PBR map node. */
-	SMUX_NODE,		 /* SNMP configuration node. */
-	DUMP_NODE,		 /* Packet dump node. */
-	FORWARDING_NODE,	 /* IP forwarding node. */
-	PROTOCOL_NODE,		 /* protocol filtering node */
-	MPLS_NODE,		 /* MPLS config node */
-	PW_NODE,		 /* Pseudowire config node */
-	VTY_NODE,		 /* Vty node. */
-	FPM_NODE,		 /* Dataplane FPM node. */
-	LINK_PARAMS_NODE,	/* Link-parameters node */
-	BGP_EVPN_VNI_NODE,       /* BGP EVPN VNI */
-	RPKI_NODE,     /* RPKI node for configuration of RPKI cache server
-			  connections.*/
-	BGP_FLOWSPECV4_NODE,	/* BGP IPv4 FLOWSPEC Address-Family */
-	BGP_FLOWSPECV6_NODE,	/* BGP IPv6 FLOWSPEC Address-Family */
-	BFD_NODE,		 /* BFD protocol mode. */
-	BFD_PEER_NODE,		 /* BFD peer configuration mode. */
-	OPENFABRIC_NODE,	/* OpenFabric router configuration node */
-	VRRP_NODE,		 /* VRRP node */
-	BMP_NODE,		/* BMP config under router bgp */
-	NODE_TYPE_MAX, /* maximum */
+	AUTH_NODE,		/* Authentication mode of vty interface. */
+	VIEW_NODE,		/* View node. Default mode of vty interface. */
+	AUTH_ENABLE_NODE,       /* Authentication mode for change enable. */
+	ENABLE_NODE,		/* Enable node. */
+	CONFIG_NODE,		/* Config node. Default mode of config file. */
+	DEBUG_NODE,		/* Debug node. */
+	VRF_DEBUG_NODE,		/* Vrf Debug node. */
+	NORTHBOUND_DEBUG_NODE,  /* Northbound Debug node. */
+	DEBUG_VNC_NODE,		/* Debug VNC node. */
+	RMAP_DEBUG_NODE,	/* Route-map debug node */
+	RESOLVER_DEBUG_NODE,    /* Resolver debug node */
+	AAA_NODE,		/* AAA node. */
+	KEYCHAIN_NODE,		/* Key-chain node. */
+	KEYCHAIN_KEY_NODE,      /* Key-chain key node. */
+	IP_NODE,		/* Static ip route node. */
+	VRF_NODE,		/* VRF mode node. */
+	INTERFACE_NODE,		/* Interface mode node. */
+	NH_GROUP_NODE,		/* Nexthop-Group mode node. */
+	ZEBRA_NODE,		/* zebra connection node. */
+	TABLE_NODE,		/* rtm_table selection node. */
+	RIP_NODE,		/* RIP protocol mode node. */
+	RIPNG_NODE,		/* RIPng protocol mode node. */
+	BABEL_NODE,		/* BABEL protocol mode node. */
+	EIGRP_NODE,		/* EIGRP protocol mode node. */
+	BGP_NODE,		/* BGP protocol mode which includes BGP4+ */
+	BGP_VPNV4_NODE,		/* BGP MPLS-VPN PE exchange. */
+	BGP_VPNV6_NODE,		/* BGP MPLS-VPN PE exchange. */
+	BGP_IPV4_NODE,		/* BGP IPv4 unicast address family.  */
+	BGP_IPV4M_NODE,		/* BGP IPv4 multicast address family.  */
+	BGP_IPV4L_NODE,		/* BGP IPv4 labeled unicast address family.  */
+	BGP_IPV6_NODE,		/* BGP IPv6 address family */
+	BGP_IPV6M_NODE,		/* BGP IPv6 multicast address family. */
+	BGP_IPV6L_NODE,		/* BGP IPv6 labeled unicast address family. */
+	BGP_VRF_POLICY_NODE,    /* BGP VRF policy */
+	BGP_VNC_DEFAULTS_NODE,  /* BGP VNC nve defaults */
+	BGP_VNC_NVE_GROUP_NODE, /* BGP VNC nve group */
+	BGP_VNC_L2_GROUP_NODE,  /* BGP VNC L2 group */
+	RFP_DEFAULTS_NODE,      /* RFP defaults node */
+	BGP_EVPN_NODE,		/* BGP EVPN node. */
+	OSPF_NODE,		/* OSPF protocol mode */
+	OSPF6_NODE,		/* OSPF protocol for IPv6 mode */
+	LDP_NODE,		/* LDP protocol mode */
+	LDP_IPV4_NODE,		/* LDP IPv4 address family */
+	LDP_IPV6_NODE,		/* LDP IPv6 address family */
+	LDP_IPV4_IFACE_NODE,    /* LDP IPv4 Interface */
+	LDP_IPV6_IFACE_NODE,    /* LDP IPv6 Interface */
+	LDP_L2VPN_NODE,		/* LDP L2VPN node */
+	LDP_PSEUDOWIRE_NODE,    /* LDP Pseudowire node */
+	ISIS_NODE,		/* ISIS protocol mode */
+	ACCESS_NODE,		/* Access list node. */
+	PREFIX_NODE,		/* Prefix list node. */
+	ACCESS_IPV6_NODE,       /* Access list node. */
+	ACCESS_MAC_NODE,	/* MAC access list node*/
+	PREFIX_IPV6_NODE,       /* Prefix list node. */
+	AS_LIST_NODE,		/* AS list node. */
+	COMMUNITY_LIST_NODE,    /* Community list node. */
+	RMAP_NODE,		/* Route map node. */
+	PBRMAP_NODE,		/* PBR map node. */
+	SMUX_NODE,		/* SNMP configuration node. */
+	DUMP_NODE,		/* Packet dump node. */
+	FORWARDING_NODE,	/* IP forwarding node. */
+	PROTOCOL_NODE,		/* protocol filtering node */
+	MPLS_NODE,		/* MPLS config node */
+	PW_NODE,		/* Pseudowire config node */
+	VTY_NODE,		/* Vty node. */
+	FPM_NODE,		/* Dataplane FPM node. */
+	LINK_PARAMS_NODE,       /* Link-parameters node */
+	BGP_EVPN_VNI_NODE,      /* BGP EVPN VNI */
+	RPKI_NODE,	   /* RPKI node for configuration of RPKI cache server
+				connections.*/
+	BGP_FLOWSPECV4_NODE, /* BGP IPv4 FLOWSPEC Address-Family */
+	BGP_FLOWSPECV6_NODE, /* BGP IPv6 FLOWSPEC Address-Family */
+	BFD_NODE,	    /* BFD protocol mode. */
+	BFD_PEER_NODE,       /* BFD peer configuration mode. */
+	OPENFABRIC_NODE,     /* OpenFabric router configuration node */
+	VRRP_NODE,	   /* VRRP node */
+	BMP_NODE,	    /* BMP config under router bgp */
+	NODE_TYPE_MAX,       /* maximum */
 };
 
 extern vector cmdvec;
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 89ffa43a7..7601496b1 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3547,8 +3545,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI

This comment has been minimized.

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/e7f56881ce9a8e5c5a590decdf83755a/raw/144f54f4c9633485b176a3cadf7191bd9cecd150/cr_6135_1586950676.diff | git apply

diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index 124b06ea8..ba1940700 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2671,8 +2671,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/lib/command.h b/lib/command.h
index e7c9ff4c5..b0a414181 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -84,84 +84,84 @@ struct host {
 
 /* List of CLI nodes. Please remember to update the name array in command.c. */
 enum node_type {
-	AUTH_NODE,		 /* Authentication mode of vty interface. */
-	VIEW_NODE,		 /* View node. Default mode of vty interface. */
-	AUTH_ENABLE_NODE,	/* Authentication mode for change enable. */
-	ENABLE_NODE,		 /* Enable node. */
-	CONFIG_NODE,		 /* Config node. Default mode of config file. */
-	DEBUG_NODE,		 /* Debug node. */
-	VRF_DEBUG_NODE,		 /* Vrf Debug node. */
-	NORTHBOUND_DEBUG_NODE,	 /* Northbound Debug node. */
-	DEBUG_VNC_NODE,		 /* Debug VNC node. */
-	RMAP_DEBUG_NODE,         /* Route-map debug node */
-	RESOLVER_DEBUG_NODE,	 /* Resolver debug node */
-	AAA_NODE,		 /* AAA node. */
-	KEYCHAIN_NODE,		 /* Key-chain node. */
-	KEYCHAIN_KEY_NODE,       /* Key-chain key node. */
-	IP_NODE,		 /* Static ip route node. */
-	VRF_NODE,		 /* VRF mode node. */
-	INTERFACE_NODE,		 /* Interface mode node. */
-	NH_GROUP_NODE,		 /* Nexthop-Group mode node. */
-	ZEBRA_NODE,		 /* zebra connection node. */
-	TABLE_NODE,		 /* rtm_table selection node. */
-	RIP_NODE,		 /* RIP protocol mode node. */
-	RIPNG_NODE,		 /* RIPng protocol mode node. */
-	BABEL_NODE,		 /* BABEL protocol mode node. */
-	EIGRP_NODE,		 /* EIGRP protocol mode node. */
-	BGP_NODE,		 /* BGP protocol mode which includes BGP4+ */
-	BGP_VPNV4_NODE,		 /* BGP MPLS-VPN PE exchange. */
-	BGP_VPNV6_NODE,		 /* BGP MPLS-VPN PE exchange. */
-	BGP_IPV4_NODE,		 /* BGP IPv4 unicast address family.  */
-	BGP_IPV4M_NODE,		 /* BGP IPv4 multicast address family.  */
-	BGP_IPV4L_NODE,		 /* BGP IPv4 labeled unicast address family.  */
-	BGP_IPV6_NODE,		 /* BGP IPv6 address family */
-	BGP_IPV6M_NODE,		 /* BGP IPv6 multicast address family. */
-	BGP_IPV6L_NODE,		 /* BGP IPv6 labeled unicast address family. */
-	BGP_VRF_POLICY_NODE,     /* BGP VRF policy */
-	BGP_VNC_DEFAULTS_NODE,   /* BGP VNC nve defaults */
-	BGP_VNC_NVE_GROUP_NODE,  /* BGP VNC nve group */
-	BGP_VNC_L2_GROUP_NODE,   /* BGP VNC L2 group */
-	RFP_DEFAULTS_NODE,       /* RFP defaults node */
-	BGP_EVPN_NODE,		 /* BGP EVPN node. */
-	OSPF_NODE,		 /* OSPF protocol mode */
-	OSPF6_NODE,		 /* OSPF protocol for IPv6 mode */
-	LDP_NODE,		 /* LDP protocol mode */
-	LDP_IPV4_NODE,		 /* LDP IPv4 address family */
-	LDP_IPV6_NODE,		 /* LDP IPv6 address family */
-	LDP_IPV4_IFACE_NODE,     /* LDP IPv4 Interface */
-	LDP_IPV6_IFACE_NODE,     /* LDP IPv6 Interface */
-	LDP_L2VPN_NODE,		 /* LDP L2VPN node */
-	LDP_PSEUDOWIRE_NODE,     /* LDP Pseudowire node */
-	ISIS_NODE,		 /* ISIS protocol mode */
-	ACCESS_NODE,		 /* Access list node. */
-	PREFIX_NODE,		 /* Prefix list node. */
-	ACCESS_IPV6_NODE,	/* Access list node. */
-	ACCESS_MAC_NODE,	 /* MAC access list node*/
-	PREFIX_IPV6_NODE,	/* Prefix list node. */
-	AS_LIST_NODE,		 /* AS list node. */
-	COMMUNITY_LIST_NODE,     /* Community list node. */
-	RMAP_NODE,		 /* Route map node. */
-	PBRMAP_NODE,		 /* PBR map node. */
-	SMUX_NODE,		 /* SNMP configuration node. */
-	DUMP_NODE,		 /* Packet dump node. */
-	FORWARDING_NODE,	 /* IP forwarding node. */
-	PROTOCOL_NODE,		 /* protocol filtering node */
-	MPLS_NODE,		 /* MPLS config node */
-	PW_NODE,		 /* Pseudowire config node */
-	VTY_NODE,		 /* Vty node. */
-	FPM_NODE,		 /* Dataplane FPM node. */
-	LINK_PARAMS_NODE,	/* Link-parameters node */
-	BGP_EVPN_VNI_NODE,       /* BGP EVPN VNI */
-	RPKI_NODE,     /* RPKI node for configuration of RPKI cache server
-			  connections.*/
-	BGP_FLOWSPECV4_NODE,	/* BGP IPv4 FLOWSPEC Address-Family */
-	BGP_FLOWSPECV6_NODE,	/* BGP IPv6 FLOWSPEC Address-Family */
-	BFD_NODE,		 /* BFD protocol mode. */
-	BFD_PEER_NODE,		 /* BFD peer configuration mode. */
-	OPENFABRIC_NODE,	/* OpenFabric router configuration node */
-	VRRP_NODE,		 /* VRRP node */
-	BMP_NODE,		/* BMP config under router bgp */
-	NODE_TYPE_MAX, /* maximum */
+	AUTH_NODE,		/* Authentication mode of vty interface. */
+	VIEW_NODE,		/* View node. Default mode of vty interface. */
+	AUTH_ENABLE_NODE,       /* Authentication mode for change enable. */
+	ENABLE_NODE,		/* Enable node. */
+	CONFIG_NODE,		/* Config node. Default mode of config file. */
+	DEBUG_NODE,		/* Debug node. */
+	VRF_DEBUG_NODE,		/* Vrf Debug node. */
+	NORTHBOUND_DEBUG_NODE,  /* Northbound Debug node. */
+	DEBUG_VNC_NODE,		/* Debug VNC node. */
+	RMAP_DEBUG_NODE,	/* Route-map debug node */
+	RESOLVER_DEBUG_NODE,    /* Resolver debug node */
+	AAA_NODE,		/* AAA node. */
+	KEYCHAIN_NODE,		/* Key-chain node. */
+	KEYCHAIN_KEY_NODE,      /* Key-chain key node. */
+	IP_NODE,		/* Static ip route node. */
+	VRF_NODE,		/* VRF mode node. */
+	INTERFACE_NODE,		/* Interface mode node. */
+	NH_GROUP_NODE,		/* Nexthop-Group mode node. */
+	ZEBRA_NODE,		/* zebra connection node. */
+	TABLE_NODE,		/* rtm_table selection node. */
+	RIP_NODE,		/* RIP protocol mode node. */
+	RIPNG_NODE,		/* RIPng protocol mode node. */
+	BABEL_NODE,		/* BABEL protocol mode node. */
+	EIGRP_NODE,		/* EIGRP protocol mode node. */
+	BGP_NODE,		/* BGP protocol mode which includes BGP4+ */
+	BGP_VPNV4_NODE,		/* BGP MPLS-VPN PE exchange. */
+	BGP_VPNV6_NODE,		/* BGP MPLS-VPN PE exchange. */
+	BGP_IPV4_NODE,		/* BGP IPv4 unicast address family.  */
+	BGP_IPV4M_NODE,		/* BGP IPv4 multicast address family.  */
+	BGP_IPV4L_NODE,		/* BGP IPv4 labeled unicast address family.  */
+	BGP_IPV6_NODE,		/* BGP IPv6 address family */
+	BGP_IPV6M_NODE,		/* BGP IPv6 multicast address family. */
+	BGP_IPV6L_NODE,		/* BGP IPv6 labeled unicast address family. */
+	BGP_VRF_POLICY_NODE,    /* BGP VRF policy */
+	BGP_VNC_DEFAULTS_NODE,  /* BGP VNC nve defaults */
+	BGP_VNC_NVE_GROUP_NODE, /* BGP VNC nve group */
+	BGP_VNC_L2_GROUP_NODE,  /* BGP VNC L2 group */
+	RFP_DEFAULTS_NODE,      /* RFP defaults node */
+	BGP_EVPN_NODE,		/* BGP EVPN node. */
+	OSPF_NODE,		/* OSPF protocol mode */
+	OSPF6_NODE,		/* OSPF protocol for IPv6 mode */
+	LDP_NODE,		/* LDP protocol mode */
+	LDP_IPV4_NODE,		/* LDP IPv4 address family */
+	LDP_IPV6_NODE,		/* LDP IPv6 address family */
+	LDP_IPV4_IFACE_NODE,    /* LDP IPv4 Interface */
+	LDP_IPV6_IFACE_NODE,    /* LDP IPv6 Interface */
+	LDP_L2VPN_NODE,		/* LDP L2VPN node */
+	LDP_PSEUDOWIRE_NODE,    /* LDP Pseudowire node */
+	ISIS_NODE,		/* ISIS protocol mode */
+	ACCESS_NODE,		/* Access list node. */
+	PREFIX_NODE,		/* Prefix list node. */
+	ACCESS_IPV6_NODE,       /* Access list node. */
+	ACCESS_MAC_NODE,	/* MAC access list node*/
+	PREFIX_IPV6_NODE,       /* Prefix list node. */
+	AS_LIST_NODE,		/* AS list node. */
+	COMMUNITY_LIST_NODE,    /* Community list node. */
+	RMAP_NODE,		/* Route map node. */
+	PBRMAP_NODE,		/* PBR map node. */
+	SMUX_NODE,		/* SNMP configuration node. */
+	DUMP_NODE,		/* Packet dump node. */
+	FORWARDING_NODE,	/* IP forwarding node. */
+	PROTOCOL_NODE,		/* protocol filtering node */
+	MPLS_NODE,		/* MPLS config node */
+	PW_NODE,		/* Pseudowire config node */
+	VTY_NODE,		/* Vty node. */
+	FPM_NODE,		/* Dataplane FPM node. */
+	LINK_PARAMS_NODE,       /* Link-parameters node */
+	BGP_EVPN_VNI_NODE,      /* BGP EVPN VNI */
+	RPKI_NODE,	   /* RPKI node for configuration of RPKI cache server
+				connections.*/
+	BGP_FLOWSPECV4_NODE, /* BGP IPv4 FLOWSPEC Address-Family */
+	BGP_FLOWSPECV6_NODE, /* BGP IPv6 FLOWSPEC Address-Family */
+	BFD_NODE,	    /* BFD protocol mode. */
+	BFD_PEER_NODE,       /* BFD peer configuration mode. */
+	OPENFABRIC_NODE,     /* OpenFabric router configuration node */
+	VRRP_NODE,	   /* VRRP node */
+	BMP_NODE,	    /* BMP config under router bgp */
+	NODE_TYPE_MAX,       /* maximum */
 };
 
 extern vector cmdvec;
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 89ffa43a7..7601496b1 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3547,8 +3545,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 15, 2020

Outdated results 🛑

Basic BGPD CI results: FAILURE

_ _
Result FAILURE git merge/6135 0e6f553 frr.github Build
Date 04/15/2020
Start 07:42:24
Finish 07:42:43
Run-Time 00:19
Total
Pass
Fail
Valgrind-Errors
Valgrind-Loss
Details vncregress-2020-04-15-07:42:24.txt
Log make-2020-04-15-07:42:24.out.bz2
Memory

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 15, 2020

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11869/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for command.h | 2 issues
===============================================
< WARNING: function definition argument 'struct vty *' should also have an identifier name
< #188: FILE: /tmp/f1-30292/command.h:188:
Report for vty.c | 2 issues
===============================================
< WARNING: Block comments use a trailing */ on a separate line
< #2612: FILE: /tmp/f1-30292/vty.c:2612:
Report for vty.h | 2 issues
===============================================
< WARNING: function definition argument 'struct vty *' should also have an identifier name
< #327: FILE: /tmp/f1-30292/vty.h:327:

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11869/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200415-09-g0e6f5537b-0 (missing) -> 7.4-dev-20200415-09-g0e6f5537b-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200415-09-g0e6f5537b-0 (missing) -> 7.4-dev-20200415-09-g0e6f5537b-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200415-09-g0e6f5537b-0 (missing) -> 7.4-dev-20200415-09-g0e6f5537b-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200415-09-g0e6f5537b-0 (missing) -> 7.4-dev-20200415-09-g0e6f5537b-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200415-09-g0e6f5537b-0 (missing) -> 7.4-dev-20200415-09-g0e6f5537b-0~deb10u1

CLANG Static Analyzer Summary

  • Github Pull Request 6135, comparing to Git base SHA 260616d
  • Base image data for Git 260616d does not exist - compare skipped

2 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11869/artifact/shared/static_analysis/index.html

Copy link
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

eqvinox and others added 9 commits April 16, 2020 12:53
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Rather than doing a f*gly hack for the RPKI code, let's do an on-exit
hook in cmd_node.  Also allows replacing some special-casing in the vty
code.

Signed-off-by: David Lamparter <equinox@diac24.net>
Cleaning up the whole mess of "exit" and "quit" commands that follows is
left for a rainy day :(

Signed-off-by: David Lamparter <equinox@diac24.net>
... requested by Lou.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/a08caca7729d58166b652763d2317eef/raw/ada014ad905568a96ca06cf30e69a7352bed6dec/cr_6135_1587034584.diff | git apply

diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 8902a8789..f502c34f7 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1772,12 +1772,10 @@ static void bmp_active_setup(struct bmp_active *ba)
 	}
 }
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 #define BMP_STR "BGP Monitoring Protocol\n"
 
diff --git a/lib/command.c b/lib/command.c
index d51922dfa..19e27ec6c 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2671,8 +2671,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 
diff --git a/lib/command.h b/lib/command.h
index 719ee9fba..b3b4e9a7d 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -84,84 +84,84 @@ struct host {
 
 /* List of CLI nodes. Please remember to update the name array in command.c. */
 enum node_type {
-	AUTH_NODE,		 /* Authentication mode of vty interface. */
-	VIEW_NODE,		 /* View node. Default mode of vty interface. */
-	AUTH_ENABLE_NODE,	/* Authentication mode for change enable. */
-	ENABLE_NODE,		 /* Enable node. */
-	CONFIG_NODE,		 /* Config node. Default mode of config file. */
-	DEBUG_NODE,		 /* Debug node. */
-	VRF_DEBUG_NODE,		 /* Vrf Debug node. */
-	NORTHBOUND_DEBUG_NODE,	 /* Northbound Debug node. */
-	DEBUG_VNC_NODE,		 /* Debug VNC node. */
-	RMAP_DEBUG_NODE,         /* Route-map debug node */
-	RESOLVER_DEBUG_NODE,	 /* Resolver debug node */
-	AAA_NODE,		 /* AAA node. */
-	KEYCHAIN_NODE,		 /* Key-chain node. */
-	KEYCHAIN_KEY_NODE,       /* Key-chain key node. */
-	IP_NODE,		 /* Static ip route node. */
-	VRF_NODE,		 /* VRF mode node. */
-	INTERFACE_NODE,		 /* Interface mode node. */
-	NH_GROUP_NODE,		 /* Nexthop-Group mode node. */
-	ZEBRA_NODE,		 /* zebra connection node. */
-	TABLE_NODE,		 /* rtm_table selection node. */
-	RIP_NODE,		 /* RIP protocol mode node. */
-	RIPNG_NODE,		 /* RIPng protocol mode node. */
-	BABEL_NODE,		 /* BABEL protocol mode node. */
-	EIGRP_NODE,		 /* EIGRP protocol mode node. */
-	BGP_NODE,		 /* BGP protocol mode which includes BGP4+ */
-	BGP_VPNV4_NODE,		 /* BGP MPLS-VPN PE exchange. */
-	BGP_VPNV6_NODE,		 /* BGP MPLS-VPN PE exchange. */
-	BGP_IPV4_NODE,		 /* BGP IPv4 unicast address family.  */
-	BGP_IPV4M_NODE,		 /* BGP IPv4 multicast address family.  */
-	BGP_IPV4L_NODE,		 /* BGP IPv4 labeled unicast address family.  */
-	BGP_IPV6_NODE,		 /* BGP IPv6 address family */
-	BGP_IPV6M_NODE,		 /* BGP IPv6 multicast address family. */
-	BGP_IPV6L_NODE,		 /* BGP IPv6 labeled unicast address family. */
-	BGP_VRF_POLICY_NODE,     /* BGP VRF policy */
-	BGP_VNC_DEFAULTS_NODE,   /* BGP VNC nve defaults */
-	BGP_VNC_NVE_GROUP_NODE,  /* BGP VNC nve group */
-	BGP_VNC_L2_GROUP_NODE,   /* BGP VNC L2 group */
-	RFP_DEFAULTS_NODE,       /* RFP defaults node */
-	BGP_EVPN_NODE,		 /* BGP EVPN node. */
-	OSPF_NODE,		 /* OSPF protocol mode */
-	OSPF6_NODE,		 /* OSPF protocol for IPv6 mode */
-	LDP_NODE,		 /* LDP protocol mode */
-	LDP_IPV4_NODE,		 /* LDP IPv4 address family */
-	LDP_IPV6_NODE,		 /* LDP IPv6 address family */
-	LDP_IPV4_IFACE_NODE,     /* LDP IPv4 Interface */
-	LDP_IPV6_IFACE_NODE,     /* LDP IPv6 Interface */
-	LDP_L2VPN_NODE,		 /* LDP L2VPN node */
-	LDP_PSEUDOWIRE_NODE,     /* LDP Pseudowire node */
-	ISIS_NODE,		 /* ISIS protocol mode */
-	ACCESS_NODE,		 /* Access list node. */
-	PREFIX_NODE,		 /* Prefix list node. */
-	ACCESS_IPV6_NODE,	/* Access list node. */
-	ACCESS_MAC_NODE,	 /* MAC access list node*/
-	PREFIX_IPV6_NODE,	/* Prefix list node. */
-	AS_LIST_NODE,		 /* AS list node. */
-	COMMUNITY_LIST_NODE,     /* Community list node. */
-	RMAP_NODE,		 /* Route map node. */
-	PBRMAP_NODE,		 /* PBR map node. */
-	SMUX_NODE,		 /* SNMP configuration node. */
-	DUMP_NODE,		 /* Packet dump node. */
-	FORWARDING_NODE,	 /* IP forwarding node. */
-	PROTOCOL_NODE,		 /* protocol filtering node */
-	MPLS_NODE,		 /* MPLS config node */
-	PW_NODE,		 /* Pseudowire config node */
-	VTY_NODE,		 /* Vty node. */
-	FPM_NODE,		 /* Dataplane FPM node. */
-	LINK_PARAMS_NODE,	/* Link-parameters node */
-	BGP_EVPN_VNI_NODE,       /* BGP EVPN VNI */
-	RPKI_NODE,     /* RPKI node for configuration of RPKI cache server
-			  connections.*/
-	BGP_FLOWSPECV4_NODE,	/* BGP IPv4 FLOWSPEC Address-Family */
-	BGP_FLOWSPECV6_NODE,	/* BGP IPv6 FLOWSPEC Address-Family */
-	BFD_NODE,		 /* BFD protocol mode. */
-	BFD_PEER_NODE,		 /* BFD peer configuration mode. */
-	OPENFABRIC_NODE,	/* OpenFabric router configuration node */
-	VRRP_NODE,		 /* VRRP node */
-	BMP_NODE,		/* BMP config under router bgp */
-	NODE_TYPE_MAX, /* maximum */
+	AUTH_NODE,		/* Authentication mode of vty interface. */
+	VIEW_NODE,		/* View node. Default mode of vty interface. */
+	AUTH_ENABLE_NODE,       /* Authentication mode for change enable. */
+	ENABLE_NODE,		/* Enable node. */
+	CONFIG_NODE,		/* Config node. Default mode of config file. */
+	DEBUG_NODE,		/* Debug node. */
+	VRF_DEBUG_NODE,		/* Vrf Debug node. */
+	NORTHBOUND_DEBUG_NODE,  /* Northbound Debug node. */
+	DEBUG_VNC_NODE,		/* Debug VNC node. */
+	RMAP_DEBUG_NODE,	/* Route-map debug node */
+	RESOLVER_DEBUG_NODE,    /* Resolver debug node */
+	AAA_NODE,		/* AAA node. */
+	KEYCHAIN_NODE,		/* Key-chain node. */
+	KEYCHAIN_KEY_NODE,      /* Key-chain key node. */
+	IP_NODE,		/* Static ip route node. */
+	VRF_NODE,		/* VRF mode node. */
+	INTERFACE_NODE,		/* Interface mode node. */
+	NH_GROUP_NODE,		/* Nexthop-Group mode node. */
+	ZEBRA_NODE,		/* zebra connection node. */
+	TABLE_NODE,		/* rtm_table selection node. */
+	RIP_NODE,		/* RIP protocol mode node. */
+	RIPNG_NODE,		/* RIPng protocol mode node. */
+	BABEL_NODE,		/* BABEL protocol mode node. */
+	EIGRP_NODE,		/* EIGRP protocol mode node. */
+	BGP_NODE,		/* BGP protocol mode which includes BGP4+ */
+	BGP_VPNV4_NODE,		/* BGP MPLS-VPN PE exchange. */
+	BGP_VPNV6_NODE,		/* BGP MPLS-VPN PE exchange. */
+	BGP_IPV4_NODE,		/* BGP IPv4 unicast address family.  */
+	BGP_IPV4M_NODE,		/* BGP IPv4 multicast address family.  */
+	BGP_IPV4L_NODE,		/* BGP IPv4 labeled unicast address family.  */
+	BGP_IPV6_NODE,		/* BGP IPv6 address family */
+	BGP_IPV6M_NODE,		/* BGP IPv6 multicast address family. */
+	BGP_IPV6L_NODE,		/* BGP IPv6 labeled unicast address family. */
+	BGP_VRF_POLICY_NODE,    /* BGP VRF policy */
+	BGP_VNC_DEFAULTS_NODE,  /* BGP VNC nve defaults */
+	BGP_VNC_NVE_GROUP_NODE, /* BGP VNC nve group */
+	BGP_VNC_L2_GROUP_NODE,  /* BGP VNC L2 group */
+	RFP_DEFAULTS_NODE,      /* RFP defaults node */
+	BGP_EVPN_NODE,		/* BGP EVPN node. */
+	OSPF_NODE,		/* OSPF protocol mode */
+	OSPF6_NODE,		/* OSPF protocol for IPv6 mode */
+	LDP_NODE,		/* LDP protocol mode */
+	LDP_IPV4_NODE,		/* LDP IPv4 address family */
+	LDP_IPV6_NODE,		/* LDP IPv6 address family */
+	LDP_IPV4_IFACE_NODE,    /* LDP IPv4 Interface */
+	LDP_IPV6_IFACE_NODE,    /* LDP IPv6 Interface */
+	LDP_L2VPN_NODE,		/* LDP L2VPN node */
+	LDP_PSEUDOWIRE_NODE,    /* LDP Pseudowire node */
+	ISIS_NODE,		/* ISIS protocol mode */
+	ACCESS_NODE,		/* Access list node. */
+	PREFIX_NODE,		/* Prefix list node. */
+	ACCESS_IPV6_NODE,       /* Access list node. */
+	ACCESS_MAC_NODE,	/* MAC access list node*/
+	PREFIX_IPV6_NODE,       /* Prefix list node. */
+	AS_LIST_NODE,		/* AS list node. */
+	COMMUNITY_LIST_NODE,    /* Community list node. */
+	RMAP_NODE,		/* Route map node. */
+	PBRMAP_NODE,		/* PBR map node. */
+	SMUX_NODE,		/* SNMP configuration node. */
+	DUMP_NODE,		/* Packet dump node. */
+	FORWARDING_NODE,	/* IP forwarding node. */
+	PROTOCOL_NODE,		/* protocol filtering node */
+	MPLS_NODE,		/* MPLS config node */
+	PW_NODE,		/* Pseudowire config node */
+	VTY_NODE,		/* Vty node. */
+	FPM_NODE,		/* Dataplane FPM node. */
+	LINK_PARAMS_NODE,       /* Link-parameters node */
+	BGP_EVPN_VNI_NODE,      /* BGP EVPN VNI */
+	RPKI_NODE,	   /* RPKI node for configuration of RPKI cache server
+				connections.*/
+	BGP_FLOWSPECV4_NODE, /* BGP IPv4 FLOWSPEC Address-Family */
+	BGP_FLOWSPECV6_NODE, /* BGP IPv6 FLOWSPEC Address-Family */
+	BFD_NODE,	    /* BFD protocol mode. */
+	BFD_PEER_NODE,       /* BFD peer configuration mode. */
+	OPENFABRIC_NODE,     /* OpenFabric router configuration node */
+	VRRP_NODE,	   /* VRRP node */
+	BMP_NODE,	    /* BMP config under router bgp */
+	NODE_TYPE_MAX,       /* maximum */
 };
 
 extern vector cmdvec;
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 89ffa43a7..7601496b1 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1361,12 +1361,10 @@ static struct cmd_node bgp_vnc_l2_group_node = {
 	.prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
-static struct cmd_node bmp_node = {
-	.name = "bmp",
-	.node = BMP_NODE,
-	.parent_node = BGP_NODE,
-	.prompt = "%s(config-bgp-bmp)# "
-};
+static struct cmd_node bmp_node = {.name = "bmp",
+				   .node = BMP_NODE,
+				   .parent_node = BGP_NODE,
+				   .prompt = "%s(config-bgp-bmp)# "};
 
 static struct cmd_node ospf_node = {
 	.name = "ospf",
@@ -3547,8 +3545,8 @@ DEFUN(find,
 			cli = vector_slot(clis, j);
 
 			if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
-				vty_out(vty, "  (%s)  %s\n",
-					node->name, cli->string);
+				vty_out(vty, "  (%s)  %s\n", node->name,
+					cli->string);
 		}
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 16, 2020

Outdated results 🛑

Basic BGPD CI results: FAILURE

_ _
Result FAILURE git merge/6135 d1b221f frr.github Build
Date 04/16/2020
Start 07:18:30
Finish 07:19:05
Run-Time 00:35
Total
Pass
Fail
Valgrind-Errors
Valgrind-Loss
Details vncregress-2020-04-16-07:18:30.txt
Log make-2020-04-16-07:18:30.out.bz2
Memory

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11902/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for command.h | 2 issues
===============================================
< WARNING: function definition argument 'struct vty *' should also have an identifier name
< #191: FILE: /tmp/f1-18737/command.h:191:
Report for vty.c | 2 issues
===============================================
< WARNING: Block comments use a trailing */ on a separate line
< #2612: FILE: /tmp/f1-18737/vty.c:2612:
Report for vty.h | 2 issues
===============================================
< WARNING: function definition argument 'struct vty *' should also have an identifier name
< #327: FILE: /tmp/f1-18737/vty.h:327:

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11902/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200416-11-gd1b221f69-0 (missing) -> 7.4-dev-20200416-11-gd1b221f69-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200416-11-gd1b221f69-0 (missing) -> 7.4-dev-20200416-11-gd1b221f69-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200416-11-gd1b221f69-0 (missing) -> 7.4-dev-20200416-11-gd1b221f69-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200416-11-gd1b221f69-0 (missing) -> 7.4-dev-20200416-11-gd1b221f69-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200416-11-gd1b221f69-0 (missing) -> 7.4-dev-20200416-11-gd1b221f69-0~deb10u1

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 16, 2020

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/6135 d1b221f
Date 04/16/2020
Start 09:38:27
Finish 10:04:28
Run-Time 26:01
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2020-04-16-09:38:27.txt
Log autoscript-2020-04-16-09:39:23.log.bz2
Memory 499 496 425

For details, please contact louberger

@donaldsharp donaldsharp merged commit 2ff9950 into FRRouting:master Apr 16, 2020
@eqvinox eqvinox deleted the cli-node-cleanup branch April 18, 2021 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants