- ds_put_cstr(&ds, "\tpartner state: ");
- ds_put_lacp_state(&ds, slave->partner.state);
- ds_put_cstr(&ds, "\n");
+ ds_put_cstr(ds, "\tpartner state:");
+ ds_put_lacp_state(ds, slave->partner.state);
+ ds_put_cstr(ds, "\n");
+ }
+
+ shash_destroy(&slave_shash);
+ free(sorted_slaves);
+}
+
+static void
+lacp_unixctl_show(struct unixctl_conn *conn, int argc, const char *argv[],
+ void *aux OVS_UNUSED) OVS_EXCLUDED(mutex)
+{
+ struct ds ds = DS_EMPTY_INITIALIZER;
+ struct lacp *lacp;
+
+ ovs_mutex_lock(&mutex);
+ if (argc > 1) {
+ lacp = lacp_find(argv[1]);
+ if (!lacp) {
+ unixctl_command_reply_error(conn, "no such lacp object");
+ goto out;
+ }
+ lacp_print_details(&ds, lacp);
+ } else {
+ LIST_FOR_EACH (lacp, node, all_lacps) {
+ lacp_print_details(&ds, lacp);
+ }