discover: extend URL in UI to support auto-discovery
[petitboot] / discover / discover-server.c
index 1765074ecd675038ddc75bf3bc997f4951b925cb..68065895f4dc52b85ccb04633f87e7201398c950 100644 (file)
@@ -216,6 +216,7 @@ static int discover_server_process_message(void *arg)
        struct boot_command *boot_command;
        struct client *client = arg;
        struct config *config;
        struct boot_command *boot_command;
        struct client *client = arg;
        struct config *config;
+       char *url;
        int rc;
 
        message = pb_protocol_read_message(client, client->fd);
        int rc;
 
        message = pb_protocol_read_message(client, client->fd);
@@ -245,6 +246,10 @@ static int discover_server_process_message(void *arg)
                device_handler_cancel_default(client->server->device_handler);
                break;
 
                device_handler_cancel_default(client->server->device_handler);
                break;
 
+       case PB_PROTOCOL_ACTION_REINIT:
+               device_handler_reinit(client->server->device_handler);
+               break;
+
        case PB_PROTOCOL_ACTION_CONFIG:
                config = talloc_zero(client, struct config);
 
        case PB_PROTOCOL_ACTION_CONFIG:
                config = talloc_zero(client, struct config);
 
@@ -258,6 +263,13 @@ static int discover_server_process_message(void *arg)
                                config);
                break;
 
                                config);
                break;
 
+       case PB_PROTOCOL_ACTION_ADD_URL:
+               url = pb_protocol_deserialise_string((void *) client, message);
+
+               device_handler_process_url(client->server->device_handler,
+                               url, NULL, NULL);
+               break;
+
        default:
                pb_log("%s: invalid action %d\n", __func__, message->action);
                return 0;
        default:
                pb_log("%s: invalid action %d\n", __func__, message->action);
                return 0;