lldpd (1.0.4)
* Changes:
- + Add "set system lldp max-neighbors XX" command to modify maximum
+ + Add "configure system max-neighbors XX" command to modify maximum
of neighbors accepted per port.
lldpd (1.0.3)
return 1;
}
-static int
-cmd_maxneighs(struct lldpctl_conn_t *conn, struct writer *w,
- struct cmd_env *env, void *arg)
-{
- log_debug("lldpctl", "set maximum neighbors");
-
- lldpctl_atom_t *config = lldpctl_get_configuration(conn);
- if (config == NULL) {
- log_warnx("lldpctl", "unable to get configuration from lldpd. %s",
- lldpctl_last_strerror(conn));
- return 0;
- }
- if (lldpctl_atom_set_str(config,
- lldpctl_k_config_max_neighbors, cmdenv_get(env, "max-neighbors")) == NULL) {
- log_warnx("lldpctl", "unable to set maximum of neighbors. %s",
- lldpctl_last_strerror(conn));
- lldpctl_atom_dec_ref(config);
- return 0;
- }
- log_info("lldpctl", "maximum neighbors set to new value %s", cmdenv_get(env, "max-neighbors"));
- lldpctl_atom_dec_ref(config);
- return 1;
-}
-
static int
cmd_status(struct lldpctl_conn_t *conn, struct writer *w,
struct cmd_env *env, void *arg)
NEWLINE, "Set LLDP transmit hold",
NULL, cmd_txhold, NULL);
- commands_new(
- commands_new(
- commands_new(configure_lldp,
- "max-neighbors", "Set maximum number of neighbors per port",
- cmd_check_no_env, NULL, "ports"),
- NULL, "Maximum number of neighbors",
- NULL, cmd_store_env_value, "max-neighbors"),
- NEWLINE, "Set maximum number of neighbors per port",
- NULL, cmd_maxneighs, NULL);
-
struct cmd_node *status = commands_new(configure_lldp,
"status", "Set administrative status",
NULL, NULL, NULL);
return 1;
}
+static int
+cmd_maxneighs(struct lldpctl_conn_t *conn, struct writer *w,
+ struct cmd_env *env, void *arg)
+{
+ log_debug("lldpctl", "set maximum neighbors");
+
+ lldpctl_atom_t *config = lldpctl_get_configuration(conn);
+ if (config == NULL) {
+ log_warnx("lldpctl", "unable to get configuration from lldpd. %s",
+ lldpctl_last_strerror(conn));
+ return 0;
+ }
+ if (lldpctl_atom_set_str(config,
+ lldpctl_k_config_max_neighbors, cmdenv_get(env, "max-neighbors")) == NULL) {
+ log_warnx("lldpctl", "unable to set maximum of neighbors. %s",
+ lldpctl_last_strerror(conn));
+ lldpctl_atom_dec_ref(config);
+ return 0;
+ }
+ log_info("lldpctl", "maximum neighbors set to new value %s", cmdenv_get(env, "max-neighbors"));
+ lldpctl_atom_dec_ref(config);
+ return 1;
+}
+
/**
* Register `configure system bond-slave-src-mac-type`
*/
NEWLINE, "Don't override system name",
NULL, cmd_hostname, NULL);
+ commands_new(
+ commands_new(
+ commands_new(configure_system,
+ "max-neighbors", "Set maximum number of neighbors per port",
+ cmd_check_no_env, NULL, "ports"),
+ NULL, "Maximum number of neighbors",
+ NULL, cmd_store_env_value, "max-neighbors"),
+ NEWLINE, "Set maximum number of neighbors per port",
+ NULL, cmd_maxneighs, NULL);
+
commands_new(
commands_new(
commands_new(
quite unlikely).
.Ed
+.Cd configure
+.Cd system max-neighbors Ar neighbors
+.Bd -ragged -offset XXXXXX
+Change the maximum number of neighbors accepted (for each protocol) on
+an interface. This is a global value. The default is 32. This setting
+only applies to future neighbors.
+.Ed
+
.Cd configure
.Cd lldp agent-type
.Cd nearest-bridge | nearest-non-tpmr-bridge | nearest-customer-bridge
the default TTL is 120 seconds.
.Ed
-.Cd configure
-.Cd lldp max-neighbors Ar neighbors
-.Bd -ragged -offset XXXXXX
-Change the maximum number of neighbors accepted (for each protocol) on
-an interface. This is a global value. The default is 32. This setting
-only applies to future neighbors.
-.Ed
-
.Cd configure
.Op ports Ar ethX Op ,...
.Cd lldp
@pytest.mark.parametrize("command, name, expected", [
+ ("configure system max-neighbors 10", "max-neighbors", 10),
("configure lldp tx-interval 20", "tx-delay", 20),
("configure lldp tx-hold 5", "tx-hold", 5),
- ("configure lldp max-neighbors 10", "max-neighbors", 10),
("configure lldp portidsubtype ifname", "lldp-portid-type", "ifname"),
pytest.param("unconfigure med fast-start",
"lldpmed-faststart", "no",
unconfigure system interface promiscuous
configure system ip management pattern *
unconfigure system ip management pattern
+configure system max-neighbors 16
configure lldp portidsubtype ifname
configure lldp portidsubtype macaddress
configure lldp portidsubtype local Batman
configure lldp portidsubtype local Batman description Batman
configure lldp tx-interval 30
configure lldp tx-hold 4
-configure lldp max-neighbors 16
configure lldp ports eth0 status tx-only
configure lldp status rx-and-tx
configure lldp custom-tlv oui 33,44,55 subtype 44