+static void process_url_cb(struct load_url_result *result, void *data)
+{
+ struct device_handler *handler;
+ struct discover_context *ctx;
+ struct discover_device *dev;
+ struct event *event = data;
+ const char *mac;
+
+ if (result->status != LOAD_OK) {
+ pb_log("%s: Load failed for %s\n", __func__, result->url->full);
+ return;
+ }
+
+ if (!event)
+ return;
+
+ handler = talloc_parent(event);
+ if (!handler)
+ return;
+
+ event->device = device_from_addr(event, result->url);
+ if (!event->device) {
+ pb_log("Downloaded a file but can't find its interface - pretending it was local\n");
+ event->device = talloc_asprintf(event, "local");
+ }
+
+ mac = event_get_param(event, "mac");
+ char *url = talloc_asprintf(event, "file://%s", result->local);
+ event_set_param(event, "pxeconffile-local", url);
+
+ dev = discover_device_create(handler, mac, event->device);
+ ctx = device_handler_discover_context_create(handler, dev);
+ talloc_steal(ctx, event);
+ ctx->event = event;
+
+ iterate_parsers(ctx);
+
+ device_handler_discover_context_commit(handler, ctx);
+
+ talloc_unlink(handler, ctx);
+}
+