ui/ncurses: Parse configuration form & send to server
[petitboot] / ui / common / discover-client.c
index b48d541050613af3b865c60fe4f684e0a2145852..0e7da9d2cca4a6a9535d9dd601601307f771e67f 100644 (file)
@@ -332,3 +332,21 @@ int discover_client_cancel_default(struct discover_client *client)
 
        return pb_protocol_write_message(client->fd, message);
 }
+
+int discover_client_send_config(struct discover_client *client,
+               struct config *config)
+{
+       struct pb_protocol_message *message;
+       int len;
+
+       len = pb_protocol_config_len(config);
+
+       message = pb_protocol_create_message(client,
+                               PB_PROTOCOL_ACTION_CONFIG, len);
+       if (!message)
+               return -1;
+
+       pb_protocol_serialise_config(config, message->payload, len);
+
+       return pb_protocol_write_message(client->fd, message);
+}