summaryrefslogtreecommitdiffstats
path: root/discover/discover-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'discover/discover-server.c')
-rw-r--r--discover/discover-server.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/discover/discover-server.c b/discover/discover-server.c
index 67ce266..29816ee 100644
--- a/discover/discover-server.c
+++ b/discover/discover-server.c
@@ -182,20 +182,30 @@ static int discover_server_process_message(void *arg)
}
- if (message->action != PB_PROTOCOL_ACTION_BOOT) {
- pb_log("%s: invalid action %d\n", __func__, message->action);
- return 0;
- }
+ switch (message->action) {
+ case PB_PROTOCOL_ACTION_BOOT:
+ boot_command = talloc(client, struct boot_command);
+
+ rc = pb_protocol_deserialise_boot_command(boot_command,
+ message);
+ if (rc) {
+ pb_log("%s: no boot command?", __func__);
+ return 0;
+ }
+
+ device_handler_boot(client->server->device_handler,
+ boot_command);
+ break;
- boot_command = talloc(client, struct boot_command);
+ case PB_PROTOCOL_ACTION_CANCEL_DEFAULT:
+ device_handler_cancel_default(client->server->device_handler);
+ break;
- rc = pb_protocol_deserialise_boot_command(boot_command, message);
- if (rc) {
- pb_log("%s: no boot command?", __func__);
+ default:
+ pb_log("%s: invalid action %d\n", __func__, message->action);
return 0;
}
- device_handler_boot(client->server->device_handler, boot_command);
return 0;
}
OpenPOWER on IntegriCloud