return 0;
}
-/* incoming conf event */
-int device_handler_conf(struct device_handler *handler,
- struct discover_device *dev, struct pb_url *url)
-{
- struct discover_context *ctx;
- struct boot_status *status;
-
- status = talloc_zero(handler, struct boot_status);
- status->type = BOOT_STATUS_INFO;
- status->message = talloc_asprintf(status, _("Processing user config"));
- device_handler_boot_status(handler, status);
-
- /* create our context */
- ctx = device_handler_discover_context_create(handler, dev);
- ctx->conf_url = url;
-
- iterate_parsers(ctx);
-
- device_handler_discover_context_commit(handler, ctx);
-
- status->message = talloc_asprintf(status,
- _("Processing user config complete"));
- device_handler_boot_status(handler, status);
-
- talloc_free(status);
- talloc_unlink(handler, ctx);
-
- return 0;
-}
-
static struct discover_boot_option *find_boot_option_by_id(
struct device_handler *handler, const char *id)
{
event = talloc(handler, struct event);
event->type = EVENT_TYPE_USER;
- event->action = EVENT_ACTION_CONF;
+ event->action = EVENT_ACTION_URL;
if (url[strlen(url) - 1] == '/') {
event->params = talloc_array(event, struct param, 3);
struct discover_device *dev);
int device_handler_dhcp(struct device_handler *handler,
struct discover_device *dev, struct event *event);
-int device_handler_conf(struct device_handler *handler,
- struct discover_device *dev, struct pb_url *url);
void device_handler_remove(struct device_handler *handler,
struct discover_device *device);
*action = EVENT_ACTION_REMOVE;
else if (streq(buf, "url"))
*action = EVENT_ACTION_URL;
- else if (streq(buf, "conf"))
- *action = EVENT_ACTION_CONF;
else if (streq(buf, "dhcp"))
*action = EVENT_ACTION_DHCP;
else if (streq(buf, "boot"))
EVENT_ACTION_ADD = 20,
EVENT_ACTION_REMOVE,
EVENT_ACTION_URL,
- EVENT_ACTION_CONF,
EVENT_ACTION_DHCP,
EVENT_ACTION_BOOT,
EVENT_ACTION_SYNC,
return 0;
}
-static int user_event_conf(struct user_event *uev, struct event *event)
-{
- struct device_handler *handler = uev->handler;
- struct discover_device *dev;
- struct pb_url *url;
- const char *val;
-
- val = event_get_param(event, "url");
- if (!val)
- return 0;
-
- url = pb_url_parse(event, val);
- if (!url)
- return 0;
-
- dev = discover_device_create(handler, event->device);
-
- device_handler_conf(handler, dev, url);
-
- return 0;
-}
-
static int user_event_add(struct user_event *uev, struct event *event)
{
struct device_handler *handler = uev->handler;
case EVENT_ACTION_URL:
result = user_event_url(uev, event);
goto out;
- case EVENT_ACTION_CONF:
- result = user_event_conf(uev, event);
- break;
case EVENT_ACTION_DHCP:
result = user_event_dhcp(uev, event);
goto out;