X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdiscover-server.c;h=76d03d1c10159924a3a73cf096d57827dd9ca31b;hp=bafcb77630ec9379b48eb3c8bb2ddc80c0c50ef1;hb=ceefe00bf8c1498dfc2118d2b3666f67f91bb956;hpb=01ed80939b8ed440390729c524ad875047dbd406 diff --git a/discover/discover-server.c b/discover/discover-server.c index bafcb77..76d03d1 100644 --- a/discover/discover-server.c +++ b/discover/discover-server.c @@ -29,6 +29,7 @@ struct discover_server { }; struct client { + struct discover_server *server; struct list_item list; int fd; }; @@ -129,6 +130,7 @@ static int write_remove_message(struct discover_server *server, static int discover_server_process_message(void *arg) { struct pb_protocol_message *message; + struct boot_command *boot_command; struct client *client = arg; message = pb_protocol_read_message(client, client->fd); @@ -141,7 +143,14 @@ static int discover_server_process_message(void *arg) return 0; } - /* todo: process boot message */ + boot_command = pb_protocol_deserialise_boot_command(client, message); + if (!boot_command) { + pb_log("%s: no boot command?", __func__); + return 0; + } + + /* todo: pass boot_command to client->server->device_handler */ + return 0; } @@ -165,6 +174,7 @@ static int discover_server_process_connection(void *arg) talloc_set_destructor(client, client_destructor); client->fd = fd; + client->server = server; /* send existing devices to client */ n_devices = device_handler_get_device_count(server->device_handler);