From: Vincent Bernat Date: Thu, 20 Jun 2013 22:58:51 +0000 (+0200) Subject: lldpcli: `configure system interface pattern` instead of `configure lldp iface-pattern` X-Git-Tag: 0.7.4~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48d0a4b0d72e4bda04f4f75cd28c6c14f710e5d5;p=thirdparty%2Flldpd.git lldpcli: `configure system interface pattern` instead of `configure lldp iface-pattern` `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). --- diff --git a/src/client/conf.c b/src/client/conf.c index 05db254b..f11324d4 100644 --- a/src/client/conf.c +++ b/src/client/conf.c @@ -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); } diff --git a/src/client/lldpcli.8 b/src/client/lldpcli.8 index 578df2e8..2590b2ea 100644 --- a/src/client/lldpcli.8 +++ b/src/client/lldpcli.8 @@ -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