]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpcli: `configure system interface pattern` instead of `configure lldp iface-pattern`
authorVincent Bernat <bernat@luffy.cx>
Thu, 20 Jun 2013 22:58:51 +0000 (00:58 +0200)
committerVincent Bernat <bernat@luffy.cx>
Thu, 20 Jun 2013 22:58:51 +0000 (00:58 +0200)
`configure system` will contain non-LLDP related stuff. Moreover, we
may add `configure system interface alias rewrite` to enable the
rewrite of ifalias (a long awaited feature).

src/client/conf.c
src/client/lldpcli.8

index 05db254b5c86bdab0e775a587e5d7a67f2ee8c90..f11324d45414e9794ad1ef90c9377298a3ed93a6 100644 (file)
@@ -93,10 +93,41 @@ cmd_iface_pattern(struct lldpctl_conn_t *conn, struct writer *w,
        return 1;
 }
 
+/**
+ * Register `configure system` commands.
+ *
+ * Those are the commands to configure protocol-independant stuff.
+ */
+static void
+register_commands_configure_system(struct cmd_node *configure)
+{
+       struct cmd_node *configure_system = commands_new(
+               configure,
+               "system", "System configuration",
+               cmd_check_no_env, NULL, "ports");
+       struct cmd_node *configure_interface = commands_new(
+               configure_system,
+               "interface", "Configure interface related items",
+               NULL, NULL, NULL);
+
+        commands_new(
+               commands_new(
+                       commands_new(configure_interface,
+                           "pattern", "Set active interface pattern",
+                           NULL, NULL, NULL),
+                       NULL, "Interface pattern (comma separated list of wildcards)",
+                       NULL, cmd_store_env_value, "iface-pattern"),
+               NEWLINE, "Set active interface pattern",
+               NULL, cmd_iface_pattern, NULL);
+}
+
 /**
  * Register `configure lldp` commands.
+ *
+ * Those are the commands that are related to the LLDP protocol but not
+ * Dot1/Dot3/MED. Commands not related to LLDP should go in system instead.
  */
-void
+static void
 register_commands_configure_lldp(struct cmd_node *configure)
 {
        struct cmd_node *configure_lldp = commands_new(
@@ -123,16 +154,6 @@ register_commands_configure_lldp(struct cmd_node *configure)
                        NULL, cmd_store_env_value, "tx-hold"),
                NEWLINE, "Set LLDP transmit hold",
                NULL, cmd_txhold, NULL);
-
-        commands_new(
-               commands_new(
-                       commands_new(configure_lldp,
-                           "iface-pattern", "Set LLDP iface pattern",
-                           cmd_check_no_env, NULL, "ports"),
-                       NULL, "LLDP iface pattern",
-                       NULL, cmd_store_env_value, "iface-pattern"),
-               NEWLINE, "Set LLDP iface pattern",
-               NULL, cmd_iface_pattern, NULL);
 }
 
 /**
@@ -154,7 +175,8 @@ register_commands_configure(struct cmd_node *root)
        cmd_restrict_ports(configure);
        cmd_restrict_ports(unconfigure);
 
-        register_commands_configure_lldp(configure);
-        register_commands_configure_med(configure, unconfigure);
-        register_commands_configure_dot3(configure);
+       register_commands_configure_system(configure);
+       register_commands_configure_lldp(configure);
+       register_commands_configure_med(configure, unconfigure);
+       register_commands_configure_dot3(configure);
 }
index 578df2e8c1db3a133319ca198ff3350c68950b20..2590b2eaada6652d4321c8cf5c6b4a902e368537 100644 (file)
@@ -167,26 +167,9 @@ update its information and send new LLDP PDU on all interfaces.
 .Ed
 
 .Cd configure
-.Cd lldp tx-interval Ar interval
-.Bd -ragged -offset XXXXXX
-Change transmit delay to the specified value in seconds. The transmit
-delay is the delay between two transmissions of LLDP PDU. The default
-value is 30 seconds.
-.Ed
-
-.Cd configure
-.Cd lldp tx-hold Ar hold
-.Bd -ragged -offset XXXXXX
-Change transmit hold value to the specified value. This value is used
-to compute the TTL of transmitted packets which is the product of this
-value and of the transmit delay. The default value is 4 and therefore
-the default TTL is 120 seconds.
-.Ed
-
-.Cd configure
-.Cd lldp iface-pattern Ar pattern
+.Cd system interface pattern Ar pattern
 .Bd -ragged -offset XXXXXX
-Set the pattern of valid interfaces to listen to. When not set,
+Set the pattern of valid interfaces to use. When not set,
 .Nm lldpd
 will listen on all available interfaces. This option can use
 wildcards. Several interfaces can be specified separated by commas.
@@ -203,6 +186,23 @@ and
 .Em eth2 .
 .Ed
 
+.Cd configure
+.Cd lldp tx-interval Ar interval
+.Bd -ragged -offset XXXXXX
+Change transmit delay to the specified value in seconds. The transmit
+delay is the delay between two transmissions of LLDP PDU. The default
+value is 30 seconds.
+.Ed
+
+.Cd configure
+.Cd lldp tx-hold Ar hold
+.Bd -ragged -offset XXXXXX
+Change transmit hold value to the specified value. This value is used
+to compute the TTL of transmitted packets which is the product of this
+value and of the transmit delay. The default value is 4 and therefore
+the default TTL is 120 seconds.
+.Ed
+
 .Cd configure med fast-start
 .Cd enable | tx-interval Ar interval
 .Bd -ragged -offset XXXXXX