From abc16b919ddb5f1d7d76774691b7d664ca5ef3ea Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2014 11:33:53 +0100 Subject: {Message,Neighbor}Commands: use Client::partition instead of Main.hxx --- src/command/NeighborCommands.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/command/NeighborCommands.cxx') diff --git a/src/command/NeighborCommands.cxx b/src/command/NeighborCommands.cxx index ee88c7935..1171f6424 100644 --- a/src/command/NeighborCommands.cxx +++ b/src/command/NeighborCommands.cxx @@ -21,7 +21,7 @@ #include "NeighborCommands.hxx" #include "client/Client.hxx" #include "Instance.hxx" -#include "Main.hxx" +#include "Partition.hxx" #include "protocol/Result.hxx" #include "neighbor/Glue.hxx" #include "neighbor/Info.hxx" @@ -32,23 +32,24 @@ #include bool -neighbor_commands_available() +neighbor_commands_available(const Instance &instance) { - return instance->neighbors != nullptr; + return instance.neighbors != nullptr; } CommandResult handle_listneighbors(Client &client, gcc_unused int argc, gcc_unused char *argv[]) { - if (instance->neighbors == nullptr) { + const NeighborGlue *const neighbors = + client.partition.instance.neighbors; + if (neighbors == nullptr) { command_error(client, ACK_ERROR_UNKNOWN, "No neighbor plugin configured"); return CommandResult::ERROR; } - const auto neighbors = instance->neighbors->GetList(); - for (const auto &i : neighbors) + for (const auto &i : neighbors->GetList()) client_printf(client, "neighbor: %s\n" "name: %s\n", -- cgit v1.2.3