return 1;
}
-/**
- * Restrict the command to some ports.
- */
-static void
-restrict_ports(struct cmd_node *root)
-{
- /* Restrict to some ports. */
- commands_new(
- commands_new(root,
- "ports",
- "Restrict configuration to some ports",
- cmd_check_no_env, NULL, "ports"),
- NULL,
- "Restrict configuration to the specified ports (comma-separated list)",
- NULL, cmd_store_env_value_and_pop2, "ports");
-}
-
/**
* Register `configure med location coordinate` commands.
*/
"configure",
"Change system settings",
NULL, NULL, NULL);
- restrict_ports(configure);
+ cmd_restrict_ports(configure);
if (has_med) {
struct cmd_node *configure_med = commands_new(
struct cmd_env *, void *);
lldpctl_atom_t* cmd_iterate_on_interfaces(struct lldpctl_conn_t *,
struct cmd_env *);
+void cmd_restrict_ports(struct cmd_node *);
/* misc.c */
int contains(const char *, const char *);
return iface;
}
+
+/**
+ * Restrict the command to some ports.
+ */
+void
+cmd_restrict_ports(struct cmd_node *root)
+{
+ /* Restrict to some ports. */
+ commands_new(
+ commands_new(root,
+ "ports",
+ "Restrict configuration to some ports",
+ cmd_check_no_env, NULL, "ports"),
+ NULL,
+ "Restrict configuration to the specified ports (comma-separated list)",
+ NULL, cmd_store_env_value_and_pop2, "ports");
+}
cmd_check_no_detailed_nor_summary, cmd_store_env_and_pop, "summary");
/* Some specific port */
- commands_new(
- commands_new(root,
- "ports",
- "Restrict to neighbors seen on some ports",
- cmd_check_no_env, NULL, "ports"),
- NULL,
- "Restrict to neighbors on those ports (comma-separated list)",
- NULL, cmd_store_env_value_and_pop2, "ports");
+ cmd_restrict_ports(root);
}
/**