]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpctl: remove "unconfigure" commands (not implemented)
authorVincent Bernat <bernat@luffy.cx>
Sat, 5 Jan 2013 13:49:51 +0000 (14:49 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sat, 5 Jan 2013 13:49:51 +0000 (14:49 +0100)
This seems better to remove them instead of documenting them but not
implementing them. The API makes it difficult to implement them for
now.

src/client/actions.c
src/client/client.h
src/client/commands.c
src/client/lldpctl.8

index 706b99358dec255dbdeb7e5a50e53aa42e1ae197..8387055d1a5d083a6c5f9458c26b9fc7926b9280 100644 (file)
@@ -379,13 +379,6 @@ cmd_dot3power(struct lldpctl_conn_t *conn, struct writer *w,
        return 1;
 }
 
-#define cmd_no_medlocation_coordinate cmd_not_implemented
-#define cmd_no_medlocation_address    cmd_not_implemented
-#define cmd_no_medlocation_elin       cmd_not_implemented
-#define cmd_no_medpolicy              cmd_not_implemented
-#define cmd_no_medpower               cmd_not_implemented
-#define cmd_no_dot3power              cmd_not_implemented
-
 /**
  * Restrict the command to some ports.
  */
@@ -520,7 +513,7 @@ register_commands_medloc_elin(struct cmd_node *configure_medlocation)
  * Register `configure med location` commands.
  */
 static void
-register_commands_medloc(struct cmd_node *configure_med, struct cmd_node *unconfigure_med)
+register_commands_medloc(struct cmd_node *configure_med)
 {
        struct cmd_node *configure_medlocation = commands_new(
                configure_med,
@@ -530,33 +523,6 @@ register_commands_medloc(struct cmd_node *configure_med, struct cmd_node *unconf
        register_commands_medloc_coord(configure_medlocation);
        register_commands_medloc_addr(configure_medlocation);
        register_commands_medloc_elin(configure_medlocation);
-
-       /* MED location (unset) */
-       struct cmd_node *unconfigure_medlocation = commands_new(
-               unconfigure_med,
-               "location", "MED location configuration",
-               NULL, NULL, NULL);
-       commands_new(
-               commands_new(
-                       unconfigure_medlocation,
-                       "coordinate", "Unconfigure MED location coordinate",
-                       NULL, NULL, NULL),
-               NEWLINE, "Unconfigure MED location coordinate",
-               NULL, cmd_no_medlocation_coordinate, NULL);
-       commands_new(
-               commands_new(
-                       unconfigure_medlocation,
-                       "coordinate", "Unconfigure MED location address",
-                       NULL, NULL, NULL),
-               NEWLINE, "Unconfigure MED location address",
-               NULL, cmd_no_medlocation_address, NULL);
-       commands_new(
-               commands_new(
-                       unconfigure_medlocation,
-                       "coordinate", "Unconfigure MED location ELIN",
-                       NULL, NULL, NULL),
-               NEWLINE, "Unconfigure MED location ELIN",
-               NULL, cmd_no_medlocation_elin, NULL);
 }
 
 static int
@@ -598,34 +564,18 @@ cmd_store_prio_env_value_and_pop2(struct lldpctl_conn_t *conn, struct writer *w,
 {
        return cmd_store_something_env_value_and_pop2("priority", env, value);
 }
-static int
-cmd_store_app_env_value(struct lldpctl_conn_t *conn, struct writer *w,
-    struct cmd_env *env, void *value)
-{
-       return (cmdenv_put(env, "application", value) != -1);
-}
 
 /**
  * Register `configure med policy` commands.
  */
 static void
-register_commands_medpol(struct cmd_node *configure_med, struct cmd_node *unconfigure_med)
+register_commands_medpol(struct cmd_node *configure_med)
 {
        struct cmd_node *configure_medpolicy = commands_new(
                configure_med,
                "policy", "MED policy configuration",
                NULL, NULL, NULL);
 
-       /* MED policy (un set) */
-       struct cmd_node *unconfigure_application =
-           commands_new(
-                   commands_new(
-                           unconfigure_med,
-                           "policy", "MED policy configuration",
-                           NULL, NULL, NULL),
-                   "application", "MED policy application",
-                   NULL, NULL, NULL);
-
        commands_new(
                configure_medpolicy,
                NEWLINE, "Apply new MED policy",
@@ -643,14 +593,6 @@ register_commands_medpol(struct cmd_node *configure_med, struct cmd_node *unconf
             pol_map->string;
             pol_map++) {
                char *tag = strdup(totag(pol_map->string)); /* TODO: memory leak, happens once */
-               commands_new(
-                       commands_new(
-                               unconfigure_application,
-                               tag,
-                               pol_map->string,
-                               NULL, cmd_store_app_env_value, pol_map->string),
-                       NEWLINE, "Remove specified MED policy",
-                       NULL, cmd_no_medpolicy, NULL);
                commands_new(
                        configure_application,
                        tag,
@@ -771,15 +713,8 @@ register_commands_pow_priority(struct cmd_node *priority, int key)
  * Register `configure med power` commands.
  */
 static void
-register_commands_medpow(struct cmd_node *configure_med, struct cmd_node *unconfigure_med)
+register_commands_medpow(struct cmd_node *configure_med)
 {
-       commands_new(
-               commands_new(unconfigure_med,
-                   "power", "MED power configuration",
-                   NULL, NULL, NULL),
-               NEWLINE, "Disable advertising of LLDP-MED POE-MDI TLV",
-               NULL, cmd_no_medpower, NULL);
-
        struct cmd_node *configure_medpower = commands_new(
                configure_med,
                "power", "MED power configuration",
@@ -843,15 +778,8 @@ cmd_check_env_power(struct cmd_env *env, void *nothing)
  * Register `configure med dot3` commands.
  */
 static void
-register_commands_dot3pow(struct cmd_node *configure_dot3, struct cmd_node *unconfigure_dot3)
+register_commands_dot3pow(struct cmd_node *configure_dot3)
 {
-       commands_new(
-               commands_new(unconfigure_dot3,
-                   "power", "Dot3 power configuration",
-                   NULL, NULL, NULL),
-               NEWLINE, "Disable advertising of Dot3 POE-MDI TLV",
-               NULL, cmd_no_dot3power, NULL);
-
        struct cmd_node *configure_dot3power = commands_new(
                configure_dot3,
                "power", "Dot3 power configuration",
@@ -971,35 +899,21 @@ register_commands_configure(struct cmd_node *root)
                "configure",
                "Change system settings",
                NULL, NULL, NULL);
-       struct cmd_node *unconfigure = commands_new(
-               root,
-               "unconfigure",
-               "Unset configuration option",
-               NULL, NULL, NULL);
        restrict_ports(configure);
-       restrict_ports(unconfigure);
 
        struct cmd_node *configure_med = commands_new(
                configure,
                "med", "MED configuration",
                NULL, NULL, NULL);
-       struct cmd_node *unconfigure_med = commands_new(
-               unconfigure,
-               "med", "MED configuration",
-               NULL, NULL, NULL);
 
-       register_commands_medloc(configure_med, unconfigure_med);
-       register_commands_medpol(configure_med, unconfigure_med);
-       register_commands_medpow(configure_med, unconfigure_med);
+       register_commands_medloc(configure_med);
+       register_commands_medpol(configure_med);
+       register_commands_medpow(configure_med);
 
        struct cmd_node *configure_dot3 = commands_new(
                configure,
                "dot3", "Dot3 configuration",
                NULL, NULL, NULL);
-       struct cmd_node *unconfigure_dot3 = commands_new(
-               unconfigure,
-               "dot3", "Dot3 configuration",
-               NULL, NULL, NULL);
 
-       register_commands_dot3pow(configure_dot3, unconfigure_dot3);
+       register_commands_dot3pow(configure_dot3);
 }
index 232c688b49fbcaf5b27fffe47854b3d7bb5726ab..1cf91c14522b9110b927c8e4fdc20820707484a8 100644 (file)
@@ -51,8 +51,6 @@ int commands_execute(struct lldpctl_conn_t *, struct writer *,
 char *commands_complete(struct cmd_node *, int argc, const char **argv,
     int cursorc, int cursoro, int all);
 /* helpers */
-int cmd_not_implemented(struct lldpctl_conn_t *, struct writer *,
-    struct cmd_env *, void *);
 int cmd_check_no_env(struct cmd_env *, void *);
 int cmd_check_env(struct cmd_env *, void *);
 int cmd_store_env(struct lldpctl_conn_t *, struct writer *,
index 2ac46ed1a56846fd78f7d5ce546efe6bae1d8045..65658ee6d0affde2f9bfa6d665a8ca7e3be9b161 100644 (file)
@@ -493,17 +493,6 @@ commands_execute(struct lldpctl_conn_t *conn, struct writer *w,
        return _commands_execute(conn, w, root, argc, argv, -1, -1, NULL, 0);
 }
 
-/**
- * A generic "not implemented" command.
- */
-int
-cmd_not_implemented(struct lldpctl_conn_t *conn, struct writer *w,
-    struct cmd_env *env, void *arg)
-{
-       log_warnx("lldpctl", "not supported yet");
-       return 1;
-}
-
 /**
  * Check if the environment does not contain the given key.
  *
index 253b16518e35b9657d0a17867561765a340b7ebb..e48bbe20552d4f3da8289571ab51071463999ebb 100644 (file)
@@ -236,17 +236,6 @@ padded with 0. Here is an example of use:
 .D1 configure ports eth2 med location elin 911
 .Ed
 
-.Cd unconfigure
-.Op ports Ar ethX Op ...
-.Cd med location
-.Op Cd coordinate | address | elin
-.Bd -ragged -offset XXXXXX
-Do not advertise the location on the given ports (or on all ports if
-no port was provided). Optionally, only remove the specified location
-(coordinate-based, address or ELIN number). Here is an example of use:
-.D1 unconfigure ports eth0 eth2 med location coordinate
-.Ed
-
 .Cd configure
 .Op ports Ar ethX Op ...
 .Cd med policy
@@ -329,17 +318,6 @@ A valid use of this command is:
 .D1 configure med policy application voice vlan 500 priority voice dscp 46
 .Ed
 
-.Cd unconfigure
-.Op ports Ar ethX Op ...
-.Cd med policy
-.Cd application Ar application
-.Bd -ragged -offset XXXXXX
-Do not advertise any network policy on the given ports (or on all
-ports if no port was provided). Optionally, only remove the specified
-application type. Here is an example of use:
-.D1 unconfigure ports eth0 eth2 med policy application voice
-.Ed
-
 .Cd configure
 .Op ports Ar ethX Op ...
 .Cd med power pse | pd
@@ -418,14 +396,6 @@ Here is an example of use:
 .D1 configure med power pd source pse priority high value 5000
 .Ed
 
-.Cd unconfigure
-.Op ports Ar ethX Op ...
-.Cd med power
-.Bd -ragged -offset XXXXXX
-Do not advertise the LLDP-MED POE-MDI TLV for the given portd (or on all
-ports if no port was provided).
-.Ed
-
 .Cd configure
 .Op ports Ar ethX Op ...
 .Cd dot3 power pse | pd
@@ -480,14 +450,6 @@ Here are two valid uses of this command:
 .D1 configure dot3 power pd supported enabled powerpairs spare class 3 type 1 source pse priority low requested 10000 allocated 15000
 .Ed
 
-.Cd unconfigure
-.Op ports Ar ethX Op ...
-.Cd dot3 power
-.Bd -ragged -offset XXXXXX
-Do not advertise the Dot3 POE-MDI TLV for the given ports (or on all
-ports if no port was provided).
-.Ed
-
 .Ed
 .Sh FILES
 .Bl -tag -width "/var/run/lldpd.socketXX" -compact